From c629da28c9bc3404fc3141b30d26ce9774761f99 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 09:53:10 +0800 Subject: [PATCH 01/19] add --- src/base/single/button/button.basic.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 5a1b20dd8f..1b62145361 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -284,13 +284,8 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - empty: function () { + destroyed: function () { $(document).unbind("mouseup." + this.getName()); - BI.BasicButton.superclass.empty.apply(this, arguments); - }, - - destroy: function () { - BI.BasicButton.superclass.destroy.apply(this, arguments); } }); BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; \ No newline at end of file From 10281e3a2f40f1441e5dd33948cb2677a14d34f1 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 22 Mar 2017 10:16:32 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E5=B8=83=E5=B1=80demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/config.js | 70 ++------ demo/js/layout/demo.border.js | 97 +++++++++++ demo/js/layout/demo.center.js | 35 ++++ demo/js/layout/demo.float_center.js | 27 +++ demo/js/layout/demo.flow.js | 85 +++++++++ demo/js/layout/demo.grid.js | 137 +++++++++++++++ demo/js/layout/demo.horizontal.js | 50 ++++++ demo/js/layout/demo.horizontal_adapt.js | 42 +++++ demo/js/layout/demo.horizontal_auto.js | 42 +++++ demo/js/layout/demo.horizontal_float.js | 35 ++++ demo/js/layout/demo.htape.js | 38 ++++ demo/js/layout/demo.inline.js | 47 +++++ .../layout/demo.left_right_vertical_adapt.js | 44 +++++ demo/js/layout/demo.table.js | 162 ++++++++++++++++++ demo/js/layout/demo.td.js | 59 +++++++ demo/js/layout/demo.vertical.js | 25 +++ demo/js/layout/demo.vertical_adapt.js | 42 +++++ demo/js/layout/demo.vtape.js | 38 ++++ dist/core.css | 2 +- dist/core.js | 4 +- .../wrapper/layout/adapt/float.horizontal.js | 4 +- src/css/utils/widget.css | 2 +- 22 files changed, 1028 insertions(+), 59 deletions(-) create mode 100644 demo/js/layout/demo.border.js create mode 100644 demo/js/layout/demo.center.js create mode 100644 demo/js/layout/demo.float_center.js create mode 100644 demo/js/layout/demo.flow.js create mode 100644 demo/js/layout/demo.grid.js create mode 100644 demo/js/layout/demo.horizontal.js create mode 100644 demo/js/layout/demo.horizontal_adapt.js create mode 100644 demo/js/layout/demo.horizontal_auto.js create mode 100644 demo/js/layout/demo.horizontal_float.js create mode 100644 demo/js/layout/demo.htape.js create mode 100644 demo/js/layout/demo.inline.js create mode 100644 demo/js/layout/demo.left_right_vertical_adapt.js create mode 100644 demo/js/layout/demo.table.js create mode 100644 demo/js/layout/demo.td.js create mode 100644 demo/js/layout/demo.vertical.js create mode 100644 demo/js/layout/demo.vertical_adapt.js create mode 100644 demo/js/layout/demo.vtape.js diff --git a/demo/js/config.js b/demo/js/config.js index e2a314c173..6ca641c57a 100644 --- a/demo/js/config.js +++ b/demo/js/config.js @@ -17,108 +17,72 @@ Demo.CONFIG = [{ pId: 1, text: "bi.center_adapt", value: "demo.center_adapt" -}, { - pId: 1, - text: "bi.float_center_adapt", - value: "float_center_adapt" -}, { - pId: 1, - text: "bi.absolute_center_adapt", - value: "absolute_center_adapt" -}, { - pId: 1, - text: "bi.flex_center", - value: "flex_center" -}, { - pId: 1, - text: "bi.inline_center_adapt", - value: "inline_center_adapt" }, { pId: 1, text: "bi.vertical_adapt", - value: "vertical_adapt" -}, { - pId: 1, - text: "bi.inline_vertical_adapt", - value: "inline_vertical_adapt" + value: "demo.vertical_adapt" }, { pId: 1, text: "bi.horizontal_adapt", - value: "horizontal_adapt" + value: "demo.horizontal_adapt" }, { pId: 1, text: "bi.horizontal_auto", - value: "horizontal_auto" + value: "demo.horizontal_auto" }, { pId: 1, text: "bi.horizontal_float", - value: "horizontal_float" + value: "demo.horizontal_float" }, { pId: 1, text: "bi.left_right_vertical_adapt", - value: "left_right_vertical_adapt" + value: "demo.left_right_vertical_adapt" }, { pId: 1, text: "bi.center", - value: "center" + value: "demo.center_layout" }, { pId: 1, text: "bi.float_center", - value: "float_center" + value: "demo.float_center" }, { pId: 1, text: "bi.vertical", - value: "vertical" + value: "demo.vertical" }, { pId: 1, text: "bi.horizontal", - value: "horizontal" + value: "demo.horizontal" }, { pId: 1, text: "bi.border", - value: "border" -}, { - pId: 1, - text: "bi.card", - value: "card" + value: "demo.border" }, { pId: 1, text: "bi.left, bi.right", - value: "flow" -}, { - pId: 1, - text: "bi.lattice", - value: "lattice" + value: "demo.flow" }, { pId: 1, text: "bi.inline", - value: "inline" + value: "demo.inline" }, { pId: 1, text: "bi.htape", - value: "htape" + value: "demo.htape" }, { pId: 1, text: "bi.vtape", - value: "vtape" + value: "demo.vtape" }, { pId: 1, text: "bi.grid", - value: "grid" + value: "demo.grid" }, { pId: 1, text: "bi.table", - value: "table" -}, { - pId: 1, - text: "bi.division", - value: "division" -}, { - pId: 1, - text: "bi.window", - value: "window" + value: "demo.table_layout" }, { pId: 1, text: "bi.td", - value: "td" + value: "demo.td" }]; \ No newline at end of file diff --git a/demo/js/layout/demo.border.js b/demo/js/layout/demo.border.js new file mode 100644 index 0000000000..0391d51fa2 --- /dev/null +++ b/demo/js/layout/demo.border.js @@ -0,0 +1,97 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.BorderLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-border" + }, + + _createNorth: function(){ + return BI.createWidget({ + type: "bi.label", + text: "North", + cls: "layout-bg1", + height: 30 + }) + }, + + _createWest: function(){ + return BI.createWidget({ + type: "bi.center", + cls: "layout-bg2", + items:[{ + type: "bi.label", + text: "West", + whiteSpace: "normal" + }] + }) + }, + + _createCenter: function(){ + return BI.createWidget({ + type: "bi.center", + cls: "layout-bg3", + items: [{ + type: "bi.label", + text: "Center", + whiteSpace: "normal" + }] + }) + }, + + _createEast: function(){ + return BI.createWidget({ + type: "bi.center", + cls: "layout-bg5", + items: [{ + type: "bi.label", + text: "East", + whiteSpace: "normal" + }] + }) + }, + + _createSouth: function(){ + return BI.createWidget({ + type: "bi.label", + text: "South", + cls: "layout-bg6", + height: 50 + }) + }, + + render: function () { + return { + type: "bi.border", + cls: "", + items: { + north: { + el: this._createNorth(), + height: 30, + top: 20, + left: 20, + right: 20 + }, + south: { + el: this._createSouth(), + height: 50, + bottom: 20, + left: 20, + right: 20 + }, + west: { + el: this._createWest(), + width: 200, + left: 20 + }, + east: { + el: this._createEast(), + width: 300, + right: 20 + }, + center: this._createCenter() + } + } + } +}); +$.shortcut("demo.border", Demo.BorderLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.center.js b/demo/js/layout/demo.center.js new file mode 100644 index 0000000000..d338936226 --- /dev/null +++ b/demo/js/layout/demo.center.js @@ -0,0 +1,35 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.CenterLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-center" + }, + render: function () { + return { + type: "bi.center", + items: [{ + type: "bi.label", + text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局", + cls: "layout-bg1", + whiteSpace: "normal" + },{ + type: "bi.label", + text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal", + cls: "layout-bg2", + whiteSpace: "normal" + },{ + type: "bi.label", + text: "Center 3", + cls: "layout-bg3" + },{ + type: "bi.label", + text: "Center 4", + cls: "layout-bg5" + }], + hgap: 20, + vgap: 20 + } + } +}); +$.shortcut("demo.center_layout", Demo.CenterLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.float_center.js b/demo/js/layout/demo.float_center.js new file mode 100644 index 0000000000..248af4e801 --- /dev/null +++ b/demo/js/layout/demo.float_center.js @@ -0,0 +1,27 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.FloatCenterLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-float-center" + }, + render: function () { + return { + type: "bi.float_center", + items: [{ + type: "bi.label", + text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度", + cls: "layout-bg1", + whiteSpace: "normal" + }, { + type: "bi.label", + text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度", + cls: "layout-bg2", + whiteSpace: "normal" + }], + hgap: 20, + vgap: 20 + } + } +}); +$.shortcut("demo.float_center", Demo.FloatCenterLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.flow.js b/demo/js/layout/demo.flow.js new file mode 100644 index 0000000000..4c08114869 --- /dev/null +++ b/demo/js/layout/demo.flow.js @@ -0,0 +1,85 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.FlowLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-flow" + }, + render: function () { + return { + type: "bi.center_adapt", + items: [{ + type: "bi.left", + items: [{ + type: "bi.label", + height: 30, + text: "Left-1", + cls: "layout-bg1", + hgap: 20 + }, { + type: "bi.label", + height: 30, + text: "Left-2", + cls: "layout-bg2", + hgap: 20 + }, { + type: "bi.label", + height: 30, + text: "Left-3", + cls: "layout-bg3", + hgap: 20 + }, { + type: "bi.label", + height: 30, + text: "Left-4", + cls: "layout-bg4", + hgap: 20 + }, { + type: "bi.label", + height: 30, + text: "Left-5", + cls: "layout-bg5", + hgap: 20 + }], + hgap: 20, + vgap: 20 + }, { + type: "bi.right", + items: [{ + type: "bi.label", + height: 30, + text: "Right-1", + cls: "layout-bg1", + hgap: 20 + }, { + type: "bi.label", + height: 30, + text: "Right-2", + cls: "layout-bg2", + hgap: 20 + }, { + type: "bi.label", + height: 30, + text: "Right-3", + cls: "layout-bg3", + hgap: 20 + }, { + type: "bi.label", + height: 30, + text: "Right-4", + cls: "layout-bg4", + hgap: 20 + }, { + type: "bi.label", + height: 30, + text: "Right-5", + cls: "layout-bg5", + hgap: 20 + }], + hgap: 20, + vgap: 20 + }] + } + } +}); +$.shortcut("demo.flow", Demo.FlowLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.grid.js b/demo/js/layout/demo.grid.js new file mode 100644 index 0000000000..0b8aeb53c6 --- /dev/null +++ b/demo/js/layout/demo.grid.js @@ -0,0 +1,137 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.GridLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-grid" + }, + render: function () { + return { + type: "bi.grid", + columns: 5, + rows: 3, + items: [{ + column: 0, + row: 0, + el: { + type: "bi.label", + text: "column-0, row-0", + cls: "layout-bg1" + } + }, { + column: 1, + row: 0, + el: { + type: "bi.label", + text: "column-1, row-0", + cls: "layout-bg2" + } + }, { + column: 2, + row: 0, + el: { + type: "bi.label", + text: "column-2, row-0", + cls: "layout-bg6" + } + }, { + column: 3, + row: 0, + el: { + type: "bi.label", + text: "column-3, row-0", + cls: "layout-bg3" + } + }, { + column: 4, + row: 0, + el: { + type: "bi.label", + text: "column-4, row-0", + cls: "layout-bg4" + } + }, { + column: 0, + row: 1, + el: { + type: "bi.label", + text: "column-0, row-1", + cls: "layout-bg5" + } + }, { + column: 1, + row: 1, + el: { + type: "bi.label", + text: "column-1, row-1", + cls: "layout-bg6" + } + }, { + column: 2, + row: 1, + el: { + type: "bi.label", + text: "column-2, row-1", + cls: "layout-bg7" + } + }, { + column: 3, + row: 1, + el: { + type: "bi.label", + text: "column-3, row-1", + cls: "layout-bg1" + } + }, { + column: 4, + row: 1, + el: { + type: "bi.label", + text: "column-4, row-1", + cls: "layout-bg3" + } + }, { + column: 0, + row: 2, + el: { + type: "bi.label", + text: "column-0, row-2", + cls: "layout-bg2" + } + }, { + column: 1, + row: 2, + el: { + type: "bi.label", + text: "column-1, row-2", + cls: "layout-bg3" + } + }, { + column: 2, + row: 2, + el: { + type: "bi.label", + text: "column-2, row-2", + cls: "layout-bg4" + } + }, { + column: 3, + row: 2, + el: { + type: "bi.label", + text: "column-3, row-2", + cls: "layout-bg5" + } + }, { + column: 4, + row: 2, + el: { + type: "bi.label", + text: "column-4, row-2", + cls: "layout-bg6" + } + }] + } + } +}); +$.shortcut("demo.grid", Demo.GridLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.horizontal.js b/demo/js/layout/demo.horizontal.js new file mode 100644 index 0000000000..5662ffb9b6 --- /dev/null +++ b/demo/js/layout/demo.horizontal.js @@ -0,0 +1,50 @@ +/** + * Created by User on 2017/3/21. + */ +Demo.Horizontal = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-horizontal" + }, + render: function () { + return { + type: "bi.vertical", + items: [{ + type: "bi.horizontal", + items: [{ + type: "bi.absolute", + items: [{ + el: { + type: "bi.text_button", + cls: "layout-bg1", + text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)", + height: 30 + }, + left: 0, + right: 0 + }], + width: 100, + height: 30 + }, { + type: "bi.absolute", + items: [{ + el: { + type: "bi.text_button", + cls: "layout-bg2", + text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)", + height: 30 + }, + left: 0, + right: 0 + }], + width: 200, + height: 30 + }] + }], + lgap: 20, + rgap: 80, + tgap: 80, + bgap: 50 + } + } +}); +$.shortcut("demo.horizontal", Demo.Horizontal); \ No newline at end of file diff --git a/demo/js/layout/demo.horizontal_adapt.js b/demo/js/layout/demo.horizontal_adapt.js new file mode 100644 index 0000000000..8688906cec --- /dev/null +++ b/demo/js/layout/demo.horizontal_adapt.js @@ -0,0 +1,42 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.HorizontalAdapt = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-horizontal-adapt" + }, + + _createLayout: function () { + return BI.createWidget({ + type: "bi.horizontal_adapt", + vgap: 10, + items: [{ + type: "bi.label", + text: "Horizontal Adapt左右自适应", + cls: "layout-bg1", + width: 300, + height: 30 + }, { + type: "bi.label", + text: "Horizontal Adapt左右自适应", + cls: "layout-bg2", + //width: 300, + height: 30 + }] + }) + }, + + render: function () { + return { + type: "bi.grid", + columns: 1, + rows: 2, + items: [{ + column: 0, + row: 0, + el: this._createLayout() + }] + } + } +}); +$.shortcut("demo.horizontal_adapt", Demo.HorizontalAdapt); \ No newline at end of file diff --git a/demo/js/layout/demo.horizontal_auto.js b/demo/js/layout/demo.horizontal_auto.js new file mode 100644 index 0000000000..a4837d609d --- /dev/null +++ b/demo/js/layout/demo.horizontal_auto.js @@ -0,0 +1,42 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.HorizontalAuto = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-horizontal-auto" + }, + + _createLayout: function () { + return BI.createWidget({ + type: "bi.horizontal_auto", + vgap: 10, + items: [{ + type: "bi.label", + text: "Horizontal Auto左右自适应", + cls: "layout-bg1", + width: 300, + height: 30 + }, { + type: "bi.label", + text: "Horizontal Auto左右自适应", + cls: "layout-bg2", + width: 300, + height: 30 + }] + }) + }, + + render: function () { + return { + type: "bi.grid", + columns: 1, + rows: 2, + items: [{ + column: 0, + row: 0, + el: this._createLayout() + }] + } + } +}); +$.shortcut("demo.horizontal_auto", Demo.HorizontalAuto); \ No newline at end of file diff --git a/demo/js/layout/demo.horizontal_float.js b/demo/js/layout/demo.horizontal_float.js new file mode 100644 index 0000000000..217b832af4 --- /dev/null +++ b/demo/js/layout/demo.horizontal_float.js @@ -0,0 +1,35 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.HorizontalFloat = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-horizontal-float" + }, + + _createLayout: function () { + return BI.createWidget({ + type: "bi.horizontal_float", + vgap: 10, + items: [{ + type: "bi.label", + text: "Horizontal Float左右自适应", + cls: "layout-bg1", + width: 100 + }] + }) + }, + + render: function () { + return { + type: "bi.grid", + columns: 1, + rows: 2, + items: [{ + column: 0, + row: 0, + el: this._createLayout() + }] + } + } +}); +$.shortcut("demo.horizontal_float", Demo.HorizontalFloat); \ No newline at end of file diff --git a/demo/js/layout/demo.htape.js b/demo/js/layout/demo.htape.js new file mode 100644 index 0000000000..fddfa2ca4d --- /dev/null +++ b/demo/js/layout/demo.htape.js @@ -0,0 +1,38 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.HtapeLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-htape" + }, + render: function () { + return { + type: "bi.htape", + items : [ + { + width: 100, + el : { + type : 'bi.label', + text : '1', + cls: "layout-bg1" + } + }, { + width: 200, + el : { + type : 'bi.label', + text : '2', + cls: "layout-bg2" + } + }, { + width: 'fill', + el : { + type : 'bi.label', + text : '3', + cls: "layout-bg3" + } + } + ] + } + } +}); +$.shortcut("demo.htape", Demo.HtapeLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.inline.js b/demo/js/layout/demo.inline.js new file mode 100644 index 0000000000..d3bde0799c --- /dev/null +++ b/demo/js/layout/demo.inline.js @@ -0,0 +1,47 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.InlineLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-inline" + }, + render: function () { + return { + type: "bi.inline", + items: [{ + type: "bi.label", + height: 30, + text: "Left-1", + cls: "layout-bg1", + hgap: 200 + }, { + type: "bi.label", + height: 30, + text: "Left-2", + cls: "layout-bg2", + hgap: 200 + }, { + type: "bi.label", + height: 30, + text: "Left-3", + cls: "layout-bg3", + hgap: 200 + }, { + type: "bi.label", + height: 30, + text: "Left-4", + cls: "layout-bg4", + hgap: 200 + }, { + type: "bi.label", + height: 30, + text: "Left-5", + cls: "layout-bg5", + hgap: 200 + }], + hgap: 20, + vgap: 20 + } + } +}); +$.shortcut("demo.inline", Demo.InlineLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.left_right_vertical_adapt.js b/demo/js/layout/demo.left_right_vertical_adapt.js new file mode 100644 index 0000000000..c92d3a9ea5 --- /dev/null +++ b/demo/js/layout/demo.left_right_vertical_adapt.js @@ -0,0 +1,44 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-left-right-vertical-adapt" + }, + render: function () { + return { + type: "bi.left_right_vertical_adapt", + lhgap: 10, + rhgap: 30, + items: { + left: [{ + type: "bi.label", + text: "左边的垂直居中", + cls: "layout-bg1", + width: 100, + height: 30 + }, { + type: "bi.label", + text: "左边的垂直居中", + cls: "layout-bg2", + width: 100, + height: 30 + }], + right: [{ + type: "bi.label", + text: "右边的垂直居中", + cls: "layout-bg1", + width: 100, + height: 30 + }, { + type: "bi.label", + text: "右边的垂直居中", + cls: "layout-bg2", + width: 100, + height: 30 + }] + } + } + } +}); +$.shortcut("demo.left_right_vertical_adapt", Demo.LeftRightVerticalAdaptLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.table.js b/demo/js/layout/demo.table.js new file mode 100644 index 0000000000..6177355561 --- /dev/null +++ b/demo/js/layout/demo.table.js @@ -0,0 +1,162 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.TableLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-table-layout" + }, + + _createTable1: function () { + return { + type: "bi.table", + items: BI.createItems([ + [ + { + el: { + cls: "layout-bg1" + } + }, + { + el: { + cls: "layout-bg2" + } + }, + { + el: { + cls: "layout-bg3" + } + } + ], + [ + { + el: { + cls: "layout-bg4" + } + }, + { + el: { + cls: "layout-bg5" + } + }, + { + el: { + cls: "layout-bg6" + } + } + ], + [ + { + el: { + cls: "layout-bg7" + } + }, + { + el: { + cls: "layout-bg8" + } + }, + { + el: { + cls: "layout-bg1" + } + } + ], + [ + { + el: { + cls: "layout-bg2" + } + }, + { + el: { + cls: "layout-bg3" + } + }, + { + el: { + cls: "layout-bg4" + } + } + ], + [ + { + el: { + cls: "layout-bg5" + } + }, + { + el: { + cls: "layout-bg6" + } + }, + { + el: { + cls: "layout-bg7" + } + } + ], + [ + { + el: { + cls: "layout-bg8" + } + }, + { + el: { + cls: "layout-bg1" + } + }, + { + el: { + cls: "layout-bg2" + } + } + ], + [ + { + el: { + cls: "layout-bg6" + } + }, + { + el: { + cls: "layout-bg7" + } + }, + { + el: { + cls: "layout-bg8" + } + } + ] + ], { + type: "bi.layout" + }), + columnSize: [100, "fill", 200], + rowSize: [10, 30, 50, 70, 90, 110, 130], + hgap: 20, + vgap: 10 + } + }, + + render: function () { + return { + type: "bi.grid", + columns: 1, + rows: 1, + items: [ + { + column: 0, + row: 0, + el: this._createTable1() + } + //, { + // column: 0, + // row: 1, + // el: this._createTable2() + //} + ] + } + } +}); +$.shortcut("demo.table_layout", Demo.TableLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.td.js b/demo/js/layout/demo.td.js new file mode 100644 index 0000000000..2b21f41fbf --- /dev/null +++ b/demo/js/layout/demo.td.js @@ -0,0 +1,59 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.TdLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-td" + }, + render: function () { + return { + type: "bi.vertical", + items: [{ + type: "bi.td", + columnSize: [100, 100, ""], + items: BI.createItems([ + [{ + el: { + type: 'bi.label', + text: '这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写', + cls: "layout-bg1" + } + }, { + el: { + type: 'bi.label', + text: '这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写', + cls: "layout-bg2" + } + }, { + el: { + type: 'bi.label', + text: '这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写', + cls: "layout-bg3" + } + }], [{ + el: { + type: 'bi.label', + text: '这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写', + cls: "layout-bg5" + } + }, { + el: { + type: 'bi.label', + text: '这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写', + cls: "layout-bg6" + } + }, { + el: { + type: 'bi.label', + text: '这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写', + cls: "layout-bg7" + } + }] + ], { + whiteSpace: "normal" + }) + }] + } + } +}); +$.shortcut("demo.td", Demo.TdLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.vertical.js b/demo/js/layout/demo.vertical.js new file mode 100644 index 0000000000..19d18fb6ac --- /dev/null +++ b/demo/js/layout/demo.vertical.js @@ -0,0 +1,25 @@ +/** + * Created by User on 2017/3/21. + */ +Demo.VerticalLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-vertical" + }, + render: function () { + return { + type: "bi.vertical", + items: [{ + type: "bi.label", + cls: "layout-bg1", + text: "这里设置了hgap(水平间距),vgap(垂直间距)", + height: 30 + }, { + type: "bi.label", + cls: "layout-bg2", + text: "这里设置了hgap(水平间距),vgap(垂直间距)", + height: 30 + }] + } + } +}); +$.shortcut("demo.vertical", Demo.VerticalLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.vertical_adapt.js b/demo/js/layout/demo.vertical_adapt.js new file mode 100644 index 0000000000..dc030e756a --- /dev/null +++ b/demo/js/layout/demo.vertical_adapt.js @@ -0,0 +1,42 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-vertical-adapt" + }, + + _createLayout: function () { + return BI.createWidget({ + type: "bi.vertical_adapt", + vgap: 10, + items: [{ + type: "bi.label", + text: "Vertical Adapt上下自适应", + cls: "layout-bg1", + width: 300, + height: 30 + }, { + type: "bi.label", + text: "Vertical Adapt上下自适应", + cls: "layout-bg2", + width: 300, + height: 30 + }] + }) + }, + + render: function () { + return { + type: "bi.grid", + columns: 2, + rows: 1, + items: [{ + column: 0, + row: 0, + el: this._createLayout() + }] + } + } +}); +$.shortcut("demo.vertical_adapt", Demo.VerticalAdaptLayout); \ No newline at end of file diff --git a/demo/js/layout/demo.vtape.js b/demo/js/layout/demo.vtape.js new file mode 100644 index 0000000000..6309482f86 --- /dev/null +++ b/demo/js/layout/demo.vtape.js @@ -0,0 +1,38 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.VtapeLayout = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-vtape" + }, + render: function () { + return { + type: "bi.vtape", + items : [ + { + height: 100, + el : { + type : 'bi.label', + text : '1', + cls: "layout-bg1" + } + }, { + height: 200, + el : { + type : 'bi.label', + text : '2', + cls: "layout-bg2" + } + }, { + height: 'fill', + el : { + type : 'bi.label', + text : '3', + cls: "layout-bg3" + } + } + ] + } + } +}); +$.shortcut("demo.vtape", Demo.VtapeLayout); \ No newline at end of file diff --git a/dist/core.css b/dist/core.css index 485d2d3411..c533d6120e 100644 --- a/dist/core.css +++ b/dist/core.css @@ -9807,7 +9807,7 @@ textarea::-webkit-scrollbar-thumb { /**** custom color(自定义颜色,用于特定场景) ****/ @font-face { font-family: 'bi'; - src: url('${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.woff') format('woff'), /* chrome、firefox */ url('${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.svg#svgFontName') format('svg'); + src: url('font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('font/iconfont.woff') format('woff'), /* chrome、firefox */ url('font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ } diff --git a/dist/core.js b/dist/core.js index 806cd26fdc..386c8eeb12 100644 --- a/dist/core.js +++ b/dist/core.js @@ -24841,7 +24841,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, { var self = this, o = this.options; this.left = BI.createWidget({ type: "bi.vertical", - items: items, + items: [item], hgap: o.hgap, vgap: o.vgap, tgap: o.tgap, @@ -24856,7 +24856,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, { items: [this.left] }); - return left; + return this.left; }, populate: function (items) { diff --git a/src/core/wrapper/layout/adapt/float.horizontal.js b/src/core/wrapper/layout/adapt/float.horizontal.js index 261ebc0183..5d90445043 100644 --- a/src/core/wrapper/layout/adapt/float.horizontal.js +++ b/src/core/wrapper/layout/adapt/float.horizontal.js @@ -39,7 +39,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, { var self = this, o = this.options; this.left = BI.createWidget({ type: "bi.vertical", - items: items, + items: [item], hgap: o.hgap, vgap: o.vgap, tgap: o.tgap, @@ -54,7 +54,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, { items: [this.left] }); - return left; + return this.left; }, populate: function (items) { diff --git a/src/css/utils/widget.css b/src/css/utils/widget.css index cc3812b8d2..0ccd6dba8d 100644 --- a/src/css/utils/widget.css +++ b/src/css/utils/widget.css @@ -3,7 +3,7 @@ /**** custom color(自定义颜色,用于特定场景) ****/ @font-face { font-family: 'bi'; - src: url('${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.woff') format('woff'), /* chrome、firefox */ url('${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.svg#svgFontName') format('svg'); + src: url('font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('font/iconfont.woff') format('woff'), /* chrome、firefox */ url('font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ } From 19d30ca18396b86a7db205366e8cce9674011da6 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 22 Mar 2017 11:13:26 +0800 Subject: [PATCH 03/19] =?UTF-8?q?base=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/demo.canvas.js | 3 + demo/js/base/demo.collection.js | 3 + demo/js/base/demo.combo.js | 3 + demo/js/config/base.js | 172 +++++++++++++++++++++++++++++++- 4 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 demo/js/base/demo.canvas.js create mode 100644 demo/js/base/demo.collection.js create mode 100644 demo/js/base/demo.combo.js diff --git a/demo/js/base/demo.canvas.js b/demo/js/base/demo.canvas.js new file mode 100644 index 0000000000..879f44652f --- /dev/null +++ b/demo/js/base/demo.canvas.js @@ -0,0 +1,3 @@ +/** + * Created by User on 2017/3/22. + */ diff --git a/demo/js/base/demo.collection.js b/demo/js/base/demo.collection.js new file mode 100644 index 0000000000..879f44652f --- /dev/null +++ b/demo/js/base/demo.collection.js @@ -0,0 +1,3 @@ +/** + * Created by User on 2017/3/22. + */ diff --git a/demo/js/base/demo.combo.js b/demo/js/base/demo.combo.js new file mode 100644 index 0000000000..879f44652f --- /dev/null +++ b/demo/js/base/demo.combo.js @@ -0,0 +1,3 @@ +/** + * Created by User on 2017/3/22. + */ diff --git a/demo/js/config/base.js b/demo/js/config/base.js index 59fe9506d2..062d3e16f6 100644 --- a/demo/js/config/base.js +++ b/demo/js/config/base.js @@ -3,6 +3,174 @@ Demo.BASE_CONFIG = [{ text: "基础控件" }, { pId: 2, - text: "bi.center_adapt", - value: "demo.center_adapt" + id: 5, + text: "组合" +}, { + pId: 2, + id: 8, + text: "tree" +}, { + pId: 2, + id: 7, + text: "button" +}, { + pId: 2, + id: 9, + text: "listitem" +}, { + pId: 2, + id: 10, + text: "editor" +}, { + pId: 2, + text: "bi.canvas", + value: "demo.canvas" +}, { + pId: 2, + text: "bi.label", + value: "demo.label" +}, { + pId: 2, + text: "bi.collection", + value: "demo.collection" +}, { + pId: 2, + text: "bi.farbtastic", + value: "demo.farbtastic" +}, { + pId: 2, + text: "bi.formulaeditor", + value: "demo.formulaeditor" +}, { + pId: 2, + text: "bi.message", + value: "demo.message" +}, { + pId: 2, + text: "bi.grid_view", + value: "demo.grid_view" +}, { + pId: 2, + id: 6, + text: "弹出层" +}, { + pId: 2, + text: "bi.pager", + value: "demo.pager" +}, { + pId: 2, + text: "bi.svg", + value: "demo.svg" +}, { + pId: 2, + text: "bi.table", + value: "demo.table" +}, { + pId: 5, + text: "bi.combo", + value: "demo.combo" +}, { + pId: 5, + text: "bi.expander", + value: "demo.expander" +}, { + pId: 5, + text: "bi.group_button", + value: "demo.group_button" +}, { + pId: 5, + text: "bi.group_combo", + value: "demo.group_combo" +}, { + pId: 5, + text: "bi.loader", + value: "demo.loader" +}, { + pId: 5, + text: "bi.navigation", + value: "demo.navigation" +}, { + pId: 5, + text: "bi.searcher", + value: "demo.searcher" +}, { + pId: 5, + text: "bi.switcher", + value: "demo.switcher" +}, { + pId: 5, + text: "bi.tab", + value: "demo.tab" +}, { + pId: 5, + text: "bi.tree_button", + value: "demo.tree_button" +}, { + pId: 6, + text: "bi.layer_float_box", + value: "demo.layer_float_box" +}, { + pId: 6, + text: "bi.layer_popup", + value: "demo.layer_popup" +}, { + pId: 6, + text: "bi.layer_scroll", + value: "demo.layer_scroll" +}, { + pId: 6, + text: "bi.layer_searcher", + value: "demo.layer_searcher" +}, { + pId: 7, + text: "bi.icon_button", + value: "demo.icon_button" +}, { + pId: 7, + text: "bi.image_button", + value: "demo.image_button" +}, { + pId: 7, + text: "bi.button", + value: "demo.button" +}, { + pId: 7, + text: "bi.text_button", + value: "demo.text_button" +}, { + pId: 8, + text: "bi.treeview", + value: "demo.treeview" +}, { + pId: 8, + text: "bi.synctree", + value: "demo.synctree" +}, { + pId: 8, + text: "bi.parttree", + value: "demo.parttree" +}, { + pId: 8, + text: "bi.customtree", + value: "demo.customtree" +}, { + pId: 9, + text: "bi.list_items", + value: "demo.list_items" +}, { + pId: 10, + text: "bi.code_editor", + value: "demo.code_editor" +}, { + pId: 10, + text: "bi.editor", + value: "demo.editor" +}, { + pId: 10, + text: "bi.multifile_editor", + value: "demo.multifile_editor" +}, { + pId: 10, + text: "bi.text_area_editor", + value: "demo.text_area_editor" }]; \ No newline at end of file From 23473d602e81cb2ceadd5193f74276fc71ffe4bc Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 11:15:08 +0800 Subject: [PATCH 04/19] add --- src/core/proto/jquery.js | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/core/proto/jquery.js diff --git a/src/core/proto/jquery.js b/src/core/proto/jquery.js new file mode 100644 index 0000000000..408285a4f9 --- /dev/null +++ b/src/core/proto/jquery.js @@ -0,0 +1,61 @@ +/*! + * jLayout JQuery Plugin v0.11 + * + * Licensed under the revised BSD License. + * Copyright 2008, Bram Stein + * All rights reserved. + */ +if (jQuery) { + (function($){ + // richer:容器在其各个边缘留出的空间 + $.fn.insets = function () { + var p = this.padding(), + b = this.border(); + return { + 'top': p.top, + 'bottom': p.bottom + b.bottom + b.top, + 'left': p.left, + 'right': p.right + b.right + b.left + }; + }; + + // richer:获取 && 设置jQuery元素的边界 + $.fn.bounds = function (value) { + var tmp = {hasIgnoredBounds : true}; + + if (value) { + if (!isNaN(value.x)) { + tmp.left = value.x; + } + if (!isNaN(value.y)) { + tmp.top = value.y; + } + if (value.width != null) { + tmp.width = (value.width - (this.outerWidth(true) - this.width())); + tmp.width = (tmp.width >= 0) ? tmp.width : value.width; + // fix chrome + //tmp.width = (tmp.width >= 0) ? tmp.width : 0; + } + if (value.height != null) { + tmp.height = value.height - (this.outerHeight(true) - this.height()); + tmp.height = (tmp.height >= 0) ? tmp.height : value.height; + // fix chrome + //tmp.height = (tmp.height >= 0) ? tmp.height : value.0; + } + this.css(tmp); + return this; + } + else { + // richer:注意此方法只对可见元素有效 + tmp = this.position(); + return { + 'x': tmp.left, + 'y': tmp.top, + // richer:这里计算外部宽度和高度的时候,都不包括边框 + 'width': this.outerWidth(), + 'height': this.outerHeight() + }; + } + }; + })(jQuery); +}; \ No newline at end of file From ade1c308ad8f75e8c1dccbf1d7cfc8b4778dbff3 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 22 Mar 2017 11:41:38 +0800 Subject: [PATCH 05/19] update --- demo/js/config/case.js | 114 ++++++++++++- demo/js/config/widget.js | 354 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 462 insertions(+), 6 deletions(-) diff --git a/demo/js/config/case.js b/demo/js/config/case.js index 8d026337e2..9dd8c9da8a 100644 --- a/demo/js/config/case.js +++ b/demo/js/config/case.js @@ -1,8 +1,116 @@ Demo.CASE_CONFIG = [{ id: 3, - text: "基础控件" + text: "实例控件" }, { pId: 3, - text: "bi.center_adapt", - value: "demo.center_adapt" + text: "bi.calendar", + value: "demo.calendar" +}, { + pId: 3, + text: "bi.zclip", + value: "demo.zclip" +}, { + pId: 3, + text: "bi.complex_calendar", + value: "demo.complex_calendar" +}, { + pId: 3, + text: "bi.calendar", + value: "demo.calendar" +}, { + pId: 3, + text: "bi.colorpicker", + value: "demo.colorpicker" +}, { + pId: 3, + text: "bi.bubble_combo", + value: "demo.bubble_combo" +}, { + pId: 3, + id: 11, + text: "editors" +}, { + pId: 11, + text: "bi.record_editor", + value: "demo.record_editor" +}, { + pId: 11, + text: "bi.shelter_editor", + value: "demo.shelter_editor" +}, { + pId: 11, + text: "bi.sign_editor", + value: "demo.sign_editor" +}, { + pId: 11, + text: "bi.state_editor", + value: "demo.state_editor" +}, { + pId: 3, + text: "各种checkbox", + value: "demo.checkboxes" +}, { + pId: 3, + text: "各种tip", + value: "demo.tips" +}, { + pId: 3, + text: "bi.branch_expander", + value: "demo.branch_expander" +}, { + pId: 3, + text: "bi.float_box", + value: "demo.float_box" +}, { + pId: 3, + text: "bi.float_box", + value: "demo.float_box" +}, { + pId: 3, + text: "bi.segment", + value: "demo.segment" +}, { + pId: 3, + id: 12, + text: "各种表格" +}, { + pId: 3, + id: 13, + text: "各种tree" +}, { + pId: 3, + text: "各种trigger", + value: "demo.triggers" +}, { + pId: 12, + text: "bi.adaptive_table", + value: "demo.adaptive_table" +}, { + pId: 12, + text: "bi.table_tree", + value: "demo.table_tree" +}, { + pId: 12, + text: "bi.layer_tree_table", + value: "demo.layer_tree_table" +}, { + pId: 13, + text: "bi.branch_tree", + value: "demo.branch_tree" +}, { + pId: 13, + text: "bi.display_tree", + value: "demo.display_tree" +}, { + pId: 13, + text: "bi.level_tree", + value: "demo.level_tree" +}, { + pId: 13, + text: "bi.simple_tree", + value: "demo.simple_tree" +}, { + pId: 13, + text: "bi.handstand_branch_tree", + value: "demo.handstand_branch_tree" }]; \ No newline at end of file diff --git a/demo/js/config/widget.js b/demo/js/config/widget.js index 4f9e86d2c0..ea6f07a0fd 100644 --- a/demo/js/config/widget.js +++ b/demo/js/config/widget.js @@ -1,8 +1,356 @@ Demo.WIDGET_CONFIG = [{ id: 4, - text: "基础控件" + text: "详细控件" }, { pId: 4, - text: "bi.center_adapt", - value: "demo.center_adapt" + text: "bi.loading_mask", + value: "demo.loadingmask" +}, { + pId: 4, + text: "可以切换的树", + value: "demo.switch_tree" +}, { + pId: 4, + text: "进度条", + value: "demo.progressbar" +}, { + pId: 4, + text: "bi.text_editor", + value: "demo.text_editor" +}, { + pId: 4, + text: "bi.search_editor", + value: "demo.search_editor" +}, { + pId: 4, + text: "bi.adapt_editor", + value: "demo.adapt_editor" +}, { + pId: 4, + text: "bi.sign_initial_editor", + value: "demo.sign_initial_editor" +}, { + pId: 4, + text: "bi.sign_style_editor", + value: "demo.sign_style_editor" +}, { + pId: 4, + text: "bi.year_combo", + value: "demo.year_combo" +}, { + pId: 4, + text: "bi.month_combo", + value: "demo.month_combo" +}, { + pId: 4, + text: "bi.quarter_combo", + value: "demo.quarter_combo" +}, { + pId: 4, + text: "bi.date_combo", + value: "demo.date_combo" +}, { + pId: 4, + text: "bi.down_list_combo", + value: "demo.down_list_combo" +}, { + pId: 4, + text: "bi.text_value_combo", + value: "demo.text_icon_combo" +}, { + pId: 4, + text: "bi.static_combo", + value: "demo.single_select_combo" +}, { + pId: 4, + text: "bi.text_value_down_list_combo", + value: "demo.text_icon_down_list_combo" +}, { + pId: 4, + text: "bi.param_date_combo", + value: "demo.param_date_combo" +}, { + pId: 4, + text: "bi.icon_combo", + value: "demo.icon_combo" +}, { + pId: 4, + text: "bi.formula_combo", + value: "demo.formula_combo" +}, { + pId: 4, + text: "bi.formula_insert", + value: "demo.formula_insert" +}, { + pId: 4, + text: "bi.formula_pane", + value: "demo.formula_pane" +}, { + pId: 4, + text: "bi.select_data_tree", + value: "demo.select_data_tree" +}, { + pId: 4, + text: "bi.select_data_switcher", + value: "demo.select_data_switcher" +}, { + pId: 4, + text: "bi.select_data_search_result", + value: "demo.select_data_search_result" +}, { + pId: 4, + text: "bi.select_data_searcher(点这)", + value: "demo.select_data_searcher" +}, { + pId: 4, + text: "bi.multidate_combo", + value: "demo.multidate_combo" +}, { + pId: 4, + text: "bi.time_interval", + value: "demo.time_interval" +}, { + pId: 4, + text: "bi.numerical_interval", + value: "demo.numerical_interval" +}, { + pId: 4, + text: "bi.multi_select_trigger", + value: "demo.multi_select_trigger" +}, { + pId: 4, + text: "bi.multi_select_search_pane", + value: "demo.multi_select_search_pane" +}, { + pId: 4, + text: "bi.multi_select_popup_view", + value: "demo.multi_select_popup_view" +}, { + pId: 4, + text: "bi.multi_select_check_pane", + value: "demo.multi_select_check_pane" +}, { + pId: 4, + text: "bi.multi_select_combo", + value: "demo.multi_select_combo" +}, { + pId: 4, + text: "bi.move2group_combo", + value: "demo.move2group_combo" +}, { + pId: 4, + text: "bi.copy2group_combo", + value: "demo.copy2group_combo" +}, { + pId: 4, + text: "bi.single_tree_combo", + value: "demo.single_tree_combo" +}, { + pId: 4, + text: "bi.multilayer_single_tree_combo", + value: "demo.multilayer_single_tree_combo" +}, { + pId: 4, + text: "bi.select_tree_combo", + value: "demo.select_tree_combo" +}, { + pId: 4, + text: "bi.multilayer_select_tree_combo", + value: "demo.multilayer_select_tree_combo" +}, { + pId: 4, + text: "bi.dialog", + value: "demo.dialog" +}, { + pId: 4, + text: "bi.multi_tree", + value: "demo.multi_tree" +}, { + pId: 4, + text: "bi.simple_select_data_searcher", + value: "demo.simple_select_data_searcher" +}, { + pId: 4, + text: "bi.filter_pane", + value: "demo.filter_pane" +}, { + pId: 4, + text: "bi.filter_operation", + value: "demo.filter_operation" +}, { + pId: 4, + text: "bi.filter", + value: "demo.filter" +}, { + pId: 4, + text: "bi.color_chooser", + value: "demo.color_chooser" +}, { + pId: 4, + text: "bi.text_toolbar", + value: "demo.text_toolbar" +}, { + pId: 4, + text: "bi.text_area", + value: "demo.text_area" +}, { + pId: 4, + text: "bi.path_chooser", + value: "demo.path_chooser" +}, { + pId: 4, + text: "bi.direction_path_chooser", + value: "demo.direction_path_chooser" +}, { + pId: 4, + text: "bi.file_manager", + value: "demo.file_manager" +}, { + pId: 4, + text: "bi.branch_relation", + value: "demo.branch_relation" +}, { + pId: 4, + text: "bi.relation_view", + value: "demo.relation_view" +}, { + pId: 4, + text: "bi.preview_table", + value: "demo.preview_table" +}, { + pId: 4, + text: "bi.adaptive_table", + value: "demo.adaptive_table" +}, { + pId: 4, + text: "bi.adaptive_table(冻结表头)", + value: "demo.adaptive_table2" +}, { + pId: 4, + text: "bi.custom_scroll_table", + value: "demo.custom_scroll_table" +}, { + pId: 4, + text: "bi.page_table", + value: "demo.page_table" +}, { + pId: 4, + text: "bi.page_table(冻结)", + value: "demo.page_table2" +}, { + pId: 4, + text: "bi.page_table(调整列宽)", + value: "demo.page_table3" +}, { + pId: 4, + text: "bi.excel_table", + value: "demo.excel_table" +}, { + pId: 4, + text: "bi.sortable_table", + value: "demo.sortable_table" +}, { + pId: 4, + text: "bi.excel_view_display_manager", + value: "demo.excel_view_display_manager" +}, { + pId: 4, + text: "bi.sequence_table", + value: "demo.sequence_table" +}, { + pId: 4, + text: "bi.sequence_table(带有汇总)", + value: "demo.sequence_table2" +}, { + pId: 4, + text: "bi.upload_image", + value: "demo.upload_image" +}, { + pId: 4, + text: "bi.web_page", + value: "demo.web_page" +}, { + pId: 4, + text: "bi.arrangement_droppable", + value: "demo.arrangement_droppable" +}, { + pId: 4, + text: "bi.arrangement", + value: "demo.arrangement" +}, { + pId: 4, + text: "bi.adaptive_arrangement", + value: "demo.adaptive_arrangement" +}, { + pId: 4, + text: "bi.arrangement(网格布局)", + value: "demo.grid_arrangement" +}, { + pId: 4, + text: "bi.adaptive_arrangement(网格布局)", + value: "demo.grid_adaptive_arrangement" +}, { + pId: 4, + text: "bi.simple_searcher", + value: "demo.simple_searcher" +}, { + pId: 4, + text: "选色", + value: "demo.select_color_combo" +}, { + pId: 4, + text: "bi.detail_chart", + value: "demo.detail_chart" +}, { + pId: 4, + text: "柱形", + value: "demo.column_charts" +}, { + pId: 4, + text: "条形图", + value: "demo.bar_charts" +}, { + pId: 4, + text: "面积图", + value: "demo.area_charts" +}, { + pId: 4, + text: "其他", + value: "demo.other_charts" +}, { + pId: 4, + text: "文本标签", + value: "demo.list_label" +}, { + pId: 4, + text: "树标签", + value: "demo.tree_label" +}, { + pId: 4, + text: "滑块", + value: "demo.slider" +}, { + pId: 4, + text: "区间双滑块", + value: "demo.interval_slider" +}, { + pId: 4, + text: "文本列表", + value: "demo.string_list" +}, { + pId: 4, + text: "树列表", + value: "demo.tree_list" +}, { + pId: 4, + text: "日期面板", + value: "demo.data_pane" +}, { + pId: 4, + text: "螺旋分析tab控件", + value: "demo.dynamic_group_tab" +}, { + pId: 4, + text: "数值微调器", + value: "demo.finetuning_number_editor" }]; \ No newline at end of file From ff651268ce40aa7b5f3712da3732617693fc42ea Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 14:15:31 +0800 Subject: [PATCH 06/19] add --- src/core/status.js | 46 -------------------------------- src/core/var.js | 65 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 47 deletions(-) delete mode 100644 src/core/status.js diff --git a/src/core/status.js b/src/core/status.js deleted file mode 100644 index 88c226f927..0000000000 --- a/src/core/status.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * guy - * 状态常量 - */ - -_.extend(BI, { - Status: { - SUCCESS: 1, - WRONG: 2, - START: 3, - END: 4, - WAITING: 5, - READY: 6, - RUNNING: 7, - OUTOFBOUNDS: 8, - NULL: -1 - }, - Direction: { - Top: "top", - Bottom: "bottom", - Left: "left", - Right: "right", - Custom: "custom" - }, - Axis: { - Vertical: "vertical", - Horizontal: "horizontal" - }, - Selection: { - Default: -999, - None: -1, - Single: 0, - Multi: 1, - All: 2 - }, - HorizontalAlign: { - Left: "left", - Right: "right", - Center: "center" - }, - VerticalAlign: { - Middle: "middle", - Top: "top", - Bottom: "bottom" - } -}); \ No newline at end of file diff --git a/src/core/var.js b/src/core/var.js index 66f7b7e59d..91c1e6338c 100644 --- a/src/core/var.js +++ b/src/core/var.js @@ -14,5 +14,68 @@ _.extend(BI, { emptyStr: "", emptyFn: function () { }, - empty: null + empty: null, + keyCode: { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + }, + Status: { + SUCCESS: 1, + WRONG: 2, + START: 3, + END: 4, + WAITING: 5, + READY: 6, + RUNNING: 7, + OUTOFBOUNDS: 8, + NULL: -1 + }, + Direction: { + Top: "top", + Bottom: "bottom", + Left: "left", + Right: "right", + Custom: "custom" + }, + Axis: { + Vertical: "vertical", + Horizontal: "horizontal" + }, + Selection: { + Default: -999, + None: -1, + Single: 0, + Multi: 1, + All: 2 + }, + HorizontalAlign: { + Left: "left", + Right: "right", + Center: "center" + }, + VerticalAlign: { + Middle: "middle", + Top: "top", + Bottom: "bottom" + } }); \ No newline at end of file From fbc1900ec410e55bb8c5d3829e211f9f53a4e912 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 22 Mar 2017 15:03:18 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gruntfile.js | 6 + demo/js/base/demo.canvas.js | 3 - demo/js/base/demo.collection.js | 3 - demo/js/base/demo.combo.js | 3 - demo/js/config/widget.js | 348 - demo/js/widget/demo.multiselectcombo.js | 88 + demo/js/widget/demo.multiselecttree.js | 14 + dist/base.js | 34259 ++++++++++------ dist/core.js | 228 +- dist/icon/check-box-disable.png | Bin 0 -> 196 bytes dist/icon/check-box-normal.png | Bin 0 -> 198 bytes src/base/collection/collection.js | 14 +- src/base/combination/combo.js | 58 +- src/base/combination/expander.js | 11 +- src/base/combination/group.button.js | 6 +- src/base/combination/loader.js | 4 + src/base/combination/map.button.js | 115 + src/base/combination/navigation.js | 4 + src/base/combination/searcher.js | 29 +- src/base/combination/switcher.js | 4 +- src/base/combination/tab.js | 4 +- src/base/combination/tree.button.js | 118 +- src/base/farbtastic/farbtastic.js | 2 + .../formula/codemirror/addon/formula-hint.js | 88 + .../formula/codemirror/addon/formula-mode.js | 80 + .../formula/codemirror/addon/show-hint.js | 432 + src/base/formula/codemirror/codemirror.js | 8736 ++++ src/base/formula/formulaeditor.js | 11 +- src/base/foundation/bi.message.js | 21 +- src/base/grid/grid.js | 10 +- src/base/layer/layer.popup.js | 19 +- src/base/pager/pager.js | 20 +- src/base/pane.js | 2 +- src/base/reqloading/loading.request.js | 192 + src/base/single/a/a.js | 5 +- src/base/single/bar/bar.loading.js | 4 +- src/base/single/button/button.basic.js | 63 +- src/base/single/button/buttons/button.icon.js | 3 +- .../single/button/buttons/button.image.js | 3 +- src/base/single/button/buttons/button.text.js | 29 +- .../button/listitem/blankiconicontextitem.js | 119 + src/base/single/editor/editor.code.js | 4 +- src/base/single/editor/editor.js | 4 +- src/base/single/editor/editor.textarea.js | 85 +- src/base/single/img/img.js | 4 +- src/base/single/input/checkbox.js | 1 - src/base/single/input/file.js | 72 +- src/base/single/input/input.js | 60 +- src/base/single/input/radio.js | 1 - src/base/single/label/label.js | 44 +- src/base/single/text.js | 4 + src/base/timeouttoast/widget.timeouttoast.js | 117 + src/base/tree/{3parttree.js => parttree.js} | 0 src/base/tree/{2synctree.js => synctree.js} | 38 +- src/base/tree/{1treeview.js => treeview.js} | 21 +- src/core/base.js | 286 +- src/core/controller.js | 2 +- src/core/loader/loader.style.js | 47 + src/core/var.js | 2 +- src/core/wrapper/layout/layout.card.js | 6 +- src/css/base/base.css | 21 + src/css/base/chart/chart.combine.css | 11 + src/css/base/combo/popup.bubble.css | 11 + src/css/base/dom.css | 9 + src/css/base/logintimeout/login.timeout.css | 32 + src/css/base/pager/pager.all.count.css | 9 + src/css/base/pager/pager.direction.css | 2 - src/css/base/reqloading/loading.request.css | 10 +- src/css/base/single/editor/editor.state.css | 6 +- .../single/editor/editor.state.simple.css | 6 +- src/css/base/single/text.css | 2 +- src/css/base/third/ztree/zTreeStyle.css | 44 +- .../base/timeouttoast/widget.timeouttoast.css | 34 + src/css/base/view/popupview.css | 1 + src/css/base/wrapper/flex.center.css | 38 + src/css/base/wrapper/flex.horizontal.css | 66 + src/css/base/wrapper/flex.vertical.center.css | 46 + src/css/base/wrapper/flex.wrapper.center.css | 41 + .../base/wrapper/flex.wrapper.horizontal.css | 67 + .../wrapper/flex.wrapper.vertical.center.css | 48 + src/less/base/base.less | 24 + src/less/base/chart/chart.combine.less | 13 + src/less/base/combo/combo.bubble.less | 16 + src/less/base/combo/popup.bubble.less | 8 + src/less/base/dom.less | 7 + src/less/base/logintimeout/login.timeout.less | 30 + .../{pager.all.less => pager.all.count.less} | 5 +- src/less/base/pager/pager.direction.less | 2 - src/less/base/pager/pager.number.less | 12 - src/less/base/pager/pager.skip.less | 12 - src/less/base/reqloading/loading.request.less | 19 +- src/less/base/single/editor/editor.state.less | 4 +- .../single/editor/editor.state.simple.less | 4 +- src/less/base/single/text.less | 2 +- src/less/base/table/table.grid.scrollbar.less | 8 +- .../base/third/jquery.mCustomScrollbar.less | 1796 - src/less/base/third/ztree/img/line_conn.gif | Bin 0 -> 45 bytes src/less/base/third/ztree/img/loading.gif | Bin 0 -> 381 bytes .../base/third/ztree/img/zTreeStandard.gif | Bin 0 -> 5564 bytes .../base/third/ztree/img/zTreeStandard.png | Bin 0 -> 11173 bytes src/less/base/third/ztree/zTreeStyle.less | 46 +- .../timeouttoast/widget.timeouttoast.less | 25 + src/less/base/view/popupview.less | 1 + 103 files changed, 33588 insertions(+), 14906 deletions(-) delete mode 100644 demo/js/base/demo.canvas.js delete mode 100644 demo/js/base/demo.collection.js delete mode 100644 demo/js/base/demo.combo.js create mode 100644 demo/js/widget/demo.multiselectcombo.js create mode 100644 demo/js/widget/demo.multiselecttree.js create mode 100644 dist/icon/check-box-disable.png create mode 100644 dist/icon/check-box-normal.png create mode 100644 src/base/combination/map.button.js create mode 100644 src/base/formula/codemirror/addon/formula-hint.js create mode 100644 src/base/formula/codemirror/addon/formula-mode.js create mode 100644 src/base/formula/codemirror/addon/show-hint.js create mode 100644 src/base/formula/codemirror/codemirror.js create mode 100644 src/base/reqloading/loading.request.js create mode 100644 src/base/single/button/listitem/blankiconicontextitem.js create mode 100644 src/base/timeouttoast/widget.timeouttoast.js rename src/base/tree/{3parttree.js => parttree.js} (100%) rename src/base/tree/{2synctree.js => synctree.js} (87%) rename src/base/tree/{1treeview.js => treeview.js} (95%) create mode 100644 src/core/loader/loader.style.js create mode 100644 src/css/base/base.css create mode 100644 src/css/base/chart/chart.combine.css create mode 100644 src/css/base/combo/popup.bubble.css create mode 100644 src/css/base/dom.css create mode 100644 src/css/base/logintimeout/login.timeout.css create mode 100644 src/css/base/pager/pager.all.count.css create mode 100644 src/css/base/timeouttoast/widget.timeouttoast.css create mode 100644 src/css/base/wrapper/flex.center.css create mode 100644 src/css/base/wrapper/flex.horizontal.css create mode 100644 src/css/base/wrapper/flex.vertical.center.css create mode 100644 src/css/base/wrapper/flex.wrapper.center.css create mode 100644 src/css/base/wrapper/flex.wrapper.horizontal.css create mode 100644 src/css/base/wrapper/flex.wrapper.vertical.center.css create mode 100644 src/less/base/base.less create mode 100644 src/less/base/chart/chart.combine.less create mode 100644 src/less/base/combo/combo.bubble.less create mode 100644 src/less/base/combo/popup.bubble.less create mode 100644 src/less/base/dom.less create mode 100644 src/less/base/logintimeout/login.timeout.less rename src/less/base/pager/{pager.all.less => pager.all.count.less} (50%) delete mode 100644 src/less/base/pager/pager.number.less delete mode 100644 src/less/base/pager/pager.skip.less delete mode 100644 src/less/base/third/jquery.mCustomScrollbar.less create mode 100644 src/less/base/third/ztree/img/line_conn.gif create mode 100644 src/less/base/third/ztree/img/loading.gif create mode 100644 src/less/base/third/ztree/img/zTreeStandard.gif create mode 100644 src/less/base/third/ztree/img/zTreeStandard.png create mode 100644 src/less/base/timeouttoast/widget.timeouttoast.less diff --git a/Gruntfile.js b/Gruntfile.js index c7f4f3e1b7..65acb4824d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -40,6 +40,12 @@ module.exports = function (grunt) { 'src/base/single/text.js', 'src/base/single/button/button.basic.js', 'src/base/single/button/button.node.js', + 'src/base/combination/group.button.js', + 'src/base/combination/tree.button.js', + 'src/base/combination/map.button.js', + 'src/base/tree/treeview.js', + 'src/base/tree/synctree.js', + 'src/base/tree/parttree.js', 'src/base/**/*.js' ], dest: 'dist/base.js' diff --git a/demo/js/base/demo.canvas.js b/demo/js/base/demo.canvas.js deleted file mode 100644 index 879f44652f..0000000000 --- a/demo/js/base/demo.canvas.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * Created by User on 2017/3/22. - */ diff --git a/demo/js/base/demo.collection.js b/demo/js/base/demo.collection.js deleted file mode 100644 index 879f44652f..0000000000 --- a/demo/js/base/demo.collection.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * Created by User on 2017/3/22. - */ diff --git a/demo/js/base/demo.combo.js b/demo/js/base/demo.combo.js deleted file mode 100644 index 879f44652f..0000000000 --- a/demo/js/base/demo.combo.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * Created by User on 2017/3/22. - */ diff --git a/demo/js/config/widget.js b/demo/js/config/widget.js index ea6f07a0fd..414d0459e2 100644 --- a/demo/js/config/widget.js +++ b/demo/js/config/widget.js @@ -1,356 +1,8 @@ Demo.WIDGET_CONFIG = [{ id: 4, text: "详细控件" -}, { - pId: 4, - text: "bi.loading_mask", - value: "demo.loadingmask" -}, { - pId: 4, - text: "可以切换的树", - value: "demo.switch_tree" -}, { - pId: 4, - text: "进度条", - value: "demo.progressbar" -}, { - pId: 4, - text: "bi.text_editor", - value: "demo.text_editor" -}, { - pId: 4, - text: "bi.search_editor", - value: "demo.search_editor" -}, { - pId: 4, - text: "bi.adapt_editor", - value: "demo.adapt_editor" -}, { - pId: 4, - text: "bi.sign_initial_editor", - value: "demo.sign_initial_editor" -}, { - pId: 4, - text: "bi.sign_style_editor", - value: "demo.sign_style_editor" -}, { - pId: 4, - text: "bi.year_combo", - value: "demo.year_combo" -}, { - pId: 4, - text: "bi.month_combo", - value: "demo.month_combo" -}, { - pId: 4, - text: "bi.quarter_combo", - value: "demo.quarter_combo" -}, { - pId: 4, - text: "bi.date_combo", - value: "demo.date_combo" -}, { - pId: 4, - text: "bi.down_list_combo", - value: "demo.down_list_combo" -}, { - pId: 4, - text: "bi.text_value_combo", - value: "demo.text_icon_combo" -}, { - pId: 4, - text: "bi.static_combo", - value: "demo.single_select_combo" -}, { - pId: 4, - text: "bi.text_value_down_list_combo", - value: "demo.text_icon_down_list_combo" -}, { - pId: 4, - text: "bi.param_date_combo", - value: "demo.param_date_combo" -}, { - pId: 4, - text: "bi.icon_combo", - value: "demo.icon_combo" -}, { - pId: 4, - text: "bi.formula_combo", - value: "demo.formula_combo" -}, { - pId: 4, - text: "bi.formula_insert", - value: "demo.formula_insert" -}, { - pId: 4, - text: "bi.formula_pane", - value: "demo.formula_pane" -}, { - pId: 4, - text: "bi.select_data_tree", - value: "demo.select_data_tree" -}, { - pId: 4, - text: "bi.select_data_switcher", - value: "demo.select_data_switcher" -}, { - pId: 4, - text: "bi.select_data_search_result", - value: "demo.select_data_search_result" -}, { - pId: 4, - text: "bi.select_data_searcher(点这)", - value: "demo.select_data_searcher" -}, { - pId: 4, - text: "bi.multidate_combo", - value: "demo.multidate_combo" -}, { - pId: 4, - text: "bi.time_interval", - value: "demo.time_interval" -}, { - pId: 4, - text: "bi.numerical_interval", - value: "demo.numerical_interval" -}, { - pId: 4, - text: "bi.multi_select_trigger", - value: "demo.multi_select_trigger" -}, { - pId: 4, - text: "bi.multi_select_search_pane", - value: "demo.multi_select_search_pane" -}, { - pId: 4, - text: "bi.multi_select_popup_view", - value: "demo.multi_select_popup_view" -}, { - pId: 4, - text: "bi.multi_select_check_pane", - value: "demo.multi_select_check_pane" }, { pId: 4, text: "bi.multi_select_combo", value: "demo.multi_select_combo" -}, { - pId: 4, - text: "bi.move2group_combo", - value: "demo.move2group_combo" -}, { - pId: 4, - text: "bi.copy2group_combo", - value: "demo.copy2group_combo" -}, { - pId: 4, - text: "bi.single_tree_combo", - value: "demo.single_tree_combo" -}, { - pId: 4, - text: "bi.multilayer_single_tree_combo", - value: "demo.multilayer_single_tree_combo" -}, { - pId: 4, - text: "bi.select_tree_combo", - value: "demo.select_tree_combo" -}, { - pId: 4, - text: "bi.multilayer_select_tree_combo", - value: "demo.multilayer_select_tree_combo" -}, { - pId: 4, - text: "bi.dialog", - value: "demo.dialog" -}, { - pId: 4, - text: "bi.multi_tree", - value: "demo.multi_tree" -}, { - pId: 4, - text: "bi.simple_select_data_searcher", - value: "demo.simple_select_data_searcher" -}, { - pId: 4, - text: "bi.filter_pane", - value: "demo.filter_pane" -}, { - pId: 4, - text: "bi.filter_operation", - value: "demo.filter_operation" -}, { - pId: 4, - text: "bi.filter", - value: "demo.filter" -}, { - pId: 4, - text: "bi.color_chooser", - value: "demo.color_chooser" -}, { - pId: 4, - text: "bi.text_toolbar", - value: "demo.text_toolbar" -}, { - pId: 4, - text: "bi.text_area", - value: "demo.text_area" -}, { - pId: 4, - text: "bi.path_chooser", - value: "demo.path_chooser" -}, { - pId: 4, - text: "bi.direction_path_chooser", - value: "demo.direction_path_chooser" -}, { - pId: 4, - text: "bi.file_manager", - value: "demo.file_manager" -}, { - pId: 4, - text: "bi.branch_relation", - value: "demo.branch_relation" -}, { - pId: 4, - text: "bi.relation_view", - value: "demo.relation_view" -}, { - pId: 4, - text: "bi.preview_table", - value: "demo.preview_table" -}, { - pId: 4, - text: "bi.adaptive_table", - value: "demo.adaptive_table" -}, { - pId: 4, - text: "bi.adaptive_table(冻结表头)", - value: "demo.adaptive_table2" -}, { - pId: 4, - text: "bi.custom_scroll_table", - value: "demo.custom_scroll_table" -}, { - pId: 4, - text: "bi.page_table", - value: "demo.page_table" -}, { - pId: 4, - text: "bi.page_table(冻结)", - value: "demo.page_table2" -}, { - pId: 4, - text: "bi.page_table(调整列宽)", - value: "demo.page_table3" -}, { - pId: 4, - text: "bi.excel_table", - value: "demo.excel_table" -}, { - pId: 4, - text: "bi.sortable_table", - value: "demo.sortable_table" -}, { - pId: 4, - text: "bi.excel_view_display_manager", - value: "demo.excel_view_display_manager" -}, { - pId: 4, - text: "bi.sequence_table", - value: "demo.sequence_table" -}, { - pId: 4, - text: "bi.sequence_table(带有汇总)", - value: "demo.sequence_table2" -}, { - pId: 4, - text: "bi.upload_image", - value: "demo.upload_image" -}, { - pId: 4, - text: "bi.web_page", - value: "demo.web_page" -}, { - pId: 4, - text: "bi.arrangement_droppable", - value: "demo.arrangement_droppable" -}, { - pId: 4, - text: "bi.arrangement", - value: "demo.arrangement" -}, { - pId: 4, - text: "bi.adaptive_arrangement", - value: "demo.adaptive_arrangement" -}, { - pId: 4, - text: "bi.arrangement(网格布局)", - value: "demo.grid_arrangement" -}, { - pId: 4, - text: "bi.adaptive_arrangement(网格布局)", - value: "demo.grid_adaptive_arrangement" -}, { - pId: 4, - text: "bi.simple_searcher", - value: "demo.simple_searcher" -}, { - pId: 4, - text: "选色", - value: "demo.select_color_combo" -}, { - pId: 4, - text: "bi.detail_chart", - value: "demo.detail_chart" -}, { - pId: 4, - text: "柱形", - value: "demo.column_charts" -}, { - pId: 4, - text: "条形图", - value: "demo.bar_charts" -}, { - pId: 4, - text: "面积图", - value: "demo.area_charts" -}, { - pId: 4, - text: "其他", - value: "demo.other_charts" -}, { - pId: 4, - text: "文本标签", - value: "demo.list_label" -}, { - pId: 4, - text: "树标签", - value: "demo.tree_label" -}, { - pId: 4, - text: "滑块", - value: "demo.slider" -}, { - pId: 4, - text: "区间双滑块", - value: "demo.interval_slider" -}, { - pId: 4, - text: "文本列表", - value: "demo.string_list" -}, { - pId: 4, - text: "树列表", - value: "demo.tree_list" -}, { - pId: 4, - text: "日期面板", - value: "demo.data_pane" -}, { - pId: 4, - text: "螺旋分析tab控件", - value: "demo.dynamic_group_tab" -}, { - pId: 4, - text: "数值微调器", - value: "demo.finetuning_number_editor" }]; \ No newline at end of file diff --git a/demo/js/widget/demo.multiselectcombo.js b/demo/js/widget/demo.multiselectcombo.js new file mode 100644 index 0000000000..f1441fa7b0 --- /dev/null +++ b/demo/js/widget/demo.multiselectcombo.js @@ -0,0 +1,88 @@ +/** + * Created by User on 2017/3/22. + */ +var _strings = " 柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂 柳州市积玉贸易有限公司 柳州市福运来贸易有限责任公司 柳州市钢义物资有限公司 柳州市洋力化工有限公司 柳州市悦盛贸易有限公司 柳州市雁城钢管物资有限公司 柳州市恒瑞钢材经营部 柳州市科拓电子有限公司 柳州市九方电子有限公司 柳州市桂龙汽车配件厂 柳州市制鞋工厂 柳州市炜力科贸有限公司 柳州市希翼贸易有限公司 柳州市兆金物资有限公司 柳州市和润电子科技有限责任公司 柳州市汇凯贸易有限公司 柳州市好机汇商贸有限公司 柳州市泛源商贸经营部 柳州市利汇达物资有限公司 广西全民药业有限责任公司 柳州超凡物资贸易有限责任公司 柳州市贵宏物资有限责任公司 柳州昊恒贸易有限责任公司 柳州市浦联物资有限公司 柳州市广通园林绿化工程有限责任公司 柳州市松发物资贸易有限责任公司 柳州市奥士达办公设备有限责任公司 柳州市海泰物资有限公司 柳州市金三环针织厂 柳州市钢贸物资有限公司 柳州市明阳纺织有限公司 柳州市世科科技发展有限公司 柳州市禄羊贸易有限公司 柳州市金兆阳商贸有限公司 柳州市汇昌物资经营部 柳州市林泰金属物资供应站 柳州市自来水管道材料设备公司 柳州市丹柳铝板有限公司 柳州市桂冶物资有限公司 柳州市宸业物资经营部 柳州市耀成贸易有限公司 柳州奥易自动化科技有限公司 柳州市萃丰科技有限责任公司 柳州市华储贸易有限责任公司 柳州市黄颜钢材有限责任公司 柳州市银盛物资有限责任公司 柳州市新仪化玻供应站 柳州市晶凯化工有限公司 广西柳州市柳江包装纸厂 柳州市志新物资有限责任公司 柳州市兆钢物资有限公司 柳州市友方科技发展有限责任公司 柳州市缝纫机台板家具总厂 柳州市晖海数码办公设备有限责任公司 柳州市富兰特服饰有限责任公司 柳州市柳北区富兴物资经营部 柳州市柳锌福利厂 柳州市海泉印刷有限责任公司 柳州市乾亨贸易有限公司 柳州市悦宁物资贸易有限公司 柳州市昊天贸易有限公司 广西惠字钢铁有限公司 柳州市名青物资有限公司 柳州市林郝物资有限公司 柳州市民政服装厂 柳州市多维劳保用品厂 柳州市轻工物资供应公司 柳州市程源物资有限责任公司 柳州市寿丰物资贸易有限责任公司 柳州市凯凡物资有限公司 柳州市利晖物资经营部 柳州市恒茂金属物资供应站 柳州市中储物资经营部 柳州市第二医疗器械厂 柳州市来鑫物资经营部 柳州市钢鑫物资贸易有限责任公司 柳州市双合袜业有限责任公司 柳州市茂松经贸有限责任公司 柳州市行行物资贸易有限公司 柳州市方一物资有限公司 柳州成异钢管销售有限公司 柳州广惠佳电脑有限公司 桂林市圣泽鑫物资有限公司柳州分公司 柳州市砼基建材贸易有限公司 柳州市海燕针织厂 上海浦光仪表厂柳州销售处 柳州市能电工贸有限责任公司 柳州市广贸物资有限公司 柳州市柳北区大昌电工灯饰经营部 柳州市金龙印务有限公司 柳州市奇缘婚典服务有限公司 柳州市盛博物资经营部 柳州市项元钢铁贸易有限公司 柳州市虞美人化妆品经营部 柳州市俊彦鞋厂 柳州市聚源特钢有限公司 柳州市迅龙科贸有限责任公司 柳州市恒飞电子有限责任公司 柳州市蓝正现代办公设备有限责任公司 柳州地区农业生产资料公司 柳州华菱钢管销售有限公司 柳州融通物资有限公司 柳州市可仁广告策划有限责任公司 柳州市鸟鑫物资有限责任公司 柳州市五丰钢材供应站 柳州市金江不锈钢有限公司 柳州市美日物资设备有限责任公司 柳州市鑫东物资贸易有限责任公司 柳州地区日用杂品公司 柳州市华纳物资贸易有限公司 柳州乾利金虹物资贸易有限责任公司 柳州市新迈计算机有限公司 柳州市富丽实业发展公司 柳州市石钢金属材料有限公司 柳州市力志传真机销售有限公司 广西宝森投资有限公司 柳州市嵘基商贸有限公司 柳州市景民商贸有限责任公司 柳州市银桥化玻有限责任公司 柳州市宏文糖烟店 柳州市科苑电脑网络有限公司 柳州市两面针旅游用品厂 柳州市立早室内装璜有限责任公司 柳州地化建材有限公司 柳州市涛达贸易有限公司 柳州市兰丰档案服务中心 柳州市惠贸物资有限责任公司 柳州市立文物资有限责任公司 柳州市致和商贸经营部 柳州市金色阳光信息咨询有限公司 柳州市赛利钢材经销部 柳州市日用化工厂 柳州市昆廷物资有限责任公司 柳州市邦盛贸易有限公司 柳州市济华贸易有限公司 柳州昕威橡塑化工经营部 柳州市联业贸易有限公司 柳州市兰钢贸易有限公司 柳州市子欣科技有限公司 柳州市狄龙机电设备有限公司 柳州市方真物资贸易有限公司 柳州市银鸥废旧回收中心 柳州市冠宝贸易有限公司 柳州市鑫盛德商务咨询有限责任公司 柳州市泰汇银通经贸有限公司 广西瀚维智测科技有限公司 柳州市钓鱼郎制衣有限责任公司 柳州溪水物资有限公司 柳州市融峰物资有限责任公司 广西新地科技有限责任公司 柳州市纺织装饰公司 柳州市粤翔冶金炉料有限公司 柳州市远腾贸易有限公司 柳州市东鸿城市改造有限公司 广西丛欣实业有限公司 柳州市服装厂 柳州市立安联合刀片有限公司 广西国扬投资有限责任公司 柳州市铭泰办公设备公司 柳州市桂钢物资供应站 柳州市昱升物资有限责任公司 柳州市鹰飞灿科贸有限公司 柳州市先导科贸有限公司 柳州市金秋建材物资经营部 柳州市童装厂 柳州市民泽物资有限公司 柳州市恒先物资贸易有限公司 柳州市银夏冷气工程有限责任公司 柳州粮食批发有限责任公司 柳州市金银华窗纱制造有限责任公司 柳州市三方贸易有限公司 柳州市丰涛商贸有限责任公司 柳州华智企业管理咨询有限责任公司 柳州市诚正建筑工程施工图审查有限公司 柳州市今科电讯设备营销中心 柳州市闽德电子有限公司 柳州市鑫虹针织厂 柳州市畅通通讯器材有限责任公司 柳州市正钢物资经营部 柳州市新柳饲料有限责任公司 柳州市黄村油库 柳州市天泰电力装饰工程有限公司 柳州市兆吉物资有限责任公司 柳州市八龙纸制品有限责任公司 柳州市巨佳电脑网络科技有限公司 "; +//各种通用数据 +var ITEMS = BI.map(_strings.match(/[^\s]+/g), function (i, v) { + return { + text: v, + value: v, + title: v + } +}); +Demo.MultiSelectCombo = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-multi-select-combo" + }, + + _createMultiSelectCombo: function () { + var self = this; + var widget = BI.createWidget({ + type: 'bi.multi_select_combo', + itemsCreator: BI.bind(this._itemsCreator, this), + width: 200 + }); + + widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () { + BI.Msg.toast(JSON.stringify(this.getValue())); + }); + + return widget; + }, + + _getItemsByTimes: function (items, times) { + var res = []; + for (var i = (times - 1) * 3; items[i] && i < times * 3; i++) { + res.push(items[i]); + } + return res; + }, + + _hasNextByTimes: function (items, times) { + return times * 3 < items.length; + }, + + _itemsCreator: function (options, callback) { + var self = this; + var items = ITEMS; + if (options.keyword) { + var search = BI.Func.getSearchResult(items, options.keyword); + items = search.matched.concat(search.finded); + } + if (options.selected_values) {//过滤 + var filter = BI.makeObject(options.selected_values, true); + items = BI.filter(items, function (i, ob) { + return !filter[ob.value]; + }); + } + if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) { + callback({ + items: items + }); + return; + } + if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { + callback({count: items.length}); + return; + } + BI.delay(function () { + callback({ + items: self._getItemsByTimes(items, options.times), + hasNext: self._hasNextByTimes(items, options.times) + }); + }, 1000); + }, + + render: function () { + return { + type: 'bi.absolute', + scrolly: false, + items: [{ + el: this._createMultiSelectCombo(), + right: 10, + top: 10 + }] + } + } +}); +$.shortcut("demo.multi_select_combo", Demo.MultiSelectCombo); \ No newline at end of file diff --git a/demo/js/widget/demo.multiselecttree.js b/demo/js/widget/demo.multiselecttree.js new file mode 100644 index 0000000000..437f121622 --- /dev/null +++ b/demo/js/widget/demo.multiselecttree.js @@ -0,0 +1,14 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.MultiSelectTree = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-multi-select-tree" + }, + render: function () { + return { + type: "bi.vertical", + } + } +}); +$.shortcut("demo.multi_select_tree", Demo.MultiSelectTree); \ No newline at end of file diff --git a/dist/base.js b/dist/base.js index f869ce10be..5b491a7868 100644 --- a/dist/base.js +++ b/dist/base.js @@ -20561,7 +20561,7 @@ BI.Pane = BI.inherit(BI.Widget, { }); } BI.Maskers.show(self.getName()); - } else { + } else if (BI.isNull(this._loading)) { this._loading = BI.createWidget({ type: "bi.layout", cls: "loading-background", @@ -20870,6 +20870,10 @@ BI.Text = BI.inherit(BI.Single, { } }, + setStyle: function (css) { + this.text.element.css(css) + }, + setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; @@ -20888,7 +20892,7 @@ BI.BasicButton = BI.inherit(BI.Single, { _defaultConfig: function () { var conf = BI.BasicButton.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-basic-button cursor-pointer", + baseCls: (conf.baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer"), value: "", text: "", stopEvent: false, @@ -21001,42 +21005,36 @@ BI.BasicButton = BI.inherit(BI.Single, { var selected = false; hand.mousedown(function (e) { // if (e.button === 0) { - if (mouseDown === true) { - return; + $(document).bind("mouseup." + self.getName(), function (e) { + // if (e.button === 0) { + if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + self.setSelected(!self.isSelected()); + self._trigger(); } - if (self.isSelected()) { - selected = true; - } else { - clk(e); - } - mouseDown = true; - ev(e); + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + // } + }); + if (mouseDown === true) { + return; + } + if (self.isSelected()) { + selected = true; + } else { + clk(e); + } + mouseDown = true; + ev(e); // } }); hand.mouseup(function (e) { // if (e.button === 0) { - if (mouseDown === true && selected === true) { - clk(e); - } - mouseDown = false; - selected = false; - // } - }); - var checking = BI.debounce(function () { - if (!BI.DOM.isExist(self)) { - $(document).unbind("mouseup." + self.getName()); + if (BI.DOM.isExist(self) && mouseDown === true && selected === true) { + clk(e); } - }, 3000); - $(document).bind("mouseup." + this.getName(), function (e) { - // if (e.button === 0) { - if (BI.DOM.isExist(self)) { - if (!hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { - self.setSelected(!self.isSelected()); - self._trigger(); - } - mouseDown = false; - checking(); - } + mouseDown = false; + selected = false; + $(document).unbind("mouseup." + self.getName()); // } }); break; @@ -21163,8 +21161,13 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - destroyed: function () { + empty: function () { $(document).unbind("mouseup." + this.getName()); + BI.BasicButton.superclass.empty.apply(this, arguments); + }, + + destroy: function () { + BI.BasicButton.superclass.destroy.apply(this, arguments); } }); BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** @@ -21222,2226 +21225,1972 @@ BI.NodeButton = BI.inherit(BI.BasicButton, { this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, this.getValue(), this); } } -});BI.Resizers = new BI.ResizeController(); -BI.Layers = new BI.LayerController(); -BI.Maskers = new BI.MaskersController(); -BI.Bubbles = new BI.BubblesController(); -BI.Tooltips = new BI.TooltipsController(); -BI.Popovers = new BI.FloatBoxController(); -BI.Broadcasts = new BI.BroadcastController(); -/** - * canvas绘图 - * - * Created by GUY on 2015/11/18. - * @class BI.Canvas +});/** + * Created by GUY on 2015/6/26. + * @class BI.ButtonGroup * @extends BI.Widget */ -BI.Canvas = BI.inherit(BI.Widget, { +BI.ButtonGroup = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.Canvas.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-canvas" + return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-button-group", + behaviors: {}, + items: [ + { + el: {type: "bi.text_button", text: "", value: ""} + } + ], + chooseType: BI.Selection.Single, + layouts: [{ + type: "bi.center", + hgap: 0, + vgap: 0 + }] }) }, _init: function () { - BI.Canvas.superclass._init.apply(this, arguments); - var self = this, o = this.options; - var canvas = document.createElement("canvas"); - if (!document.createElement('canvas').getContext) { - canvas = window.G_vmlCanvasManager.initElement(canvas); - } - this.element.append(canvas); - canvas.width = o.width; - canvas.height = o.height; - $(canvas).width("100%"); - $(canvas).height("100%"); - this.canvas = canvas; - this._queue = []; + BI.ButtonGroup.superclass._init.apply(this, arguments); + var behaviors = {}; + BI.each(this.options.behaviors, function (key, rule) { + behaviors[key] = BI.BehaviorFactory.createBehavior(key, { + rule: rule + }) + }); + this.behaviors = behaviors; + this.populate(this.options.items); }, - _getContext: function () { - if (!this.ctx) { - this.ctx = this.canvas.getContext('2d'); - } - return this.ctx; + _createBtns: function (items) { + var o = this.options; + return BI.createWidgets(BI.createItems(items, { + type: "bi.text_button" + })); }, - _attr: function (key, value) { - var self = this; - if (BI.isNull(key)) { - return; - } - if (BI.isObject(key)) { - BI.each(key, function (k, v) { - self._queue.push({k: k, v: v}); - }); - return; - } - this._queue.push({k: key, v: value}); - }, + _btnsCreator: function (items) { + var self = this, args = Array.prototype.slice.call(arguments), o = this.options; + var buttons = this._createBtns(items); + args[0] = buttons; - _line: function (x0, y0) { - var self = this; - var args = [].slice.call(arguments, 2); - if (BI.isOdd(args.length)) { - this._attr(BI.last(args)); - args = BI.initial(args); - } - this._attr("moveTo", [x0, y0]); - var odd = BI.filter(args, function (i) { - return i % 2 === 0; - }); - var even = BI.filter(args, function (i) { - return i % 2 !== 0; + BI.each(this.behaviors, function (i, behavior) { + behavior.doBehavior.apply(behavior, args); }); - args = BI.zip(odd, even); - BI.each(args, function (i, point) { - self._attr("lineTo", point); + BI.each(buttons, function (i, btn) { + btn.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + if (type === BI.Events.CLICK) { + switch (o.chooseType) { + case BI.ButtonGroup.CHOOSE_TYPE_SINGLE: + self.setValue(btn.getValue()); + break; + case BI.ButtonGroup.CHOOSE_TYPE_NONE: + self.setValue([]); + break; + } + self.fireEvent(BI.ButtonGroup.EVENT_CHANGE, value, obj); + } + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + btn.on(BI.Events.DESTROY, function () { + BI.remove(self.buttons, btn); + }) }); - }, - line: function (x0, y0, x1, y1) { - this._line.apply(this, arguments); - this._attr("stroke", []); + return buttons; }, - rect: function (x, y, w, h, color) { - this._attr("fillStyle", color); - this._attr("fillRect", [x, y, w, h]); + _packageBtns: function (btns) { + var o = this.options; + + for (var i = o.layouts.length - 1; i > 0; i--) { + btns = BI.map(btns, function (k, it) { + return BI.extend({}, o.layouts[i], { + items: [ + BI.extend({}, o.layouts[i].el, { + el: it + }) + ] + }) + }) + } + return btns; }, - circle: function (x, y, radius, color) { - this._attr({ - fillStyle: color, - beginPath: [], - arc: [x, y, radius, 0, Math.PI * 2, true], - closePath: [], - fill: [] - }); + _packageItems: function (items, packBtns) { + return BI.createItems(BI.makeArrayByArray(items, {}), BI.clone(packBtns)); }, - hollow: function () { - this._attr("beginPath", []); - this._line.apply(this, arguments); - this._attr("closePath", []); - this._attr("stroke", []); + _packageLayout: function (items) { + var o = this.options, layout = BI.deepClone(o.layouts[0]); + + var lay = BI.formatEL(layout).el; + while (lay && lay.items && !BI.isEmpty(lay.items)) { + lay = BI.formatEL(lay.items[0]).el; + } + lay.items = items; + return layout; }, - solid: function () { - this.hollow.apply(this, arguments); - this._attr("fill", []); + + doBehavior: function () { + var args = Array.prototype.slice.call(arguments); + args.unshift(this.buttons); + BI.each(this.behaviors, function (i, behavior) { + behavior.doBehavior.apply(behavior, args); + }) }, - gradient: function (x0, y0, x1, y1, start, end) { - var grd = this._getContext().createLinearGradient(x0, y0, x1, y1); - grd.addColorStop(0, start); - grd.addColorStop(1, end); - return grd; + prependItems: function (items) { + var o = this.options; + var btns = this._btnsCreator.apply(this, arguments); + this.buttons = BI.concat(btns, this.buttons); + + //如果是一个简单的layout + if (o.layouts.length === 1 && !BI.isNotEmptyArray(o.layouts[0].items) + && this.layouts && this.layouts.prependItems) { + this.layouts.prependItems(btns); + return; + } + + var items = this._packageItems(items, this._packageBtns(btns)); + BI.createWidget(BI.extend(this._packageLayout(items))).element.children().prependTo(this.element); }, - reset: function () { - this._getContext().clearRect(0, 0, this.canvas.width, this.canvas.height); + addItems: function (items) { + var o = this.options; + var btns = this._btnsCreator.apply(this, arguments); + this.buttons = BI.concat(this.buttons, btns); + + //如果是一个简单的layout + if (o.layouts.length === 1 && !BI.isNotEmptyArray(o.layouts[0].items) + && this.layouts && this.layouts.addItems) { + this.layouts.addItems(btns); + return; + } + + var items = this._packageItems(items, this._packageBtns(btns)); + BI.createWidget(BI.extend(this._packageLayout(items))).element.children().appendTo(this.element); }, - stroke: function (callback) { + removeItemAt: function (indexes) { var self = this; - BI.nextTick(function () { - var ctx = self._getContext(); - BI.each(self._queue, function (i, q) { - if (BI.isFunction(ctx[q.k])) { - ctx[q.k].apply(ctx, q.v); - } else { - ctx[q.k] = q.v; - } - }); - self._queue = []; - callback && callback(); - }); - } -}); -$.shortcut("bi.canvas", BI.Canvas);/** - * Collection - * - * Created by GUY on 2016/1/15. - * @class BI.Collection - * @extends BI.Widget - */ -BI.Collection = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.Collection.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-collection", - width: 400, - height: 300, - overflowX: true, - overflowY: true, - cellSizeAndPositionGetter: BI.emptyFn, - horizontalOverscanSize: 0, - verticalOverscanSize: 0, - scrollLeft: 0, - scrollTop: 0, - items: [] + indexes = BI.isArray(indexes) ? indexes : [indexes]; + var buttons = []; + BI.each(indexes, function (i, index) { + buttons.push(self.buttons[index]); }); + BI.each(buttons, function (i, btn) { + btn && btn.destroy(); + }) }, - _init: function () { - BI.Collection.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.renderedCells = []; - this.renderedKeys = []; - this._scrollLock = false; - this._debounceRelease = BI.debounce(function () { - self._scrollLock = false; - }, 150); - this.container = BI.createWidget({ - type: "bi.absolute" - }); - this.element.scroll(function () { - if (self._scrollLock === true) { - return; + removeItems: function (v) { + v = BI.isArray(v) ? v : [v]; + var indexes = []; + BI.each(this.buttons, function (i, item) { + if (BI.deepContains(v, item.getValue())) { + indexes.push(i); } - o.scrollLeft = self.element.scrollLeft(); - o.scrollTop = self.element.scrollTop(); - self._calculateChildrenToRender(); - self.fireEvent(BI.Collection.EVENT_SCROLL, { - scrollLeft: o.scrollLeft, - scrollTop: o.scrollTop - }); - }); - BI.createWidget({ - type: "bi.vertical", - element: this, - scrollable: o.overflowX === true && o.overflowY === true, - scrolly: o.overflowX === false && o.overflowY === true, - scrollx: o.overflowX === true && o.overflowY === false, - items: [this.container] }); - if (o.items.length > 0) { - this._calculateSizeAndPositionData(); - this._populate(); - } - }, - - mounted: function () { - var o = this.options; - if (o.scrollLeft !== 0 || o.scrollTop !== 0) { - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); - } - }, - - destroyed: function () { - this._debounceRelease = null; + this.removeItemAt(indexes); }, - _calculateSizeAndPositionData: function () { - var o = this.options; - var cellMetadata = []; - var sectionManager = new BI.SectionManager(); - var height = 0; - var width = 0; - - for (var index = 0, len = o.items.length; index < len; index++) { - var cellMetadatum = o.cellSizeAndPositionGetter(index); - - if ( - cellMetadatum.height == null || isNaN(cellMetadatum.height) || - cellMetadatum.width == null || isNaN(cellMetadatum.width) || - cellMetadatum.x == null || isNaN(cellMetadatum.x) || - cellMetadatum.y == null || isNaN(cellMetadatum.y) - ) { - throw Error(); - } - - height = Math.max(height, cellMetadatum.y + cellMetadatum.height); - width = Math.max(width, cellMetadatum.x + cellMetadatum.width); + populate: function (items) { + this.options.items = items || []; + this.empty(); - cellMetadatum.index = index; - cellMetadata[index] = cellMetadatum; - sectionManager.registerCell(cellMetadatum, index); - } + this.buttons = this._btnsCreator.apply(this, arguments); + var items = this._packageItems(items, this._packageBtns(this.buttons)); - this._cellMetadata = cellMetadata; - this._sectionManager = sectionManager; - this._height = height; - this._width = width; + this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); }, - _cellRenderers: function (height, width, x, y) { - this._lastRenderedCellIndices = this._sectionManager.getCellIndices(height, width, x, y); - return this._cellGroupRenderer() + setEnable: function (b) { + BI.ButtonGroup.superclass.setEnable.apply(this, arguments); + BI.each(this.buttons, function (i, item) { + item.setEnable(b); + }); }, - _cellGroupRenderer: function () { - var self = this, o = this.options; - var rendered = []; - BI.each(this._lastRenderedCellIndices, function (i, index) { - var cellMetadata = self._sectionManager.getCellMetadata(index); - rendered.push(cellMetadata); + setNotSelectedValue: function (v) { + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (i, item) { + if (BI.deepContains(v, item.getValue())) { + item.setSelected && item.setSelected(false); + } else { + item.setSelected && item.setSelected(true); + } }); - return rendered; }, - _calculateChildrenToRender: function () { - var self = this, o = this.options; - var scrollLeft = BI.clamp(o.scrollLeft, 0, this._getMaxScrollLeft()); - var scrollTop = BI.clamp(o.scrollTop, 0, this._getMaxScrollTop()); - var left = Math.max(0, scrollLeft - o.horizontalOverscanSize); - var top = Math.max(0, scrollTop - o.verticalOverscanSize); - var right = Math.min(this._width, scrollLeft + o.width + o.horizontalOverscanSize); - var bottom = Math.min(this._height, scrollTop + o.height + o.verticalOverscanSize); - var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top); - var renderedCells = [], renderedKeys = []; - for (var i = 0, len = childrenToDisplay.length; i < len; i++) { - var datum = childrenToDisplay[i]; - var index = BI.deepIndexOf(this.renderedKeys, datum.index); - if (index > -1) { - if (datum.width !== this.renderedCells[index]._width) { - this.renderedCells[index]._width = datum.width; - this.renderedCells[index].el.setWidth(datum.width); - } - if (datum.height !== this.renderedCells[index]._height) { - this.renderedCells[index]._height = datum.height; - this.renderedCells[index].el.setHeight(datum.height); - } - if (this.renderedCells[index].left !== datum.x) { - this.renderedCells[index].el.element.css("left", datum.x + "px"); - } - if (this.renderedCells[index].top !== datum.y) { - this.renderedCells[index].el.element.css("top", datum.y + "px"); - } - renderedCells.push(this.renderedCells[index]); + setEnabledValue: function (v) { + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (i, item) { + if (BI.deepContains(v, item.getValue())) { + item.setEnable(true); } else { - var child = BI.createWidget(BI.extend({ - type: "bi.label", - width: datum.width, - height: datum.height - }, o.items[datum.index], { - cls: (o.items[datum.index].cls || "") + " container-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : ""), - _left: datum.x, - _top: datum.y - })); - renderedCells.push({ - el: child, - left: datum.x, - top: datum.y, - _width: datum.width, - _height: datum.height - }); + item.setEnable(false); } - renderedKeys.push(datum.index); - } - //已存在的, 需要添加的和需要删除的 - var existSet = {}, addSet = {}, deleteArray = []; - BI.each(renderedKeys, function (i, key) { - if (BI.deepContains(self.renderedKeys, key)) { - existSet[i] = key; + }); + }, + + setValue: function (v) { + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (i, item) { + if (BI.deepContains(v, item.getValue())) { + item.setSelected && item.setSelected(true); } else { - addSet[i] = key; + item.setSelected && item.setSelected(false); } }); - BI.each(this.renderedKeys, function (i, key) { - if (BI.deepContains(existSet, key)) { - return; - } - if (BI.deepContains(addSet, key)) { - return; + }, + + getNotSelectedValue: function () { + var v = []; + BI.each(this.buttons, function (i, item) { + if (item.isEnabled() && !(item.isSelected && item.isSelected())) { + v.push(item.getValue()); } - deleteArray.push(i); - }); - BI.each(deleteArray, function (i, index) { - self.renderedCells[index].el.destroy(); - }); - var addedItems = []; - BI.each(addSet, function (index) { - addedItems.push(renderedCells[index]) }); - BI.createWidget({ - type: "bi.absolute", - element: this.container, - items: addedItems - }); - this.renderedCells = renderedCells; - this.renderedKeys = renderedKeys; + return v; }, - _getMaxScrollLeft: function () { - return Math.max(0, this._width - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0)); + getValue: function () { + var v = []; + BI.each(this.buttons, function (i, item) { + if (item.isEnabled() && item.isSelected && item.isSelected()) { + v.push(item.getValue()); + } + }); + return v; }, - _getMaxScrollTop: function () { - return Math.max(0, this._height - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0)); + getAllButtons: function () { + return this.buttons; }, - _populate: function () { - var o = this.options; - if (o.items.length > 0) { - this.container.setWidth(this._width); - this.container.setHeight(this._height); + getAllLeaves: function () { + return this.buttons; + }, - this._calculateChildrenToRender(); - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); - } - }, - - setScrollLeft: function (scrollLeft) { - if (this.options.scrollLeft === scrollLeft) { - return; - } - this._scrollLock = true; - this.options.scrollLeft = BI.clamp(scrollLeft || 0, 0, this._getMaxScrollLeft()); - this._debounceRelease(); - this._calculateChildrenToRender(); - this.element.scrollLeft(this.options.scrollLeft); - }, - - setScrollTop: function (scrollTop) { - if (this.options.scrollTop === scrollTop) { - return; - } - this._scrollLock = true; - this.options.scrollTop = BI.clamp(scrollTop || 0, 0, this._getMaxScrollTop()); - this._debounceRelease(); - this._calculateChildrenToRender(); - this.element.scrollTop(this.options.scrollTop); - }, - - setOverflowX: function (b) { - var self = this; - if (this.options.overflowX !== !!b) { - this.options.overflowX = !!b; - BI.nextTick(function () { - self.element.css({overflowX: !!b ? "auto" : "hidden"}); - }); - } - }, - - setOverflowY: function (b) { - var self = this; - if (this.options.overflowY !== !!b) { - this.options.overflowY = !!b; - BI.nextTick(function () { - self.element.css({overflowY: !!b ? "auto" : "hidden"}); - }); - } - }, - - getScrollLeft: function () { - return this.options.scrollLeft; + getSelectedButtons: function () { + var btns = []; + BI.each(this.buttons, function (i, item) { + if (item.isSelected && item.isSelected()) { + btns.push(item); + } + }); + return btns; }, - getScrollTop: function () { - return this.options.scrollTop; + getNotSelectedButtons: function () { + var btns = []; + BI.each(this.buttons, function (i, item) { + if (item.isSelected && !item.isSelected()) { + btns.push(item); + } + }); + return btns; }, - getMaxScrollLeft: function () { - return this._getMaxScrollLeft(); + getIndexByValue: function (value) { + var index = -1; + BI.any(this.buttons, function (i, item) { + if (item.isEnabled() && item.getValue() === value) { + index = i; + return true; + } + }); + return index; }, - getMaxScrollTop: function () { - return this._getMaxScrollTop(); + getNodeById: function (id) { + var node; + BI.any(this.buttons, function (i, item) { + if (item.isEnabled() && item.options.id === id) { + node = item; + return true; + } + }); + return node; }, - restore: function () { - BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); + getNodeByValue: function (value) { + var node; + BI.any(this.buttons, function (i, item) { + if (item.isEnabled() && item.getValue() === value) { + node = item; + return true; + } }); - this.renderedCells = []; - this.renderedKeys = []; - this._scrollLock = false; + return node; }, - populate: function (items) { - if (items && items !== this.options.items) { - this.options.items = items; - this._calculateSizeAndPositionData(); - } - this._populate(); + destroy: function () { + BI.ButtonGroup.superclass.destroy.apply(this, arguments); } }); -BI.Collection.EVENT_SCROLL = "EVENT_SCROLL"; -$.shortcut('bi.collection_view', BI.Collection);/** - * @class BI.Combo - * @extends BI.Widget +BI.extend(BI.ButtonGroup, { + CHOOSE_TYPE_SINGLE: BI.Selection.Single, + CHOOSE_TYPE_MULTI: BI.Selection.Multi, + CHOOSE_TYPE_ALL: BI.Selection.All, + CHOOSE_TYPE_NONE: BI.Selection.None, + CHOOSE_TYPE_DEFAULT: BI.Selection.Default +}); +BI.ButtonGroup.EVENT_CHANGE = "EVENT_CHANGE"; + +$.shortcut("bi.button_group", BI.ButtonGroup);/** + * Created by GUY on 2015/8/10. + * @class BI.ButtonTree + * @extends BI.ButtonGroup */ -BI.Combo = BI.inherit(BI.Widget, { + +BI.ButtonTree = BI.inherit(BI.ButtonGroup, { _defaultConfig: function () { - return BI.extend(BI.Combo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo", - trigger: "click", - toggle: true, - direction: "bottom", //top||bottom||left||right||top,left||top,right||bottom,left||bottom,right - isDefaultInit: false, - isNeedAdjustHeight: true,//是否需要高度调整 - isNeedAdjustWidth: true, - adjustLength: 0,//调整的距离 - adjustXOffset: 0, - adjustYOffset: 0, - hideChecker: BI.emptyFn, - offsetStyle: "left", //left,right,center - el: {}, - popup: {}, - comboClass: "bi-combo-popup", - hoverClass: "bi-combo-hover" + return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-button-tree" }) }, _init: function () { - BI.Combo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this._initCombo(); - this._initPullDownAction(); - this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - if (self.isEnabled() && this.isEnabled()) { - if (type === BI.Events.EXPAND) { - self._popupView(); - } - if (type === BI.Events.COLLAPSE) { - self._hideView(); - } - if (type === BI.Events.EXPAND || type === BI.Events.COLLAPSE) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - } + BI.ButtonTree.superclass._init.apply(this, arguments); + }, - if (type === BI.Events.CLICK) { - self.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE, obj); - } + setNotSelectedValue: function (v) { + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (i, item) { + if (!BI.isFunction(item.setSelected)) { + item.setNotSelectedValue(v); + return; + } + if (BI.deepContains(v, item.getValue())) { + item.setSelected(false); + } else { + item.setSelected(true); } }); + }, - self.element.on("mouseenter." + self.getName(), function (e) { - if (self.isEnabled() && self.combo.isEnabled()) { - self.element.addClass(o.hoverClass); + setEnabledValue: function (v) { + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (i, item) { + if (BI.isFunction(item.setEnabledValue)) { + item.setEnabledValue(v); + return; } - }); - self.element.on("mouseleave." + self.getName(), function (e) { - if (self.isEnabled() && self.combo.isEnabled()) { - self.element.removeClass(o.hoverClass); + if (BI.deepContains(v, item.getValue())) { + item.setEnable(true); + } else { + item.setEnable(false); } }); + }, - BI.createWidget({ - type: "bi.vertical", - scrolly: false, - element: this, - items: [ - {el: this.combo} - ] + setValue: function (v) { + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (i, item) { + if (!BI.isFunction(item.setSelected)) { + item.setValue(v); + return; + } + if (BI.deepContains(v, item.getValue())) { + item.setSelected(true); + } else { + item.setSelected(false); + } }); - o.isDefaultInit && (this._assertPopupView()); - BI.Resizers.add(this.getName(), BI.bind(function () { - if (this.isViewVisible()) { - this._hideView(); + }, + + getNotSelectedValue: function () { + var v = []; + BI.each(this.buttons, function (i, item) { + if (item.isEnabled() && !BI.isFunction(item.setSelected)) { + v = BI.concat(v, item.getNotSelectedValue()); + return; } - }, this)); + if (item.isEnabled() && item.isSelected && !item.isSelected()) { + v.push(item.getValue()); + } + }); + return v; }, - _toggle: function () { - this._assertPopupViewRender(); - if (this.popupView.isVisible()) { - this._hideView(); - } else { - if (this.isEnabled()) { - this._popupView(); + getValue: function () { + var v = []; + BI.each(this.buttons, function (i, item) { + if (item.isEnabled() && !BI.isFunction(item.setSelected)) { + v = BI.concat(v, item.getValue()); + return; } - } + if (item.isEnabled() && item.isSelected && item.isSelected()) { + v.push(item.getValue()); + } + }); + return v; }, - _initPullDownAction: function () { - var self = this, o = this.options; - var evs = this.options.trigger.split(","); - BI.each(evs, function (i, ev) { - switch (ev) { - case "hover": - self.element.on("mouseenter." + self.getName(), function (e) { - if (self.isEnabled() && self.combo.isEnabled()) { - self._popupView(); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); - self.fireEvent(BI.Combo.EVENT_EXPAND); - } - }); - self.element.on("mouseleave." + self.getName(), function (e) { - if (self.isEnabled() && self.combo.isEnabled() && o.toggle === true) { - self._hideView(); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo); - self.fireEvent(BI.Combo.EVENT_COLLAPSE); - } - }); - break; - case "click": - if (ev) { - self.element.off(ev + "." + self.getName()).on(ev + "." + self.getName(), BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { - if (self.isEnabled() && self.combo.isEnabled()) { - o.toggle ? self._toggle() : self._popupView(); - if (self.isViewVisible()) { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); - self.fireEvent(BI.Combo.EVENT_EXPAND); - } else { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo); - self.fireEvent(BI.Combo.EVENT_COLLAPSE); - } - } - } - }, BI.EVENT_RESPONSE_TIME, true)); - } - break; + getSelectedButtons: function () { + var btns = []; + BI.each(this.buttons, function (i, item) { + if (item.isEnabled() && !BI.isFunction(item.setSelected)) { + btns = btns.concat(item.getSelectedButtons()); + return; } - }) + if (item.isSelected && item.isSelected()) { + btns.push(item); + } + }); + return btns; }, - _initCombo: function () { - this.combo = BI.createWidget(this.options.el); + getNotSelectedButtons: function () { + var btns = []; + BI.each(this.buttons, function (i, item) { + if (item.isEnabled() && !BI.isFunction(item.setSelected)) { + btns = btns.concat(item.getNotSelectedButtons()); + return; + } + if (item.isSelected && !item.isSelected()) { + btns.push(item); + } + }); + return btns; }, - _assertPopupView: function () { - var self = this; - if (this.popupView == null) { - this.popupView = BI.createWidget(this.options.popup, { - type: "bi.popup_view" - }); - this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - if (type === BI.Events.CLICK) { - self.combo.setValue(self.getValue()); - self.fireEvent(BI.Combo.EVENT_CHANGE, value, obj); - } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.popupView.setVisible(false); - BI.nextTick(function () { - self.fireEvent(BI.Combo.EVENT_AFTER_INIT); - }); - } + //获取所有的叶子节点 + getAllLeaves: function () { + var leaves = []; + BI.each(this.buttons, function (i, item) { + if (item.isEnabled() && !BI.isFunction(item.setSelected)) { + leaves = leaves.concat(item.getAllLeaves()); + return; + } + if (item.isEnabled()) { + leaves.push(item); + } + }); + return leaves; }, - _assertPopupViewRender: function () { - this._assertPopupView(); - if (!this._rendered) { - BI.createWidget({ - type: "bi.vertical", - scrolly: false, - element: this, - items: [ - {el: this.popupView} - ] - }); - this._rendered = true; - } + getIndexByValue: function (value) { + var index = -1; + BI.any(this.buttons, function (i, item) { + var vs = item.getValue(); + if (item.isEnabled() && (vs === value || BI.contains(vs, value))) { + index = i; + return true; + } + }); + return index; }, - _hideIf: function (e) { - if (this.element.__isMouseInBounds__(e) || (this.popupView && this.popupView.element.__isMouseInBounds__(e))) { - return; - } - if (this.element.find(e.target).length > 0) { - return; - } - var isHide = this.options.hideChecker.apply(this, [e]); - if (isHide === false) { - return; - } - this._hideView(); + getNodeById: function (id) { + var node; + BI.any(this.buttons, function (i, item) { + if (item.isEnabled()) { + if (item.attr("id") === id) { + node = item; + return true; + } else if (BI.isFunction(item.getNodeById)) { + if (node = item.getNodeById(id)) { + return true; + } + } + } + }); + return node; }, - _hideView: function () { - this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW); - this.popupView && this.popupView.invisible(); - this.element.removeClass(this.options.comboClass); + getNodeByValue: function (value) { + var node; + BI.any(this.buttons, function (i, item) { + if (item.isEnabled()) { + if (item.getValue() === value) { + node = item; + return true; + } else if (BI.isFunction(item.getNodeByValue)) { + if (node = item.getNodeByValue(value)) { + return true; + } + } + } + }); + return node; + } +}); +BI.ButtonTree.EVENT_CHANGE = "EVENT_CHANGE"; - $(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); - this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); +$.shortcut("bi.button_tree", BI.ButtonTree);/** + * value作为key值缓存button, 不支持顺序读写 + * 适合用于频繁增删的一组button + * Created by GUY on 2015/8/10. + * @class BI.ButtonMap + * @extends BI.ButtonTree + */ + +BI.ButtonMap = BI.inherit(BI.ButtonTree, { + _defaultConfig: function () { + return BI.extend(BI.ButtonMap.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-button-map" + }) }, - _popupView: function () { - this._assertPopupViewRender(); - this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW); + _init: function () { + BI.ButtonMap.superclass._init.apply(this, arguments); + }, - this.popupView.visible(); - this.adjustWidth(); - this.adjustHeight(); + _createBtns: function (items) { + var self = this, o = this.options; + var buttons = BI.createWidgets(BI.createItems(items, {type: "bi.text_button", once: o.chooseType === 0})); + var keys = BI.map(items, function (i, item) { + item = BI.stripEL(item); + if (!(item.id || item.value)) { + throw new Error("item必须包含id或value属性"); + } + return item.id || item.value; + }); + return BI.object(keys, buttons); + }, - this.element.addClass(this.options.comboClass); - $(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); - this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); + setValue: function (v) { + var self = this; + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (val, item) { + if (!BI.isFunction(item.setSelected)) { + item.setValue(v); + return; + } + if (v.contains(val)) { + item.setSelected && item.setSelected(true); + } else { + item.setSelected && item.setSelected(false); + } + }); }, - adjustWidth: function () { - var o = this.options; - if (!this.popupView) { - return; - } - if (o.isNeedAdjustWidth === true) { - this.resetListWidth(""); - var width = this.popupView.element.outerWidth(); - var maxW = this.element.outerWidth() || o.width; - if (width > maxW + 80) { - maxW = maxW + 80; - } else if (width > maxW) { - maxW = width; + setNotSelectedValue: function (v) { + var self = this; + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (val, item) { + if (!BI.isFunction(item.setSelected)) { + item.setNotSelectedValue(v); + return; } - this.resetListWidth(maxW < 100 ? 100 : maxW); - } + if (v.contains(val)) { + item.setSelected && item.setSelected(false); + } else { + item.setSelected && item.setSelected(true); + } + }); }, - adjustHeight: function () { - var o = this.options, p = {}; - if (!this.popupView) { - return; + populate: function (items) { + var self = this; + var args = [].slice.call(arguments); + var linkHashMap = new BI.LinkHashMap(); + var val = function (item) { + return item.id || item.value; + }; + if (!this.buttons) { + this.buttons = {}; } - var isVisible = this.popupView.isVisible(); - this.popupView.visible(); - switch (o.direction) { - case "bottom": - case "bottom,right": - p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['bottom', 'top', 'right', 'left'], o.offsetStyle); - break; - case "top": - case "top,right": - p = $.getComboPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['top', 'bottom', 'right', 'left'], o.offsetStyle); - break; - case "left": - case "left,bottom": - p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['left', 'right', 'bottom', 'top'], o.offsetStyle); - break; - case "right": - case "right,bottom": - p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['right', 'left', 'bottom', 'top'], o.offsetStyle); - break; - case "top,left": - p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['top', 'bottom', 'left', 'right'], o.offsetStyle); - break; - case "bottom,left": - p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['bottom', 'top', 'left', 'right'], o.offsetStyle); - break; - case "left,top": - p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['left', 'right', 'top', 'bottom'], o.offsetStyle); - break; - case "right,top": - p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['right', 'left', 'top', 'bottom'], o.offsetStyle); - break; - case "top,custom": - case "custom,top": - p = $.getTopAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); - break; - case "custom,bottom": - case "bottom,custom": - p = $.getBottomAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); - break; - case "left,custom": - case "custom,left": - p = $.getLeftAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); - delete p.top; - delete p.adaptHeight; - break; - case "custom,right": - case "right,custom": - p = $.getRightAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); - delete p.top; - delete p.adaptHeight; - break; - } - - if ("adaptHeight" in p) { - this.resetListHeight(p['adaptHeight']); - } - if ("left" in p) { - this.popupView.element.css({ - left: p.left - }); - } - if ("top" in p) { - this.popupView.element.css({ - top: p.top - }); - } - this.popupView.setVisible(isVisible); - }, - - resetListHeight: function (h) { - this._assertPopupView(); - this.popupView.resetHeight && this.popupView.resetHeight(h); - }, - - resetListWidth: function (w) { - this._assertPopupView(); - this.popupView.resetWidth && this.popupView.resetWidth(w); - }, - - populate: function (items) { - this._assertPopupView(); - this.popupView.populate.apply(this.popupView, arguments); - this.combo.populate.apply(this.combo, arguments); - }, - - setEnable: function (arg) { - BI.Combo.superclass.setEnable.apply(this, arguments); - this.combo && this.combo.setEnable(arg); - this.popupView && this.popupView.setEnable(arg); - !arg && this._hideView(); - }, - - setValue: function (v) { - this._assertPopupView(); - this.combo.setValue(v); - this.popupView && this.popupView.setValue(v); - }, - - getValue: function () { - this._assertPopupView(); - return this.popupView && this.popupView.getValue(); - }, - - isViewVisible: function () { - return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible(); - }, - - showView: function () { - if (this.isEnabled() && this.combo.isEnabled()) { - this._popupView(); - } - }, - - hideView: function () { - this._hideView(); - }, + //所有已存在的和新添加的 + var willCreated = []; + BI.each(items, function (i, item) { + item = BI.stripEL(item); + if (self.buttons[val(item)]) { + var ob = self.buttons[val(item)]; + args[0] = item.items; + args[2] = item; + ob.populate && ob.populate.apply(ob, args); + } else { + willCreated.push(item); + } + }); + //创建新元素 + args[0] = willCreated; + var newBtns = this._btnsCreator.apply(this, args); - getView: function () { - return this.popupView; - }, + //整理 + var array = []; + BI.each(items, function (i, item) { + item = BI.stripEL(item); + var button = self.buttons[val(item)] || newBtns[val(item)]; + linkHashMap.add(val(item), button); + array.push(button); + }); + this.buttons = linkHashMap.map; - doBehavior: function () { - this._assertPopupView(); - this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments); - }, + BI.DOM.hang(this.buttons); + this.empty(); - toggle: function () { - this._toggle(); + var packages = this._packageItems(items, this._packageBtns(array)); + BI.createWidget(BI.extend({element: this}, this._packageLayout(packages))); }, - destroyed: function () { - $(document).unbind("mousedown." + this.getName()) - .unbind("mousewheel." + this.getName()) - .unbind("mouseenter." + this.getName()) - .unbind("mousemove." + this.getName()) - .unbind("mouseleave." + this.getName()); - this.popupView && this.popupView.destroy(); - BI.Resizers.remove(this.getName()); + getIndexByValue: function (value) { + throw new Error("不能使用getIndexByValue方法"); } }); -BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; -BI.Combo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.Combo.EVENT_EXPAND = "EVENT_EXPAND"; -BI.Combo.EVENT_COLLAPSE = "EVENT_COLLAPSE"; -BI.Combo.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; - - -BI.Combo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; -BI.Combo.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW"; -BI.Combo.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW"; -BI.Combo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; +BI.ButtonMap.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.combo", BI.Combo);/** - * - * 某个可以展开的节点 - * - * Created by GUY on 2015/9/10. - * @class BI.Expander - * @extends BI.Widget +$.shortcut("bi.button_map", BI.ButtonMap);/** + * guy + * 异步树 + * @class BI.TreeView + * @extends BI.Pane */ -BI.Expander = BI.inherit(BI.Widget, { +BI.TreeView = BI.inherit(BI.Pane, { _defaultConfig: function () { - return BI.extend(BI.Expander.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-expander", - trigger: "click", - toggle: true, - //direction: "bottom", //top,bottom四个方向 - isDefaultInit: false, //是否默认初始化子节点 - el: {}, - popup: {}, - expanderClass: "bi-expander-popup", - hoverClass: "bi-expander-hover" + return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-tree", + paras: {}, + itemsCreator: BI.emptyFn }) }, - _init: function () { - BI.Expander.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this._expanded = !!o.el.open; - this._initExpander(); - this._initPullDownAction(); - this.expander.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - if (type === BI.Events.EXPAND) { - self._popupView(); - } - if (type === BI.Events.COLLAPSE) { - self._hideView(); - } - if (self.isEnabled() && this.isEnabled()) { - if (type === BI.Events.EXPAND || type === BI.Events.COLLAPSE) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - } - if (type === BI.Events.CLICK) { - self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE, value, obj); - } - } - }); + BI.TreeView.superclass._init.apply(this, arguments); + FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.core-3.5.js', 'js'); + FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.excheck-3.5.js', 'js'); + FR.$defaultImport('/com/fr/bi/web/css/base/third/ztree/zTreeStyle.css', 'css'); - this.element.hover(function () { - if (self.isEnabled() && self.expander.isEnabled()) { - self.element.addClass(o.hoverClass); - } - }, function () { - if (self.isEnabled() && self.expander.isEnabled()) { - self.element.removeClass(o.hoverClass); - } + this._stop = false; + this.container = BI.createWidget(); + + this._createTree(); + this.tip = BI.createWidget({ + type: "bi.loading_bar", + invisible: true, + handler: BI.bind(this._loadMore, this) }); BI.createWidget({ type: "bi.vertical", + scrollable: true, scrolly: false, element: this, - items: [ - {el: this.expander} - ] + items: [this.container, this.tip] }); - o.isDefaultInit && this._assertPopupView(); - if (this.expander.isOpened() === true) { - this._popupView(); - } - }, - _toggle: function () { - this._assertPopupViewRender(); - if (this.popupView.isVisible()) { - this._hideView(); - } else { - if (this.isEnabled()) { - this._popupView(); - } - } }, - _initPullDownAction: function () { - var self = this, o = this.options; - var evs = this.options.trigger.split(","); - BI.each(evs, function (i, e) { - switch (e) { - case "hover": - self.element[e](function (e) { - if (self.isEnabled() && self.expander.isEnabled()) { - self._popupView(); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.expander); - self.fireEvent(BI.Expander.EVENT_EXPAND); - } - }, function () { - if (self.isEnabled() && self.expander.isEnabled() && o.toggle) { - self._hideView(); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.expander); - self.fireEvent(BI.Expander.EVENT_COLLAPSE); - } - }); - break; - default : - if (e) { - self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.expander.element.__isMouseInBounds__(e)) { - if (self.isEnabled() && self.expander.isEnabled()) { - o.toggle ? self._toggle() : self._popupView(); - if (self.isExpanded()) { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.expander); - self.fireEvent(BI.Expander.EVENT_EXPAND); - } else { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.expander); - self.fireEvent(BI.Expander.EVENT_COLLAPSE); - } - } - } - }, BI.EVENT_RESPONSE_TIME, true)); - } - break; - } - }) + _createTree: function () { + this.id = "bi-tree" + BI.UUID(); + if (this.nodes) { + this.nodes.destroy(); + } + if (this.tree) { + this.tree.destroy(); + } + this.tree = BI.createWidget({ + type: "bi.layout", + element: "
    " + }); + BI.createWidget({ + type: "bi.default", + element: this.container, + items: [this.tree] + }); }, - _initExpander: function () { - this.expander = BI.createWidget(this.options.el); + //选择节点触发方法 + _selectTreeNode: function (treeId, treeNode) { + this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, treeNode, this); + this.fireEvent(BI.TreeView.EVENT_CHANGE, treeNode, this); }, - _assertPopupView: function () { + //配置属性 + _configSetting: function () { + var paras = this.options.paras; var self = this; - if (this.popupView == null) { - this.popupView = BI.createWidget(this.options.popup, { - type: "bi.button_group", - cls: "expander-popup", - layouts: [{ - type: "bi.vertical", - hgap: 0, - vgap: 0 - }] - }); - this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if (type === BI.Events.CLICK) { - //self.setValue(self.getValue()); - self.fireEvent(BI.Expander.EVENT_CHANGE, value, obj); + var setting = { + async: { + enable: true, + url: getUrl, + autoParam: ["id", "name"], + otherParam: FR.cjkEncodeDO(paras) + }, + check: { + enable: true + }, + data: { + key: { + title: "title", + name: "text" + }, + simpleData: { + enable: true } - }); - this.popupView.setVisible(this.isExpanded()); - BI.nextTick(function () { - self.fireEvent(BI.Expander.EVENT_AFTER_INIT); - }); - } - }, + }, + view: { + showIcon: false, + expandSpeed: "", + nameIsHTML: true, + dblClickExpand: false + }, + callback: { + beforeExpand: beforeExpand, + onAsyncSuccess: onAsyncSuccess, + onAsyncError: onAsyncError, + beforeCheck: beforeCheck, + onCheck: onCheck, + onExpand: onExpand, + onCollapse: onCollapse, + onClick: onClick + } + }; + var className = "dark", perTime = 100; - _assertPopupViewRender: function () { - this._assertPopupView(); - if (!this._rendered) { - BI.createWidget({ - type: "bi.vertical", - scrolly: false, - element: this, - items: [ - {el: this.popupView} - ] - }); - this._rendered = true; + function onClick(event, treeId, treeNode) { + self.nodes.checkNode(treeNode, !treeNode.checked, true, true); } - }, - - _hideView: function () { - this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW); - this._expanded = false; - this.expander.setOpened(false); - this.popupView && this.popupView.invisible(); - this.element.removeClass(this.options.expanderClass); - this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW); - }, + function getUrl(treeId, treeNode) { + var parentNode = self._getParentValues(treeNode); + treeNode.times = treeNode.times || 1; + var param = "id=" + treeNode.id + + "×=" + (treeNode.times++) + + "&parent_values= " + window.encodeURIComponent(FR.jsonEncode(parentNode)) + + "&check_state=" + window.encodeURIComponent(FR.jsonEncode(treeNode.getCheckStatus())); - _popupView: function () { - this._assertPopupViewRender(); - this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW); - this._expanded = true; - this.expander.setOpened(true); - this.popupView.visible(); - this.element.addClass(this.options.expanderClass); - this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW); - }, + return FR.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; + } - populate: function (items) { - //this._assertPopupView(); - this.popupView && this.popupView.populate.apply(this.popupView, arguments); - this.expander.populate.apply(this.expander, arguments); - }, + function beforeExpand(treeId, treeNode) { + if (!treeNode.isAjaxing) { + if (!treeNode.children) { + treeNode.times = 1; + ajaxGetNodes(treeNode, "refresh"); + } + return true; + } else { + BI.Msg.toast("Please Wait。", "warning"); + return false; + } + } - setEnable: function (arg) { - BI.Expander.superclass.setEnable.apply(this, arguments); - this.expander && this.expander.setEnable(arg); - this.popupView && this.popupView.setEnable(arg); - !arg && this._hideView(); - }, + function onAsyncSuccess(event, treeId, treeNode, msg) { + treeNode.halfCheck = false; + if (!msg || msg.length === 0 || /^[\s,\S]*<\/html>$/gi.test(msg) || self._stop) { + return; + } + var zTree = self.nodes; + var totalCount = treeNode.count || 0; - setValue: function (v) { - //this._assertPopupView(); - this.expander.setValue(v); - this.popupView && this.popupView.setValue(v); - }, + //尝试去获取下一组节点,若获取值为空数组,表示获取完成 + // TODO by GUY + if (treeNode.children.length > totalCount) { + treeNode.count = treeNode.children.length; + BI.delay(function () { + ajaxGetNodes(treeNode); + }, perTime); + } else { + //treeNode.icon = ""; + zTree.updateNode(treeNode); + zTree.selectNode(treeNode.children[0]); + //className = (className === "dark" ? "":"dark"); + } + } - getValue: function () { - //this._assertPopupView(); - return this.popupView ? this.popupView.getValue() : []; - }, + function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) { + var zTree = self.nodes; + BI.Msg.toast("Error!", "warning"); + //treeNode.icon = ""; + //zTree.updateNode(treeNode); + } - isViewVisible: function () { - return this.isEnabled() && this.expander.isEnabled() && !!this.popupView && this.popupView.isVisible(); - }, + function ajaxGetNodes(treeNode, reloadType) { + var zTree = self.nodes; + if (reloadType == "refresh") { + //treeNode.icon = FR.servletURL +"?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif"; + zTree.updateNode(treeNode); + } + zTree.reAsyncChildNodes(treeNode, reloadType, true); + } - isExpanded: function () { - return this._expanded; - }, + function beforeCheck(treeId, treeNode) { + treeNode.halfCheck = false; + if (treeNode.checked === true) { + //将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy + //所有的半选状态都需要取消halfCheck=true的情况 + function track(children) { + BI.each(children, function (i, ch) { + if (ch.halfCheck === true) { + ch.halfCheck = false; + track(ch.children); + } + }) + } - showView: function () { - if (this.isEnabled() && this.expander.isEnabled()) { - this._popupView(); + track(treeNode.children); + var treeObj = self.nodes; + var nodes = treeObj.getSelectedNodes(); + $.each(nodes, function (index, node) { + node.halfCheck = false; + }) + } } - }, - hideView: function () { - this._hideView(); - }, + function onCheck(event, treeId, treeNode) { + self._selectTreeNode(treeId, treeNode); + } - getView: function () { - return this.popupView; - }, + function onExpand(event, treeId, treeNode) { + treeNode.halfCheck = false; + } - doBehavior: function () { - //this._assertPopupView(); - this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments); - }, + function onCollapse(event, treeId, treeNode) { + } - getAllLeaves: function () { - return this.popupView && this.popupView.getAllLeaves(); + return setting; }, - getNodeById: function (id) { - if (this.expander.options.id === id) { - return this.expander; + _getParentValues: function (treeNode) { + if (!treeNode.getParentNode()) { + return []; } - return this.popupView && this.popupView.getNodeById(id); + var parentNode = treeNode.getParentNode(); + var result = this._getParentValues(parentNode); + result = result.concat([this._getNodeValue(parentNode)]); + return result; }, - getNodeByValue: function (value) { - if (this.expander.getValue() === value) { - return this.expander; - } - return this.popupView && this.popupView.getNodeByValue(value); + _getNodeValue: function (node) { + //去除标红 + return node.value || node.text.replace(/<[^>]+>/g, ""); }, - destroyed: function () { - this.popupView && this.popupView.destroy(); - } -}); -BI.Expander.EVENT_EXPAND = "EVENT_EXPAND"; -BI.Expander.EVENT_COLLAPSE = "EVENT_COLLAPSE"; -BI.Expander.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; -BI.Expander.EVENT_CHANGE = "EVENT_CHANGE"; -BI.Expander.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; - - -BI.Expander.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; -BI.Expander.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW"; -BI.Expander.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW"; -BI.Expander.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; - -$.shortcut("bi.expander", BI.Expander);/** - * Created by GUY on 2015/6/26. - * @class BI.ButtonGroup - * @extends BI.Widget - */ - -BI.ButtonGroup = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-button-group", - behaviors: {}, - items: [ - { - el: {type: "bi.text_button", text: "", value: ""} - } - ], - chooseType: BI.Selection.Single, - layouts: [{ - type: "bi.center", - hgap: 0, - vgap: 0 - }] - }) + //获取半选框值 + _getHalfSelectedValues: function (map, node) { + var self = this; + var checkState = node.getCheckStatus(); + //将未选的去掉 + if (checkState.checked === false && checkState.half === false) { + return; + } + //如果节点已展开,并且是半选 + if (BI.isNotEmptyArray(node.children) && checkState.half === true) { + var children = node.children; + BI.each(children, function (i, ch) { + self._getHalfSelectedValues(map, ch); + }); + return; + } + var parent = node.parentValues || self._getParentValues(node); + var path = parent.concat(this._getNodeValue(node)); + if (BI.isNotEmptyArray(node.children) || checkState.half === false) { + this._buildTree(map, path); + return; + } + var storeValues = BI.deepClone(this.options.paras.selected_values); + var treeNode = this._getTree(storeValues, path); + this._addTreeNode(map, parent, this._getNodeValue(node), treeNode); }, - _init: function () { - BI.ButtonGroup.superclass._init.apply(this, arguments); - var behaviors = {}; - BI.each(this.options.behaviors, function (key, rule) { - behaviors[key] = BI.BehaviorFactory.createBehavior(key, { - rule: rule - }) + _getTree: function (map, values) { + var cur = map; + BI.any(values, function (i, value) { + if (cur[value] == null) { + return true; + } + cur = cur[value]; }); - this.behaviors = behaviors; - this.populate(this.options.items); + return cur; }, - _createBtns: function (items) { - var o = this.options; - return BI.createWidgets(BI.createItems(items, { - type: "bi.text_button" - })); + _addTreeNode: function (map, values, key, value) { + var cur = map; + BI.each(values, function (i, value) { + if (cur[value] == null) { + cur[value] = {}; + } + cur = cur[value]; + }); + cur[key] = value; }, - _btnsCreator: function (items) { - var self = this, args = Array.prototype.slice.call(arguments), o = this.options; - var buttons = this._createBtns(items); - args[0] = buttons; + //构造树节点 + _buildTree: function (map, values) { + var cur = map; + BI.each(values, function (i, value) { + if (cur[value] == null) { + cur[value] = {}; + } + cur = cur[value]; + }) + }, - BI.each(this.behaviors, function (i, behavior) { - behavior.doBehavior.apply(behavior, args); - }); - BI.each(buttons, function (i, btn) { - btn.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - if (type === BI.Events.CLICK) { - switch (o.chooseType) { - case BI.ButtonGroup.CHOOSE_TYPE_SINGLE: - self.setValue(btn.getValue()); - break; - case BI.ButtonGroup.CHOOSE_TYPE_NONE: - self.setValue([]); - break; + //获取选中的值 + _getSelectedValues: function () { + var self = this; + var hashMap = {}; + var rootNoots = this.nodes.getNodes(); + track(rootNoots); + function track(nodes) { + BI.each(nodes, function (i, node) { + var checkState = node.getCheckStatus(); + if (checkState.checked === true || checkState.half === true) { + if (checkState.half === true) { + self._getHalfSelectedValues(hashMap, node); + } else { + var parentValues = node.parentValues || self._getParentValues(node); + var values = parentValues.concat([self._getNodeValue(node)]); + self._buildTree(hashMap, values); } - self.fireEvent(BI.ButtonGroup.EVENT_CHANGE, value, obj); } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - btn.on(BI.Events.DESTROY, function () { - BI.remove(self.buttons, btn); - }) - }); - - return buttons; - }, - - _packageBtns: function (btns) { - var o = this.options; - - for (var i = o.layouts.length - 1; i > 0; i--) { - btns = BI.map(btns, function (k, it) { - return BI.extend({}, o.layouts[i], { - items: [ - BI.extend({}, o.layouts[i].el, { - el: it - }) - ] - }) }) } - return btns; - }, - _packageItems: function (items, packBtns) { - return BI.createItems(BI.makeArrayByArray(items, {}), BI.clone(packBtns)); + return hashMap; }, - _packageLayout: function (items) { - var o = this.options, layout = BI.deepClone(o.layouts[0]); - - var lay = BI.formatEL(layout).el; - while (lay && lay.items && !BI.isEmpty(lay.items)) { - lay = BI.formatEL(lay.items[0]).el; + //处理节点 + _dealWidthNodes: function (nodes) { + var self = this, o = this.options; + //处理标红 + if (BI.isKey(o.paras.keyword)) { + var keyword = o.paras.keyword; + var ns = BI.Tree.arrayFormat(nodes); + BI.each(ns, function (i, n) { + n.text = $("
    ").__textKeywordMarked__(n.text, keyword, n.py).html(); + }); } - lay.items = items; - return layout; + return nodes; }, + _loadMore: function () { + var self = this, o = this.options; + this.tip.setLoading(); + var op = BI.extend({}, o.paras, { + times: ++this.times + }); + o.itemsCreator(op, function (res) { + if (self._stop === true) { + return; + } + var hasNext = !!res.hasNext, nodes = res.items || []; - doBehavior: function () { - var args = Array.prototype.slice.call(arguments); - args.unshift(this.buttons); - BI.each(this.behaviors, function (i, behavior) { - behavior.doBehavior.apply(behavior, args); - }) + if (!hasNext) { + self.tip.setEnd(); + } else { + self.tip.setLoaded(); + } + if (nodes.length > 0) { + self.nodes.addNodes(null, self._dealWidthNodes(nodes)); + } + }); }, - prependItems: function (items) { - var o = this.options; - var btns = this._btnsCreator.apply(this, arguments); - this.buttons = BI.concat(btns, this.buttons); - - //如果是一个简单的layout - if (o.layouts.length === 1 && !BI.isNotEmptyArray(o.layouts[0].items) - && this.layouts && this.layouts.prependItems) { - this.layouts.prependItems(btns); - return; - } - - var items = this._packageItems(items, this._packageBtns(btns)); - BI.createWidget(BI.extend(this._packageLayout(items))).element.children().prependTo(this.element); - }, - - addItems: function (items) { - var o = this.options; - var btns = this._btnsCreator.apply(this, arguments); - this.buttons = BI.concat(this.buttons, btns); - - //如果是一个简单的layout - if (o.layouts.length === 1 && !BI.isNotEmptyArray(o.layouts[0].items) - && this.layouts && this.layouts.addItems) { - this.layouts.addItems(btns); - return; - } - - var items = this._packageItems(items, this._packageBtns(btns)); - BI.createWidget(BI.extend(this._packageLayout(items))).element.children().appendTo(this.element); - }, - - removeItemAt: function (indexes) { - var self = this; - indexes = BI.isArray(indexes) ? indexes : [indexes]; - var buttons = []; - BI.each(indexes, function (i, index) { - buttons.push(self.buttons[index]); + //生成树内部方法 + _initTree: function (setting) { + var self = this, o = this.options; + self.fireEvent(BI.Events.INIT); + this.times = 1; + var tree = this.tree; + tree.empty(); + this.loading(); + this.tip.setVisible(false); + var callback = function (nodes) { + if (self._stop === true) { + return; + } + self.nodes = $.fn.zTree.init(tree.element, setting, nodes); + }; + var op = BI.extend({}, o.paras, { + times: 1, + type: BICst.TREE.TREE_REQ_TYPE.INIT_DATA }); - BI.each(buttons, function (i, btn) { - btn && btn.destroy(); - }) - }, - removeItems: function (v) { - v = BI.isArray(v) ? v : [v]; - var indexes = []; - BI.each(this.buttons, function (i, item) { - if (BI.deepContains(v, item.getValue())) { - indexes.push(i); + o.itemsCreator(op, function (res) { + if (self._stop === true) { + return; + } + var hasNext = !!res.hasNext, nodes = res.items || []; + if (nodes.length > 0) { + callback(self._dealWidthNodes(nodes)); } + self.setTipVisible(nodes.length <= 0); + self.loaded(); + if (!hasNext) { + self.tip.invisible(); + } else { + self.tip.setLoaded(); + } + op.times === 1 && self.fireEvent(BI.Events.AFTERINIT); }); - this.removeItemAt(indexes); }, - populate: function (items) { - this.options.items = items || []; - this.empty(); - - this.buttons = this._btnsCreator.apply(this, arguments); - var items = this._packageItems(items, this._packageBtns(this.buttons)); + //构造树结构, + initTree: function (nodes, setting) { + var setting = setting || { + async: { + enable: false + }, + check: { + enable: false + }, + data: { + key: { + title: "title", + name: "text" + }, + simpleData: { + enable: true + } + }, + view: { + showIcon: false, + expandSpeed: "" + }, + callback: {} + }; + this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes); + }, - this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); + start: function () { + this._stop = false; }, - setEnable: function (b) { - BI.ButtonGroup.superclass.setEnable.apply(this, arguments); - BI.each(this.buttons, function (i, item) { - item.setEnable(b); - }); + stop: function () { + this._stop = true; }, - setNotSelectedValue: function (v) { - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (i, item) { - if (BI.deepContains(v, item.getValue())) { - item.setSelected && item.setSelected(false); - } else { - item.setSelected && item.setSelected(true); - } - }); + //生成树方法 + stroke: function (config) { + delete this.options.keyword; + BI.extend(this.options.paras, config); + var setting = this._configSetting(); + this._createTree(); + this.start(); + this._initTree(setting); }, - setEnabledValue: function (v) { - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (i, item) { - if (BI.deepContains(v, item.getValue())) { - item.setEnable(true); - } else { - item.setEnable(false); - } - }); + populate: function () { + this.stroke.apply(this, arguments); }, - setValue: function (v) { - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (i, item) { - if (BI.deepContains(v, item.getValue())) { - item.setSelected && item.setSelected(true); - } else { - item.setSelected && item.setSelected(false); - } - }); + hasChecked: function () { + var treeObj = this.nodes; + return treeObj.getCheckedNodes(true).length > 0; }, - getNotSelectedValue: function () { - var v = []; - BI.each(this.buttons, function (i, item) { - if (item.isEnabled() && !(item.isSelected && item.isSelected())) { - v.push(item.getValue()); - } - }); - return v; + checkAll: function (checked) { + this.nodes && this.nodes.checkAllNodes(checked); }, - getValue: function () { - var v = []; - BI.each(this.buttons, function (i, item) { - if (item.isEnabled() && item.isSelected && item.isSelected()) { - v.push(item.getValue()); - } - }); - return v; + expandAll: function (flag) { + this.nodes && this.nodes.expandAll(flag); }, - getAllButtons: function () { - return this.buttons; + setValue: function (value, param) { + this.setSelectedValue(value); + this.checkAll(false); + this.updateValue(value, param); + this.refresh(); }, - getAllLeaves: function () { - return this.buttons; + setSelectedValue: function (value) { + this.options.paras.selected_values = value || {}; + this.selected_values = BI.deepClone(value) || {}; }, - getSelectedButtons: function () { - var btns = []; - BI.each(this.buttons, function (i, item) { - if (item.isSelected && item.isSelected()) { - btns.push(item); - } + updateValue: function (values, param) { + if (!this.nodes) { + return; + } + param || (param = "value"); + var treeObj = this.nodes; + BI.each(values, function (v, op) { + var nodes = treeObj.getNodesByParam(param, v, null); + BI.each(nodes, function (j, node) { + BI.extend(node, {checked: true}, op); + treeObj.updateNode(node); + }) }); - return btns; }, - getNotSelectedButtons: function () { - var btns = []; - BI.each(this.buttons, function (i, item) { - if (item.isSelected && !item.isSelected()) { - btns.push(item); - } - }); - return btns; + refresh: function () { + this.nodes && this.nodes.refresh(); }, - getIndexByValue: function (value) { - var index = -1; - BI.any(this.buttons, function (i, item) { - if (item.isEnabled() && item.getValue() === value) { - index = i; - return true; - } - }); - return index; + getValue: function () { + if (!this.nodes) { + return null; + } + return this._getSelectedValues(); }, - getNodeById: function (id) { - var node; - BI.any(this.buttons, function (i, item) { - if (item.isEnabled() && item.options.id === id) { - node = item; - return true; - } - }); - return node; + empty: function () { + BI.isNotNull(this.nodes) && this.nodes.destroy(); }, - getNodeByValue: function (value) { - var node; - BI.any(this.buttons, function (i, item) { - if (item.isEnabled() && item.getValue() === value) { - node = item; - return true; - } - }); - return node; + destroy: function () { + this.stop(); + this.nodes && this.nodes.destroy(); + BI.TreeView.superclass.destroy.apply(this, arguments); } }); -BI.extend(BI.ButtonGroup, { - CHOOSE_TYPE_SINGLE: BI.Selection.Single, - CHOOSE_TYPE_MULTI: BI.Selection.Multi, - CHOOSE_TYPE_ALL: BI.Selection.All, - CHOOSE_TYPE_NONE: BI.Selection.None, - CHOOSE_TYPE_DEFAULT: BI.Selection.Default +BI.extend(BI.TreeView, { + REQ_TYPE_INIT_DATA: 1, + REQ_TYPE_ADJUST_DATA: 2, + REQ_TYPE_CALCULATE_SELECT_DATA: 3, + REQ_TYPE_SELECTED_DATA: 4 }); -BI.ButtonGroup.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.button_group", BI.ButtonGroup); -/** - * Created by GUY on 2015/8/10. - */ +BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE"; +BI.TreeView.EVENT_INIT = BI.Events.INIT; +BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT; -BI.ComboGroup = BI.inherit(BI.Widget, { +$.shortcut("bi.tree", BI.TreeView);/** + * guy + * 同步树 + * @class BI.SyncTree + * @extends BI.TreeView + */ +BI.SyncTree = BI.inherit(BI.TreeView, { _defaultConfig: function () { - return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo-group", - - //以下这些属性对每一个combo都是公用的 - trigger: "click,hover", - direction: "right", - adjustLength: 0, - isDefaultInit: false, - isNeedAdjustHeight: false, - isNeedAdjustWidth: false, - - el: {type: "bi.text_button", text: "", value: ""}, - children: [], - - popup: { - el: { - type: "bi.button_tree", - chooseType: 0, - layouts: [{ - type: "bi.vertical" - }] - } - } - }) + return BI.extend(BI.SyncTree.superclass._defaultConfig.apply(this, arguments), {}) }, - _init: function () { - BI.ComboGroup.superclass._init.apply(this, arguments); - this.populate(this.options.el); + BI.SyncTree.superclass._init.apply(this, arguments); }, - populate: function (item) { - var self = this, o = this.options; - var children = o.children; - if (BI.isEmpty(children)) { - throw new Error("ComboGroup构造错误"); - } - BI.each(children, function (i, ch) { - var son = BI.formatEL(ch).el.children; - ch = BI.formatEL(ch).el; - if (!BI.isEmpty(son)) { - ch.el = BI.clone(ch); - ch.children = son; - ch.type = "bi.combo_group"; - ch.action = o.action; - ch.height = o.height; - ch.direction = o.direction; - ch.isDefaultInit = o.isDefaultInit; - ch.isNeedAdjustHeight = o.isNeedAdjustHeight; - ch.isNeedAdjustWidth = o.isNeedAdjustWidth; - ch.adjustLength = o.adjustLength; - ch.popup = o.popup; - } - }) - this.combo = BI.createWidget({ - type: "bi.combo", - element: this, - height: o.height, - trigger: o.trigger, - direction: o.direction, - isDefaultInit: o.isDefaultInit, - isNeedAdjustWidth: o.isNeedAdjustWidth, - isNeedAdjustHeight: o.isNeedAdjustHeight, - adjustLength: o.adjustLength, - el: item, - popup: BI.extend({}, o.popup, { - el: BI.extend({ - items: children - }, o.popup.el) - }) - }) - this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if (type === BI.Events.CLICK) { - self.fireEvent(BI.ComboGroup.EVENT_CHANGE, obj); + //配置属性 + _configSetting: function () { + var paras = this.options.paras; + var self = this; + var setting = { + async: { + enable: false, + otherParam: FR.cjkEncodeDO(paras) + }, + check: { + enable: true + }, + data: { + key: { + title: "title", + name: "text" + }, + simpleData: { + enable: true + } + }, + view: { + showIcon: false, + expandSpeed: "", + nameIsHTML: true, + dblClickExpand: false + }, + callback: { + beforeCheck: beforeCheck, + onCheck: onCheck, + beforeExpand: beforeExpand, + onExpand: onExpand, + onCollapse: onCollapse, + onClick: onClick } - }) - }, + }; - setEnable: function (b) { - BI.ComboGroup.superclass.setEnable.apply(this, arguments); - this.combo && this.combo.setEnable(b); - }, + function onClick(event, treeId, treeNode) { + var zTree = $.fn.zTree.getZTreeObj(treeId); + zTree.checkNode(treeNode, !treeNode.checked, true, true); + } - getValue: function () { - return this.combo.getValue(); - }, + function beforeCheck(treeId, treeNode) { + treeNode.halfCheck = false; + if (treeNode.checked === true) { + //将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy + //所有的半选状态都需要取消halfCheck=true的情况 + function track(children) { + BI.each(children, function (i, ch) { + if (ch.halfCheck === true) { + ch.halfCheck = false; + track(ch.children); + } + }) + } - setValue: function (v) { - this.combo.setValue(v); - } -}); -BI.ComboGroup.EVENT_CHANGE = "EVENT_CHANGE"; + track(treeNode.children); -$.shortcut("bi.combo_group", BI.ComboGroup);/** - * 加载控件 - * - * Created by GUY on 2015/8/31. - * @class BI.Loader - * @extends BI.Widget - */ -BI.Loader = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.Loader.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-loader", + var treeObj = $.fn.zTree.getZTreeObj(treeId); + var nodes = treeObj.getSelectedNodes(); + BI.each(nodes, function (index, node) { + node.halfCheck = false; + }) + } + } - direction: "top", - isDefaultInit: true,//是否默认初始化数据 - logic: { - dynamic: true, - scrolly: true - }, + function beforeExpand(treeId, treeNode) { + self._expandNode(treeId, treeNode); + } - //下面是button_group的属性 - el: { - type: "bi.button_group" - }, + function onCheck(event, treeId, treeNode) { + self._selectTreeNode(treeId, treeNode); + } - items: [], - itemsCreator: BI.emptyFn, - onLoaded: BI.emptyFn, + function onExpand(event, treeId, treeNode) { + treeNode.halfCheck = false; + } - //下面是分页信息 - count: false, - prev: false, - next: {}, - hasPrev: BI.emptyFn, - hasNext: BI.emptyFn - }) - }, + function onCollapse(event, treeId, treeNode) { + treeNode.halfCheck = false; + } - _prevLoad: function () { - var self = this, o = this.options; - this.prev.setLoading(); - o.itemsCreator.apply(this, [{times: --this.times}, function () { - self.prev.setLoaded(); - self.prependItems.apply(self, arguments); - }]); + return setting; }, - _nextLoad: function () { + _selectTreeNode: function (treeId, treeNode) { var self = this, o = this.options; - this.next.setLoading(); - o.itemsCreator.apply(this, [{times: ++this.times}, function () { - self.next.setLoaded(); - self.addItems.apply(self, arguments); - }]); + var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); + var name = this._getNodeValue(treeNode) +// var values = parent_values.concat([name]); + if (treeNode.checked === true) { + } else { + var tNode = treeNode; + var pNode = this._getTree(this.selected_values, parent_values); + if (BI.isNotNull(pNode[name])) { + delete pNode[name]; + } + while (tNode != null && BI.isEmpty(pNode)) { + parent_values = parent_values.slice(0, parent_values.length - 1); + tNode = tNode.getParentNode(); + if (tNode != null) { + pNode = this._getTree(this.selected_values, parent_values); + name = this._getNodeValue(tNode); + delete pNode[name]; + } + } + } + BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); }, - _init: function () { - BI.Loader.superclass._init.apply(this, arguments); + //展开节点 + _expandNode: function (treeId, treeNode) { var self = this, o = this.options; - if (o.itemsCreator === false) { - o.prev = false; - o.next = false; - } - if (o.prev !== false) { - this.prev = BI.createWidget(BI.extend({ - type: "bi.loading_bar" - }, o.prev)); - this.prev.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) { - self._prevLoad(); - } - }); - } - - this.button_group = BI.createWidget(o.el, { - type: "bi.button_group", - chooseType: 0, - items: o.items, - behaviors: {}, - layouts: [{ - type: "bi.vertical" - }] + var parentValues = treeNode.parentValues || self._getParentValues(treeNode); + var op = BI.extend({}, o.paras, { + "id": treeNode.id, + "times": 1, + "parent_values": parentValues.concat(this._getNodeValue(treeNode)), + "check_state": treeNode.getCheckStatus() }); - this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if (type === BI.Events.CLICK) { - self.fireEvent(BI.Loader.EVENT_CHANGE, obj); + var complete = function (d) { + var nodes = d.items || []; + if (nodes.length > 0) { + callback(self._dealWidthNodes(nodes), !!d.hasNext); } - }); - - if (o.next !== false) { - this.next = BI.createWidget(BI.extend({ - type: "bi.loading_bar" - }, o.next)); - this.next.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) { - self._nextLoad(); - } - }) - } + }; + var times = 1; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({ - scrolly: true - }, o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.prev, this.button_group, this.next) - })))); + function callback(nodes, hasNext) { + self.nodes.addNodes(treeNode, nodes); - o.isDefaultInit && BI.isEmpty(o.items) && BI.nextTick(BI.bind(function () { - o.isDefaultInit && BI.isEmpty(o.items) && this.populate(); - }, this)); - if (BI.isNotEmptyArray(o.items)) { - this.populate(o.items); + if (hasNext === true) { + BI.delay(function () { + times++; + op.times = times; + o.itemsCreator(op, complete); + }, 100); + } } - }, - hasPrev: function () { - var o = this.options; - if (BI.isNumber(o.count)) { - return this.count < o.count; + if (!treeNode.children) { + o.itemsCreator(op, complete) } - return !!o.hasPrev.apply(this, [{ - times: this.times, - count: this.count - }]) }, - hasNext: function () { - var o = this.options; - if (BI.isNumber(o.count)) { - return this.count < o.count; + _join: function (valueA, valueB) { + var self = this; + var map = {}; + track([], valueA, valueB); + track([], valueB, valueA); + function track(parent, node, compare) { + BI.each(node, function (n, item) { + if (BI.isNull(compare[n])) { + self._addTreeNode(map, parent, n, item); + } else if (BI.isEmpty(compare[n])) { + self._addTreeNode(map, parent, n, {}); + } else { + track(parent.concat([n]), node[n], compare[n]); + } + }) } - return !!o.hasNext.apply(this, [{ - times: this.times, - count: this.count - }]) - }, - prependItems: function (items) { - this.count += items.length; - if (this.next !== false) { - if (this.hasPrev()) { - this.options.items = this.options.items.concat(items); - this.prev.setLoaded(); - } else { - this.prev.setEnd(); - } - } - this.button_group.prependItems.apply(this.button_group, arguments); + return map; }, - addItems: function (items) { - this.count += items.length; - if (BI.isObject(this.next)) { - if (this.hasNext()) { - this.options.items = this.options.items.concat(items); - this.next.setLoaded(); - } else { - this.next.setEnd(); - } - } - this.button_group.addItems.apply(this.button_group, arguments); + hasChecked: function () { + return !BI.isEmpty(this.selected_values) || BI.SyncTree.superclass.hasChecked.apply(this, arguments); }, - populate: function (items) { - var self = this, o = this.options; - if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) { - o.itemsCreator.apply(this, [{times: 1}, function () { - if (arguments.length === 0) { - throw new Error("arguments can not be null!!!"); - } - self.populate.apply(self, arguments); - o.onLoaded(); - }]); - return; + getValue: function () { + if (!this.nodes) { + return {}; } - this.options.items = items; - this.times = 1; - this.count = 0; - this.count += items.length; - if (BI.isObject(this.next)) { - if (this.hasNext()) { - this.next.setLoaded(); - } else { - this.next.invisible(); - } + var checkedValues = this._getSelectedValues(); + if (BI.isEmpty(checkedValues)) { + return this.selected_values; } - if (BI.isObject(this.prev)) { - if (this.hasPrev()) { - this.prev.setLoaded(); - } else { - this.prev.invisible(); - } + if (BI.isEmpty(this.selected_values)) { + return checkedValues; } - this.button_group.populate.apply(this.button_group, arguments); - }, - - setEnable: function (v) { - this.button_group.setEnable(v); - }, - - doBehavior: function () { - this.button_group.doBehavior.apply(this.button_group, arguments); - }, - - setNotSelectedValue: function () { - this.button_group.setNotSelectedValue.apply(this.button_group, arguments); + return this._join(checkedValues, this.selected_values); }, - getNotSelectedValue: function () { - return this.button_group.getNotSelectedValue(); - }, + //生成树方法 + stroke: function (config) { + delete this.options.keyword; + BI.extend(this.options.paras, config); + //取消选中时使用 + this.selected_values = BI.deepClone(this.options.paras.selected_values) || {}; + var setting = this._configSetting(); + this._initTree(setting); + } +}); - setValue: function () { - this.button_group.setValue.apply(this.button_group, arguments); +$.shortcut("bi.sync_tree", BI.SyncTree);/** + * guy + * 局部树,两个请求树, 第一个请求构造树,第二个请求获取节点 + * @class BI.PartTree + * @extends BI.SyncTree + */ +BI.PartTree = BI.inherit(BI.SyncTree, { + _defaultConfig: function () { + return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this, arguments), {}) }, - getValue: function () { - return this.button_group.getValue.apply(this.button_group, arguments); + _init: function () { + BI.PartTree.superclass._init.apply(this, arguments); }, - getAllButtons: function () { - return this.button_group.getAllButtons(); + _loadMore: function () { + var self = this, o = this.options; + var op = BI.extend({}, o.paras, { + type: BI.TreeView.REQ_TYPE_INIT_DATA, + times: ++this.times + }); + this.tip.setLoading(); + o.itemsCreator(op, function (d) { + var hasNext = !!d.hasNext, nodes = d.items || []; + o.paras.last_search_value = d.last_search_value; + if (self._stop === true) { + return; + } + if (!hasNext) { + self.tip.setEnd(); + } else { + self.tip.setLoaded(); + } + if (nodes.length > 0) { + self.nodes.addNodes(null, self._dealWidthNodes(nodes)); + } + }); }, - getAllLeaves: function () { - return this.button_group.getAllLeaves(); + _selectTreeNode: function (treeId, treeNode) { + var self = this, o = this.options; + var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); + var name = this._getNodeValue(treeNode) +// var values = parent_values.concat([name]); + if (treeNode.checked === true) { + BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + } else { + o.itemsCreator(BI.extend({}, o.paras, { + type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA, + selected_values: this.selected_values, + not_selected_value: name, + parent_values: parent_values + }), function (new_values) { + if (BI.isEqual(self.selected_values, new_values)) { + var tNode = treeNode; + var pNode = self._getTree(new_values, parent_values); + if (pNode[name]) { + delete pNode[name]; + } + while (tNode != null && BI.isEmpty(pNode)) { + parent_values = parent_values.slice(0, parent_values.length - 1); + tNode = tNode.getParentNode(); + if (tNode != null) { + pNode = self._getTree(new_values, parent_values); + name = self._getNodeValue(tNode); + delete pNode[name]; + } + } + } + self.selected_values = new_values; + BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + }); + } }, - getSelectedButtons: function () { - return this.button_group.getSelectedButtons(); - }, + _getSelectedValues: function () { + var self = this; + var hashMap = {}; + var rootNoots = this.nodes.getNodes(); + track(rootNoots); + function track(nodes) { + BI.each(nodes, function (i, node) { + var checkState = node.getCheckStatus(); + if (checkState.checked === false) { + return true; + } + var parentValues = node.parentValues || self._getParentValues(node); + //把文字中的html去掉,其实就是把文字颜色去掉 + var values = parentValues.concat([self._getNodeValue(node)]); + self._buildTree(hashMap, values); +// if(checkState.checked === true && checkState.half === false && nodes[i].flag === true){ +// continue; +// } + if (BI.isNotEmptyArray(node.children)) { + track(node.children); + return true; + } + if (checkState.half === true) { + self._getHalfSelectedValues(hashMap, node); + } + }) + } - getNotSelectedButtons: function () { - return this.button_group.getNotSelectedButtons(); + return hashMap; }, - getIndexByValue: function (value) { - return this.button_group.getIndexByValue(value); - }, + _initTree: function (setting, keyword) { + var self = this, o = this.options; + this.times = 1; + var tree = this.tree; + tree.empty(); + self.tip.setVisible(false); + this.loading(); + var op = BI.extend({}, o.paras, { + type: BI.TreeView.REQ_TYPE_INIT_DATA, + times: this.times + }); + var complete = function (d) { + if (self._stop === true || keyword != o.paras.keyword) { + return; + } + var hasNext = !!d.hasNext, nodes = d.items || []; + o.paras.last_search_value = d.last_search_value; + if (nodes.length > 0) { + callback(self._dealWidthNodes(nodes)); + } + self.setTipVisible(nodes.length <= 0); + self.loaded(); + if (!hasNext) { + self.tip.invisible(); + } else { + self.tip.setLoaded(); + } + self.fireEvent(BI.Events.AFTERINIT); + }; - getNodeById: function (id) { - return this.button_group.getNodeById(id); - }, + function callback(nodes) { + if (self._stop === true) { + return; + } + self.nodes = $.fn.zTree.init(tree.element, setting, nodes); + } - getNodeByValue: function (value) { - return this.button_group.getNodeByValue(value); + BI.delay(function () { + o.itemsCreator(op, complete); + }, 100); }, - empty: function () { - this.button_group.empty(); - BI.each([this.prev, this.next], function (i, ob) { - ob && ob.setVisible(false); + getValue: function () { + var o = this.options; + var result = BI.PartTree.superclass.getValue.apply(this, arguments); + o.itemsCreator({ + type: BI.TreeView.REQ_TYPE_ADJUST_DATA, + selected_values: result + }, function (res) { + result = res; }); + return result; + }, + + //生成树方法 + stroke: function (config) { + var o = this.options; + delete o.paras.keyword; + BI.extend(o.paras, config); + delete o.paras.last_search_value; + //取消选中时使用 + this.selected_values = BI.deepClone(o.paras.selected_values) || {}; + //delete this.options.paras.selected_values; + var setting = this._configSetting(); + this._initTree(setting, o.paras.keyword); } }); -BI.Loader.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.loader", BI.Loader);/** - * Created by GUY on 2015/6/26. - */ -BI.Navigation = BI.inherit(BI.Widget, { - _defaultConfig: function(){ - return BI.extend(BI.Navigation.superclass._defaultConfig.apply(this,arguments), { - direction: "bottom",//top, bottom, left, right, custom - logic: { - dynamic: false - }, - defaultShowIndex: 0, - tab: { - type: "bi.button_group", - items: [], - layouts: [] - }, - cardCreator: function(v){ - return BI.createWidget(); - }, +$.shortcut("bi.part_tree", BI.PartTree);BI.Resizers = new BI.ResizeController(); +BI.Layers = new BI.LayerController(); +BI.Maskers = new BI.MaskersController(); +BI.Bubbles = new BI.BubblesController(); +BI.Tooltips = new BI.TooltipsController(); +BI.Popovers = new BI.FloatBoxController(); +BI.Broadcasts = new BI.BroadcastController(); +/** + * canvas绘图 + * + * Created by GUY on 2015/11/18. + * @class BI.Canvas + * @extends BI.Widget + */ +BI.Canvas = BI.inherit(BI.Widget, { - afterCardCreated: BI.emptyFn, - afterCardShow: BI.emptyFn + _defaultConfig: function () { + return BI.extend(BI.Canvas.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-canvas" }) }, - _init: function(){ - BI.Navigation.superclass._init.apply(this,arguments); + _init: function () { + BI.Canvas.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.tab = BI.createWidget(this.options.tab, {type: "bi.button_group"}); - this.cardMap = {}; - this.showIndex = 0; - this.layout = BI.createWidget({ - type: "bi.card" - }); - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tab, this.layout) - })))); - - - new BI.ShowListener({ - eventObj: this.tab, - cardLayout: this.layout, - cardNameCreator: function(v){ - return self.showIndex + v; - }, - cardCreator: function(v){ - var card = o.cardCreator(v); - self.cardMap[v] = card; - return card; - }, - afterCardCreated: BI.bind(this.afterCardCreated, this), - afterCardShow: BI.bind(this.afterCardShow, this) - }) - if(o.defaultShowIndex !== false){ - this.setSelect(o.defaultShowIndex); + var canvas = document.createElement("canvas"); + if (!document.createElement('canvas').getContext) { + canvas = window.G_vmlCanvasManager.initElement(canvas); } + this.element.append(canvas); + canvas.width = o.width; + canvas.height = o.height; + $(canvas).width("100%"); + $(canvas).height("100%"); + this.canvas = canvas; + this._queue = []; }, - afterCardCreated: function(v){ - var self = this; - this.cardMap[v].on(BI.Controller.EVENT_CHANGE, function(type, value, obj){ - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if(type === BI.Events.CLICK) { - self.fireEvent(BI.Navigation.EVENT_CHANGE, obj); - } - }) - this.options.afterCardCreated.apply(this, arguments); + _getContext: function () { + if (!this.ctx) { + this.ctx = this.canvas.getContext('2d'); + } + return this.ctx; }, - afterCardShow: function(v){ - this.showIndex = v; - this.options.afterCardShow.apply(this, arguments); + _attr: function (key, value) { + var self = this; + if (BI.isNull(key)) { + return; + } + if (BI.isObject(key)) { + BI.each(key, function (k, v) { + self._queue.push({k: k, v: v}); + }); + return; + } + this._queue.push({k: key, v: value}); }, - populate: function(){ - var card = this.layout.getShowingCard(); - if(card){ - return card.populate.apply(card, arguments); + _line: function (x0, y0) { + var self = this; + var args = [].slice.call(arguments, 2); + if (BI.isOdd(args.length)) { + this._attr(BI.last(args)); + args = BI.initial(args); } + this._attr("moveTo", [x0, y0]); + var odd = BI.filter(args, function (i) { + return i % 2 === 0; + }); + var even = BI.filter(args, function (i) { + return i % 2 !== 0; + }); + args = BI.zip(odd, even); + BI.each(args, function (i, point) { + self._attr("lineTo", point); + }); }, - setSelect: function(v){ - this.showIndex = v; - if(!this.layout.isCardExisted(v)){ - var card = this.options.cardCreator(v); - this.cardMap[v] = card; - this.layout.addCardByName(v, card); - this.afterCardCreated(v); - } - this.layout.showCardByName(v); - BI.nextTick(BI.bind(this.afterCardShow, this, v)); + line: function (x0, y0, x1, y1) { + this._line.apply(this, arguments); + this._attr("stroke", []); }, - getSelect: function(){ - return this.showIndex; + rect: function (x, y, w, h, color) { + this._attr("fillStyle", color); + this._attr("fillRect", [x, y, w, h]); }, - getSelectedCard: function(){ - if(BI.isKey(this.showIndex)){ - return this.cardMap[this.showIndex]; - } + circle: function (x, y, radius, color) { + this._attr({ + fillStyle: color, + beginPath: [], + arc: [x, y, radius, 0, Math.PI * 2, true], + closePath: [], + fill: [] + }); }, - /** - * @override - */ - setValue: function(v){ - var card = this.layout.getShowingCard(); - if(card){ - card.setValue(v); - } + hollow: function () { + this._attr("beginPath", []); + this._line.apply(this, arguments); + this._attr("closePath", []); + this._attr("stroke", []); }, - /** - * @override - */ - getValue: function(){ - var card = this.layout.getShowingCard(); - if(card){ - return card.getValue(); - } + solid: function () { + this.hollow.apply(this, arguments); + this._attr("fill", []); }, - empty: function(){ - this.layout.deleteAllCard(); - this.cardMap = {}; + gradient: function (x0, y0, x1, y1, start, end) { + var grd = this._getContext().createLinearGradient(x0, y0, x1, y1); + grd.addColorStop(0, start); + grd.addColorStop(1, end); + return grd; + }, + + reset: function () { + this._getContext().clearRect(0, 0, this.canvas.width, this.canvas.height); + }, + + stroke: function (callback) { + var self = this; + BI.nextTick(function () { + var ctx = self._getContext(); + BI.each(self._queue, function (i, q) { + if (BI.isFunction(ctx[q.k])) { + ctx[q.k].apply(ctx, q.v); + } else { + ctx[q.k] = q.v; + } + }); + self._queue = []; + callback && callback(); + }); } }); -BI.Navigation.EVENT_CHANGE = "EVENT_CHANGE"; - -$.shortcut("bi.navigation", BI.Navigation);/** - * 搜索逻辑控件 +$.shortcut("bi.canvas", BI.Canvas);/** + * Collection * - * Created by GUY on 2015/9/28. - * @class BI.Searcher + * Created by GUY on 2016/1/15. + * @class BI.Collection * @extends BI.Widget */ - -BI.Searcher = BI.inherit(BI.Widget, { +BI.Collection = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.Searcher.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-searcher", - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0, - vgap: 0, - hgap: 0, - - isDefaultInit: false, - isAutoSearch: true, //是否自动搜索 - isAutoSync: true, //是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一 - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - - //isAutoSearch为false时启用 - onSearch: function (op, callback) { - callback([]) - }, - - - el: { - type: "bi.search_editor" - }, - - popup: { - type: "bi.searcher_view" - }, - - adapter: null, - masker: { //masker层 - offset: {} - } - }) + return BI.extend(BI.Collection.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-collection", + width: 400, + height: 300, + overflowX: true, + overflowY: true, + cellSizeAndPositionGetter: BI.emptyFn, + horizontalOverscanSize: 0, + verticalOverscanSize: 0, + scrollLeft: 0, + scrollTop: 0, + items: [] + }); }, _init: function () { - BI.Searcher.superclass._init.apply(this, arguments); + BI.Collection.superclass._init.apply(this, arguments); var self = this, o = this.options; - - this.editor = BI.createWidget(o.el, { - type: "bi.search_editor" + this.renderedCells = []; + this.renderedKeys = []; + this._scrollLock = false; + this._debounceRelease = BI.debounce(function () { + self._scrollLock = false; + }, 150); + this.container = BI.createWidget({ + type: "bi.absolute" + }); + this.element.scroll(function () { + if (self._scrollLock === true) { + return; + } + o.scrollLeft = self.element.scrollLeft(); + o.scrollTop = self.element.scrollTop(); + self._calculateChildrenToRender(); + self.fireEvent(BI.Collection.EVENT_SCROLL, { + scrollLeft: o.scrollLeft, + scrollTop: o.scrollTop + }); }); - BI.createWidget({ type: "bi.vertical", element: this, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - vgap: o.vgap, - hgap: o.hgap, - items: [this.editor] + scrollable: o.overflowX === true && o.overflowY === true, + scrolly: o.overflowX === false && o.overflowY === true, + scrollx: o.overflowX === true && o.overflowY === false, + items: [this.container] }); - o.isDefaultInit && (this._assertPopupView()); + if (o.items.length > 0) { + this._calculateSizeAndPositionData(); + this._populate(); + } + if (o.scrollLeft !== 0 || o.scrollTop !== 0) { + BI.nextTick(function () { + self.element.scrollTop(o.scrollTop); + self.element.scrollLeft(o.scrollLeft); + }); + } + }, - var search = BI.debounce(BI.bind(this._search, this), BI.EVENT_RESPONSE_TIME, true); - this.editor.on(BI.Controller.EVENT_CHANGE, function (type) { - switch (type) { - case BI.Events.STARTEDIT: - self._startSearch(); - break; - case BI.Events.EMPTY: - self._stopSearch(); - break; - case BI.Events.CHANGE: - search(); - break; - case BI.Events.PAUSE: - self._pauseSearch(); - break; + _calculateSizeAndPositionData: function () { + var o = this.options; + var cellMetadata = []; + var sectionManager = new BI.SectionManager(); + var height = 0; + var width = 0; + + for (var index = 0, len = o.items.length; index < len; index++) { + var cellMetadatum = o.cellSizeAndPositionGetter(index); + + if ( + cellMetadatum.height == null || isNaN(cellMetadatum.height) || + cellMetadatum.width == null || isNaN(cellMetadatum.width) || + cellMetadatum.x == null || isNaN(cellMetadatum.x) || + cellMetadatum.y == null || isNaN(cellMetadatum.y) + ) { + throw Error(); } - }) - }, - _assertPopupView: function () { - var self = this, o = this.options; - if (!BI.Maskers.has(this.getName())) { - this.popupView = BI.createWidget(o.popup, { - type: "bi.searcher_view", - chooseType: o.chooseType - }); - BI.Maskers.create(this.getName(), o.adapter, { - offset: o.masker.offset, - container: this, - render: this.popupView - }); + height = Math.max(height, cellMetadatum.y + cellMetadatum.height); + width = Math.max(width, cellMetadatum.x + cellMetadatum.width); - this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if (type === BI.Events.CLICK) { - if (o.isAutoSync) { - var values = o.adapter.getValue(); - if (!obj.isSelected()) { - o.adapter.setValue(BI.deepWithout(values, obj.getValue())); - } else { - switch (o.chooseType) { - case BI.ButtonGroup.CHOOSE_TYPE_SINGLE: - o.adapter.setValue([obj.getValue()]); - break; - case BI.ButtonGroup.CHOOSE_TYPE_MULTI: - values.push(obj.getValue()); - o.adapter.setValue(values); - break; - } - } - } - self.fireEvent(BI.Searcher.EVENT_CHANGE, value, obj); - } - }); - BI.nextTick(function () { - self.fireEvent(BI.Searcher.EVENT_AFTER_INIT); - }); + cellMetadatum.index = index; + cellMetadata[index] = cellMetadatum; + sectionManager.registerCell(cellMetadatum, index); } - }, - _startSearch: function () { - this._assertPopupView(); - this._stop = false; - this._isSearching = true; - this.fireEvent(BI.Searcher.EVENT_START); - this.popupView.startSearch && this.popupView.startSearch(); - //搜索前先清空dom - BI.Maskers.get(this.getName()).empty(); - BI.nextTick(function (name) { - BI.Maskers.show(name); - }, this.getName()); + this._cellMetadata = cellMetadata; + this._sectionManager = sectionManager; + this._height = height; + this._width = width; }, - _pauseSearch: function () { - var o = this.options, name = this.getName(); - this._stop = true; - BI.Maskers.hide(name); - if (BI.Maskers.has(name) && this._isSearching === true) { - this.popupView && this.popupView.pauseSearch && this.popupView.pauseSearch(); - this.fireEvent(BI.Searcher.EVENT_PAUSE); - } - this._isSearching = false; + _cellRenderers: function (height, width, x, y) { + this._lastRenderedCellIndices = this._sectionManager.getCellIndices(height, width, x, y); + return this._cellGroupRenderer() }, - _stopSearch: function () { - var o = this.options, name = this.getName(); - this._stop = true; - BI.Maskers.hide(name); - if (BI.Maskers.has(name) && this._isSearching === true) { - //搜索后清空dom - BI.nextTick(function () { - BI.Maskers.has(name) && BI.Maskers.get(name).empty(); - }); - this.popupView && this.popupView.stopSearch && this.popupView.stopSearch(); - this.fireEvent(BI.Searcher.EVENT_STOP); - } - this._isSearching = false; + _cellGroupRenderer: function () { + var self = this, o = this.options; + var rendered = []; + BI.each(this._lastRenderedCellIndices, function (i, index) { + var cellMetadata = self._sectionManager.getCellMetadata(index); + rendered.push(cellMetadata); + }); + return rendered; }, - _search: function () { - var self = this, o = this.options, keyword = this.editor.getValue(); - if (keyword === "" || this._stop) { - return; - } - if (o.isAutoSearch) { - var items = (o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items") || []; - var finding = BI.Func.getSearchResult(items, keyword); - var matched = finding.matched, finded = finding.finded; - this.popupView.populate(finded, matched, keyword); - o.isAutoSync && this.popupView.setValue(o.adapter.getValue()); - self.fireEvent(BI.Searcher.EVENT_SEARCHING); - return; - } - this.popupView.loading && this.popupView.loading(); - o.onSearch({ - times: 1, - keyword: keyword, - selectedValues: o.adapter.getValue() - }, function (searchResult, matchResult) { - if (!self._stop) { - var args = [].slice.call(arguments); - if (args.length > 0) { - args.push(keyword); + _calculateChildrenToRender: function () { + var self = this, o = this.options; + var scrollLeft = BI.clamp(o.scrollLeft, 0, this._getMaxScrollLeft()); + var scrollTop = BI.clamp(o.scrollTop, 0, this._getMaxScrollTop()); + var left = Math.max(0, scrollLeft - o.horizontalOverscanSize); + var top = Math.max(0, scrollTop - o.verticalOverscanSize); + var right = Math.min(this._width, scrollLeft + o.width + o.horizontalOverscanSize); + var bottom = Math.min(this._height, scrollTop + o.height + o.verticalOverscanSize); + var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top); + var renderedCells = [], renderedKeys = []; + for (var i = 0, len = childrenToDisplay.length; i < len; i++) { + var datum = childrenToDisplay[i]; + var index = BI.deepIndexOf(this.renderedKeys, datum.index); + if (index > -1) { + if (datum.width !== this.renderedCells[index]._width) { + this.renderedCells[index]._width = datum.width; + this.renderedCells[index].el.setWidth(datum.width); } - BI.Maskers.show(self.getName()); - self.popupView.populate.apply(self.popupView, args); - o.isAutoSync && self.popupView.setValue(o.adapter.getValue()); - self.popupView.loaded && self.popupView.loaded(); - self.fireEvent(BI.Searcher.EVENT_SEARCHING); + if (datum.height !== this.renderedCells[index]._height) { + this.renderedCells[index]._height = datum.height; + this.renderedCells[index].el.setHeight(datum.height); + } + if (this.renderedCells[index].left !== datum.x) { + this.renderedCells[index].el.element.css("left", datum.x + "px"); + } + if (this.renderedCells[index].top !== datum.y) { + this.renderedCells[index].el.element.css("top", datum.y + "px"); + } + renderedCells.push(this.renderedCells[index]); + } else { + var child = BI.createWidget(BI.extend({ + type: "bi.label", + width: datum.width, + height: datum.height + }, o.items[datum.index], { + cls: (o.items[datum.index].cls || "") + " container-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : ""), + _left: datum.x, + _top: datum.y + })); + renderedCells.push({ + el: child, + left: datum.x, + top: datum.y, + _width: datum.width, + _height: datum.height + }); + } + renderedKeys.push(datum.index); + } + //已存在的, 需要添加的和需要删除的 + var existSet = {}, addSet = {}, deleteArray = []; + BI.each(renderedKeys, function (i, key) { + if (BI.deepContains(self.renderedKeys, key)) { + existSet[i] = key; + } else { + addSet[i] = key; + } + }); + BI.each(this.renderedKeys, function (i, key) { + if (BI.deepContains(existSet, key)) { + return; + } + if (BI.deepContains(addSet, key)) { + return; } + deleteArray.push(i); + }); + BI.each(deleteArray, function (i, index) { + self.renderedCells[index].el.destroy(); + }); + var addedItems = []; + BI.each(addSet, function (index) { + addedItems.push(renderedCells[index]) + }); + BI.createWidget({ + type: "bi.absolute", + element: this.container, + items: addedItems }); + this.renderedCells = renderedCells; + this.renderedKeys = renderedKeys; }, - setAdapter: function (adapter) { - this.options.adapter = adapter; - BI.Maskers.remove(this.getName()); + _getMaxScrollLeft: function () { + return Math.max(0, this._width - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0)); }, - doSearch: function () { - if (this.isSearching()) { - this._search(); - } + _getMaxScrollTop: function () { + return Math.max(0, this._height - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0)); }, - stopSearch: function () { - this._stopSearch();//先停止搜索,然后再去设置editor为空 - //important:停止搜索必须退出编辑状态,这里必须加上try(input框不显示时blur会抛异常) - try { - this.editor.blur(); - } catch (e) { - if (!this.editor.blur) { - throw new Error("editor没有实现blur方法"); - } - } finally { - this.editor.setValue(""); - } - }, + _populate: function () { + var o = this.options; + if (o.items.length > 0) { + this.container.setWidth(this._width); + this.container.setHeight(this._height); - isSearching: function () { - return this._isSearching; + this._calculateChildrenToRender(); + this.element.scrollTop(o.scrollTop); + this.element.scrollLeft(o.scrollLeft); + } }, - isViewVisible: function () { - return this.editor.isEnabled() && BI.Maskers.isVisible(this.getName()); + setScrollLeft: function (scrollLeft) { + if (this.options.scrollLeft === scrollLeft) { + return; + } + this._scrollLock = true; + this.options.scrollLeft = BI.clamp(scrollLeft || 0, 0, this._getMaxScrollLeft()); + this._debounceRelease(); + this._calculateChildrenToRender(); + this.element.scrollLeft(this.options.scrollLeft); }, - getView: function () { - return this.popupView; + setScrollTop: function (scrollTop) { + if (this.options.scrollTop === scrollTop) { + return; + } + this._scrollLock = true; + this.options.scrollTop = BI.clamp(scrollTop || 0, 0, this._getMaxScrollTop()); + this._debounceRelease(); + this._calculateChildrenToRender(); + this.element.scrollTop(this.options.scrollTop); }, - hasMatched: function () { - this._assertPopupView(); - return this.popupView.hasMatched(); + setOverflowX: function (b) { + var self = this; + if (this.options.overflowX !== !!b) { + this.options.overflowX = !!b; + BI.nextTick(function () { + self.element.css({overflowX: !!b ? "auto" : "hidden"}); + }); + } }, - adjustHeight: function () { - if (BI.Maskers.has(this.getName()) && BI.Maskers.get(this.getName()).isVisible()) { - BI.Maskers.show(this.getName()); + setOverflowY: function (b) { + var self = this; + if (this.options.overflowY !== !!b) { + this.options.overflowY = !!b; + BI.nextTick(function () { + self.element.css({overflowY: !!b ? "auto" : "hidden"}); + }); } }, - adjustView: function () { - this.isViewVisible() && BI.Maskers.show(this.getName()); + getScrollLeft: function () { + return this.options.scrollLeft; }, - setValue: function (v) { - this._assertPopupView(); - this.popupView && this.popupView.setValue(v); + getScrollTop: function () { + return this.options.scrollTop; }, - getKeyword: function () { - return this.editor.getValue(); + getMaxScrollLeft: function () { + return this._getMaxScrollLeft(); }, - getValue: function () { - var o = this.options; - if (o.isAutoSync) { - return o.adapter.getValue(); - } - if (this.isSearching()) { - return this.popupView.getValue(); - } else { - return o.adapter.getValue(); - } + getMaxScrollTop: function () { + return this._getMaxScrollTop(); }, - populate: function (result, searchResult, keyword) { - var o = this.options; - this._assertPopupView(); - this.popupView.populate.apply(this.popupView, arguments); - if (o.isAutoSync) { - this.popupView.setValue(o.adapter.getValue()); - } + restore: function () { + BI.each(this.renderedCells, function (i, cell) { + cell.el.destroy(); + }); + this.renderedCells = []; + this.renderedKeys = []; + this._scrollLock = false; }, - empty: function () { - this.popupView && this.popupView.empty(); - }, - - destroyed: function () { - this.popupView && this.popupView.destroy(); - BI.Maskers.remove(this.getName()); + populate: function (items) { + if (items && items !== this.options.items) { + this.options.items = items; + this._calculateSizeAndPositionData(); + } + this._populate(); } }); -BI.Searcher.EVENT_CHANGE = "EVENT_CHANGE"; -BI.Searcher.EVENT_START = "EVENT_START"; -BI.Searcher.EVENT_STOP = "EVENT_STOP"; -BI.Searcher.EVENT_PAUSE = "EVENT_PAUSE"; -BI.Searcher.EVENT_SEARCHING = "EVENT_SEARCHING"; -BI.Searcher.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; - -$.shortcut("bi.searcher", BI.Searcher);/** - * - * 切换显示或隐藏面板 - * - * Created by GUY on 2015/11/2. - * @class BI.Switcher +BI.Collection.EVENT_SCROLL = "EVENT_SCROLL"; +$.shortcut('bi.collection_view', BI.Collection);/** + * @class BI.Combo * @extends BI.Widget */ -BI.Switcher = BI.inherit(BI.Widget, { +BI.Combo = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.Switcher.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-switcher", - direction: BI.Direction.Top, + var conf = BI.Combo.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-combo", trigger: "click", toggle: true, + direction: "bottom", //top||bottom||left||right||top,left||top,right||bottom,left||bottom,right + isDefaultInit: false, + isNeedAdjustHeight: true,//是否需要高度调整 + isNeedAdjustWidth: true, + stopEvent: false, + stopPropagation: false, + adjustLength: 0,//调整的距离 + adjustXOffset: 0, + adjustYOffset: 0, + hideChecker: BI.emptyFn, + offsetStyle: "left", //left,right,center el: {}, popup: {}, - adapter: null, - masker: {}, - switcherClass: "bi-switcher-popup", - hoverClass: "bi-switcher-hover" + comboClass: "bi-combo-popup", + hoverClass: "bi-combo-hover" }) }, _init: function () { - BI.Switcher.superclass._init.apply(this, arguments); + BI.Combo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this._initSwitcher(); + this._initCombo(); this._initPullDownAction(); - this.switcher.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { if (self.isEnabled() && this.isEnabled()) { if (type === BI.Events.EXPAND) { self._popupView(); @@ -23452,35 +23201,43 @@ BI.Switcher = BI.inherit(BI.Widget, { if (type === BI.Events.EXPAND || type === BI.Events.COLLAPSE) { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); } + if (type === BI.Events.CLICK) { - self.fireEvent(BI.Switcher.EVENT_TRIGGER_CHANGE, value, obj); + self.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE, obj); } } }); - this.element.hover(function () { - if (self.isEnabled() && self.switcher.isEnabled()) { + self.element.on("mouseenter." + self.getName(), function (e) { + if (self.isEnabled() && self.combo.isEnabled()) { self.element.addClass(o.hoverClass); } - }, function () { - if (self.isEnabled() && self.switcher.isEnabled()) { + }); + self.element.on("mouseleave." + self.getName(), function (e) { + if (self.isEnabled() && self.combo.isEnabled()) { self.element.removeClass(o.hoverClass); } }); + BI.createWidget({ type: "bi.vertical", scrolly: false, element: this, items: [ - {el: this.switcher} + {el: this.combo} ] }); o.isDefaultInit && (this._assertPopupView()); + BI.Resizers.add(this.getName(), BI.bind(function () { + if (this.isViewVisible()) { + this._hideView(); + } + }, this)); }, _toggle: function () { - this._assertPopupView(); - if (this.isExpanded()) { + this._assertPopupViewRender(); + if (this.popupView.isVisible()) { this._hideView(); } else { if (this.isEnabled()) { @@ -23492,11504 +23249,21666 @@ BI.Switcher = BI.inherit(BI.Widget, { _initPullDownAction: function () { var self = this, o = this.options; var evs = this.options.trigger.split(","); - BI.each(evs, function (i, e) { - switch (e) { + var st = function (e) { + if (o.stopEvent) { + e.stopEvent(); + } + if (o.stopPropagation) { + e.stopPropagation(); + } + }; + BI.each(evs, function (i, ev) { + switch (ev) { case "hover": - self.element[e](function (e) { - if (self.isEnabled() && self.switcher.isEnabled()) { + self.element.on("mouseenter." + self.getName(), function (e) { + if (self.isEnabled() && self.combo.isEnabled()) { self._popupView(); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.switcher); - self.fireEvent(BI.Switcher.EVENT_EXPAND); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); + self.fireEvent(BI.Combo.EVENT_EXPAND); } - }, function () { - if (self.isEnabled() && self.switcher.isEnabled() && o.toggle) { + }); + self.element.on("mouseleave." + self.getName(), function (e) { + if (self.isEnabled() && self.combo.isEnabled() && o.toggle === true) { self._hideView(); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.switcher); - self.fireEvent(BI.Switcher.EVENT_COLLAPSE); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo); + self.fireEvent(BI.Combo.EVENT_COLLAPSE); } }); break; - default : - if (e) { - self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { - if (self.switcher.element.__isMouseInBounds__(e)) { - if (self.isEnabled() && self.switcher.isEnabled()) { - o.toggle ? self._toggle() : self._popupView(); - if (self.isExpanded()) { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.switcher); - self.fireEvent(BI.Switcher.EVENT_EXPAND); - } else { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.switcher); - self.fireEvent(BI.Switcher.EVENT_COLLAPSE); - } + case "click": + var debounce = BI.debounce(function (e) { + if (self.combo.element.__isMouseInBounds__(e)) { + if (self.isEnabled() && self.combo.isEnabled()) { + o.toggle ? self._toggle() : self._popupView(); + if (self.isViewVisible()) { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); + self.fireEvent(BI.Combo.EVENT_EXPAND); + } else { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo); + self.fireEvent(BI.Combo.EVENT_COLLAPSE); } } - }, BI.EVENT_RESPONSE_TIME, true)); - } + } + }, BI.EVENT_RESPONSE_TIME, true); + self.element.off(ev + "." + self.getName()).on(ev + "." + self.getName(), function(e){ + debounce(e); + st(e); + }); break; } - }) + }); }, - _initSwitcher: function () { - this.switcher = BI.createWidget(this.options.el); + _initCombo: function () { + this.combo = BI.createWidget(this.options.el); }, _assertPopupView: function () { - var self = this, o = this.options; - if (!this._created) { - this.popupView = BI.createWidget(o.popup, { - type: "bi.button_group", - element: o.adapter && BI.Maskers.create(this.getName(), o.adapter, BI.extend({container: this}, o.masker)), - cls: "switcher-popup", - layouts: [{ - type: "bi.vertical", - hgap: 0, - vgap: 0 - }] + var self = this; + if (this.popupView == null) { + this.popupView = BI.createWidget(this.options.popup, { + type: "bi.popup_view" }); this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); if (type === BI.Events.CLICK) { - self.fireEvent(BI.Switcher.EVENT_CHANGE, value, obj); + self.combo.setValue(self.getValue()); + self.fireEvent(BI.Combo.EVENT_CHANGE, value, obj); } + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); - if (o.direction !== BI.Direction.Custom && !o.adapter) { - BI.createWidget({ - type: "bi.vertical", - scrolly: false, - element: this, - items: [ - {el: this.popupView} - ] - }); - } - this._created = true; + this.popupView.setVisible(false); BI.nextTick(function () { - self.fireEvent(BI.Switcher.EVENT_AFTER_INIT); + self.fireEvent(BI.Combo.EVENT_AFTER_INIT); }); } }, - _hideView: function () { - this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW); - var self = this, o = this.options; - o.adapter ? BI.Maskers.hide(self.getName()) : (self.popupView && self.popupView.setVisible(false)); - BI.nextTick(function () { - o.adapter ? BI.Maskers.hide(self.getName()) : (self.popupView && self.popupView.setVisible(false)); - self.element.removeClass(o.switcherClass); - self.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW); - }); - }, - - _popupView: function () { - var self = this, o = this.options; + _assertPopupViewRender: function () { this._assertPopupView(); - this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW); - o.adapter ? BI.Maskers.show(this.getName()) : self.popupView.setVisible(true); - BI.nextTick(function (name) { - o.adapter ? BI.Maskers.show(name) : self.popupView.setVisible(true); - self.element.addClass(o.switcherClass); - self.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW); - }, this.getName()); + if (!this._rendered) { + BI.createWidget({ + type: "bi.vertical", + scrolly: false, + element: this, + items: [ + {el: this.popupView} + ] + }); + this._rendered = true; + } }, - populate: function (items) { - this._assertPopupView(); - this.popupView.populate.apply(this.popupView, arguments); - this.switcher.populate.apply(this.switcher, arguments); + _hideIf: function (e) { + if (this.element.__isMouseInBounds__(e) || (this.popupView && this.popupView.element.__isMouseInBounds__(e))) { + return; + } + if (this.element.find(e.target).length > 0) { + return; + } + var isHide = this.options.hideChecker.apply(this, [e]); + if (isHide === false) { + return; + } + this._hideView(); }, - setEnable: function (arg) { - BI.Switcher.superclass.setEnable.apply(this, arguments); - this.switcher && this.switcher.setEnable(arg); - this.popupView && this.popupView.setEnable(arg); - !arg && this._hideView(); - }, + _hideView: function () { + this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW); + this.popupView && this.popupView.invisible(); + this.element.removeClass(this.options.comboClass); - setValue: function (v) { - this._assertPopupView(); - this.switcher.setValue(v); - this.popupView && this.popupView.setValue(v); + $(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); + this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); }, - getValue: function () { - this._assertPopupView(); - return this.popupView ? this.popupView.getValue() : []; - }, + _popupView: function () { + this._assertPopupViewRender(); + this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW); - isViewVisible: function () { - return this.isEnabled() && this.switcher.isEnabled() && - (this.options.adapter ? BI.Maskers.isVisible(this.getName()) : (this.popupView && this.popupView.isVisible())); - }, + this.popupView.visible(); + this.adjustWidth(); + this.adjustHeight(); - isExpanded: function () { - return this.isViewVisible(); + this.element.addClass(this.options.comboClass); + $(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); + this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); }, - showView: function () { - if (this.isEnabled() && this.switcher.isEnabled()) { - this._popupView(); + adjustWidth: function () { + var o = this.options; + if (!this.popupView) { + return; + } + if (o.isNeedAdjustWidth === true) { + this.resetListWidth(""); + var width = this.popupView.element.outerWidth(); + var maxW = this.element.outerWidth() || o.width; + if (width > maxW + 80) { + maxW = maxW + 80; + } else if (width > maxW) { + maxW = width; + } + this.resetListWidth(maxW < 100 ? 100 : maxW); } }, - hideView: function () { - this._hideView(); - }, - - getView: function () { - return this.popupView; - }, + adjustHeight: function () { + var o = this.options, p = {}; + if (!this.popupView) { + return; + } + var isVisible = this.popupView.isVisible(); + this.popupView.visible(); + switch (o.direction) { + case "bottom": + case "bottom,right": + p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['bottom', 'top', 'right', 'left'], o.offsetStyle); + break; + case "top": + case "top,right": + p = $.getComboPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['top', 'bottom', 'right', 'left'], o.offsetStyle); + break; + case "left": + case "left,bottom": + p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['left', 'right', 'bottom', 'top'], o.offsetStyle); + break; + case "right": + case "right,bottom": + p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['right', 'left', 'bottom', 'top'], o.offsetStyle); + break; + case "top,left": + p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['top', 'bottom', 'left', 'right'], o.offsetStyle); + break; + case "bottom,left": + p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['bottom', 'top', 'left', 'right'], o.offsetStyle); + break; + case "left,top": + p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['left', 'right', 'top', 'bottom'], o.offsetStyle); + break; + case "right,top": + p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['right', 'left', 'top', 'bottom'], o.offsetStyle); + break; + case "top,custom": + case "custom,top": + p = $.getTopAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); + break; + case "custom,bottom": + case "bottom,custom": + p = $.getBottomAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); + break; + case "left,custom": + case "custom,left": + p = $.getLeftAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); + delete p.top; + delete p.adaptHeight; + break; + case "custom,right": + case "right,custom": + p = $.getRightAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); + delete p.top; + delete p.adaptHeight; + break; + } - adjustView: function () { - this.isViewVisible() && BI.Maskers.show(this.getName()); + if ("adaptHeight" in p) { + this.resetListHeight(p['adaptHeight']); + } + if ("left" in p) { + this.popupView.element.css({ + left: p.left + }); + } + if ("top" in p) { + this.popupView.element.css({ + top: p.top + }); + } + this.position = p; + this.popupView.setVisible(isVisible); }, - doBehavior: function () { + resetListHeight: function (h) { this._assertPopupView(); - this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments); + this.popupView.resetHeight && this.popupView.resetHeight(h); }, - getAllLeaves: function () { - return this.popupView && this.popupView.getAllLeaves(); + resetListWidth: function (w) { + this._assertPopupView(); + this.popupView.resetWidth && this.popupView.resetWidth(w); }, - getNodeById: function (id) { - if (this.switcher.attr("id") === id) { - return this.switcher; - } - return this.popupView && this.popupView.getNodeById(id); + populate: function (items) { + this._assertPopupView(); + this.popupView.populate.apply(this.popupView, arguments); + this.combo.populate.apply(this.combo, arguments); }, - getNodeByValue: function (value) { - if (this.switcher.getValue() === value) { - return this.switcher; - } - return this.popupView && this.popupView.getNodeByValue(value); + setEnable: function (arg) { + BI.Combo.superclass.setEnable.apply(this, arguments); + this.combo && this.combo.setEnable(arg); + this.popupView && this.popupView.setEnable(arg); + !arg && this.isViewVisible() && this._hideView(); }, - empty: function () { - this.popupView && this.popupView.empty(); + setValue: function (v) { + this._assertPopupView(); + this.combo.setValue(v); + this.popupView && this.popupView.setValue(v); }, - destroyed: function () { - this.popupView && this.popupView.destroy(); - } -}); -BI.Switcher.EVENT_EXPAND = "EVENT_EXPAND"; -BI.Switcher.EVENT_COLLAPSE = "EVENT_COLLAPSE"; -BI.Switcher.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; -BI.Switcher.EVENT_CHANGE = "EVENT_CHANGE"; -BI.Switcher.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; - - -BI.Switcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; -BI.Switcher.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW"; -BI.Switcher.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW"; -BI.Switcher.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; - -$.shortcut("bi.switcher", BI.Switcher);/** - * Created by GUY on 2015/6/26. - */ - -BI.Tab = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.Tab.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-tab", - direction: "top",//top, bottom, left, right, custom - logic: { - dynamic: false - }, - defaultShowIndex: 0, - tab: false, - cardCreator: function (v) { - return BI.createWidget(); - } - }) + getValue: function () { + this._assertPopupView(); + return this.popupView && this.popupView.getValue(); }, - _init: function () { - BI.Tab.superclass._init.apply(this, arguments); - var self = this, o = this.options; - if (BI.isObject(o.tab)) { - this.tab = BI.createWidget(this.options.tab, {type: "bi.button_group"}); - this.tab.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }) - } - this.cardMap = {}; - this.layout = BI.createWidget({ - type: "bi.card" - }); - - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tab, this.layout) - })))); - - var listener = new BI.ShowListener({ - eventObj: this.tab, - cardLayout: this.layout, - cardCreator: function (v) { - var card = o.cardCreator.apply(self, arguments); - self.cardMap[v] = card; - return card; - }, - afterCardShow: function (v) { - self.curr = v; - } - }); - listener.on(BI.ShowListener.EVENT_CHANGE, function (value) { - self.fireEvent(BI.Tab.EVENT_CHANGE, value, self); - }); - if (o.defaultShowIndex !== false) { - this.setSelect(o.defaultShowIndex); - } + isViewVisible: function () { + return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible(); }, - _assertCard: function (v) { - if (!this.layout.isCardExisted(v)) { - var card = this.options.cardCreator(v); - this.cardMap[v] = card; - this.layout.addCardByName(v, card); + showView: function () { + if (this.isEnabled() && this.combo.isEnabled()) { + this._popupView(); } }, - setSelect: function (v) { - this.tab && this.tab.setValue(v); - this._assertCard(v); - this.layout.showCardByName(v); - if (this.curr !== v) { - this.curr = v; - } + hideView: function () { + this._hideView(); }, - getSelect: function () { - return this.curr; + getView: function () { + return this.popupView; }, - getSelectedTab: function () { - return this.layout.getShowingCard(); + getPopupPosition: function () { + return this.position; }, - getTab: function (v) { - this._assertCard(v); - return this.layout.getCardByName(v); + doBehavior: function () { + this._assertPopupView(); + this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments); }, - setValue: function (v) { - var card = this.layout.getShowingCard(); - if (card) { - card.setValue(v); - } + toggle: function () { + this._toggle(); }, - getValue: function () { - var card = this.layout.getShowingCard(); - if (card) { - return card.getValue(); - } - }, + destroy: function () { + $(document).unbind("mousedown." + this.getName()) + .unbind("mousewheel." + this.getName()) + .unbind("mouseenter." + this.getName()) + .unbind("mousemove." + this.getName()) + .unbind("mouseleave." + this.getName()); + BI.Resizers.remove(this.getName()); + BI.Combo.superclass.destroy.apply(this, arguments); + } +}); +BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; +BI.Combo.EVENT_CHANGE = "EVENT_CHANGE"; +BI.Combo.EVENT_EXPAND = "EVENT_EXPAND"; +BI.Combo.EVENT_COLLAPSE = "EVENT_COLLAPSE"; +BI.Combo.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; - populate: function () { - var card = this.layout.getShowingCard(); - if (card) { - return card.populate && card.populate.apply(card, arguments); - } - }, - - empty: function () { - this.layout.deleteAllCard(); - this.cardMap = {}; - }, - destroyed: function () { - this.layout.deleteAllCard(); - this.cardMap = {}; - } -}); -BI.Tab.EVENT_CHANGE = "EVENT_CHANGE"; +BI.Combo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; +BI.Combo.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW"; +BI.Combo.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW"; +BI.Combo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; -$.shortcut("bi.tab", BI.Tab);/** - * Created by GUY on 2015/8/10. - * @class BI.ButtonTree - * @extends BI.ButtonGroup +$.shortcut("bi.combo", BI.Combo);/** + * + * 某个可以展开的节点 + * + * Created by GUY on 2015/9/10. + * @class BI.Expander + * @extends BI.Widget */ - -BI.ButtonTree = BI.inherit(BI.ButtonGroup, { +BI.Expander = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-button-tree" + return BI.extend(BI.Expander.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-expander", + trigger: "click", + toggle: true, + //direction: "bottom", //top,bottom四个方向 + isDefaultInit: false, //是否默认初始化子节点 + el: {}, + popup: {}, + expanderClass: "bi-expander-popup", + hoverClass: "bi-expander-hover" }) }, _init: function () { - BI.ButtonTree.superclass._init.apply(this, arguments); - }, - - setNotSelectedValue: function (v) { - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (i, item) { - if (!BI.isFunction(item.setSelected)) { - item.setNotSelectedValue(v); - return; - } - if (BI.deepContains(v, item.getValue())) { - item.setSelected(false); - } else { - item.setSelected(true); + BI.Expander.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this._expanded = !!o.el.open; + this._initExpander(); + this._initPullDownAction(); + this.expander.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + if (type === BI.Events.EXPAND) { + self._popupView(); } - }); - }, - - setEnabledValue: function (v) { - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (i, item) { - if (BI.isFunction(item.setEnabledValue)) { - item.setEnabledValue(v); - return; + if (type === BI.Events.COLLAPSE) { + self._hideView(); } - if (BI.deepContains(v, item.getValue())) { - item.setEnable(true); - } else { - item.setEnable(false); + if (self.isEnabled() && this.isEnabled()) { + if (type === BI.Events.EXPAND) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + self.fireEvent(BI.Expander.EVENT_EXPAND); + } + if(type === BI.Events.COLLAPSE) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + self.fireEvent(BI.Expander.EVENT_COLLAPSE); + } + if (type === BI.Events.CLICK) { + self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE, value, obj); + } } }); - }, - setValue: function (v) { - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (i, item) { - if (!BI.isFunction(item.setSelected)) { - item.setValue(v); - return; + this.element.hover(function () { + if (self.isEnabled() && self.expander.isEnabled()) { + self.element.addClass(o.hoverClass); } - if (BI.deepContains(v, item.getValue())) { - item.setSelected(true); - } else { - item.setSelected(false); + }, function () { + if (self.isEnabled() && self.expander.isEnabled()) { + self.element.removeClass(o.hoverClass); } }); - }, - - getNotSelectedValue: function () { - var v = []; - BI.each(this.buttons, function (i, item) { - if (item.isEnabled() && !BI.isFunction(item.setSelected)) { - v = BI.concat(v, item.getNotSelectedValue()); - return; - } - if (item.isEnabled() && item.isSelected && !item.isSelected()) { - v.push(item.getValue()); - } + BI.createWidget({ + type: "bi.vertical", + scrolly: false, + element: this, + items: [ + {el: this.expander} + ] }); - return v; + o.isDefaultInit && this._assertPopupView(); + if (this.expander.isOpened() === true) { + this._popupView(); + } }, - getValue: function () { - var v = []; - BI.each(this.buttons, function (i, item) { - if (item.isEnabled() && !BI.isFunction(item.setSelected)) { - v = BI.concat(v, item.getValue()); - return; - } - if (item.isEnabled() && item.isSelected && item.isSelected()) { - v.push(item.getValue()); + _toggle: function () { + this._assertPopupViewRender(); + if (this.popupView.isVisible()) { + this._hideView(); + } else { + if (this.isEnabled()) { + this._popupView(); } - }); - return v; + } }, - getSelectedButtons: function () { - var btns = []; - BI.each(this.buttons, function (i, item) { - if (item.isEnabled() && !BI.isFunction(item.setSelected)) { - btns = btns.concat(item.getSelectedButtons()); - return; - } - if (item.isSelected && item.isSelected()) { - btns.push(item); + _initPullDownAction: function () { + var self = this, o = this.options; + var evs = this.options.trigger.split(","); + BI.each(evs, function (i, e) { + switch (e) { + case "hover": + self.element[e](function (e) { + if (self.isEnabled() && self.expander.isEnabled()) { + self._popupView(); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.expander); + self.fireEvent(BI.Expander.EVENT_EXPAND); + } + }, function () { + if (self.isEnabled() && self.expander.isEnabled() && o.toggle) { + self._hideView(); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.expander); + self.fireEvent(BI.Expander.EVENT_COLLAPSE); + } + }); + break; + default : + if (e) { + self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { + if (self.expander.element.__isMouseInBounds__(e)) { + if (self.isEnabled() && self.expander.isEnabled()) { + o.toggle ? self._toggle() : self._popupView(); + if (self.isExpanded()) { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.expander); + self.fireEvent(BI.Expander.EVENT_EXPAND); + } else { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.expander); + self.fireEvent(BI.Expander.EVENT_COLLAPSE); + } + } + } + }, BI.EVENT_RESPONSE_TIME, true)); + } + break; } - }); - return btns; + }) }, - getNotSelectedButtons: function () { - var btns = []; - BI.each(this.buttons, function (i, item) { - if (item.isEnabled() && !BI.isFunction(item.setSelected)) { - btns = btns.concat(item.getNotSelectedButtons()); - return; - } - if (item.isSelected && !item.isSelected()) { - btns.push(item); - } - }); - return btns; + _initExpander: function () { + this.expander = BI.createWidget(this.options.el); }, - //获取所有的叶子节点 - getAllLeaves: function () { - var leaves = []; - BI.each(this.buttons, function (i, item) { - if (item.isEnabled() && !BI.isFunction(item.setSelected)) { - leaves = leaves.concat(item.getAllLeaves()); - return; - } - if (item.isEnabled()) { - leaves.push(item); - } - }); - return leaves; + _assertPopupView: function () { + var self = this; + if (this.popupView == null) { + this.popupView = BI.createWidget(this.options.popup, { + type: "bi.button_group", + cls: "expander-popup", + layouts: [{ + type: "bi.vertical", + hgap: 0, + vgap: 0 + }] + }); + this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + //self.setValue(self.getValue()); + self.fireEvent(BI.Expander.EVENT_CHANGE, value, obj); + } + }); + this.popupView.setVisible(this.isExpanded()); + BI.nextTick(function () { + self.fireEvent(BI.Expander.EVENT_AFTER_INIT); + }); + } }, - getIndexByValue: function (value) { - var index = -1; - BI.any(this.buttons, function (i, item) { - var vs = item.getValue(); - if (item.isEnabled() && (vs === value || BI.contains(vs, value))) { - index = i; - return true; - } - }); - return index; - }, - - getNodeById: function (id) { - var node; - BI.any(this.buttons, function (i, item) { - if (item.isEnabled()) { - if (item.attr("id") === id) { - node = item; - return true; - } else if (BI.isFunction(item.getNodeById)) { - if (node = item.getNodeById(id)) { - return true; - } - } - } - }); - return node; + _assertPopupViewRender: function () { + this._assertPopupView(); + if (!this._rendered) { + BI.createWidget({ + type: "bi.vertical", + scrolly: false, + element: this, + items: [ + {el: this.popupView} + ] + }); + this._rendered = true; + } }, - getNodeByValue: function (value) { - var node; - BI.any(this.buttons, function (i, item) { - if (item.isEnabled()) { - if (item.getValue() === value) { - node = item; - return true; - } else if (BI.isFunction(item.getNodeByValue)) { - if (node = item.getNodeByValue(value)) { - return true; - } - } - } - }); - return node; - } -}); -BI.ButtonTree.EVENT_CHANGE = "EVENT_CHANGE"; - -$.shortcut("bi.button_tree", BI.ButtonTree); + _hideView: function () { + this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW); + this._expanded = false; + this.expander.setOpened(false); + this.popupView && this.popupView.invisible(); + this.element.removeClass(this.options.expanderClass); -/** - * value作为key值缓存button, 不支持顺序读写 - * 适合用于频繁增删的一组button - * Created by GUY on 2015/8/10. - * @class BI.ButtonMap - * @extends BI.ButtonTree - */ + this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW); + }, -BI.ButtonMap = BI.inherit(BI.ButtonTree, { - _defaultConfig: function () { - return BI.extend(BI.ButtonMap.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-button-map" - }) + _popupView: function () { + this._assertPopupViewRender(); + this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW); + this._expanded = true; + this.expander.setOpened(true); + this.popupView.visible(); + this.element.addClass(this.options.expanderClass); + this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW); }, - _init: function () { - BI.ButtonMap.superclass._init.apply(this, arguments); + populate: function (items) { + //this._assertPopupView(); + this.popupView && this.popupView.populate.apply(this.popupView, arguments); + this.expander.populate.apply(this.expander, arguments); }, - _createBtns: function (items) { - var self = this, o = this.options; - var buttons = BI.createWidgets(BI.createItems(items, {type: "bi.text_button", once: o.chooseType === 0})); - var keys = BI.map(items, function (i, item) { - item = BI.stripEL(item); - if (!(item.id || item.value)) { - throw new Error("item必须包含id或value属性"); - } - return item.id || item.value; - }); - return BI.object(keys, buttons); + setEnable: function (arg) { + BI.Expander.superclass.setEnable.apply(this, arguments); + this.expander && this.expander.setEnable(arg); + this.popupView && this.popupView.setEnable(arg); + !arg && this._hideView(); }, setValue: function (v) { - var self = this; - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (val, item) { - if (!BI.isFunction(item.setSelected)) { - item.setValue(v); - return; - } - if (v.contains(val)) { - item.setSelected && item.setSelected(true); - } else { - item.setSelected && item.setSelected(false); - } - }); + //this._assertPopupView(); + this.expander.setValue(v); + this.popupView && this.popupView.setValue(v); }, - setNotSelectedValue: function (v) { - var self = this; - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (val, item) { - if (!BI.isFunction(item.setSelected)) { - item.setNotSelectedValue(v); - return; - } - if (v.contains(val)) { - item.setSelected && item.setSelected(false); - } else { - item.setSelected && item.setSelected(true); - } - }); + getValue: function () { + //this._assertPopupView(); + return this.popupView ? this.popupView.getValue() : []; }, - populate: function (items) { - var self = this; - var args = [].slice.call(arguments); - var linkHashMap = new BI.LinkHashMap(); - var val = function (item) { - return item.id || item.value; - }; - if (!this.buttons) { - this.buttons = {}; - } - //所有已存在的和新添加的 - var willCreated = []; - BI.each(items, function (i, item) { - item = BI.stripEL(item); - if (self.buttons[val(item)]) { - var ob = self.buttons[val(item)]; - args[0] = item.items; - args[2] = item; - ob.populate && ob.populate.apply(ob, args); - } else { - willCreated.push(item); - } - }); - //创建新元素 - args[0] = willCreated; - var newBtns = this._btnsCreator.apply(this, args); + isViewVisible: function () { + return this.isEnabled() && this.expander.isEnabled() && !!this.popupView && this.popupView.isVisible(); + }, - //整理 - var array = []; - BI.each(items, function (i, item) { - item = BI.stripEL(item); - var button = self.buttons[val(item)] || newBtns[val(item)]; - linkHashMap.add(val(item), button); - array.push(button); - }); - this.buttons = linkHashMap.map; + isExpanded: function () { + return this._expanded; + }, - BI.DOM.hang(this.buttons); - this.empty(); + showView: function () { + if (this.isEnabled() && this.expander.isEnabled()) { + this._popupView(); + } + }, - var packages = this._packageItems(items, this._packageBtns(array)); - BI.createWidget(BI.extend({element: this}, this._packageLayout(packages))); + hideView: function () { + this._hideView(); }, - getIndexByValue: function (value) { - throw new Error("不能使用getIndexByValue方法"); - } -}); -BI.ButtonMap.EVENT_CHANGE = "EVENT_CHANGE"; + getView: function () { + return this.popupView; + }, -$.shortcut("bi.button_map", BI.ButtonMap);/** - * 表示当前对象 - * - * Created by GUY on 2015/9/7. - * @class BI.EL - * @extends BI.Widget - */ -BI.EL = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.EL.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-el", - el: {}, - layout: {} - }); + doBehavior: function () { + //this._assertPopupView(); + this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments); }, - _init: function () { - BI.EL.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.ele = BI.createWidget(o.el); - BI.createWidget(o.layout, { - type: "bi.adaptive", - element: this, - items: [this.ele] - }); - this.ele.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }) + + getAllLeaves: function () { + return this.popupView && this.popupView.getAllLeaves(); }, - setValue: function (v) { - this.ele.setValue(v); + getNodeById: function (id) { + if (this.expander.options.id === id) { + return this.expander; + } + return this.popupView && this.popupView.getNodeById(id); }, - getValue: function () { - return this.ele.getValue(); + getNodeByValue: function (value) { + if (this.expander.getValue() === value) { + return this.expander; + } + return this.popupView && this.popupView.getNodeByValue(value); }, - populate: function () { - this.ele.populate.apply(this, arguments); + destroy: function () { + BI.Expander.superclass.destroy.apply(this, arguments); } }); -$.shortcut('bi.el', BI.EL);/** - * 选色控件 - * - * Created by GUY on 2015/11/16. - * @class BI.Farbtastic - * @extends BI.Widget - */ -BI.Farbtastic = BI.inherit(BI.Widget, { - - _defaultConfig: function () { - return BI.extend(BI.Farbtastic.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-farbtastic", - width: 195, - height: 195 +BI.Expander.EVENT_EXPAND = "EVENT_EXPAND"; +BI.Expander.EVENT_COLLAPSE = "EVENT_COLLAPSE"; +BI.Expander.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; +BI.Expander.EVENT_CHANGE = "EVENT_CHANGE"; +BI.Expander.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; + + +BI.Expander.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; +BI.Expander.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW"; +BI.Expander.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW"; +BI.Expander.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; + +$.shortcut("bi.expander", BI.Expander);/** + * Created by GUY on 2015/8/10. + */ + +BI.ComboGroup = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-combo-group", + + //以下这些属性对每一个combo都是公用的 + trigger: "click,hover", + direction: "right", + adjustLength: 0, + isDefaultInit: false, + isNeedAdjustHeight: false, + isNeedAdjustWidth: false, + + el: {type: "bi.text_button", text: "", value: ""}, + children: [], + + popup: { + el: { + type: "bi.button_tree", + chooseType: 0, + layouts: [{ + type: "bi.vertical" + }] + } + } }) }, _init: function () { - BI.Farbtastic.superclass._init.apply(this, arguments); - var self = this; + BI.ComboGroup.superclass._init.apply(this, arguments); + this.populate(this.options.el); + }, - this.farbtastic = $.farbtastic(this.element, function (v) { - self.fireEvent(BI.Farbtastic.EVENT_CHANGE, self.getValue(), self); - }); + populate: function (item) { + var self = this, o = this.options; + var children = o.children; + if (BI.isEmpty(children)) { + throw new Error("ComboGroup构造错误"); + } + BI.each(children, function (i, ch) { + var son = BI.formatEL(ch).el.children; + ch = BI.formatEL(ch).el; + if (!BI.isEmpty(son)) { + ch.el = BI.clone(ch); + ch.children = son; + ch.type = "bi.combo_group"; + ch.action = o.action; + ch.height = o.height; + ch.direction = o.direction; + ch.isDefaultInit = o.isDefaultInit; + ch.isNeedAdjustHeight = o.isNeedAdjustHeight; + ch.isNeedAdjustWidth = o.isNeedAdjustWidth; + ch.adjustLength = o.adjustLength; + ch.popup = o.popup; + } + }) + this.combo = BI.createWidget({ + type: "bi.combo", + element: this, + height: o.height, + trigger: o.trigger, + direction: o.direction, + isDefaultInit: o.isDefaultInit, + isNeedAdjustWidth: o.isNeedAdjustWidth, + isNeedAdjustHeight: o.isNeedAdjustHeight, + adjustLength: o.adjustLength, + el: item, + popup: BI.extend({}, o.popup, { + el: BI.extend({ + items: children + }, o.popup.el) + }) + }) + this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + self.fireEvent(BI.ComboGroup.EVENT_CHANGE, obj); + } + }) }, - setValue: function (color) { - this.farbtastic.setColor(color); + setEnable: function (b) { + BI.ComboGroup.superclass.setEnable.apply(this, arguments); + this.combo && this.combo.setEnable(b); }, getValue: function () { - return this.farbtastic.color; + return this.combo.getValue(); + }, + + setValue: function (v) { + this.combo.setValue(v); } }); -BI.Farbtastic.EVENT_CHANGE = "Farbtastic.EVENT_CHANGE"; -$.shortcut("bi.farbtastic", BI.Farbtastic);; -(function ($) { - /** - * 公式编辑控件 - * @class BI.FormulaEditor - * @extends BI.Widget - */ - BI.FormulaEditor = BI.inherit(BI.Single, { - _defaultConfig: function () { - return $.extend(BI.FormulaEditor.superclass._defaultConfig.apply(), { - baseCls: 'bi-formula-editor', - watermark: '', - value: '', - fieldTextValueMap: {} - }); - }, - _init: function () { - BI.FormulaEditor.superclass._init.apply(this, arguments); - var o = this.options, self = this; - this.editor = CodeMirror(this.element[0], { - textWrapping: true, - lineWrapping: true, - lineNumbers: false, - mode: 'formula' - }); - this.editor.on("change", function (cm, change) { - self._checkWaterMark(); - CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false}); - BI.nextTick(function () { - self.fireEvent(BI.FormulaEditor.EVENT_CHANGE) - }); - }); - - this.editor.on("focus", function () { - self._checkWaterMark(); - self.fireEvent(BI.FormulaEditor.EVENT_FOCUS); - }); +BI.ComboGroup.EVENT_CHANGE = "EVENT_CHANGE"; - this.editor.on("blur", function () { - self.fireEvent(BI.FormulaEditor.EVENT_BLUR); - }); +$.shortcut("bi.combo_group", BI.ComboGroup);/** + * 加载控件 + * + * Created by GUY on 2015/8/31. + * @class BI.Loader + * @extends BI.Widget + */ +BI.Loader = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.Loader.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-loader", + direction: "top", + isDefaultInit: true,//是否默认初始化数据 + logic: { + dynamic: true, + scrolly: true + }, - if (BI.isKey(o.value)) { - self.setValue(o.value); - } + //下面是button_group的属性 + el: { + type: "bi.button_group" + }, - if (BI.isKey(this.options.watermark)) { - var self = this; - this.watermark = BI.createWidget({ - type: "bi.label", - cls: "bi-water-mark", - text: this.options.watermark, - whiteSpace: "nowrap", - textAlign: "left" - }); - BI.createWidget({ - type: "bi.absolute", - element: self, - items: [{ - el: self.watermark, - left: 0, - top: 0 - }] - }); + items: [], + itemsCreator: BI.emptyFn, + onLoaded: BI.emptyFn, - this.watermark.element.bind( - "mousedown", function (e) { - self.insertString(""); - self.editor.focus(); - e.stopEvent(); - } - ); - this.watermark.element.bind("click", function (e) { - self.editor.focus(); - e.stopEvent(); - }); - this.watermark.element.css({ - position: "absolute", - left: 3, - right: 3, - top: 6, - bottom: 0 - }); - } - }, + //下面是分页信息 + count: false, + prev: false, + next: {}, + hasPrev: BI.emptyFn, + hasNext: BI.emptyFn + }) + }, - _checkWaterMark: function () { - var o = this.options; - if (!this.disabledWarterMark && BI.isEmptyString(this.editor.getValue()) && BI.isKey(o.watermark)) { - this.watermark && this.watermark.visible(); - } else { - this.watermark && this.watermark.invisible(); - } - }, + _prevLoad: function () { + var self = this, o = this.options; + this.prev.setLoading(); + o.itemsCreator.apply(this, [{times: --this.times}, function () { + self.prev.setLoaded(); + self.prependItems.apply(self, arguments); + }]); + }, - disableWarterMark: function () { - this.disabledWarterMark = true; - this._checkWaterMark(); - }, + _nextLoad: function () { + var self = this, o = this.options; + this.next.setLoading(); + o.itemsCreator.apply(this, [{times: ++this.times}, function () { + self.next.setLoaded(); + self.addItems.apply(self, arguments); + }]); + }, - /** - * 添加字段 - * @param field - */ - insertField: function (field) { - var from = this.editor.getCursor(); - this.editor.replaceSelection(field); - var to = this.editor.getCursor(); - this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle : "start", endStyle:"end"}); - this.editor.replaceSelection(" "); - this.editor.focus(); - }, + _init: function () { + BI.Loader.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (o.itemsCreator === false) { + o.prev = false; + o.next = false; + } + if (o.prev !== false) { + this.prev = BI.createWidget(BI.extend({ + type: "bi.loading_bar" + }, o.prev)); + this.prev.on(BI.Controller.EVENT_CHANGE, function (type) { + if (type === BI.Events.CLICK) { + self._prevLoad(); + } + }); + } - insertFunction: function (fn) { - var from = this.editor.getCursor(); - this.editor.replaceSelection(fn); - var to = this.editor.getCursor(); - this.editor.markText(from, to, {className: "#function", atomic: true}); - this.editor.replaceSelection("() "); - to = this.editor.getCursor(); - to.ch = to.ch - 2; - this.editor.setCursor(to); - this.editor.focus(); - }, - insertOperator: function (op) { - var from = this.editor.getCursor(); - this.editor.replaceSelection(op); - var to = this.editor.getCursor(); - this.editor.markText(from, to, {className: "%operator", atomic: true}); - this.editor.replaceSelection(" "); - this.editor.focus(); - }, + this.button_group = BI.createWidget(o.el, { + type: "bi.button_group", + chooseType: 0, + items: o.items, + behaviors: {}, + layouts: [{ + type: "bi.vertical" + }] + }); + this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + self.fireEvent(BI.Loader.EVENT_CHANGE, obj); + } + }); - setFunction: function (v) { - var from = this.editor.getCursor(); - this.editor.replaceSelection(v); - var to = this.editor.getCursor(); - this.editor.markText(from, to, {className: "#function", atomic: true}); - }, + if (o.next !== false) { + this.next = BI.createWidget(BI.extend({ + type: "bi.loading_bar" + }, o.next)); + this.next.on(BI.Controller.EVENT_CHANGE, function (type) { + if (type === BI.Events.CLICK) { + self._nextLoad(); + } + }) + } - insertString: function (str) { - this.editor.replaceSelection(str); - this.editor.focus(); - }, + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({ + scrolly: true + }, o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.prev, this.button_group, this.next) + })))); - getFormulaString: function () { - return this.editor.getValue(); - }, + o.isDefaultInit && BI.isEmpty(o.items) && BI.nextTick(BI.bind(function () { + o.isDefaultInit && BI.isEmpty(o.items) && this.populate(); + }, this)); + if (BI.isNotEmptyArray(o.items)) { + this.populate(o.items); + } + }, - getUsedFields: function () { - var fieldMap = this.options.fieldTextValueMap; - var fields = []; - this.editor.getValue(true, function (line) { - var value = line.text; - _.forEach(line.markedSpans, function (i, ms) { - switch (i.marker.className) { - case "fieldName": - var dId = fieldMap[value.substr(i.from, i.to - i.from)]; - if (!fields.contains(dId)) { - fields.push(dId); - } + hasPrev: function () { + var o = this.options; + if (BI.isNumber(o.count)) { + return this.count < o.count; + } + return !!o.hasPrev.apply(this, [{ + times: this.times, + count: this.count + }]) + }, - } - }); - }); - return fields; - }, + hasNext: function () { + var o = this.options; + if (BI.isNumber(o.count)) { + return this.count < o.count; + } + return !!o.hasNext.apply(this, [{ + times: this.times, + count: this.count + }]) + }, - getCheckString: function () { - return this.editor.getValue(true, function (line) { - var rawText = line.text, value = line.text, num = 0; - value.text = rawText; - _.forEach(line.markedSpans, function (i, ms) { + prependItems: function (items) { + this.count += items.length; + if (this.next !== false) { + if (this.hasPrev()) { + this.options.items = this.options.items.concat(items); + this.prev.setLoaded(); + } else { + this.prev.setEnd(); + } + } + this.button_group.prependItems.apply(this.button_group, arguments); + }, - switch (i.marker.className) { - case "fieldName": - var fieldNameLength = i.to - i.from; - value = value.substr(0, i.from + num) + "$a" + value.substr(i.to + num, value.length); - num = num + 2 - fieldNameLength; - break; - } + addItems: function (items) { + this.count += items.length; + if (BI.isObject(this.next)) { + if (this.hasNext()) { + this.options.items = this.options.items.concat(items); + this.next.setLoaded(); + } else { + this.next.setEnd(); + } + } + this.button_group.addItems.apply(this.button_group, arguments); + }, - }); - return value; - }); - }, + populate: function (items) { + var self = this, o = this.options; + if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) { + o.itemsCreator.apply(this, [{times: 1}, function () { + if (arguments.length === 0) { + throw new Error("arguments can not be null!!!"); + } + self.populate.apply(self, arguments); + o.onLoaded(); + }]); + return; + } + this.options.items = items; + this.times = 1; + this.count = 0; + this.count += items.length; + if (BI.isObject(this.next)) { + if (this.hasNext()) { + this.next.setLoaded(); + } else { + this.next.invisible(); + } + } + if (BI.isObject(this.prev)) { + if (this.hasPrev()) { + this.prev.setLoaded(); + } else { + this.prev.invisible(); + } + } + this.button_group.populate.apply(this.button_group, arguments); + }, - getValue: function () { - var fieldMap = this.options.fieldTextValueMap; - return this.editor.getValue("\n", function (line) { - var rawText = line.text, value = line.text, num = 0; - value.text = rawText; - _.forEach(line.markedSpans, function (i, ms) { - switch (i.marker.className) { - case "fieldName": - var fieldNameLength = i.to - i.from; - var fieldId = fieldMap[value.substr(i.from + num, fieldNameLength)]; - value = value.substr(0, i.from + num) + "$\{" + fieldMap[value.substr(i.from + num, fieldNameLength)] + "\}" + value.substr(i.to + num, value.length); - num += fieldId.length - fieldNameLength + 3; - break; - } - }); - return value; - }); - }, + setEnable: function (v) { + this.button_group.setEnable(v); + }, - setValue: function (value) { - this.editor.setValue(value); - }, + doBehavior: function () { + this.button_group.doBehavior.apply(this.button_group, arguments); + }, - setFieldTextValueMap: function (fieldTextValueMap) { - this.options.fieldTextValueMap = fieldTextValueMap; - }, + setNotSelectedValue: function () { + this.button_group.setNotSelectedValue.apply(this.button_group, arguments); + }, - refresh: function () { - var self = this; - BI.nextTick(function () { - self.editor.refresh(); - }); - } + getNotSelectedValue: function () { + return this.button_group.getNotSelectedValue(); + }, - }); - BI.FormulaEditor.EVENT_CHANGE = "EVENT_CHANGE"; - BI.FormulaEditor.EVENT_BLUR = "EVENT_BLUR"; - BI.FormulaEditor.EVENT_FOCUS = "EVENT_FOCUS"; - $.shortcut("bi.formula", BI.FormulaEditor); -})(jQuery); -/** - * z-index在1亿层级 - * 弹出提示消息框,用于模拟阻塞操作(通过回调函数实现) - * @class BI.Msg - */ -$.extend(BI, { - Msg: function () { + setValue: function () { + this.button_group.setValue.apply(this.button_group, arguments); + }, - var messageShow, $mask, $pop; + getValue: function () { + return this.button_group.getValue.apply(this.button_group, arguments); + }, - return { - toast: function (message, level, context) { - context = context || $("body"); - var toast = BI.createWidget({ - type: "bi.toast", - level: level, - text: message - }); - BI.createWidget({ - type: "bi.absolute", - element: context, - items: [{ - el: toast, - left: "50%", - top: 0 - }] - }); - if (toast.element.outerWidth() > context.outerWidth()) { - toast.setWidth(context.width()); - } - toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2}); - toast.invisible(); - toast.element.slideDown(500, function () { - BI.delay(function () { - toast.element.slideUp(500, function () { - toast.destroy(); - }) - }, 5000) - }) - }, - _show: function (hasCancel, title, message, callback) { - $mask = $('
    ').css({ - position: 'absolute', - 'zIndex': 99999998, - top: 0, - left: 0, - right: 0, - bottom: 0, - opacity: 0.1 - }).appendTo('body'); - $pop = $('
    ').css({ - position: 'absolute', - 'zIndex': 99999999, - top: 0, - left: 0, - right: 0, - bottom: 0 - }).appendTo('body'); - var close = function () { - messageShow.destroy(); - $mask.remove(); - }; - var controlItems = []; - if (hasCancel === true) { - controlItems.push({ - el: { - type: 'bi.button', - text: BI.i18nText("BI-Cancel"), - height: 30, - level: 'ignore', - handler: function () { - close(); - if (BI.isFunction(callback)) { - callback.apply(null, [false]); - } - } - } - }); - } - controlItems.push({ - el: { - type: 'bi.button', - text: BI.i18nText("BI-OK"), - height: 30, - handler: function () { - close(); - if (BI.isFunction(callback)) { - callback.apply(null, [true]); - } - } - } - }); - var conf = { - element: $pop, - type: 'bi.center_adapt', - items: [ - { - type: 'bi.border', - cls: 'bi-message-content', - items: { - 'north': { - el: { - type: 'bi.border', - cls: 'bi-message-title', - items: { - center: { - el: { - type: 'bi.label', - text: title || BI.i18nText("BI-Prompt"), - textAlign: 'left', - hgap: 20, - height: 50 - } - }, - east: { - el: { - type: 'bi.icon_button', - cls: 'bi-message-close close-font', -// height: 50, - handler: function () { - close(); - } - }, - width: 60 - } - } - }, - height: 50 - }, - 'center': { - el: { - type: "bi.text", - cls: "bi-message-text", - tgap: 60, - hgap: 20, - lineHeight: 30, - whiteSpace: "normal", - text: message - } - }, - 'south': { - el: { - type: "bi.absolute", - items: [{ - el: { - type: 'bi.right_vertical_adapt', - hgap: 5, - items: controlItems - }, - top: 0, - left: 20, - right: 20, - bottom: 0 - }] + getAllButtons: function () { + return this.button_group.getAllButtons(); + }, - }, - height: 60 - } - }, - width: 400, - height: 300 - } - ] - }; + getAllLeaves: function () { + return this.button_group.getAllLeaves(); + }, - messageShow = BI.createWidget(conf); - } - }; - }() -});/** - * Grid - * - * Created by GUY on 2016/1/11. - * @class BI.Grid - * @extends BI.Widget - */ -BI.Grid = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.Grid.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-grid", - width: 400, - height: 300, - overflowX: true, - overflowY: true, - overscanColumnCount: 0, - overscanRowCount: 0, - rowHeightGetter: BI.emptyFn, - columnWidthGetter: BI.emptyFn, - estimatedColumnSize: 100, - estimatedRowSize: 30, - scrollLeft: 0, - scrollTop: 0, - items: [] - }); + getSelectedButtons: function () { + return this.button_group.getSelectedButtons(); }, - _init: function () { - BI.Grid.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.renderedCells = []; - this.renderedKeys = []; - this._scrollLock = false; - this._debounceRelease = BI.debounce(function () { - self._scrollLock = false; - }, 150); - this.container = BI.createWidget({ - type: "bi.absolute" - }); - this.element.scroll(function () { - if (self._scrollLock === true) { - return; - } - o.scrollLeft = self.element.scrollLeft(); - o.scrollTop = self.element.scrollTop(); - self._calculateChildrenToRender(); - self.fireEvent(BI.Grid.EVENT_SCROLL, { - scrollLeft: o.scrollLeft, - scrollTop: o.scrollTop - }); - }); - BI.createWidget({ - type: "bi.vertical", - element: this, - scrollable: o.overflowX === true && o.overflowY === true, - scrolly: o.overflowX === false && o.overflowY === true, - scrollx: o.overflowX === true && o.overflowY === false, - items: [this.container] - }); - if (o.items.length > 0) { - this._populate(); - } + getNotSelectedButtons: function () { + return this.button_group.getNotSelectedButtons(); }, - mounted: function () { - var o = this.options; - if (o.scrollLeft !== 0 || o.scrollTop !== 0) { - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); - } + getIndexByValue: function (value) { + return this.button_group.getIndexByValue(value); }, - _getOverscanIndices: function (cellCount, overscanCellsCount, startIndex, stopIndex) { - return { - overscanStartIndex: Math.max(0, startIndex - overscanCellsCount), - overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount) - } + getNodeById: function (id) { + return this.button_group.getNodeById(id); }, - _calculateChildrenToRender: function () { - var self = this, o = this.options; + getNodeByValue: function (value) { + return this.button_group.getNodeByValue(value); + }, - var width = o.width, height = o.height, scrollLeft = BI.clamp(o.scrollLeft, 0, this._getMaxScrollLeft()), scrollTop = BI.clamp(o.scrollTop, 0, this._getMaxScrollTop()), - overscanColumnCount = o.overscanColumnCount, overscanRowCount = o.overscanRowCount; + empty: function () { + this.button_group.empty(); + BI.each([this.prev, this.next], function (i, ob) { + ob && ob.setVisible(false); + }); + }, - if (height > 0 && width > 0) { - var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange(width, scrollLeft); - var visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange(height, scrollTop); - - var horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment(width, scrollLeft); - var verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment(height, scrollTop); - - this._renderedColumnStartIndex = visibleColumnIndices.start; - this._renderedColumnStopIndex = visibleColumnIndices.stop; - this._renderedRowStartIndex = visibleRowIndices.start; - this._renderedRowStopIndex = visibleRowIndices.stop; - - var overscanColumnIndices = this._getOverscanIndices(this.columnCount, overscanColumnCount, this._renderedColumnStartIndex, this._renderedColumnStopIndex) - - var overscanRowIndices = this._getOverscanIndices(this.rowCount, overscanRowCount, this._renderedRowStartIndex, this._renderedRowStopIndex); + destroy: function () { + BI.Loader.superclass.destroy.apply(this, arguments); + } +}); +BI.Loader.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.loader", BI.Loader);/** + * Created by GUY on 2015/6/26. + */ - var columnStartIndex = overscanColumnIndices.overscanStartIndex; - var columnStopIndex = overscanColumnIndices.overscanStopIndex; - var rowStartIndex = overscanRowIndices.overscanStartIndex; - var rowStopIndex = overscanRowIndices.overscanStopIndex; +BI.Navigation = BI.inherit(BI.Widget, { + _defaultConfig: function(){ + return BI.extend(BI.Navigation.superclass._defaultConfig.apply(this,arguments), { + direction: "bottom",//top, bottom, left, right, custom + logic: { + dynamic: false + }, + defaultShowIndex: 0, + tab: { + type: "bi.button_group", + items: [], + layouts: [] + }, + cardCreator: function(v){ + return BI.createWidget(); + }, - var renderedCells = [], renderedKeys = []; + afterCardCreated: BI.emptyFn, + afterCardShow: BI.emptyFn + }) + }, - for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { - var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); + _init: function(){ + BI.Navigation.superclass._init.apply(this,arguments); + var self = this, o = this.options; + this.tab = BI.createWidget(this.options.tab, {type: "bi.button_group"}); + this.cardMap = {}; + this.showIndex = 0; + this.layout = BI.createWidget({ + type: "bi.card" + }); + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tab, this.layout) + })))); - for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) { - var key = [rowIndex, columnIndex]; - var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex); - var index = BI.deepIndexOf(this.renderedKeys, key); - if (index > -1) { - if (columnDatum.size !== this.renderedCells[index]._width) { - this.renderedCells[index]._width = columnDatum.size; - this.renderedCells[index].el.setWidth(columnDatum.size); - } - if (rowDatum.size !== this.renderedCells[index]._height) { - this.renderedCells[index]._height = rowDatum.size; - this.renderedCells[index].el.setHeight(rowDatum.size); - } - if (this.renderedCells[index].left !== columnDatum.offset + horizontalOffsetAdjustment) { - this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) + "px"); - } - if (this.renderedCells[index].top !== rowDatum.offset + verticalOffsetAdjustment) { - this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) + "px"); - } - renderedCells.push(this.renderedCells[index]); - } else { - var child = BI.createWidget(BI.extend({ - type: "bi.label", - width: columnDatum.size, - height: rowDatum.size - }, o.items[rowIndex][columnIndex], { - cls: (o.items[rowIndex][columnIndex].cls || "") + " grid-cell" + (rowIndex === 0 ? " first-row" : "") + (columnIndex === 0 ? " first-col" : ""), - _rowIndex: rowIndex, - _columnIndex: columnIndex, - _left: columnDatum.offset + horizontalOffsetAdjustment, - _top: rowDatum.offset + verticalOffsetAdjustment - })); - renderedCells.push({ - el: child, - left: columnDatum.offset + horizontalOffsetAdjustment, - top: rowDatum.offset + verticalOffsetAdjustment, - _width: columnDatum.size, - _height: rowDatum.size - }); - } - renderedKeys.push(key); - } - } - //已存在的, 需要添加的和需要删除的 - var existSet = {}, addSet = {}, deleteArray = []; - BI.each(renderedKeys, function (i, key) { - if (BI.deepContains(self.renderedKeys, key)) { - existSet[i] = key; - } else { - addSet[i] = key; - } - }); - BI.each(this.renderedKeys, function (i, key) { - if (BI.deepContains(existSet, key)) { - return; - } - if (BI.deepContains(addSet, key)) { - return; - } - deleteArray.push(i); - }); - BI.each(deleteArray, function (i, index) { - self.renderedCells[index].el.destroy(); - }); - var addedItems = []; - BI.each(addSet, function (index) { - addedItems.push(renderedCells[index]) - }); - BI.createWidget({ - type: "bi.absolute", - element: this.container, - items: addedItems - }); - this.renderedCells = renderedCells; - this.renderedKeys = renderedKeys; + new BI.ShowListener({ + eventObj: this.tab, + cardLayout: this.layout, + cardNameCreator: function(v){ + return self.showIndex + v; + }, + cardCreator: function(v){ + var card = o.cardCreator(v); + self.cardMap[v] = card; + return card; + }, + afterCardCreated: BI.bind(this.afterCardCreated, this), + afterCardShow: BI.bind(this.afterCardShow, this) + }) + if(o.defaultShowIndex !== false){ + this.setSelect(o.defaultShowIndex); } }, - _getMaxScrollLeft: function () { - return Math.max(0, this._columnSizeAndPositionManager.getTotalSize() - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0)); + afterCardCreated: function(v){ + var self = this; + this.cardMap[v].on(BI.Controller.EVENT_CHANGE, function(type, value, obj){ + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if(type === BI.Events.CLICK) { + self.fireEvent(BI.Navigation.EVENT_CHANGE, obj); + } + }) + this.options.afterCardCreated.apply(this, arguments); }, - _getMaxScrollTop: function () { - return Math.max(0, this._rowSizeAndPositionManager.getTotalSize() - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0)); + afterCardShow: function(v){ + this.showIndex = v; + this.options.afterCardShow.apply(this, arguments); }, - _populate: function () { - var self = this, o = this.options; - if (o.items.length > 0) { - this.columnCount = o.items[0].length; - this.rowCount = o.items.length; - this.container.setWidth(this.columnCount * o.estimatedColumnSize); - this.container.setHeight(this.rowCount * o.estimatedRowSize); - - this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); - this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); - - this._calculateChildrenToRender(); - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); + populate: function(){ + var card = this.layout.getShowingCard(); + if(card){ + return card.populate.apply(card, arguments); } }, - setScrollLeft: function (scrollLeft) { - if (this.options.scrollLeft === scrollLeft) { - return; + setSelect: function(v){ + this.showIndex = v; + if(!this.layout.isCardExisted(v)){ + var card = this.options.cardCreator(v); + this.cardMap[v] = card; + this.layout.addCardByName(v, card); + this.afterCardCreated(v); } - this._scrollLock = true; - this.options.scrollLeft = BI.clamp(scrollLeft || 0, 0, this._getMaxScrollLeft()); - this._debounceRelease(); - this._calculateChildrenToRender(); - this.element.scrollLeft(this.options.scrollLeft); + this.layout.showCardByName(v); + BI.nextTick(BI.bind(this.afterCardShow, this, v)); }, - setScrollTop: function (scrollTop) { - if (this.options.scrollTop === scrollTop) { - return; - } - this._scrollLock = true; - this.options.scrollTop = BI.clamp(scrollTop || 0, 0, this._getMaxScrollTop()); - this._debounceRelease(); - this._calculateChildrenToRender(); - this.element.scrollTop(this.options.scrollTop); + getSelect: function(){ + return this.showIndex; }, - setOverflowX: function (b) { - var self = this; - if (this.options.overflowX !== !!b) { - this.options.overflowX = !!b; - BI.nextTick(function () { - self.element.css({overflowX: !!b ? "auto" : "hidden"}); - }); + getSelectedCard: function(){ + if(BI.isKey(this.showIndex)){ + return this.cardMap[this.showIndex]; } }, - setOverflowY: function (b) { - var self = this; - if (this.options.overflowY !== !!b) { - this.options.overflowY = !!b; - BI.nextTick(function () { - self.element.css({overflowY: !!b ? "auto" : "hidden"}); - }); + /** + * @override + */ + setValue: function(v){ + var card = this.layout.getShowingCard(); + if(card){ + card.setValue(v); } }, - getScrollLeft: function () { - return this.options.scrollLeft; + /** + * @override + */ + getValue: function(){ + var card = this.layout.getShowingCard(); + if(card){ + return card.getValue(); + } }, - getScrollTop: function () { - return this.options.scrollTop; + empty: function(){ + this.layout.deleteAllCard(); + this.cardMap = {}; }, - getMaxScrollLeft: function () { - return this._getMaxScrollLeft(); - }, - - getMaxScrollTop: function () { - return this._getMaxScrollTop(); - }, - - setEstimatedColumnSize: function (width) { - this.options.estimatedColumnSize = width; - }, - - setEstimatedRowSize: function (height) { - this.options.estimatedRowSize = height; - }, - - restore: function () { - BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); - }); - this.renderedCells = []; - this.renderedKeys = []; - this._scrollLock = false; - }, - - populate: function (items) { - if (items && items !== this.options.items) { - this.options.items = items; - this.restore(); - } - this._populate(); - } -}); -BI.Grid.EVENT_SCROLL = "EVENT_SCROLL"; -$.shortcut('bi.grid_view', BI.Grid);/** - * floatBox弹出层, - * @class BI.FloatBox - * @extends BI.Widget - */ -BI.FloatBox = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-float-box", - width: 600, - height: 500 - }) - }, - _init: function () { - BI.FloatBox.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.showAction = new BI.ShowAction({ - tar: this - }); - this._center = BI.createWidget(); - this._north = BI.createWidget(); - this.element.draggable({ - cursor: BICst.cursorUrl, - handle: ".bi-message-title", - drag: function (e, ui) { - var W = $("body").width(), H = $("body").height(); - if (ui.position.left + o.width > W) { - ui.position.left = W - o.width; - } - if (ui.position.top + o.height > H) { - ui.position.top = H - o.height; - } - if (ui.position.left < 0) { - ui.position.left = 0; - } - if (ui.position.top < 0) { - ui.position.top = 0; - } - } - }); - this._south = BI.createWidget(); - BI.createWidget({ - type: 'bi.border', - element: this, - items: { - 'north': { - el: { - type: 'bi.border', - cls: 'bi-message-title', - items: { - center: { - el: { - type: "bi.absolute", - items: [{ - el: this._north, - left: 10, - top: 0, - right: 0, - bottom: 0 - }] - } - }, - east: { - el: { - type: 'bi.icon_button', - cls: 'bi-message-close close-font', - height: 50, - handler: function () { - self.currentSectionProvider.close(); - } - }, - width: 60 - } - } - }, - height: 50 - }, - 'center': { - el: { - type: "bi.absolute", - items: [{ - el: this._center, - left: 10, - top: 10, - right: 10, - bottom: 10 - }] - } - }, - 'south': { - el: { - type: "bi.absolute", - items: [{ - el: this._south, - left: 10, - top: 0, - right: 10, - bottom: 0 - }] - }, - height: 60 - } - } - }) - }, - - populate: function (sectionProvider) { - var self = this; - this.currentSectionProvider = sectionProvider; - sectionProvider.rebuildNorth(this._north); - sectionProvider.rebuildCenter(this._center); - sectionProvider.rebuildSouth(this._south); - if (sectionProvider instanceof BI.Widget) { - sectionProvider.on(BI.PopoverSection.EVENT_CLOSE, function () { - self.close(); - }) - } - }, - - show: function () { - this.showAction.actionPerformed(); - }, - - hide: function () { - this.showAction.actionBack(); - }, - - open: function () { - this.show(); - this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_OPEN); - }, - - close: function () { - this.hide(); - this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED); - }, - - setZindex: function (zindex) { - this.element.css({"z-index": zindex}); + destroy: function(){ + BI.Navigation.superclass.destroy.apply(this, arguments); } }); +BI.Navigation.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.float_box", BI.FloatBox); - -BI.FloatBox.EVENT_FLOAT_BOX_CLOSED = "EVENT_FLOAT_BOX_CLOSED"; -BI.FloatBox.EVENT_FLOAT_BOX_OPEN = "EVENT_FLOAT_BOX_CLOSED"; -/** - * 下拉框弹出层, zIndex在1000w - * @class BI.PopupView +$.shortcut("bi.navigation", BI.Navigation);/** + * 搜索逻辑控件 + * + * Created by GUY on 2015/9/28. + * @class BI.Searcher * @extends BI.Widget */ -BI.PopupView = BI.inherit(BI.Widget, { + +BI.Searcher = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-list-view", - maxWidth: 'auto', - minWidth: 100, - //maxHeight: 200, - minHeight: 25, + return BI.extend(BI.Searcher.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-searcher", lgap: 0, rgap: 0, tgap: 0, bgap: 0, vgap: 0, hgap: 0, - direction: BI.Direction.Top, //工具栏的方向 - stopEvent: false,//是否停止mousedown、mouseup事件 - stopPropagation: false, //是否停止mousedown、mouseup向上冒泡 - logic: { - dynamic: true + + isDefaultInit: false, + isAutoSearch: true, //是否自动搜索 + isAutoSync: true, //是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一 + chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, + + //isAutoSearch为false时启用 + onSearch: function (op, callback) { + callback([]) }, - tool: false, //自定义工具栏 - tabs: [], //导航栏 - buttons: [], //toolbar栏 el: { - type: "bi.button_group", - items: [], - chooseType: 0, - behaviors: {}, - layouts: [{ - type: "bi.vertical" - }] + type: "bi.search_editor" + }, + + popup: { + type: "bi.searcher_view" + }, + + adapter: null, + masker: { //masker层 + offset: {} } }) }, _init: function () { - BI.PopupView.superclass._init.apply(this, arguments); + BI.Searcher.superclass._init.apply(this, arguments); var self = this, o = this.options; - var fn = function (e) { - e.stopPropagation(); - }, stop = function (e) { - e.stopEvent(); - return false; - }; - this.element.css({ - "z-index": BI.zIndex_popup, - "min-width": o.minWidth + "px", - "max-width": o.maxWidth + "px" - }).bind({"click": fn, "mousewheel": fn}); - - o.stopPropagation && this.element.bind({"mousedown": fn, "mouseup": fn, "mouseover": fn}); - o.stopEvent && this.element.bind({"mousedown": stop, "mouseup": stop, "mouseover": stop}); - this.tool = this._createTool(); - this.tab = this._createTab(); - this.view = this._createView(); - this.toolbar = this._createToolBar(); - this.button_group.on(BI.Controller.EVENT_CHANGE, function (type) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if (type === BI.Events.CLICK) { - self.fireEvent(BI.PopupView.EVENT_CHANGE); - } + this.editor = BI.createWidget(o.el, { + type: "bi.search_editor" }); - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { - scrolly: false, + BI.createWidget({ + type: "bi.vertical", + element: this, lgap: o.lgap, rgap: o.rgap, tgap: o.tgap, bgap: o.bgap, vgap: o.vgap, hgap: o.hgap, - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, - BI.extend({ - cls: "list-view-outer" - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tool, this.tab, this.view, this.toolbar) - }))) - ) - })))); + items: [this.editor] + }); + o.isDefaultInit && (this._assertPopupView()); + + var search = BI.debounce(BI.bind(this._search, this), BI.EVENT_RESPONSE_TIME, true); + this.editor.on(BI.Controller.EVENT_CHANGE, function (type) { + switch (type) { + case BI.Events.STARTEDIT: + self._startSearch(); + break; + case BI.Events.EMPTY: + self._stopSearch(); + break; + case BI.Events.CHANGE: + search(); + break; + case BI.Events.PAUSE: + self._pauseSearch(); + break; + } + }) }, - _createView: function () { - var o = this.options; - this.button_group = BI.createWidget(o.el, {type: "bi.button_group"}); - this.button_group.element.css({"min-height": o.minHeight + "px"}); - return this.button_group; + _assertPopupView: function () { + var self = this, o = this.options; + if (!BI.Maskers.has(this.getName())) { + this.popupView = BI.createWidget(o.popup, { + type: "bi.searcher_view", + chooseType: o.chooseType + }); + BI.Maskers.create(this.getName(), o.adapter, BI.extend({ + container: this, + render: this.popupView + }, o.masker)); + + this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + if (o.isAutoSync) { + var values = o.adapter && o.adapter.getValue(); + if (!obj.isSelected()) { + o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue())); + } else { + switch (o.chooseType) { + case BI.ButtonGroup.CHOOSE_TYPE_SINGLE: + o.adapter && o.adapter.setValue([obj.getValue()]); + break; + case BI.ButtonGroup.CHOOSE_TYPE_MULTI: + values.push(obj.getValue()); + o.adapter && o.adapter.setValue(values); + break; + } + } + } + self.fireEvent(BI.Searcher.EVENT_CHANGE, value, obj); + } + }); + BI.nextTick(function () { + self.fireEvent(BI.Searcher.EVENT_AFTER_INIT); + }); + } }, - _createTool: function () { - var o = this.options; - if (false === o.tool) { - return; + _startSearch: function () { + this._assertPopupView(); + this._stop = false; + this._isSearching = true; + this.fireEvent(BI.Searcher.EVENT_START); + this.popupView.startSearch && this.popupView.startSearch(); + //搜索前先清空dom + BI.Maskers.get(this.getName()).empty(); + BI.nextTick(function (name) { + BI.Maskers.show(name); + }, this.getName()); + }, + + _pauseSearch: function () { + var o = this.options, name = this.getName(); + this._stop = true; + BI.nextTick(function (name) { + BI.Maskers.hide(name); + }, this.getName()); + if (BI.Maskers.has(name) && this._isSearching === true) { + this.popupView && this.popupView.pauseSearch && this.popupView.pauseSearch(); + this.fireEvent(BI.Searcher.EVENT_PAUSE); } - return BI.createWidget(o.tool) + this._isSearching = false; }, - _createTab: function () { - var o = this.options; - if (o.tabs.length === 0) { - return; + _stopSearch: function () { + var o = this.options, name = this.getName(); + this._stop = true; + BI.Maskers.hide(name); + if (BI.Maskers.has(name) && this._isSearching === true) { + //搜索后清空dom + BI.nextTick(function () { + BI.Maskers.has(name) && BI.Maskers.get(name).empty(); + }); + this.popupView && this.popupView.stopSearch && this.popupView.stopSearch(); + this.fireEvent(BI.Searcher.EVENT_STOP); } - return BI.createWidget({ - type: "bi.center", - cls: "list-view-tab", - height: 25, - items: o.tabs - }) + this._isSearching = false; }, - _createToolBar: function () { - var o = this.options; - if (o.buttons.length === 0) { + _search: function () { + var self = this, o = this.options, keyword = this.editor.getValue(); + if (keyword === "" || this._stop) { return; } + if (o.isAutoSearch) { + var items = (o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items") || []; + var finding = BI.Func.getSearchResult(items, keyword); + var matched = finding.matched, finded = finding.finded; + this.popupView.populate(finded, matched, keyword); + o.isAutoSync && this.popupView.setValue(o.adapter.getValue()); + self.fireEvent(BI.Searcher.EVENT_SEARCHING); + return; + } + this.popupView.loading && this.popupView.loading(); + o.onSearch({ + times: 1, + keyword: keyword, + selectedValues: o.adapter && o.adapter.getValue() + }, function (searchResult, matchResult) { + if (!self._stop) { + var args = [].slice.call(arguments); + if (args.length > 0) { + args.push(keyword); + } + BI.Maskers.show(self.getName()); + self.popupView.populate.apply(self.popupView, args); + o.isAutoSync && self.popupView.setValue(o.adapter && o.adapter.getValue()); + self.popupView.loaded && self.popupView.loaded(); + self.fireEvent(BI.Searcher.EVENT_SEARCHING); + } + }); + }, - return BI.createWidget({ - type: "bi.center", - cls: "list-view-toolbar", - height: 30, - items: BI.createItems(o.buttons, { - once: false, - shadow: true, - isShadowShowingOnSelected: true - }) - }) + setAdapter: function (adapter) { + this.options.adapter = adapter; + BI.Maskers.remove(this.getName()); }, - populate: function (items) { - this.button_group.populate.apply(this.button_group, arguments); + doSearch: function () { + if (this.isSearching()) { + this._search(); + } }, - resetWidth: function (w) { - this.options.width = w; - this.element.width(w); + stopSearch: function () { + this._stopSearch();//先停止搜索,然后再去设置editor为空 + //important:停止搜索必须退出编辑状态,这里必须加上try(input框不显示时blur会抛异常) + try { + this.editor.blur(); + } catch (e) { + if (!this.editor.blur) { + throw new Error("editor没有实现blur方法"); + } + } finally { + this.editor.setValue(""); + } }, - resetHeight: function (h) { - var tbHeight = 30 * (this.toolbar ? 1 : 0), - tabHeight = 25 * (this.tab ? 1 : 0), - toolHeight = ((this.tool && this.tool.element.outerHeight()) || 25) * ((this.tool && this.tool.isVisible()) ? 1 : 0); - this.view.resetHeight ? this.view.resetHeight(h - tbHeight - tabHeight - toolHeight - 2) : - this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"}) + isSearching: function () { + return this._isSearching; }, - setEnable: function (arg) { - BI.PopupView.superclass.setEnable.apply(this, arguments); - this.view && this.view.setEnable(arg); + isViewVisible: function () { + return this.editor.isEnabled() && BI.Maskers.isVisible(this.getName()); }, - setValue: function (selectedValues) { - this.tab && this.tab.setValue(selectedValues); - this.button_group.setValue(selectedValues); + getView: function () { + return this.popupView; }, - getValue: function () { - return this.button_group.getValue(); - } -}); -BI.PopupView.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.popup_view", BI.PopupView);/** - * guy - * @class BI.ScrollView - * @extends BI.Widget - */ -BI.ScrollView = BI.inherit(BI.Widget, { + hasMatched: function () { + this._assertPopupView(); + return this.popupView.hasMatched(); + }, - _const: { - dropDownHeight: 15, - expandIcon: "column-next-page-h-font", - collapseIcon: "column-pre-page-h-font" + adjustHeight: function () { + if (BI.Maskers.has(this.getName()) && BI.Maskers.get(this.getName()).isVisible()) { + BI.Maskers.show(this.getName()); + } }, - _defaultConfig: function() { - return BI.extend(BI.ScrollView.superclass._defaultConfig.apply(this, arguments), { - baseCls:"bi-scroll-view", - scrollHeight: 50, - maxHeight: 300 - }) + adjustView: function () { + this.isViewVisible() && BI.Maskers.show(this.getName()); }, - _init : function() { - BI.ScrollView.superclass._init.apply(this, arguments); + setValue: function (v) { + this._assertPopupView(); + this.popupView && this.popupView.setValue(v); + }, - this.scrollUp = false; - this.scroll = BI.createWidget({ - type: "bi.vertical", - cls: "scroll-container", - scrolly: true - }) - BI.createWidget({ - type: "bi.vertical", - element: this, - scrolly: false, - items: [this.scroll] - }) + getKeyword: function () { + return this.editor.getValue(); + }, - this.dropdown = BI.createWidget({ - type: "bi.icon_button", - height: this._const.dropDownHeight, - cls: "scroll-drop-down-icon " + this._const.expandIcon, - handler: BI.bind(this._dropDownOrUp, this) - }) - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.dropdown, - left: 0, - right: 0, - bottom: -1 * this._const.dropDownHeight - }] - }) - this.populate(this.options.items); + getKeywords: function () { + return this.editor.getKeywords(); }, - _dropDownOrUp: function(){ - if(!this.scrollUp){ - var height = this.element.height(); - height += this.options.scrollHeight; - height = Math.min(height, this.scroll.element[0].scrollHeight, this.options.maxHeight); - this.element.height(height); - this._checkDropDownState(); - } else { - var height = this.element.height(); - height -= this.options.scrollHeight; - height = Math.max(height, this.options.height); - this.element.height(height); - this._checkDropDownState(); + getValue: function () { + var o = this.options; + if (o.isAutoSync) { + return o.adapter.getValue(); } - }, - - _checkDropDownState: function(){ - var height = this.element.height(); - if(!this._checkScroll() || height >= this.options.maxHeight){ - this.scrollUp = true; - this.dropdown.element.removeClass(this._const.expandIcon).addClass(this._const.collapseIcon); - } else if(height <= this.options.height){ - this.scrollUp = false; - this.dropdown.element.addClass(this._const.expandIcon); + if (this.isSearching()) { + return this.popupView.getValue(); } else { - this.dropdown.element.addClass(this.scrollUp ? this._const.collapseIcon : this._const.expandIcon); + return o.adapter.getValue(); } }, - _checkScroll: function(){ - this.scroll.element.height(this.element.height()); - return this.scroll.element[0].scrollHeight > this.scroll.element[0].clientHeight; - }, - - _checkDropDown: function(){ - if(this._checkScroll()){ - this.dropdown.visible(); - //this.scrollUp = false; - this._checkDropDownState(); - } else { - this.dropdown.invisible(); + populate: function (result, searchResult, keyword) { + var o = this.options; + this._assertPopupView(); + this.popupView.populate.apply(this.popupView, arguments); + if (o.isAutoSync) { + this.popupView.setValue(o.adapter.getValue()); } }, - populate: function(){ - this.scroll.populate.apply(this.scroll, arguments); - this.resize(); - }, - - resize: function(){ - this.element.height(this.options.height); - BI.nextTick(BI.bind(this._checkDropDown, this)); + empty: function () { + this.popupView && this.popupView.empty(); }, - addItem: function(){ - this.scroll.addItem.apply(this.scroll, arguments); - BI.nextTick(BI.bind(this._checkDropDown, this)); + destroy: function () { + BI.Maskers.remove(this.getName()); + BI.Searcher.superclass.destroy.apply(this, arguments); } }); +BI.Searcher.EVENT_CHANGE = "EVENT_CHANGE"; +BI.Searcher.EVENT_START = "EVENT_START"; +BI.Searcher.EVENT_STOP = "EVENT_STOP"; +BI.Searcher.EVENT_PAUSE = "EVENT_PAUSE"; +BI.Searcher.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.Searcher.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; -$.shortcut("bi.scroll_view", BI.ScrollView);/** - * 搜索面板 +$.shortcut("bi.searcher", BI.Searcher);/** * - * Created by GUY on 2015/9/28. - * @class BI.SearcherView - * @extends BI.Pane + * 切换显示或隐藏面板 + * + * Created by GUY on 2015/11/2. + * @class BI.Switcher + * @extends BI.Widget */ - -BI.SearcherView = BI.inherit(BI.Pane, { +BI.Switcher = BI.inherit(BI.Widget, { _defaultConfig: function () { - var conf = BI.SearcherView.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-searcher-view", - tipText: BI.i18nText("BI-No_Select"), - chooseType: BI.Selection.Single, - - matcher: {//完全匹配的构造器 - type: "bi.button_group", - behaviors: { - redmark: function () { - return true; - } - }, - items: [], - layouts: [{ - type: "bi.vertical" - }] - }, - searcher: { - type: "bi.button_group", - behaviors: { - redmark: function () { - return true; - } - }, - items: [], - layouts: [{ - type: "bi.vertical" - }] - } + return BI.extend(BI.Switcher.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-switcher", + direction: BI.Direction.Top, + trigger: "click", + toggle: true, + el: {}, + popup: {}, + adapter: null, + masker: {}, + switcherClass: "bi-switcher-popup", + hoverClass: "bi-switcher-hover" }) }, _init: function () { - BI.SearcherView.superclass._init.apply(this, arguments); + BI.Switcher.superclass._init.apply(this, arguments); var self = this, o = this.options; - - this.matcher = BI.createWidget(o.matcher, { - type: "bi.button_group", - chooseType: o.chooseType, - behaviors: { - redmark: function () { - return true; + this._initSwitcher(); + this._initPullDownAction(); + this.switcher.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + if (self.isEnabled() && this.isEnabled()) { + if (type === BI.Events.EXPAND) { + self._popupView(); } - }, - layouts: [{ - type: "bi.vertical" - }] - }); - this.matcher.on(BI.Controller.EVENT_CHANGE, function (type, val, ob) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if (type === BI.Events.CLICK) { - self.fireEvent(BI.SearcherView.EVENT_CHANGE, val, ob); - } - }); - this.spliter = BI.createWidget({ - type: "bi.vertical", - height: 1, - hgap: 10, - items: [{ - type: "bi.layout", - height: 1, - cls: "searcher-view-spliter" - }] - }); - this.searcher = BI.createWidget(o.searcher, { - type: "bi.button_group", - chooseType: o.chooseType, - behaviors: { - redmark: function () { - return true; + if (type === BI.Events.COLLAPSE) { + self._hideView(); + } + if (type === BI.Events.EXPAND || type === BI.Events.COLLAPSE) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + } + if (type === BI.Events.CLICK) { + self.fireEvent(BI.Switcher.EVENT_TRIGGER_CHANGE, value, obj); } - }, - layouts: [{ - type: "bi.vertical" - }] - }); - this.searcher.on(BI.Controller.EVENT_CHANGE, function (type, val, ob) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if (type === BI.Events.CLICK) { - self.fireEvent(BI.SearcherView.EVENT_CHANGE, val, ob); } }); + this.element.hover(function () { + if (self.isEnabled() && self.switcher.isEnabled()) { + self.element.addClass(o.hoverClass); + } + }, function () { + if (self.isEnabled() && self.switcher.isEnabled()) { + self.element.removeClass(o.hoverClass); + } + }); BI.createWidget({ type: "bi.vertical", + scrolly: false, element: this, - items: [this.matcher, this.spliter, this.searcher] + items: [ + {el: this.switcher} + ] }); + o.isDefaultInit && (this._assertPopupView()); }, - startSearch: function () { - - }, - - stopSearch: function () { - - }, - - setValue: function (v) { - this.matcher.setValue(v); - this.searcher.setValue(v); - }, - - getValue: function () { - return this.matcher.getValue().concat(this.searcher.getValue()); - }, - - populate: function (searchResult, matchResult, keyword) { - searchResult || (searchResult = []); - matchResult || (matchResult = []); - this.setTipVisible(searchResult.length + matchResult.length === 0); - this.spliter.setVisible(BI.isNotEmptyArray(matchResult) && BI.isNotEmptyArray(searchResult)); - this.matcher.populate(matchResult, keyword); - this.searcher.populate(searchResult, keyword); - }, - - empty: function () { - this.searcher.empty(); - this.matcher.empty(); + _toggle: function () { + this._assertPopupView(); + if (this.isExpanded()) { + this._hideView(); + } else { + if (this.isEnabled()) { + this._popupView(); + } + } }, - hasMatched: function () { - return this.matcher.getAllButtons().length > 0; - } -}); -BI.SearcherView.EVENT_CHANGE = "EVENT_CHANGE"; + _initPullDownAction: function () { + var self = this, o = this.options; + var evs = this.options.trigger.split(","); + BI.each(evs, function (i, e) { + switch (e) { + case "hover": + self.element[e](function (e) { + if (self.isEnabled() && self.switcher.isEnabled()) { + self._popupView(); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.switcher); + self.fireEvent(BI.Switcher.EVENT_EXPAND); + } + }, function () { + if (self.isEnabled() && self.switcher.isEnabled() && o.toggle) { + self._hideView(); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.switcher); + self.fireEvent(BI.Switcher.EVENT_COLLAPSE); + } + }); + break; + default : + if (e) { + self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) { + if (self.switcher.element.__isMouseInBounds__(e)) { + if (self.isEnabled() && self.switcher.isEnabled()) { + o.toggle ? self._toggle() : self._popupView(); + if (self.isExpanded()) { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.switcher); + self.fireEvent(BI.Switcher.EVENT_EXPAND); + } else { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.switcher); + self.fireEvent(BI.Switcher.EVENT_COLLAPSE); + } + } + } + }, BI.EVENT_RESPONSE_TIME, true)); + } + break; + } + }) + }, -$.shortcut("bi.searcher_view", BI.SearcherView);/** - * 分页控件 - * - * Created by GUY on 2015/8/31. - * @class BI.Pager - * @extends BI.Widget - */ -BI.Pager = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.Pager.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-pager", - behaviors: {}, - layouts: [{ - type: "bi.horizontal", - hgap: 10, - vgap: 0 - }], + _initSwitcher: function () { + this.switcher = BI.createWidget(this.options.el); + }, - dynamicShow: true, //是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态 - //dynamicShow为false时以下两个有用 - dynamicShowFirstLast: false,//是否动态显示首页、尾页 - dynamicShowPrevNext: false,//是否动态显示上一页、下一页 - pages: false, //总页数 - curr: function () { - return 1; - }, //初始化当前页 - groups: 0, //连续显示分页数 - jump: BI.emptyFn, //分页的回调函数 + _assertPopupView: function () { + var self = this, o = this.options; + if (!this._created) { + this.popupView = BI.createWidget(o.popup, { + type: "bi.button_group", + element: o.adapter && BI.Maskers.create(this.getName(), o.adapter, BI.extend({container: this}, o.masker)), + cls: "switcher-popup", + layouts: [{ + type: "bi.vertical", + hgap: 0, + vgap: 0 + }] + }); + this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + self.fireEvent(BI.Switcher.EVENT_CHANGE, value, obj); + } + }); + if (o.direction !== BI.Direction.Custom && !o.adapter) { + BI.createWidget({ + type: "bi.vertical", + scrolly: false, + element: this, + items: [ + {el: this.popupView} + ] + }); + } + this._created = true; + BI.nextTick(function () { + self.fireEvent(BI.Switcher.EVENT_AFTER_INIT); + }); + } + }, - first: false, //是否显示首页 - last: false, //是否显示尾页 - prev: "上一页", - next: "下一页", + _hideView: function () { + this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW); + var self = this, o = this.options; + o.adapter ? BI.Maskers.hide(self.getName()) : (self.popupView && self.popupView.setVisible(false)); + BI.nextTick(function () { + o.adapter ? BI.Maskers.hide(self.getName()) : (self.popupView && self.popupView.setVisible(false)); + self.element.removeClass(o.switcherClass); + self.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW); + }); + }, - firstPage: 1, - lastPage: function () { //在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法 - return 1; - }, - hasPrev: BI.emptyFn, //pages不可用时有效 - hasNext: BI.emptyFn //pages不可用时有效 - }) + _popupView: function () { + var self = this, o = this.options; + this._assertPopupView(); + this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW); + o.adapter ? BI.Maskers.show(this.getName()) : self.popupView.setVisible(true); + BI.nextTick(function (name) { + o.adapter ? BI.Maskers.show(name) : self.popupView.setVisible(true); + self.element.addClass(o.switcherClass); + self.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW); + }, this.getName()); }, - _init: function () { - BI.Pager.superclass._init.apply(this, arguments); - var self = this; - this.currPage = BI.result(this.options, "curr"); - //翻页太灵敏 - this._lock = false; - this._debouce = BI.debounce(function () { - self._lock = false; - }, 300); - this._populate(); + + populate: function (items) { + this._assertPopupView(); + this.popupView.populate.apply(this.popupView, arguments); + this.switcher.populate.apply(this.switcher, arguments); }, - populate: function () { - this.currPage = BI.result(this.options, "curr"); - this._populate(); + setEnable: function (arg) { + BI.Switcher.superclass.setEnable.apply(this, arguments); + this.switcher && this.switcher.setEnable(arg); + this.popupView && this.popupView.setEnable(arg); + !arg && this._hideView(); }, - - refresh: function () { - this._populate(); + + setValue: function (v) { + this._assertPopupView(); + this.switcher.setValue(v); + this.popupView && this.popupView.setValue(v); }, - _populate: function () { - var self = this, o = this.options, view = [], dict = {}; - this.empty(); - var pages = BI.result(o, "pages"); - var curr = BI.result(this, "currPage"); - var groups = BI.result(o, "groups"); - var first = BI.result(o, "first"); - var last = BI.result(o, "last"); - var prev = BI.result(o, "prev"); - var next = BI.result(o, "next"); + getValue: function () { + this._assertPopupView(); + return this.popupView ? this.popupView.getValue() : []; + }, - if (pages === false) { - groups = 0; - first = false; - last = false; - } else { - groups > pages && (groups = pages); - } + isViewVisible: function () { + return this.isEnabled() && this.switcher.isEnabled() && + (this.options.adapter ? BI.Maskers.isVisible(this.getName()) : (this.popupView && this.popupView.isVisible())); + }, - //计算当前组 - dict.index = Math.ceil((curr + ((groups > 1 && groups !== pages) ? 1 : 0)) / (groups === 0 ? 1 : groups)); + isExpanded: function () { + return this.isViewVisible(); + }, - //当前页非首页,则输出上一页 - if (((!o.dynamicShow && !o.dynamicShowPrevNext) || curr > 1) && prev !== false) { - if (BI.isKey(prev)) { - view.push({ - text: prev, - value: "prev", - disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) - }) - } else { - view.push(BI.extend({ - disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) - }, prev)); - } + showView: function () { + if (this.isEnabled() && this.switcher.isEnabled()) { + this._popupView(); } + }, - //当前组非首组,则输出首页 - if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (dict.index > 1 && groups !== 0)) && first) { - view.push({ - text: first, - value: "first", - disabled: !(dict.index > 1 && groups !== 0) - }); - if (dict.index > 1 && groups !== 0) { - view.push({ - type: "bi.label", - cls: "page-ellipsis", - text: "\u2026" - }); - } + hideView: function () { + this._hideView(); + }, + + getView: function () { + return this.popupView; + }, + + adjustView: function () { + this.isViewVisible() && BI.Maskers.show(this.getName()); + }, + + doBehavior: function () { + this._assertPopupView(); + this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments); + }, + + getAllLeaves: function () { + return this.popupView && this.popupView.getAllLeaves(); + }, + + getNodeById: function (id) { + if (this.switcher.attr("id") === id) { + return this.switcher; } + return this.popupView && this.popupView.getNodeById(id); + }, - //输出当前页组 - dict.poor = Math.floor((groups - 1) / 2); - dict.start = dict.index > 1 ? curr - dict.poor : 1; - dict.end = dict.index > 1 ? (function () { - var max = curr + (groups - dict.poor - 1); - return max > pages ? pages : max; - }()) : groups; - if (dict.end - dict.start < groups - 1) { //最后一组状态 - dict.start = dict.end - groups + 1; - } - var s = dict.start, e = dict.end; - if (first && last && (dict.index > 1 && groups !== 0) && (pages > groups && dict.end < pages && groups !== 0)) { - s++; - e--; - } - for (; s <= e; s++) { - if (s === curr) { - view.push({ - text: s, - value: s, - selected: true - }) - } else { - view.push({ - text: s, - value: s - }) - } + getNodeByValue: function (value) { + if (this.switcher.getValue() === value) { + return this.switcher; } + return this.popupView && this.popupView.getNodeByValue(value); + }, - //总页数大于连续分页数,且当前组最大页小于总页,输出尾页 - if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) { - if (pages > groups && dict.end < pages && groups !== 0) { - view.push({ - type: "bi.label", - cls: "page-ellipsis", - text: "\u2026" - }); + empty: function () { + this.popupView && this.popupView.empty(); + }, + + destroy: function () { + BI.Switcher.superclass.destroy.apply(this, arguments); + } +}); +BI.Switcher.EVENT_EXPAND = "EVENT_EXPAND"; +BI.Switcher.EVENT_COLLAPSE = "EVENT_COLLAPSE"; +BI.Switcher.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; +BI.Switcher.EVENT_CHANGE = "EVENT_CHANGE"; +BI.Switcher.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; + + +BI.Switcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; +BI.Switcher.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW"; +BI.Switcher.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW"; +BI.Switcher.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; + +$.shortcut("bi.switcher", BI.Switcher);/** + * Created by GUY on 2015/6/26. + */ + +BI.Tab = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.Tab.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-tab", + direction: "top",//top, bottom, left, right, custom + logic: { + dynamic: false + }, + defaultShowIndex: 0, + tab: false, + cardCreator: function (v) { + return BI.createWidget(); } - view.push({ - text: last, - value: "last", - disabled: !(pages > groups && dict.end < pages && groups !== 0) + }) + }, + + _init: function () { + BI.Tab.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isObject(o.tab)) { + this.tab = BI.createWidget(this.options.tab, {type: "bi.button_group"}); + this.tab.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }) } + this.cardMap = {}; + this.layout = BI.createWidget({ + type: "bi.card" + }); - //当前页不为尾页时,输出下一页 - dict.flow = !prev && groups === 0; - if (((!o.dynamicShow && !o.dynamicShowPrevNext) && next) || (curr !== pages && next || dict.flow)) { - view.push((function () { - if (BI.isKey(next)) { - if (pages === false) { - return {text: next, value: "next", disabled: o.hasNext(curr) === false} - } - return (dict.flow && curr === pages) - ? - {text: next, value: "next", disabled: true} - : - {text: next, value: "next", disabled: !(curr !== pages && next || dict.flow)}; - } else { - return BI.extend({ - disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow) - }, next); - } - }())); - } + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tab, this.layout) + })))); - this.button_group = BI.createWidget({ - type: "bi.button_group", - element: this, - items: BI.createItems(view, { - cls: "page-item", - height: 23, - hgap: 10 - }), - behaviors: o.behaviors, - layouts: o.layouts - }); - this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - if (self._lock === true) { - return; - } - self._lock = true; - self._debouce(); - if (type === BI.Events.CLICK) { - var v = self.button_group.getValue()[0]; - switch (v) { - case "first": - self.currPage = 1; - break; - case "last": - self.currPage = pages; - break; - case "prev": - self.currPage--; - break; - case "next": - self.currPage++; - break; - default: - self.currPage = v; - break; - } - o.jump.apply(self, [{ - pages: pages, - curr: self.currPage - }]); - self._populate(); - self.fireEvent(BI.Pager.EVENT_CHANGE, obj); + var listener = new BI.ShowListener({ + eventObj: this.tab, + cardLayout: this.layout, + cardCreator: function (v) { + var card = o.cardCreator.apply(self, arguments); + self.cardMap[v] = card; + return card; + }, + afterCardShow: function (v) { + self.curr = v; } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); - this.fireEvent(BI.Pager.EVENT_AFTER_POPULATE); + listener.on(BI.ShowListener.EVENT_CHANGE, function (value) { + self.fireEvent(BI.Tab.EVENT_CHANGE, value, self); + }); + if (o.defaultShowIndex !== false) { + this.setSelect(o.defaultShowIndex); + } }, - getCurrentPage: function () { - return this.currPage; + _assertCard: function (v) { + if (!this.layout.isCardExisted(v)) { + var card = this.options.cardCreator(v); + this.cardMap[v] = card; + this.layout.addCardByName(v, card); + } }, - setAllPages: function (pages) { - this.options.pages = pages; + setSelect: function (v) { + this.tab && this.tab.setValue(v); + this._assertCard(v); + this.layout.showCardByName(v); + if (this.curr !== v) { + this.curr = v; + } }, - hasPrev: function (v) { - v || (v = 1); - var o = this.options; - var pages = this.options.pages; - return pages === false ? o.hasPrev(v) : v > 1; + getSelect: function () { + return this.curr; }, - hasNext: function (v) { - v || (v = 1); - var o = this.options; - var pages = this.options.pages; - return pages === false ? o.hasNext(v) : v < pages; + getSelectedTab: function () { + return this.layout.getShowingCard(); + }, + + getTab: function (v) { + this._assertCard(v); + return this.layout.getCardByName(v); }, setValue: function (v) { - var o = this.options; - v = v | 0; - v = v < 1 ? 1 : v; - if (o.pages === false) { - var lastPage = BI.result(o, "lastPage"), firstPage = 1; - this.currPage = v > lastPage ? lastPage : ((firstPage = BI.result(o, "firstPage")), (v < firstPage ? firstPage : v)); - } else { - v = v > o.pages ? o.pages : v; - this.currPage = v; + var card = this.layout.getShowingCard(); + if (card) { + card.setValue(v); } - this._populate(); }, getValue: function () { - var val = this.button_group.getValue()[0]; - switch (val) { - case "prev": - return -1; - case "next": - return 1; - case "first": - return BI.MIN; - case "last": - return BI.MAX; - default : - return val; + var card = this.layout.getShowingCard(); + if (card) { + return card.getValue(); } - } -}); -BI.Pager.EVENT_CHANGE = "EVENT_CHANGE"; -BI.Pager.EVENT_AFTER_POPULATE = "EVENT_AFTER_POPULATE"; -$.shortcut("bi.pager", BI.Pager);/** - * 超链接 - * - * Created by GUY on 2015/9/9. - * @class BI.A - * @extends BI.Text - * @abstract - */ -BI.A = BI.inherit(BI.Text, { - _defaultConfig: function () { - var conf = BI.A.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-a display-block", - href: "", - target: "_blank", - el: null - }) - }, - _init: function () { - var o = this.options; - this.options.element = $(""); - BI.A.superclass._init.apply(this, arguments); - if (o.el) { - BI.createWidget(o.el, { - element: this - }); - } - } -}); - -$.shortcut("bi.a", BI.A);/** - * guy - * 加载条 - * @type {*|void|Object} - */ -BI.LoadingBar = BI.inherit(BI.Single, { - consts: { - loadedText: '加载更多', - endText: '无更多数据' - }, - _defaultConfig: function() { - var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments); - return BI.extend( conf, { - baseCls : (conf.baseCls ||"")+' bi-loading-bar', - height: 30, - handler: BI.emptyFn - }) - }, - _init : function() { - BI.LoadingBar.superclass._init.apply(this, arguments); - var self = this; - this.loaded = BI.createWidget({ - type: "bi.text_button", - cls: "loading-text", - text: this.consts.loadedText, - width: 120, - handler: this.options.handler - }) - this.loaded.on(BI.Controller.EVENT_CHANGE, function(type){ - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }) - - this.loading = BI.createWidget({ - type: "bi.layout", - height:this.options.height, - cls: "loading-background cursor-default" - }) - var loaded = BI.createWidget({ - type: "bi.center_adapt", - items: [this.loaded] - }) - var loading = BI.createWidget({ - type: "bi.center_adapt", - items: [this.loading] - }) - this.cardLayout = BI.createWidget({ - type: "bi.card", - element: this, - items: [{ - el: loaded, - cardName: "loaded" - }, { - el: loading, - cardName: "loading" - }] - }) - this.invisible(); - }, - - _reset: function(){ - this.visible(); - this.loaded.setText(this.consts.loadedText); - this.loaded.enable(); }, - setLoaded: function(){ - this._reset(); - this.cardLayout.showCardByName("loaded"); + populate: function () { + var card = this.layout.getShowingCard(); + if (card) { + return card.populate && card.populate.apply(card, arguments); + } }, - setEnd: function(){ - this.setLoaded(); - this.loaded.setText(this.consts.endText); - this.loaded.disable(); + empty: function () { + this.layout.deleteAllCard(); + this.cardMap = {}; }, - setLoading: function(){ - this._reset(); - this.cardLayout.showCardByName("loading"); + destroy: function () { + this.cardMap = {}; + BI.Tab.superclass.destroy.apply(this, arguments); } }); +BI.Tab.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.loading_bar", BI.LoadingBar);/** - * @class BI.IconButton - * @extends BI.BasicButton - * 图标的button +$.shortcut("bi.tab", BI.Tab);/** + * 表示当前对象 + * + * Created by GUY on 2015/9/7. + * @class BI.EL + * @extends BI.Widget */ -BI.IconButton = BI.inherit(BI.BasicButton, { +BI.EL = BI.inherit(BI.Widget, { _defaultConfig: function () { - var conf = BI.IconButton.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - tagName: "a", - baseCls: (conf.baseCls || "") + " bi-icon-button horizon-center display-block", - iconWidth: null, - iconHeight: null - }) + return BI.extend(BI.EL.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-el", + el: {}, + layout: {} + }); }, - _init: function () { - BI.IconButton.superclass._init.apply(this, arguments); - var o = this.options; - this.element.css({ - textAlign: 'center' - }); - this.icon = BI.createWidget({ - type: 'bi.icon', - width: o.iconWidth, - height: o.iconHeight + BI.EL.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.ele = BI.createWidget(o.el); + BI.createWidget(o.layout, { + type: "bi.adaptive", + element: this, + items: [this.ele] }); - if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) { - this.element.css("lineHeight", o.height + "px"); - BI.createWidget({ - type: "bi.default", - element: this, - items: [this.icon] - }) - } else { - BI.createWidget({ - element: this, - type: 'bi.center_adapt', - items: [this.icon] - }); - } + this.ele.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }) }, - doClick: function () { - BI.IconButton.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.IconButton.EVENT_CHANGE, this); - } + setValue: function (v) { + this.ele.setValue(v); + }, + + getValue: function () { + return this.ele.getValue(); + }, + + populate: function () { + this.ele.populate.apply(this, arguments); } }); -BI.IconButton.EVENT_CHANGE = "IconButton.EVENT_CHANGE"; -$.shortcut("bi.icon_button", BI.IconButton);/** - * 图片的button +$.shortcut('bi.el', BI.EL);/** + * 选色控件 * - * Created by GUY on 2016/1/27. - * @class BI.ImageButton - * @extends BI.BasicButton + * Created by GUY on 2015/11/16. + * @class BI.Farbtastic + * @extends BI.Widget */ -BI.ImageButton = BI.inherit(BI.BasicButton, { +BI.Farbtastic = BI.inherit(BI.Widget, { + _defaultConfig: function () { - var conf = BI.ImageButton.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - tagName: "a", - baseCls: (conf.baseCls || "") + " bi-image-button display-block", - src: "", - iconWidth: "100%", - iconHeight: "100%" + return BI.extend(BI.Farbtastic.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-farbtastic", + width: 195, + height: 195 }) }, _init: function () { - BI.ImageButton.superclass._init.apply(this, arguments); - var o = this.options; - this.image = BI.createWidget({ - type: "bi.img", - width: o.iconWidth, - height: o.iconHeight, - src: o.src - }); - if (BI.isNumber(o.iconWidth) || BI.isNumber(o.iconHeight)) { - BI.createWidget({ - type: "bi.center_adapt", - element: this, - items: [this.image] - }) - } else { - BI.createWidget({ - type: "bi.adaptive", - element: this, - items: [this.image], - scrollable: false - }) - } - }, - - setWidth: function (w) { - BI.ImageButton.superclass.setWidth.apply(this, arguments); - this.options.width = w; - }, - - setHeight: function (h) { - BI.ImageButton.superclass.setHeight.apply(this, arguments); - this.options.height = h; - }, + BI.Farbtastic.superclass._init.apply(this, arguments); + var self = this; + FR.$defaultImport('/com/fr/bi/web/js/third/farbtastic.js', 'js'); + FR.$defaultImport('/com/fr/bi/web/css/base/third/farbtastic/farbtastic.css', 'css'); - setImageWidth: function (w) { - this.image.setWidth(w); + this.farbtastic = $.farbtastic(this.element, function (v) { + self.fireEvent(BI.Farbtastic.EVENT_CHANGE, self.getValue(), self); + }); }, - setImageHeight: function (h) { - this.image.setHeight(h); + setValue: function (color) { + this.farbtastic.setColor(color); }, - getImageWidth: function () { - return this.image.element.width(); - }, + getValue: function () { + return this.farbtastic.color; + } +}); +BI.Farbtastic.EVENT_CHANGE = "Farbtastic.EVENT_CHANGE"; +$.shortcut("bi.farbtastic", BI.Farbtastic);(function (mod) { + mod(CodeMirror); +})(function (CodeMirror) { + var Pos = CodeMirror.Pos; - getImageHeight: function () { - return this.image.element.height(); - }, + function forEach(arr, f) { + for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); + } - setSrc: function (src) { - this.options.src = src; - this.image.setSrc(src); - }, + function arrayContains(arr, item) { + if (!Array.prototype.indexOf) { + var i = arr.length; + while (i--) { + if (arr[i] === item) { + return true; + } + } + return false; + } + return arr.indexOf(item) != -1; + } - getSrc: function () { - return this.image.getSrc(); - }, + function scriptHint(editor, keywords, getToken, options) { + // Find the token at the cursor + var cur = editor.getCursor(), token = getToken(editor, cur); + if (/\b(?:string)\b/.test(token.type)) { + return; + } + token.state = CodeMirror.innerMode(editor.getMode(), token.state).state; - doClick: function () { - BI.ImageButton.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.ImageButton.EVENT_CHANGE, this); + if (!/^[\w$_]*$/.test(token.string)) { + token = { + start: cur.ch, end: cur.ch, string: "", state: token.state, + type: token.string == "." ? "property" : null + }; + } else if (token.end > cur.ch) { + token.end = cur.ch; + token.string = token.string.slice(0, cur.ch - token.start); + } + + var tprop = token; + // If it is a property, find out what it is a property of. + while (tprop.type == "property") { + tprop = getToken(editor, Pos(cur.line, tprop.start)); + if (tprop.string != ".") return; + tprop = getToken(editor, Pos(cur.line, tprop.start)); + if (!context) var context = []; + context.push(tprop); } + return { + list: getCompletions(token, context, keywords, options), + from: Pos(cur.line, token.start), + to: Pos(cur.line, token.end) + }; } -}); -BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE"; -$.shortcut("bi.image_button", BI.ImageButton);(function ($) { - /** - * 文字类型的按钮 - * @class BI.Button - * @extends BI.BasicButton - * - * @cfg {JSON} options 配置属性 - * @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型,用不同颜色强调不同的场景 - */ - BI.Button = BI.inherit(BI.BasicButton, { - _const: { - minWidth: 90 - }, + function getFormulaKeywords() { + return FormulaCollections; + } - _defaultConfig: function () { - var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + ' bi-button', - shadow: true, - isShadowShowingOnSelected: true, - readonly: true, - iconClass: "", - level: 'common', - textAlign: "center", - whiteSpace: "nowrap", - forceCenter: false, - textWidth: null, - textHeight: null, - hgap: 10, - vgap: 0, - tgap: 0, - bgap: 0, - lgap: 0, - rgap: 0 - }) - }, + function formulaHint(editor, options) { + return scriptHint(editor, getFormulaKeywords(), + function (e, cur) { + return e.getTokenAt(cur); + }, + options); + }; + CodeMirror.registerHelper("hint", "formula", formulaHint); - _init: function () { - BI.Button.superclass._init.apply(this, arguments); - var o = this.options, self = this; - if (BI.isNumber(o.height)) { - this.element.css({height: o.height - 2, lineHeight: (o.height - 2) + 'px'}); - } - if (BI.isKey(o.iconClass)) { - this.icon = BI.createWidget({ - type: "bi.icon", - width: 18 - }); - this.text = BI.createWidget({ - type: "bi.label", - text: o.text, - value: o.value - }); - BI.createWidget({ - type: "bi.horizontal_auto", - cls: "button-" + o.level + " " + o.iconClass, - element: this, - hgap: o.hgap, - vgap: o.vgap, - tgap: o.tgap, - bgap: o.bgap, - lgap: o.lgap, - rgap: o.rgap, - items: [{ - type: "bi.horizontal", - items: [this.icon, this.text] - }] - }) - } else { - this.text = BI.createWidget({ - type: "bi.label", - cls: "button-" + o.level, - textAlign: o.textAlign, - whiteSpace: o.whiteSpace, - forceCenter: o.forceCenter, - textWidth: o.textWidth, - textHeight: o.textHeight, - hgap: o.hgap, - vgap: o.vgap, - tgap: o.tgap, - bgap: o.bgap, - lgap: o.lgap, - rgap: o.rgap, - element: this, - text: o.text, - value: o.value - }); + function getCompletions(token, context, keywords, options) { + var found = [], start = token.string; + if (!start) { + return found; + } + function maybeAdd(str) { + if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) { + found.push(str); } - this.element.css({"min-width": this._const.minWidth - 2 + "px"}); - }, + } - doClick: function () { - BI.Button.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.Button.EVENT_CHANGE, this); - } - }, + if (context && context.length) { + context.pop(); + } else { + forEach(keywords, maybeAdd); + } + return found; + } +});(function (mod) { + mod(CodeMirror); +})(function (CodeMirror) { + "use strict"; - setText: function (text) { - BI.Button.superclass.setText.apply(this, arguments); - this.text.setText(text); - }, + CodeMirror.defineMode('formula', function () { + function wordObj(words) { + var o = {}; + for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; + return o; + } - setValue: function (text) { - BI.Button.superclass.setValue.apply(this, arguments); - if (!this.isReadOnly()) { - this.text.setValue(text); + var atoms = wordObj(['false', 'true']); + var keywords = wordObj(FormulaCollections); + + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; } - }, + var ch = stream.next(); - setEnable: function (b) { - BI.Button.superclass.setEnable.apply(this, arguments); - this.text.setEnable(b); - this.icon && this.icon.setEnable(b); - }, + if (ch === '"' || ch === '\'') { + nextUntilUnescaped(stream, ch); + return "string"; + } + if (/[\[\],\(\)]/.test(ch)) { + return 'bracket'; + } - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + // richie:暂时不需要解析操作符号 + //if (/[+\-*\/=<>!&|]/.test(ch)) { + // return 'operator'; + //} + //if (/\d|\d./.test(ch)) { + // stream.eatWhile(/\d|\./); + // if (stream.eol() || !/\w/.test(stream.peek())) { + // return 'number'; + // } + //} - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); - }, + stream.eatWhile(/[\w-]/); + var word = stream.current(); + if (atoms.hasOwnProperty(word)) { + return "atom"; + } + if (keywords.hasOwnProperty(word)) { + return "keyword"; + } + return null; + } - destroy: function () { - BI.Button.superclass.destroy.apply(this, arguments); + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next === end && !escaped) { + return false; + } + escaped = !escaped && next === "\\"; + } + return escaped; } - }); - $.shortcut('bi.button', BI.Button); - BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; -})(jQuery);/** - * guy - * 可以点击的一行文字 - * @class BI.TextButton - * @extends BI.BasicButton - * 文字button - */ -BI.TextButton = BI.inherit(BI.BasicButton, { - _defaultConfig: function() { - var conf = BI.TextButton.superclass._defaultConfig.apply(this, arguments); - return BI.extend( conf, { - tagName: "a", - baseCls: (conf.baseCls || "") + " bi-text-button display-block", - textAlign: "center", - whiteSpace: "nowrap", - forceCenter: false, - textWidth: null, - textHeight: null, - hgap: 0, - lgap: 0, - rgap: 0, - text:"", - py: "" - }) - }, - - _init:function() { - BI.TextButton.superclass._init.apply(this, arguments); - var o = this.options; - this.text = BI.createWidget({ - type: "bi.label", - element: this, - textAlign: o.textAlign, - whiteSpace: o.whiteSpace, - textWidth: o.textWidth, - textHeight: o.textHeight, - forceCenter: o.forceCenter, - width: o.width, - height: o.height, - hgap: o.hgap, - lgap: o.lgap, - rgap: o.rgap, - text: o.text, - value: o.value, - py: o.py - }); - }, - doClick: function(){ - BI.TextButton.superclass.doClick.apply(this, arguments); - if(this.isValid()) { - this.fireEvent(BI.TextButton.EVENT_CHANGE, this.getValue(), this); + function tokenize(stream, state) { + return (state.tokens[0] || tokenBase)(stream, state); } - }, - - doRedMark: function(){ - this.text.doRedMark.apply(this.text, arguments); - }, - unRedMark: function(){ - this.text.unRedMark.apply(this.text, arguments); - }, - - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, + return { + startState: function () { + return {tokens: []}; + }, + token: function (stream, state) { + return tokenize(stream, state); + }, + fold: "brace" + }; + }); + CodeMirror.defineMIME("text/fx-formula", "formula"); +});// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); - }, +(function (mod) { + mod(CodeMirror); +})(function (CodeMirror) { + "use strict"; - setText: function(text){ - BI.TextButton.superclass.setText.apply(this, arguments); - text = BI.isArray(text) ? text.join(",") : text; - this.text.setText(text); - }, + var HINT_ELEMENT_CLASS = "CodeMirror-hint"; + var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active"; - setValue: function(text){ - BI.TextButton.superclass.setValue.apply(this, arguments); - if(!this.isReadOnly()) { - text = BI.isArray(text) ? text.join(",") : text; - this.text.setValue(text); - } - } -}); -BI.TextButton.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.text_button", BI.TextButton);/** - * guy - * 一个占位符和两个icon和一行数 组成的一行listitem - * - * Created by GUY on 2015/9/15. - * @class BI.BlankIconTextIconItem - * @extends BI.BasicButton - */ -BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, { - _const: { - commonWidth: 25 - }, + // This is the old interface, kept around for now to stay + // backwards-compatible. + CodeMirror.showHint = function (cm, getHints, options) { + if (!getHints) return cm.showHint(options); + if (options && options.async) getHints.async = true; + var newOpts = {hint: getHints}; + if (options) for (var prop in options) newOpts[prop] = options[prop]; + return cm.showHint(newOpts); + }; - _defaultConfig: function () { - var conf = BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-blank-icon-text-icon-item", - logic: { - dynamic: false - }, - iconCls1: "close-ha-font", - iconCls2: "close-ha-font", - blankWidth: 0, - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.BlankIconTextIconItem.superclass._init.apply(this, arguments); - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }) + CodeMirror.defineExtension("showHint", function (options) { + // We want a single cursor position. + if (this.listSelections().length > 1 || this.somethingSelected()) return; - var icon1 = BI.createWidget({ - type: "bi.center_adapt", - cls: o.iconCls1, - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }) - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: { - type: "bi.center_adapt", - cls: o.iconCls2, - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }, - top: 0, - bottom: 0, - right: 0 - }] - }) + if (this.state.completionActive) this.state.completionActive.close(); + var completion = this.state.completionActive = new Completion(this, options); + if (!completion.options.hint) return; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", { - type: "bi.layout", - width: o.blankWidth - }, icon1, this.text, { - type: "bi.layout", - width: c.commonWidth - }) - })))); - }, + CodeMirror.signal(this, "startCompletion", this); + completion.update(true); + }); - doClick: function () { - BI.BlankIconTextIconItem.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE, this.getValue(), this); - } - }, + function Completion(cm, options) { + this.cm = cm; + this.options = this.buildOptions(options); + this.widget = null; + this.debounce = 0; + this.tick = 0; + this.startPos = this.cm.getCursor(); + this.startLen = this.cm.getLine(this.startPos.line).length; - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + var self = this; + cm.on("cursorActivity", this.activityFunc = function () { + self.cursorActivity(); + }); + } - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, + var requestAnimationFrame = window.requestAnimationFrame || function (fn) { + return setTimeout(fn, 1000 / 60); + }; + var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, + Completion.prototype = { + close: function () { + if (!this.active()) return; + this.cm.state.completionActive = null; + this.tick = null; + this.cm.off("cursorActivity", this.activityFunc); - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); - }, + if (this.widget && this.data) CodeMirror.signal(this.data, "close"); + if (this.widget) this.widget.close(); + CodeMirror.signal(this.cm, "endCompletion", this.cm); + }, - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); - } - }, + active: function () { + return this.cm.state.completionActive == this; + }, - getValue: function () { - return this.text.getValue(); - }, + pick: function (data, i) { + var completion = data.list[i]; + if (completion.hint) completion.hint(this.cm, data, completion); + else { + this.cm.replaceRange(getText(completion), completion.from || data.from, + completion.to || data.to, "complete"); + var to = this.cm.getCursor(); + this.cm.markText(completion.from || data.from, to, {className: "#function", atomic: true}); + this.cm.replaceSelection("() "); + to = this.cm.getCursor(); + to.ch = to.ch - 2; + this.cm.setCursor(to); + this.cm.focus(); + } + CodeMirror.signal(data, "pick", completion); + this.close(); + }, - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + cursorActivity: function () { + if (this.debounce) { + cancelAnimationFrame(this.debounce); + this.debounce = 0; + } - getText: function () { - return this.text.getText(); - } -}); -BI.BlankIconTextIconItem.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.blank_icon_text_icon_item", BI.BlankIconTextIconItem);/** - * 带有一个占位 - * - * Created by GUY on 2015/9/11. - * @class BI.BlankIconTextItem - * @extends BI.BasicButton - */ -BI.BlankIconTextItem = BI.inherit(BI.BasicButton, { - _const: { - commonWidth: 25 - }, + var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line); + if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || + pos.ch < this.startPos.ch || this.cm.somethingSelected() || + (pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { + this.close(); + } else { + var self = this; + this.debounce = requestAnimationFrame(function () { + self.update(); + }); + if (this.widget) this.widget.disable(); + } + }, - _defaultConfig: function () { - var conf = BI.BlankIconTextItem.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item", - logic: { - dynamic: false - }, - cls: "close-ha-font", - blankWidth: 0, - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.BlankIconTextItem.superclass._init.apply(this, arguments); - var o = this.options, c = this._const; - var blank = BI.createWidget({ - type: "bi.layout", - width: o.blankWidth - }) - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }) - this.icon = BI.createWidget({ - type: "bi.center_adapt", - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }); + update: function (first) { + if (this.tick == null) return; + if (this.data) CodeMirror.signal(this.data, "update"); + if (!this.options.hint.async) { + this.finishUpdate(this.options.hint(this.cm, this.options), first); + } else { + var myTick = ++this.tick, self = this; + this.options.hint(this.cm, function (data) { + if (self.tick == myTick) self.finishUpdate(data, first); + }, this.options); + } + }, - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon, this.text) - })))); - }, + finishUpdate: function (data, first) { + this.data = data; - doClick: function () { - BI.BlankIconTextItem.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.BlankIconTextItem.EVENT_CHANGE, this.getValue(), this); - } - }, + var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle); + if (this.widget) this.widget.close(); + if (data && data.list.length) { + if (picked && data.list.length == 1) { + this.pick(data, 0); + } else { + this.widget = new Widget(this, data); + CodeMirror.signal(data, "shown"); + } + } + }, - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); + buildOptions: function (options) { + var editor = this.cm.options.hintOptions; + var out = {}; + for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; + if (editor) for (var prop in editor) + if (editor[prop] !== undefined) out[prop] = editor[prop]; + if (options) for (var prop in options) + if (options[prop] !== undefined) out[prop] = options[prop]; + return out; } - }, - - getValue: function () { - return this.text.getValue(); - }, - - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + }; - getText: function () { - return this.text.getText(); - }, + function getText(completion) { + if (typeof completion == "string") return completion; + else return completion.text; + } - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + function buildKeyMap(completion, handle) { + var baseMap = { + Up: function () { + handle.moveFocus(-1); + }, + Down: function () { + handle.moveFocus(1); + }, + PageUp: function () { + handle.moveFocus(-handle.menuSize() + 1, true); + }, + PageDown: function () { + handle.moveFocus(handle.menuSize() - 1, true); + }, + Home: function () { + handle.setFocus(0); + }, + End: function () { + handle.setFocus(handle.length - 1); + }, + Enter: handle.pick, + Tab: handle.pick, + Esc: handle.close + }; + var custom = completion.options.customKeys; + var ourMap = custom ? {} : baseMap; - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, + function addBinding(key, val) { + var bound; + if (typeof val != "string") + bound = function (cm) { + return val(cm, handle); + }; + // This mechanism is deprecated + else if (baseMap.hasOwnProperty(val)) + bound = baseMap[val]; + else + bound = val; + ourMap[key] = bound; + } - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, + if (custom) + for (var key in custom) if (custom.hasOwnProperty(key)) + addBinding(key, custom[key]); + var extra = completion.options.extraKeys; + if (extra) + for (var key in extra) if (extra.hasOwnProperty(key)) + addBinding(key, extra[key]); + return ourMap; + } - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); + function getHintElement(hintsElement, el) { + while (el && el != hintsElement) { + if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; + el = el.parentNode; + } } -}); -BI.BlankIconTextItem.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.blank_icon_text_item", BI.BlankIconTextItem);/** - * guy - * 两个icon和一行数 组成的一行listitem - * - * Created by GUY on 2015/9/9. - * @class BI.IconTextIconItem - * @extends BI.BasicButton - */ -BI.IconTextIconItem = BI.inherit(BI.BasicButton, { - _const: { - commonWidth: 25 - }, - _defaultConfig: function () { - var conf = BI.IconTextIconItem.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-icon-text-icon-item", - logic: { - dynamic: false - }, - iconCls1: "close-ha-font", - iconCls2: "close-ha-font", - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.IconTextIconItem.superclass._init.apply(this, arguments); - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }) + function Widget(completion, data) { + this.completion = completion; + this.data = data; + this.picked = false; + var widget = this, cm = completion.cm; - var icon1 = BI.createWidget({ - type: "bi.center_adapt", - cls: o.iconCls1, - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight + var hints = this.hints = document.createElement("ul"); + hints.className = "CodeMirror-hints"; + this.selectedHint = data.selectedHint || 0; + + var completions = data.list; + for (var i = 0; i < completions.length; ++i) { + var elt = hints.appendChild(document.createElement("li")), cur = completions[i]; + var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); + if (cur.className != null) className = cur.className + " " + className; + elt.className = className; + if (cur.render) cur.render(elt, data, cur); + else elt.appendChild(document.createTextNode(cur.displayText || getText(cur))); + elt.hintId = i; + } + + var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); + var left = pos.left, top = pos.bottom, below = true; + hints.style.left = left + "px"; + hints.style.top = top + "px"; + // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. + var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); + var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); + (completion.options.container || document.body).appendChild(hints); + var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; + if (overlapY > 0) { + var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); + if (curTop - height > 0) { // Fits above cursor + hints.style.top = (top = pos.top - height) + "px"; + below = false; + } else if (height > winH) { + hints.style.height = (winH - 5) + "px"; + hints.style.top = (top = pos.bottom - box.top) + "px"; + var cursor = cm.getCursor(); + if (data.from.ch != cursor.ch) { + pos = cm.cursorCoords(cursor); + hints.style.left = (left = pos.left) + "px"; + box = hints.getBoundingClientRect(); } - }] - }) - var blank = BI.createWidget({ - type: "bi.layout", - width: c.commonWidth - }) - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: { - type: "bi.center_adapt", - cls: o.iconCls2, - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }, - top: 0, - bottom: 0, - right: 0 - }] - }) + } + } + var overlapX = box.right - winW; + if (overlapX > 0) { + if (box.right - box.left > winW) { + hints.style.width = (winW - 5) + "px"; + overlapX -= (box.right - box.left) - winW; + } + hints.style.left = (left = pos.left - overlapX) + "px"; + } - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank) - })))); - }, + cm.addKeyMap(this.keyMap = buildKeyMap(completion, { + moveFocus: function (n, avoidWrap) { + widget.changeActive(widget.selectedHint + n, avoidWrap); + }, + setFocus: function (n) { + widget.changeActive(n); + }, + menuSize: function () { + return widget.screenAmount(); + }, + length: completions.length, + close: function () { + completion.close(); + }, + pick: function () { + widget.pick(); + }, + data: data + })); - doClick: function () { - BI.IconTextIconItem.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.IconTextIconItem.EVENT_CHANGE, this.getValue(), this); + if (completion.options.closeOnUnfocus) { + var closingOnBlur; + cm.on("blur", this.onBlur = function () { + closingOnBlur = setTimeout(function () { + completion.close(); + }, 100); + }); + cm.on("focus", this.onFocus = function () { + clearTimeout(closingOnBlur); + }); } - }, - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + var startScroll = cm.getScrollInfo(); + cm.on("scroll", this.onScroll = function () { + var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect(); + var newTop = top + startScroll.top - curScroll.top; + var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop); + if (!below) point += hints.offsetHeight; + if (point <= editor.top || point >= editor.bottom) return completion.close(); + hints.style.top = newTop + "px"; + hints.style.left = (left + startScroll.left - curScroll.left) + "px"; + }); - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, + CodeMirror.on(hints, "dblclick", function (e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) { + widget.changeActive(t.hintId); + widget.pick(); + } + }); - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, + CodeMirror.on(hints, "click", function (e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) { + widget.changeActive(t.hintId); + if (completion.options.completeOnSingleClick) widget.pick(); + } + }); - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); - }, + CodeMirror.on(hints, "mousedown", function () { + setTimeout(function () { + cm.focus(); + }, 20); + }); - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); - } - }, + CodeMirror.signal(data, "select", completions[0], hints.firstChild); + return true; + } - getValue: function () { - return this.text.getValue(); - }, + Widget.prototype = { + close: function () { + if (this.completion.widget != this) return; + this.completion.widget = null; + this.hints.parentNode.removeChild(this.hints); + this.completion.cm.removeKeyMap(this.keyMap); - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + var cm = this.completion.cm; + if (this.completion.options.closeOnUnfocus) { + cm.off("blur", this.onBlur); + cm.off("focus", this.onFocus); + } + cm.off("scroll", this.onScroll); + }, - getText: function () { - return this.text.getText(); - } -}); -BI.IconTextIconItem.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.icon_text_icon_item", BI.IconTextIconItem);/** - * guy - * - * Created by GUY on 2015/9/9. - * @class BI.IconTextItem - * @extends BI.BasicButton - */ -BI.IconTextItem = BI.inherit(BI.BasicButton, { - _const: { - commonWidth: 25 - }, + disable: function () { + this.completion.cm.removeKeyMap(this.keyMap); + var widget = this; + this.keyMap = { + Enter: function () { + widget.picked = true; + } + }; + this.completion.cm.addKeyMap(this.keyMap); + }, - _defaultConfig: function () { - var conf = BI.IconTextItem.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-icon-text-item", - direction: BI.Direction.Left, - logic: { - dynamic: false - }, - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.IconTextItem.superclass._init.apply(this, arguments); - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); - this.icon = BI.createWidget({ - type: "bi.center_adapt", - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }); + pick: function () { + this.completion.pick(this.data, this.selectedHint); + }, - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.icon, this.text) - })))); - }, + changeActive: function (i, avoidWrap) { + if (i >= this.data.list.length) + i = avoidWrap ? this.data.list.length - 1 : 0; + else if (i < 0) + i = avoidWrap ? 0 : this.data.list.length - 1; + if (this.selectedHint == i) return; + var node = this.hints.childNodes[this.selectedHint]; + node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); + node = this.hints.childNodes[this.selectedHint = i]; + node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; + if (node.offsetTop < this.hints.scrollTop) + this.hints.scrollTop = node.offsetTop - 3; + else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) + this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3; + CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); + }, - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); + screenAmount: function () { + return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; } - }, + }; - getValue: function () { - return this.text.getValue(); - }, + CodeMirror.registerHelper("hint", "auto", function (cm, options) { + var helpers = cm.getHelpers(cm.getCursor(), "hint"), words; + if (helpers.length) { + for (var i = 0; i < helpers.length; i++) { + var cur = helpers[i](cm, options); + if (cur && cur.list.length) return cur; + } + } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { + if (words) return CodeMirror.hint.fromList(cm, {words: words}); + } else if (CodeMirror.hint.anyword) { + return CodeMirror.hint.anyword(cm, options); + } + }); - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + CodeMirror.registerHelper("hint", "fromList", function (cm, options) { + var cur = cm.getCursor(), token = cm.getTokenAt(cur); + var found = []; + for (var i = 0; i < options.words.length; i++) { + var word = options.words[i]; + if (word.slice(0, token.string.length) == token.string) + found.push(word); + } - getText: function () { - return this.text.getText(); - }, + if (found.length) return { + list: found, + from: CodeMirror.Pos(cur.line, token.start), + to: CodeMirror.Pos(cur.line, token.end) + }; + }); - doClick: function () { - BI.IconTextItem.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.IconTextItem.EVENT_CHANGE, this.getValue(), this); - } - }, + CodeMirror.commands.autocomplete = CodeMirror.showHint; - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + var defaultOptions = { + hint: CodeMirror.hint.auto, + completeSingle: true, + alignWithWord: true, + closeCharacters: /[\s()\[\]{};:>,]/, + closeOnUnfocus: true, + completeOnSingleClick: true, + container: null, + customKeys: null, + extraKeys: null + }; - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, + CodeMirror.defineOption("hintOptions", null); +});// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, +// This is CodeMirror (http://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); - } -}); -BI.IconTextItem.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.icon_text_item", BI.IconTextItem);/** - * - * 图标的button - * - * Created by GUY on 2015/9/9. - * @class BI.TextIconItem - * @extends BI.BasicButton - */ -BI.TextIconItem = BI.inherit(BI.BasicButton, { - _const: { - commonWidth: 25 - }, +(function(mod) { + this.CodeMirror = mod(); +})(function() { + "use strict"; - _defaultConfig: function () { - var conf = BI.TextIconItem.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-text-icon-item", - logic: { - dynamic: false - }, - cls: "close-ha-font", - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.TextIconItem.superclass._init.apply(this, arguments); - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); - this.icon = BI.createWidget({ - type: "bi.center_adapt", - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }); + // BROWSER SNIFFING - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon) - })))); - }, + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. - doClick: function () { - BI.TextIconItem.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.TextIconItem.EVENT_CHANGE, this.getValue(), this); - } - }, + var gecko = /gecko\/\d/i.test(navigator.userAgent); + var ie_upto10 = /MSIE \d/.test(navigator.userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); + var ie = ie_upto10 || ie_11up; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); + var webkit = /WebKit\//.test(navigator.userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); + var chrome = /Chrome\//.test(navigator.userAgent); + var presto = /Opera\//.test(navigator.userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); + var phantom = /PhantomJS/.test(navigator.userAgent); - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); - } - }, + var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent); + var mac = ios || /Mac/.test(navigator.platform); + var windows = /win/i.test(navigator.platform); - getValue: function () { - return this.text.getValue(); - }, + var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) presto_version = Number(presto_version[1]); + if (presto_version && presto_version >= 15) { presto = false; webkit = true; } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || (ie && ie_version >= 9); - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + // Optimize some code when these features are not used. + var sawReadOnlySpans = false, sawCollapsedSpans = false; - getText: function () { - return this.text.getText(); - }, + // EDITOR CONSTRUCTOR - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, + function CodeMirror(place, options) { + if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + setGuttersForLineNumbers(options); - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); - } -}); -BI.TextIconItem.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.text_icon_item", BI.TextIconItem);/** - * guy - * 一个button和一行数 组成的一行listitem - * - * Created by GUY on 2015/9/9. - * @class BI.TextItem - * @extends BI.BasicButton - */ -BI.TextItem = BI.inherit(BI.BasicButton, { + var doc = options.value; + if (typeof doc == "string") doc = new Doc(doc, options.mode); + this.doc = doc; - _defaultConfig: function () { - var conf = BI.TextItem.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-text-item", - textAlign: "left", - whiteSpace: "nowrap", - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.TextItem.superclass._init.apply(this, arguments); - var o = this.options; - this.text = BI.createWidget({ - type: "bi.label", - element: this, - textAlign: o.textAlign, - whiteSpace: o.whiteSpace, - textHeight: o.whiteSpace == "nowrap" ? o.height : o.textHeight, - height: o.height, - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - py: o.py - }); - }, + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input); + display.wrapper.CodeMirror = this; + updateGutters(this); + themeChanged(this); + if (options.lineWrapping) + this.display.wrapper.className += " CodeMirror-wrap"; + if (options.autofocus && !mobile) display.input.focus(); + initScrollbars(this); - doClick: function () { - BI.TextItem.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.TextItem.EVENT_CHANGE, this.getValue(), this); - } - }, + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null, // Unfinished key sequence + specialChars: null + }; - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + var cm = this; - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20); - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, + registerEventHandlers(this); + ensureGlobalHandlers(); - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); - }, + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); - } - }, + if ((options.autofocus && !mobile) || cm.hasFocus()) + setTimeout(bind(onFocus, this), 20); + else + onBlur(this); - getValue: function () { - return this.text.getValue(); - }, + for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) + optionHandlers[opt](this, options[opt], Init); + maybeUpdateLineNumberWidth(this); + if (options.finishInit) options.finishInit(this); + for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + display.lineDiv.style.textRendering = "auto"; + } - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + // DISPLAY CONSTRUCTOR - getText: function () { - return this.text.getText(); + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = elt("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (!webkit && !(gecko && mobile)) d.scroller.draggable = true; + + if (place) { + if (place.appendChild) place.appendChild(d.wrapper); + else place(d.wrapper); } -}); -BI.TextItem.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.text_item", BI.TextItem);/** - * guy - * Created by GUY on 2015/9/9. - * @class BI.IconTextIconNode - * @extends BI.NodeButton - */ -BI.IconTextIconNode = BI.inherit(BI.NodeButton, { - _const: { - commonWidth: 25 - }, - _defaultConfig: function () { - var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node", - logic: { - dynamic: false - }, - iconCls1: "close-ha-font", - iconCls2: "close-ha-font", - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.IconTextIconNode.superclass._init.apply(this, arguments); - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }) + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; - var icon1 = BI.createWidget({ - type: "bi.center_adapt", - cls: o.iconCls1, - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }) - var blank = BI.createWidget({ - type: "bi.layout", - width: c.commonWidth - }) - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: { - type: "bi.center_adapt", - cls: o.iconCls2, - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }, - top: 0, - bottom: 0, - right: 0 - }] - }) + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank) - })))); - }, + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; - doClick: function () { - BI.IconTextIconNode.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.IconTextIconNode.EVENT_CHANGE, this.getValue(), this); - } - }, + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); - } - }, + // True when shift is held down. + d.shift = false; - getValue: function () { - return this.text.getValue(); - }, + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + d.activeTouch = null; - getText: function () { - return this.text.getText(); - } -}); -BI.IconTextIconNode.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.icon_text_icon_node", BI.IconTextIconNode);/** - * guy - * Created by GUY on 2015/9/9. - * @class BI.IconTextNode - * @extends BI.NodeButton - */ -BI.IconTextNode = BI.inherit(BI.NodeButton, { - _const: { - commonWidth: 25 - }, + input.init(d); + } - _defaultConfig: function () { - var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-icon-text-node", - logic: { - dynamic: false - }, - cls: "close-ha-font", - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.IconTextNode.superclass._init.apply(this, arguments); - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }) - this.icon = BI.createWidget({ - type: "bi.center_adapt", - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }) + // STATE UPDATES - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon, this.text) - })))); - }, + // Used to get the editor into a consistent state again when options change. - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); - } - }, + function loadMode(cm) { + cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } - getValue: function () { - return this.text.getValue(); - }, + function resetModeState(cm) { + cm.doc.iter(function(line) { + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + }); + cm.doc.frontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) regChange(cm); + } - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function(){updateScrollbars(cm);}, 100); + } - getText: function () { - return this.text.getText(); - }, + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function(line) { + if (lineIsHidden(cm.doc, line)) return 0; - doClick: function () { - BI.IconTextNode.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.IconTextNode.EVENT_CHANGE, this.getValue(), this); - } - }, + var widgetsHeight = 0; + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; + } - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + if (wrapping) + return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; + else + return widgetsHeight + th; + }; + } - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - } -}); -BI.IconTextNode.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.icon_text_node", BI.IconTextNode);/** - * Created by GUY on 2015/9/9. - * @class BI.TextIconNode - * @extends BI.NodeButton - */ -BI.TextIconNode = BI.inherit(BI.NodeButton, { - _const: { - commonWidth: 25 - }, + function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm); + doc.iter(function(line) { + var estHeight = est(line); + if (estHeight != line.height) updateLineHeight(line, estHeight); + }); + } - _defaultConfig: function () { - var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-text-icon-node", - logic: { - dynamic: false - }, - cls: "close-ha-font", - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.TextIconNode.superclass._init.apply(this, arguments); - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }) - this.icon = BI.createWidget({ - type: "bi.center_adapt", - width: c.commonWidth, - items: [{ - el: { - type: "bi.icon", - width: o.iconWidth, - height: o.iconHeight - } - }] - }); - - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon) - })))); - }, - - doClick: function () { - BI.TextIconNode.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.TextIconNode.EVENT_CHANGE, this.getValue(), this); - } - }, + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); - } - }, + function guttersChanged(cm) { + updateGutters(cm); + regChange(cm); + setTimeout(function(){alignHorizontally(cm);}, 20); + } - getValue: function () { - return this.text.getValue(); - }, + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function updateGutters(cm) { + var gutters = cm.display.gutters, specs = cm.options.gutters; + removeChildren(gutters); + for (var i = 0; i < specs.length; ++i) { + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = i ? "" : "none"; + updateGutterSpace(cm); + } - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth; + cm.display.sizer.style.marginLeft = width + "px"; + } - getText: function () { - return this.text.getText(); - }, + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) return 0; + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found = merged.find(0, true); + len -= cur.text.length - found.from.ch; + cur = found.to.line; + len += cur.text.length - found.to.ch; + } + return len; + } - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function(line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); + // Make sure the gutters options contains the element + // "CodeMirror-linenumbers" when the lineNumbers option is true. + function setGuttersForLineNumbers(options) { + var found = indexOf(options.gutters, "CodeMirror-linenumbers"); + if (found == -1 && options.lineNumbers) { + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); + } else if (found > -1 && !options.lineNumbers) { + options.gutters = options.gutters.slice(0); + options.gutters.splice(found, 1); } -}); -BI.TextIconNode.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.text_icon_node", BI.TextIconNode);/** - * guy - * - * Created by GUY on 2015/9/9. - * @class BI.TextNode - * @extends BI.NodeButton - */ -BI.TextNode = BI.inherit(BI.NodeButton, { + } - _defaultConfig: function () { - var conf = BI.TextNode.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-text-node", - textAlign: "left", - whiteSpace: "nowrap", - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.TextNode.superclass._init.apply(this, arguments); - var o = this.options; - this.text = BI.createWidget({ - type: "bi.label", - element: this, - textAlign: o.textAlign, - whiteSpace: o.whiteSpace, - textHeight: o.whiteSpace == "nowrap" ? o.height : o.textHeight, - height: o.height, - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - py: o.py - }); - }, + // SCROLLBARS - doClick: function () { - BI.TextNode.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.TextNode.EVENT_CHANGE, this.getValue(), this); - } - }, + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + }; + } - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); - }, + function NativeScrollbars(place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + place(vert); place(horiz); - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); - }, + on(vert, "scroll", function() { + if (vert.clientHeight) scroll(vert.scrollTop, "vertical"); + }); + on(horiz, "scroll", function() { + if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); + }); - setValue: function () { - if (!this.isReadOnly()) { - this.text.setValue.apply(this.text, arguments); - } - }, + this.checkedOverlay = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; + } - getValue: function () { - return this.text.getValue(); - }, + NativeScrollbars.prototype = copyObj({ + update: function(measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; - setText: function () { - this.text.setText.apply(this.text, arguments); - }, + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } - getText: function () { - return this.text.getText(); - } -}); -BI.TextNode.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.text_node", BI.TextNode);/** - * - * Created by GUY on 2016/1/15. - * @class BI.CodeEditor - * @extends BI.Single - */ -BI.CodeEditor = BI.inherit(BI.Single, { - _defaultConfig: function () { - return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), { - baseCls: 'bi-code-editor', - value: '', - watermark: "" - }); - }, - _init: function () { - BI.CodeEditor.superclass._init.apply(this, arguments); - var o = this.options, self = this; - this.editor = CodeMirror(this.element[0], { - textWrapping: true, - lineWrapping: true, - lineNumbers: false - }); - this.editor.on("change", function (cm, change) { - BI.nextTick(function () { - self.fireEvent(BI.CodeEditor.EVENT_CHANGE) - }); - }); + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = + (measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } - this.editor.on("focus", function () { - watermark.setVisible(false); - self.fireEvent(BI.CodeEditor.EVENT_FOCUS); - }); + if (!this.checkedOverlay && measure.clientHeight > 0) { + if (sWidth == 0) this.overlayHack(); + this.checkedOverlay = true; + } - this.editor.on("blur", function () { - watermark.setVisible(BI.isEmptyString(self.getValue())); - self.fireEvent(BI.CodeEditor.EVENT_BLUR); - }); + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}; + }, + setScrollLeft: function(pos) { + if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos; + }, + setScrollTop: function(pos) { + if (this.vert.scrollTop != pos) this.vert.scrollTop = pos; + }, + overlayHack: function() { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.minHeight = this.vert.style.minWidth = w; + var self = this; + var barMouseDown = function(e) { + if (e_target(e) != self.vert && e_target(e) != self.horiz) + operation(self.cm, onMouseDown)(e); + }; + on(this.vert, "mousedown", barMouseDown); + on(this.horiz, "mousedown", barMouseDown); + }, + clear: function() { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + } + }, NativeScrollbars.prototype); - // this.editor.on("blur", function () { - // self.editor.execCommand("goLineEnd"); - // }); + function NullScrollbars() {} - //水印 - var watermark = BI.createWidget({ - type: "bi.label", - text: o.watermark, - cls: "bi-water-mark", - whiteSpace: "nowrap", - textAlign: "left" - }); - watermark.element.bind( - "mousedown", function (e) { - self.insertString(""); - self.editor.focus(); - e.stopEvent(); - } - ); - watermark.element.bind("click", function (e) { - self.editor.focus(); - e.stopEvent(); - }); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: watermark, - top: 0, - left: 5 - }] - }); + NullScrollbars.prototype = copyObj({ + update: function() { return {bottom: 0, right: 0}; }, + setScrollLeft: function() {}, + setScrollTop: function() {}, + clear: function() {} + }, NullScrollbars.prototype); - if (BI.isKey(o.value)) { - BI.nextTick(function () { - self.setValue(o.value); - }); - } - }, + CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; - setEnable: function (b) { - BI.CodeEditor.superclass.setEnable.apply(this, arguments); - this.editor.setOption("readOnly", b === true ? false : "nocursor") - }, + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) + rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } - insertParam: function(param){ - var from = this.editor.getCursor(); - this.editor.replaceSelection(param); - var to = this.editor.getCursor(); - this.editor.markText(from, to, {className: 'param', atomic: true}); - this.editor.replaceSelection(" "); - this.editor.focus(); - }, + cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function() { + if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0); + }); + node.setAttribute("cm-not-content", "true"); + }, function(pos, axis) { + if (axis == "horizontal") setScrollLeft(cm, pos); + else setScrollTop(cm, pos); + }, cm); + if (cm.display.scrollbars.addClass) + addClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } - insertString: function(str){ - this.editor.replaceSelection(str); - this.editor.focus(); - }, + function updateScrollbars(cm, measure) { + if (!measure) measure = measureForScrollbars(cm); + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + updateHeightsInViewport(cm); + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; + } + } - getValue: function () { - return this.editor.getValue("\n", function (line) { - var rawText = line.text, value = line.text, num = 0; - value.text = rawText; - _.forEach(line.markedSpans, function (i, ms) { - switch (i.marker.className) { - case "param": - var fieldNameLength = i.to - i.from; - value = value.substr(0, i.from + num) + "$\{" + value.substr(i.from + num, fieldNameLength) + "\}" + value.substr(i.to + num, value.length); - num += fieldNameLength + 3; - break; - } - }); - return value; - }); - }, + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); - _analyzeContent: function (v) { - var regx = /\$[\{][^\}]*[\}]|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)|\n/g; - return v.match(regx); - }, + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; - setValue: function (v) { - var self = this, result; - this.refresh(); - self.editor.setValue(""); - result = this._analyzeContent(v || ""); - BI.each(result, function (i, item) { - var fieldRegx = /\$[\{][^\}]*[\}]/; - var str = item.match(fieldRegx); - if (BI.isNotEmptyArray(str)) { - self.insertParam(str[0].substring(2, item.length - 1)); - } else { - self.insertString(item); - } - }) - }, + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else d.scrollbarFiller.style.display = ""; + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else d.gutterFiller.style.display = ""; + } - refresh: function(){ - var self = this; - BI.nextTick(function () { - self.editor.refresh(); - }); + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } } -}); -BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS"; -$.shortcut("bi.code_editor", BI.CodeEditor);/** - * Created by GUY on 2015/4/15. - * @class BI.Editor - * @extends BI.Single - */ -BI.Editor = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.Editor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: "bi-editor", - hgap: 4, - vgap: 2, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0, - tipType: "warning", - inputType: "text", - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn, - mouseOut: false, - allowBlank: false, - watermark: "", - errorText: "" - }) - }, - - _init: function () { - BI.Editor.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.editor = this.addWidget(BI.createWidget({ - type: "bi.input", - element: "", - watermark: o.watermark, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker, - mouseOut: o.mouseOut, - allowBlank: o.allowBlank - })); - this.editor.element.css({ - "width": "100%", - "height": "100%", - "border": "none", - "outline": "none", - "padding": "0", - "margin": "0" - }); - if (BI.isKey(this.options.watermark)) { - this.watermark = BI.createWidget({ - type: "bi.label", - cls: "bi-water-mark", - text: this.options.watermark, - forceCenter: true, - whiteSpace: "nowrap", - textAlign: "left" - }); - this.watermark.element.bind({ - mousedown: function (e) { - if (self.isEnabled()) { - self.editor.isEditing() || self.editor.focus(); - } else { - self.editor.isEditing() && self.editor.blur(); - } - e.stopEvent(); - } - }); - this.watermark.element.bind("click", function (e) { - if (self.isEnabled()) { - self.editor.isEditing() || self.editor.focus(); - } else { - self.editor.isEditing() && self.editor.blur(); - } - e.stopEvent(); - }); - this.watermark.element.css({ - position: "absolute", - left: "3px", - right: "3px", - top: "0px", - bottom: "0px" - }); - } - var items = [{ - el: { - type: "bi.default", - items: this.watermark ? [this.editor, this.watermark] : [this.editor] - }, - left: o.hgap + o.lgap, - right: o.hgap + o.rgap, - top: o.vgap + o.tgap, - bottom: o.vgap + o.bgap - }]; + return {from: from, to: Math.max(to, from + 1)}; + } - BI.createWidget({ - type: "bi.absolute", - element: this, - items: items - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.editor.on(BI.Input.EVENT_FOCUS, function () { - self._checkError(); - self.element.addClass("bi-editor-focus"); - self.fireEvent(BI.Editor.EVENT_FOCUS, arguments); - }); - this.editor.on(BI.Input.EVENT_BLUR, function () { - self.setErrorVisible(false); - self.element.removeClass("bi-editor-focus"); - self.fireEvent(BI.Editor.EVENT_BLUR, arguments); - }); - this.editor.on(BI.Input.EVENT_CLICK, function () { - self.fireEvent(BI.Editor.EVENT_CLICK, arguments); - }); - this.editor.on(BI.Input.EVENT_CHANGE, function () { - self.fireEvent(BI.Editor.EVENT_CHANGE, arguments); - }); - this.editor.on(BI.Input.EVENT_KEY_DOWN, function (v) { - self.fireEvent(BI.Editor.EVENT_KEY_DOWN, arguments); - }); - this.editor.on(BI.Input.EVENT_QUICK_DOWN, function (v) { - self.watermark && self.watermark.invisible(); - }); + // LINE NUMBERS - this.editor.on(BI.Input.EVENT_VALID, function () { - self._checkWaterMark(); - self.setErrorVisible(false); - self.fireEvent(BI.Editor.EVENT_VALID, arguments); - }); - this.editor.on(BI.Input.EVENT_ERROR, function () { - self._checkWaterMark(); - self.fireEvent(BI.Editor.EVENT_ERROR, arguments); - self.setErrorVisible(self.isEditing()); - }); - this.editor.on(BI.Input.EVENT_RESTRICT, function () { - self._checkWaterMark(); - var tip = self.setErrorVisible(true); - tip && tip.element.fadeOut(100, function () { - tip.element.fadeIn(100); - }); - self.fireEvent(BI.Editor.EVENT_RESTRICT, arguments); - }); - this.editor.on(BI.Input.EVENT_EMPTY, function () { - self._checkWaterMark(); - self.fireEvent(BI.Editor.EVENT_EMPTY, arguments); - }); - this.editor.on(BI.Input.EVENT_ENTER, function () { - self.fireEvent(BI.Editor.EVENT_ENTER, arguments); - }); - this.editor.on(BI.Input.EVENT_SPACE, function () { - self.fireEvent(BI.Editor.EVENT_SPACE, arguments); - }); - this.editor.on(BI.Input.EVENT_BACKSPACE, function () { - self.fireEvent(BI.Editor.EVENT_BACKSPACE, arguments); - }); - this.editor.on(BI.Input.EVENT_REMOVE, function () { - self.fireEvent(BI.Editor.EVENT_REMOVE, arguments); - }); - this.editor.on(BI.Input.EVENT_START, function () { - self.fireEvent(BI.Editor.EVENT_START, arguments); - }); - this.editor.on(BI.Input.EVENT_PAUSE, function () { - self.fireEvent(BI.Editor.EVENT_PAUSE, arguments); - }); - this.editor.on(BI.Input.EVENT_STOP, function () { - self.fireEvent(BI.Editor.EVENT_STOP, arguments); - }); - this.editor.on(BI.Input.EVENT_CONFIRM, function () { - self.fireEvent(BI.Editor.EVENT_CONFIRM, arguments); - }); - this.element.click(function (e) { - e.stopPropagation(); - return false; - }); - if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) { - this.setValue(this.options.value); - } else { - this._checkWaterMark(); - } - }, + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) if (!view[i].hidden) { + if (cm.options.fixedGutter && view[i].gutter) + view[i].gutter.style.left = left; + var align = view[i].alignable; + if (align) for (var j = 0; j < align.length; j++) + align[j].style.left = left; + } + if (cm.options.fixedGutter) + display.gutters.style.left = (comp + gutterW) + "px"; + } - _checkToolTip: function () { - var o = this.options; - var errorText = o.errorText; - if (BI.isFunction(errorText)) { - errorText = errorText(this.editor.getValue()); - } - if (BI.isKey(errorText)) { - if (!this.isEnabled() || this.isValid() || (BI.Bubbles.has(this.getName()) && BI.Bubbles.get(this.getName()).isVisible())) { - this.setTitle(""); - } else { - this.setTitle(errorText); - } - } - }, + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) return false; + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm); + return true; + } + return false; + } - _checkError: function () { - this.setErrorVisible(this.isEnabled() && !this.isValid()); - this._checkToolTip(); - }, + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } - _checkWaterMark: function () { - var o = this.options; - if (!this.disabledWarterMark && this.editor.getValue() === "" && BI.isKey(o.watermark)) { - this.watermark && this.watermark.visible(); - } else { - this.watermark && this.watermark.invisible(); - } - }, + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; + } - setErrorText: function (text) { - this.options.errorText = text; - }, + // DISPLAY DRAWING - getErrorText: function () { - return this.options.errorText; - }, + function DisplayUpdate(cm, viewport, force) { + var display = cm.display; - setErrorVisible: function (b) { - var o = this.options; - var errorText = o.errorText; - if (BI.isFunction(errorText)) { - errorText = errorText(this.editor.getValue()); - } - if (!this.disabledError && BI.isKey(errorText)) { - BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this); - this._checkToolTip(); - return BI.Bubbles.get(this.getName()); - } - }, + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + } - disableError: function () { - this.disabledError = true; - this._checkError(); - }, + DisplayUpdate.prototype.signal = function(emitter, type) { + if (hasHandler(emitter, type)) + this.events.push(arguments); + }; + DisplayUpdate.prototype.finish = function() { + for (var i = 0; i < this.events.length; i++) + signal.apply(null, this.events[i]); + }; - enableError: function () { - this.disabledError = false; - this._checkError(); - }, + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } - disableWarterMark: function () { - this.disabledWarterMark = true; - this._checkWaterMark(); - }, + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc; - enableWarterMark: function () { - this.disabledWarterMark = false; - this._checkWaterMark(); - }, + if (update.editorIsHidden) { + resetView(cm); + return false; + } - focus: function () { - this.element.addClass("text-editor-focus"); - this.editor.focus(); - }, + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + return false; - blur: function () { - this.element.removeClass("text-editor-focus"); - this.editor.blur(); - }, + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } - selectAll: function () { - this.editor.selectAll(); - }, + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); + if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } - onKeyDown: function (k) { - this.editor.onKeyDown(k); - }, + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); - setValue: function (v) { - BI.Editor.superclass.setValue.apply(this, arguments); - this.editor.setValue(v); - this._checkError(); - this._checkWaterMark(); - }, + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; - getLastValidValue: function () { - return BI.trim(this.editor.getLastValidValue()); - }, + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + return false; - resetLastValidValue: function () { - this.editor.resetLastValidValue(); - }, + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var focused = activeElt(); + if (toUpdate > 4) display.lineDiv.style.display = "none"; + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) display.lineDiv.style.display = ""; + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); - getValue: function () { - if (!this.isValid()) { - return BI.trim(this.editor.getLastValidValue()); - } - return BI.trim(this.editor.getValue()); - }, + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = 0; - setValid: function (b) { - BI.Editor.superclass.setValid.apply(this, arguments); - this.editor.setValid(b); - }, + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } - isEditing: function () { - return this.editor.isEditing(); - }, + display.updateLineNumbers = null; - isValid: function () { - return this.editor.isValid(); - }, + return true; + } - setEnable: function (b) { - BI.Editor.superclass.setEnable.apply(this, arguments); - this.editor && this.editor.setEnable(b); - this.watermark && this.watermark.setEnable(b); + function postUpdateDisplay(cm, update) { + var viewport = update.viewport; + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + break; + } + if (!updateDisplayIfNeeded(cm, update)) break; + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + setDocumentHeight(cm, barMeasure); + updateScrollbars(cm, barMeasure); } -}); -BI.Editor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.Editor.EVENT_FOCUS = "EVENT_FOCUS"; -BI.Editor.EVENT_BLUR = "EVENT_BLUR"; -BI.Editor.EVENT_CLICK = "EVENT_CLICK"; -BI.Editor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.Editor.EVENT_SPACE = "EVENT_SPACE"; -BI.Editor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; -BI.Editor.EVENT_START = "EVENT_START"; -BI.Editor.EVENT_PAUSE = "EVENT_PAUSE"; -BI.Editor.EVENT_STOP = "EVENT_STOP"; -BI.Editor.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.Editor.EVENT_VALID = "EVENT_VALID"; -BI.Editor.EVENT_ERROR = "EVENT_ERROR"; -BI.Editor.EVENT_ENTER = "EVENT_ENTER"; -BI.Editor.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.Editor.EVENT_REMOVE = "EVENT_REMOVE"; -BI.Editor.EVENT_EMPTY = "EVENT_EMPTY"; + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; + } + } -$.shortcut("bi.editor", BI.Editor);/** - * 多文件 - * - * Created by GUY on 2016/4/13. - * @class BI.MultifileEditor - * @extends BI.Single - * @abstract - */ -BI.MultifileEditor = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.MultifileEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-multifile-editor", - multiple: false, - maxSize: 1024 * 1024, - accept: "", - url: "" - }) - }, + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + setDocumentHeight(cm, barMeasure); + updateScrollbars(cm, barMeasure); + update.finish(); + } + } - _init: function () { - var self = this, o = this.options; - BI.MultifileEditor.superclass._init.apply(this, arguments); - this.file = BI.createWidget({ - type: "bi.file", - cls: "multifile-editor", - width: "100%", - height: "100%", - name: o.name, - url: o.url, - multiple: o.multiple, - accept: o.accept, - maxSize: o.maxSize - }); - this.file.on(BI.File.EVENT_CHANGE, function () { - self.fireEvent(BI.MultifileEditor.EVENT_CHANGE, arguments); - }); - this.file.on(BI.File.EVENT_UPLOADSTART, function () { - self.fireEvent(BI.MultifileEditor.EVENT_UPLOADSTART, arguments); - }); - this.file.on(BI.File.EVENT_ERROR, function () { - self.fireEvent(BI.MultifileEditor.EVENT_ERROR, arguments); - }); - this.file.on(BI.File.EVENT_PROGRESS, function () { - self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS, arguments); - }); - this.file.on(BI.File.EVENT_UPLOADED, function () { - self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED, arguments); - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: { - type: "bi.adaptive", - scrollable: false, - items: [this.file] - }, - top: 0, - right: 0, - left: 0, - bottom: 0 - }] - }); - }, + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + var total = measure.docHeight + cm.display.barHeight; + cm.display.heightForcer.style.top = total + "px"; + cm.display.gutters.style.height = Math.max(total + scrollGap(cm), measure.clientHeight) + "px"; + } - select: function () { - this.file.select(); - }, + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], height; + if (cur.hidden) continue; + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + } + var diff = cur.line.height - height; + if (height < 2) height = textHeight(display); + if (diff > .001 || diff < -.001) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) for (var j = 0; j < cur.rest.length; j++) + updateWidgetHeight(cur.rest[j]); + } + } + } - getValue: function () { - return this.file.getValue(); - }, + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) + line.widgets[i].height = line.widgets[i].node.offsetHeight; + } - upload: function () { - this.file.upload(); - }, + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; + width[cm.options.gutters[i]] = n.clientWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth}; + } - reset: function () { - this.file.reset(); - }, + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, cur = container.firstChild; - setEnable: function (enable) { - BI.MultiFile.superclass.setEnable.apply(this, arguments); - this.file.setEnable(enable); + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + node.style.display = "none"; + else + node.parentNode.removeChild(node); + return next; } -}); -BI.MultifileEditor.EVENT_CHANGE = "MultifileEditor.EVENT_CHANGE"; -BI.MultifileEditor.EVENT_UPLOADSTART = "MultifileEditor.EVENT_UPLOADSTART"; -BI.MultifileEditor.EVENT_ERROR = "MultifileEditor.EVENT_ERROR"; -BI.MultifileEditor.EVENT_PROGRESS = "MultifileEditor.EVENT_PROGRESS"; -BI.MultifileEditor.EVENT_UPLOADED = "MultifileEditor.EVENT_UPLOADED"; -$.shortcut("bi.multifile_editor", BI.MultifileEditor);/** - * - * Created by GUY on 2016/1/18. - * @class BI.TextAreaEditor - * @extends BI.Single - */ -BI.TextAreaEditor = BI.inherit(BI.Single, { - _defaultConfig: function () { - return $.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(), { - baseCls: 'bi-textarea-editor', - value: '' - }); - }, - _init: function () { - BI.TextAreaEditor.superclass._init.apply(this, arguments); - var o = this.options, self = this; - this.content = BI.createWidget({ - type: "bi.layout", - tagName: "textarea", - width: "100%", - height: "100%", - cls: "textarea-editor-content display-block" - }); - this.content.element.css({"resize": "none"}); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: { - type: "bi.adaptive", - items: [this.content] - }, - left: 0, - right: 3, - top: 0, - bottom: 5 - }] - }); - this.content.element.focus(function () { - self.content.element.addClass("textarea-editor-focus"); - self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS); - }); - this.content.element.blur(function () { - self.content.element.removeClass("textarea-editor-focus"); - self.fireEvent(BI.TextAreaEditor.EVENT_BLUR); - }); - if (BI.isKey(o.value)) { - self.setValue(o.value); + var view = display.view, lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) { + } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { // Already drawn + while (cur != lineView.node) cur = rm(cur); + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; + updateLineForChanges(cm, lineView, lineN, dims); } - }, - - focus: function () { - this.content.element.addClass("textarea-editor-focus"); - this.content.element.focus(); - }, + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) cur = rm(cur); + } - blur: function () { - this.content.element.removeClass("textarea-editor-focus"); - this.content.element.blur(); - }, + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") updateLineText(cm, lineView); + else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); + else if (type == "class") updateLineClasses(lineView); + else if (type == "widget") updateLineWidgets(cm, lineView, dims); + } + lineView.changes = null; + } - getValue: function () { - return this.content.element.val(); - }, + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) + lineView.text.parentNode.replaceChild(lineView.node, lineView.text); + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) lineView.node.style.zIndex = 2; + } + return lineView.node; + } - setValue: function (value) { - this.content.element.val(value); - }, + function updateLineBackground(lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) cls += " CodeMirror-linebackground"; + if (lineView.background) { + if (cls) lineView.background.className = cls; + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + } + } - setStyle: function (style) { - this.style = style; - this.element.css(style); - this.content.element.css(style) - }, + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built; + } + return buildLineContent(cm, lineView); + } - getStyle: function () { - return this.style; - }, + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) lineView.node = built.pre; + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(lineView); + } else if (cls) { + lineView.text.className = cls; + } + } - setValid: function (b) { - BI.TextAreaEditor.superclass.setValid.apply(this, arguments); - this.content.setValid(b); - }, + function updateLineClasses(lineView) { + updateLineBackground(lineView); + if (lineView.line.wrapClass) + ensureLineWrapped(lineView).className = lineView.line.wrapClass; + else if (lineView.node != lineView.text) + lineView.node.className = ""; + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } - setEnable: function (b) { - BI.TextAreaEditor.superclass.setEnable.apply(this, arguments); - this.content.setEnable(b); + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; } -}); -BI.TextAreaEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.TextAreaEditor.EVENT_FOCUS = "EVENT_FOCUS"; -$.shortcut("bi.textarea_editor", BI.TextAreaEditor);/** - * guy 图标 - * @class BI.Icon - * @extends BI.Single - */ -BI.Icon = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.Icon.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - tagName: "i", - baseCls: (conf.baseCls || "") + " x-icon b-font horizon-center display-block" - }) - }, - _init: function () { - BI.Icon.superclass._init.apply(this, arguments); + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + + "px; width: " + dims.gutterTotalWidth + "px"); + cm.display.input.setUneditable(gutterWrap); + wrap.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) + gutterWrap.className += " " + lineView.line.gutterClass; + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + + cm.display.lineNumInnerWidth + "px")); + if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; + if (found) + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } } -}); -$.shortcut("bi.icon", BI.Icon);/** - * @class BI.Iframe - * @extends BI.Single - * @abstract - * Created by GameJian on 2016/3/2. - */ -BI.Iframe = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.Iframe.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-iframe", - src: "", - width: "100%", - height: "100%" - }) - }, + } - _init: function () { - var o = this.options; - this.options.element = $("')); - } catch (e) { - var form = document.createElement('form'), - iframe = handler.iframe || (handler.iframe = document.createElement("iframe")); - form.setAttribute("enctype", "multipart/form-data"); - iframe.setAttribute("name", iframe.id = target); - iframe.setAttribute("src", url); - } - ; - iframe.style.position = "absolute"; - iframe.style.left = iframe.style.top = "-10000px"; - iframe.onload = onload; - iframe.onerror = function (event) { - if (isFunction(handler.onerror)) - handler.onerror(rpe, event || window.event); - }; - iframe.onreadystatechange = function () { - if (/loaded|complete/i.test(iframe.readyState)) { - onload(); + function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) return; + var sel = cm.doc.sel; - //wei : todo,将附件信息放到handler.attach - } - else if (isFunction(handler.onloadprogress)) { - if (rpe.loaded < rpe.total) - ++rpe.loaded; - handler.onloadprogress(rpe, { - readyState: { - loading: 2, - interactive: 3, - loaded: 4, - complete: 4 - }[iframe.readyState] || 1 - }); - } - }; - form.setAttribute("action", handler.url + '&width=' + width + '&height=' + height); - form.setAttribute("target", iframe.id); - form.setAttribute("method", "post"); - form.appendChild(handler.file); - form.style.display = "none"; - if (isFunction(handler.onloadstart)) - handler.onloadstart(rpe, {}); - with (document.body || document.documentElement) { - appendChild(iframe); - appendChild(form); - form.submit(); - } - ; - return handler; - }; - xhr = null; - return sendFile; - })(Object.prototype.toString); + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue; + var mode = cm.getModeAt(range.head); + var indented = false; + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range.head.line, "smart"); + break; + } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) + indented = indentLine(cm, range.head.line, "smart"); + } + if (indented) signalLater(cm, "electricInput", cm, range.head.line); + } + } - var sendFiles = function (handler, maxSize, width, height) { + function copyableRanges(cm) { + var text = [], ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return {text: text, ranges: ranges}; + } - var length = handler.files.length, - i = 0, - onload = handler.onload, - onloadstart = handler.onloadstart; - handler.current = 0; - handler.total = 0; - handler.sent = 0; - while (handler.current < length) { - handler.total += (handler.files[handler.current].fileSize || handler.files[handler.current].size); - handler.current++; - } - handler.current = 0; - if (length && handler.files[0].fileSize !== -1) { - handler.file = handler.files[handler.current]; + function disableBrowserMagic(field) { + field.setAttribute("autocorrect", "off"); + field.setAttribute("autocapitalize", "off"); + field.setAttribute("spellcheck", "false"); + } - sendFile(handler, maxSize, width, height).onload = function (rpe, xhr) { - handler.onloadstart = null; - handler.sent += (handler.files[handler.current].fileSize || handler.files[handler.current].size); - if (++handler.current < length) { - handler.file = handler.files[handler.current]; - sendFile(handler, maxSize, width, height).onload = arguments.callee; - } else if (onload) { - handler.onloadstart = onloadstart; - handler.onload = onload; - handler.onload(rpe, xhr); - } - }; - } else if (length) { - handler.total = length * 100; - handler.file = handler.files[handler.current]; - sendFile(handler, maxSize, width, height).onload = function (rpe, xhr) { - var callee = arguments.callee; - handler.onloadstart = null; - handler.sent += 100; - if (++handler.current < length) { - if (/\b(chrome|safari)\b/i.test(navigator.userAgent)) { - handler.iframe.parentNode.removeChild(handler.iframe); - handler.iframe = null; - } - ; - setTimeout(function () { - handler.file = handler.files[handler.current]; - sendFile(handler, maxSize, width, height).onload = callee; - }, 15); - } else if (onload) { - setTimeout(function () { - handler.iframe.parentNode.removeChild(handler.iframe); - handler.iframe = null; - handler.onloadstart = onloadstart; - handler.onload = onload; - handler.onload(rpe, xhr); - }, 15); - } - }; - } - return handler; - }; + // TEXTAREA INPUT STYLE - BI.File = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.File.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-file display-block", - element: "", - name: "", - url: "", - multiple: true, - accept: "", /**'*.jpg; *.zip'**/ - maxSize: 1024 * 1024 - }) - }, + function TextareaInput(cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; - _init: function () { - var self = this, o = this.options; - BI.File.superclass._init.apply(this, arguments); - if (o.multiple === true) { - this.element.attr("multiple", "multiple"); - } - this.element.attr("name", o.name || this.getName()); + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Tracks when input.reset has punted to just putting a short + // string into the textarea instead of the full selection. + this.inaccurateSelection = false; + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + this.composing = null; + }; - BI.nextTick(function () { - // create the noswfupload.wrap Object - // wrap.maxSize 文件大小限制 - // wrap.maxlength 文件个数限制 - var _wrap = self.wrap = self._wrap(self.element[0], o.maxSize); - // fileType could contain whatever text but filter checks *.{extension} - // if present + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) te.style.width = "1000px"; + else te.setAttribute("wrap", "off"); + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) te.style.border = "1px solid black"; + disableBrowserMagic(te); + return div; + } - // handlers + TextareaInput.prototype = copyObj({ + init: function(display) { + var input = this, cm = this.cm; - _wrap.onloadstart = function (rpe, xhr) { - //BI.Msg.toast("loadstart"); - self.fireEvent(BI.File.EVENT_UPLOADSTART); - }; + // Wraps and hides input textarea + var div = this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + var te = this.textarea = div.firstChild; + display.wrapper.insertBefore(div, display.wrapper.firstChild); - _wrap.onprogress = function (rpe, xhr) { - //BI.Msg.toast("onprogress"); - // percent for each bar + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) te.style.width = "0px"; - // fileSize is -1 only if browser does not support file info access - // this if splits recent browsers from others - if (this.file.fileSize !== -1) { - // simulation property indicates when the progress event is fake - if (rpe.simulation) { + on(te, "input", function() { + if (ie && ie_version >= 9 && input.hasSelection) input.hasSelection = null; + input.poll(); + }); - } else { + on(te, "paste", function(e) { + if (handlePaste(e, cm)) return true; - } - } else { - // if fileSIze is -1 browser is using an iframe because it does - // not support - // files sent via Ajax (XMLHttpRequest) - // We can still show some information - } - self.fireEvent(BI.File.EVENT_PROGRESS, { - file: this.file, - total: rpe.total, - loaded: rpe.loaded, - simulation: rpe.simulation - }); - }; + cm.state.pasteIncoming = true; + input.fastPoll(); + }); - // generated if there is something wrong during upload - _wrap.onerror = function () { - // just inform the user something was wrong - self.fireEvent(BI.File.EVENT_ERROR); - }; + function prepareCopyCut(e) { + if (cm.somethingSelected()) { + lastCopied = cm.getSelections(); + if (input.inaccurateSelection) { + input.prevInput = ""; + input.inaccurateSelection = false; + te.value = lastCopied.join("\n"); + selectInput(te); + } + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + lastCopied = ranges.text; + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") cm.state.cutIncoming = true; + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); - // generated when every file has been sent (one or more, it does not - // matter) - _wrap.onload = function (rpe, xhr) { - var self_ = this; - // just show everything is fine ... - // ... and after a second reset the component - setTimeout(function () { - self_.clean(); // remove files from list - self_.hide(); // hide progress bars and enable input file + on(display.scroller, "paste", function(e) { + if (eventInWidget(display, e)) return; + cm.state.pasteIncoming = true; + input.focus(); + }); - //BI.Msg.toast("onload"); - self.fireEvent(BI.File.EVENT_UPLOADED); - // enable again the submit button/element - }, 1000); - }; - _wrap.url = o.url ? o.url : BI.servletURL - + '?op=fr_attach&cmd=ah_upload'; - _wrap.fileType = o.accept; //文件类型限制 - _wrap.attach_array = []; - _wrap.attach_names = []; - _wrap.attachNum = 0; - }); - }, + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function(e) { + if (!eventInWidget(display, e)) e_preventDefault(e); + }); - _events: function (wrap) { - var self = this; - event.add(wrap.dom.input, "change", function () { - event.del(wrap.dom.input, "change", arguments.callee); - for (var input = wrap.dom.input.cloneNode(true), i = 0, files = F(wrap.dom.input); i < files.length; i++) { - var item = files.item(i); - var tempFile = item.value || item.name; - var value = item.fileName || (item.fileName = tempFile.split("\\").pop()), - ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown", - size = item.fileSize || item.size; - if (wrap.fileType && -1 === wrap.fileType.indexOf("*." + ext)) { - //文件类型不支持 - BI.Msg.toast("文件类型不支持"); - self.fireEvent(BI.File.EVENT_ERROR, { - errorType: 0, - file: item - }); - } else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) { - //文件大小不支持 - BI.Msg.toast("文件大小不支持"); - self.fireEvent(BI.File.EVENT_ERROR, { - errorType: 1, - file: item - }); - } else { - wrap.files.unshift(item); - //BI.Msg.toast(value); - self.fireEvent(BI.File.EVENT_CHANGE, { - file: item - }); - } - } - input.value = ""; - wrap.dom.input.parentNode.replaceChild(input, wrap.dom.input); - wrap.dom.input = input; - event.add(wrap.dom.input, "change", arguments.callee); - }); - return wrap; - }, + on(te, "compositionstart", function() { + var start = cm.getCursor("from"); + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) + }; + }); + on(te, "compositionend", function() { + if (input.composing) { + input.poll(); + input.composing.range.clear(); + input.composing = null; + } + }); + }, - _wrap: function () { - var self = this, o = this.options; - // be sure input accept multiple files - var input = this.element[0]; - this.element.attr("multiple", "multiple"); - input.value = ""; + prepareSelection: function() { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc; + var result = prepareSelection(cm); - // wrap Object - return this._events({ + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); + } - // DOM namespace - dom: { - input: input, // input file - disabled: false // internal use, checks input file state - }, - name: input.name, // name to send for each file ($_FILES[{name}] in the server) - // maxSize is the maximum amount of bytes for each file - maxSize: o.maxSize ? o.maxSize >> 0 : -1, - files: [], // file list + return result; + }, - // remove every file from the noswfupload component - clean: function () { - this.files = []; - }, + showSelection: function(drawn) { + var cm = this.cm, display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }, - // upload one file a time (which make progress possible rather than all files in one shot) - // the handler is an object injected into the wrap one, could be the wrap itself or - // something like {onload:function(){alert("OK")},onerror:function(){alert("Error")}, etc ...} - upload: function (handler) { - if (handler) { - for (var key in handler) - this[key] = handler[key]; - } - sendFiles(this, this.maxSize); - return this; - }, + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + reset: function(typing) { + if (this.contextMenuPending) return; + var minimal, selected, cm = this.cm, doc = cm.doc; + if (cm.somethingSelected()) { + this.prevInput = ""; + var range = doc.sel.primary(); + minimal = hasCopyEvent && + (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); + var content = minimal ? "-" : selected || cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) selectInput(this.textarea); + if (ie && ie_version >= 9) this.hasSelection = content; + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) this.hasSelection = null; + } + this.inaccurateSelection = minimal; + }, - // hide progress bar (total + current) and enable files selection - hide: function () { - if (this.dom.disabled) { - this.dom.disabled = false; - this.dom.input.removeAttribute("disabled"); - } - }, + getField: function() { return this.textarea; }, - // show progress bar and disable file selection (used during upload) - // total and current are pixels used to style bars - // totalProp and currentProp are properties to change, "height" by default - show: function (total, current, totalProp, currentProp) { - if (!this.dom.disabled) { - this.dom.disabled = true; - this.dom.input.setAttribute("disabled", "disabled"); - } - } - }); - }, + supportsTouch: function() { return false; }, - select: function () { - $(this.wrap.dom.input).click(); - }, + focus: function() { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { this.textarea.focus(); } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }, - upload: function (handler) { - this.wrap.upload(handler); - }, + blur: function() { this.textarea.blur(); }, - getValue: function () { - return this.wrap.attach_array; - }, + resetPosition: function() { + this.wrapper.style.top = this.wrapper.style.left = 0; + }, - reset: function () { - this.wrap.attach_array = []; - this.wrap.attach_names = []; - this.wrap.attachNum = 0; - }, + receivedFocus: function() { this.slowPoll(); }, - setEnable: function (enable) { - BI.MultiFile.superclass.setEnable.apply(this, arguments); - if (enable === true) { - this.element.attr("disabled", "disabled"); - } else { - this.element.removeAttr("disabled"); - } - } - }); - BI.File.EVENT_CHANGE = "BI.File.EVENT_CHANGE"; - BI.File.EVENT_UPLOADSTART = "EVENT_UPLOADSTART"; - BI.File.EVENT_ERROR = "EVENT_ERROR"; - BI.File.EVENT_PROGRESS = "EVENT_PROGRESS"; - BI.File.EVENT_UPLOADED = "EVENT_UPLOADED"; - $.shortcut("bi.file", BI.File); -})();/** - * guy - * @class BI.Input 一个button和一行数 组成的一行listitem - * @extends BI.Single - * @type {*|void|Object} - */ -BI.Input = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.Input.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-input display-block", - element: "", - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn,//按确定键能否退出编辑 - mouseOut: false, - allowBlank: false - }) - }, - - _init: function () { - BI.Input.superclass._init.apply(this, arguments); - var self = this; - var _keydown = BI.debounce(function (keyCode) { - self.onKeyDown(keyCode); - self._keydown_ = false; - }, 300); - var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, true); - this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, true); - this.element - .keydown(function (e) { - self.fireEvent(BI.Input.EVENT_QUICK_DOWN); - }) - .keyup(function (e) { - self._keydown_ = true; - _keydown(e.keyCode); - }) - .on("input propertychange", function (e) { - self._keydown_ = true; - _keydown(e.keyCode); - }) - .click(function (e) { - e.stopPropagation(); - _clk(); - }) - .mousedown(function (e) { - self.element.val(self.element.val()); - }) - .focusout(function (e) { - self._blurDebounce(); - }); + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + slowPoll: function() { + var input = this; + if (input.pollingFast) return; + input.polling.set(this.cm.options.pollInterval, function() { + input.poll(); + if (input.cm.state.focused) input.slowPoll(); + }); }, - _focus: function () { - this.element.addClass("bi-input-focus"); - this._checkValidationOnValueChange(); - this._isEditing = true; - if (this.getValue() == "") { - this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); - this.fireEvent(BI.Input.EVENT_EMPTY); - } - this.fireEvent(BI.Input.EVENT_FOCUS); + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + fastPoll: function() { + var missed = false, input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) {missed = true; input.polling.set(60, p);} + else {input.pollingFast = false; input.slowPoll();} + } + input.polling.set(20, p); }, - _blur: function () { - var self = this; - if (self._keydown_ === true) { - BI.delay(blur, 300); - } else { - blur(); - } - function blur() { - if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) { - self.element.val(self._lastValidValue ? self._lastValidValue : ""); - self._checkValidationOnValueChange(); - self._defaultState(); - } - self.element.removeClass("bi-input-focus"); - self._isEditing = false; - self._start = false; - if (self.isValid()) { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CONFIRM, self.getValue(), self); - self.fireEvent(BI.Input.EVENT_CONFIRM); - } - self.fireEvent(BI.Input.EVENT_BLUR); - } - }, + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + poll: function() { + var cm = this.cm, input = this.textarea, prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || + (hasSelection(input) && !prevInput) || + isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq) + return false; - _click: function () { - if (this._isEditing !== true) { - this._focus(); - this.selectAll(); - this.fireEvent(BI.Input.EVENT_CLICK); - } - }, + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) return false; + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false; + } - onClick: function () { - this._click(); - }, + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) prevInput = "\u200b"; + if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo"); } + } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; - onKeyDown: function (keyCode) { - if (!this.isValid() || BI.trim(this._lastValidValue) !== BI.trim(this.getValue())) { - this._checkValidationOnValueChange(); - } - if (keyCode == BI.keyCode.ENTER) { - if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) { - this.blur(); - this.fireEvent(BI.Input.EVENT_ENTER); - } else { - this.fireEvent(BI.Input.EVENT_RESTRICT); - } - } - if (keyCode == BI.keyCode.SPACE) { - this.fireEvent(BI.Input.EVENT_SPACE); - } - if (keyCode == BI.keyCode.BACKSPACE && this._lastValue == "") { - this.fireEvent(BI.Input.EVENT_REMOVE); - } - if (keyCode == BI.keyCode.BACKSPACE || keyCode == BI.keyCode.DELETE) { - this.fireEvent(BI.Input.EVENT_BACKSPACE); - } - this.fireEvent(BI.Input.EVENT_KEY_DOWN); + var self = this; + runInOp(cm, function() { + applyTextInput(cm, text.slice(same), prevInput.length - same, + null, self.composing ? "*compose" : null); - if (this.isValid() && BI.trim(this.getValue()) !== "") { - if (BI.trim(this.getValue()) !== this._lastValue && (!this._start || this._lastValue == null || this._lastValue === "") - || (this._pause === true && !/(\s|\u00A0)$/.test(this.getValue()))) { - this._start = true; - this._pause = false; - this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STARTEDIT, this.getValue(), this); - this.fireEvent(BI.Input.EVENT_START); - } - } + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = ""; + else self.prevInput = text; - if (/(\s|\u00A0)$/.test(this.getValue())) { - this._pause = true; - this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.PAUSE, "", this); - this.fireEvent(BI.Input.EVENT_PAUSE); - this._defaultState(); - } else if ((keyCode === BI.keyCode.BACKSPACE || keyCode === BI.keyCode.DELETE) && - BI.trim(this.getValue()) === "" && (this._lastValue !== null && BI.trim(this._lastValue) !== "")) { - this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT, this.getValue(), this); - this.fireEvent(BI.Input.EVENT_STOP); - this._valueChange(); - } else { - this._valueChange(); + if (self.composing) { + self.composing.range.clear(); + self.composing.range = cm.markText(self.composing.start, cm.getCursor("to"), + {className: "CodeMirror-composing"}); } + }); + return true; }, - //初始状态 - _defaultState: function () { - if (this.getValue() == "") { - this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); - this.fireEvent(BI.Input.EVENT_EMPTY); - } - this._lastValue = this.getValue(); - this._lastSubmitValue = null; + ensurePolled: function() { + if (this.pollingFast && this.poll()) this.pollingFast = false; }, - _valueChange: function () { - if (this.isValid() && BI.trim(this.getValue()) !== this._lastSubmitValue) { - this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CHANGE, this.getValue(), this); - this.fireEvent(BI.Input.EVENT_CHANGE); - this._lastSubmitValue = BI.trim(this.getValue()); - } - if (this.getValue() == "") { - this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); - this.fireEvent(BI.Input.EVENT_EMPTY); - } - this._lastValue = this.getValue(); + onKeyPress: function() { + if (ie && ie_version >= 9) this.hasSelection = null; + this.fastPoll(); }, - _checkValidationOnValueChange: function () { - var o = this.options; - var v = this.getValue(); - this.setValid( - (o.allowBlank === true && BI.trim(v) == "") || - (BI.isNotEmptyString(BI.trim(v)) - && (v === this._lastValidValue || - o.validationChecker.apply(this, [BI.trim(v)]) !== false)) - ); - }, + onContextMenu: function(e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea; + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || presto) return; // Opera is difficult. - focus: function () { - if (!this.element.is(":visible")) { - throw new Error("input输入框在不可见下不能focus"); - } - if (!this._isEditing === true) { - this.element.focus(); - this._focus(); - this.selectAll(); - } - }, + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) + operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); - blur: function () { - if (!this.element.is(":visible")) { - throw new Error("input输入框在不可见下不能blur"); - } - if (this._isEditing === true) { - this.element.blur(); - this._blurDebounce(); + var oldCSS = te.style.cssText; + input.wrapper.style.position = "absolute"; + te.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + + "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + + "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) window.scrollTo(null, oldScrollY); + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) te.value = input.prevInput = " "; + input.contextMenuPending = true; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; } - }, + } + function rehide() { + input.contextMenuPending = false; + input.wrapper.style.position = "relative"; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); - selectAll: function () { - if (!this.element.is(":visible")) { - throw new Error("input输入框在不可见下不能select"); + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); + var i = 0, poll = function() { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && + te.selectionEnd > 0 && input.prevInput == "\u200b") + operation(cm, commands.selectAll)(cm); + else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); + else display.input.reset(); + }; + display.detectingSelectAll = setTimeout(poll, 200); } - this.element.select(); - this._isEditing = true; - }, + } - setValue: function (textValue) { - this.element.val(textValue); - BI.nextTick(BI.bind(function () { - this._checkValidationOnValueChange(); - this._defaultState(); - if (this.isValid()) { - this._lastSubmitValue = this.getValue(); - } - }, this)); + if (ie && ie_version >= 9) prepareSelectAllHack(); + if (captureRightClick) { + e_stop(e); + var mouseup = function() { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } }, - getValue: function () { - return this.element.val() || ""; - }, + setUneditable: nothing, - isEditing: function () { - return this._isEditing; - }, + needsContentAttribute: false + }, TextareaInput.prototype); - getLastValidValue: function () { - return this._lastValidValue; - }, + // CONTENTEDITABLE INPUT STYLE - setValid: function () { - BI.Input.superclass.setValid.apply(this, arguments); - if (this.isValid()) { - this._lastValidValue = this.getValue(); - this.element.removeClass("bi-input-error"); - this.fireEvent(BI.Input.EVENT_VALID, BI.trim(this.getValue()), this); - } else { - if (this._lastValidValue === this.getValue()) { - this._lastValidValue = null; - } - this.element.addClass("bi-input-error"); - this.fireEvent(BI.Input.EVENT_ERROR, BI.trim(this.getValue()), this); - } - }, + function ContentEditableInput(cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.gracePeriod = false; + } - setEnable: function (b) { - BI.Input.superclass.setEnable.apply(this, [b]); - this.element[0].disabled = !b; - } -}); -BI.Input.EVENT_CHANGE = "EVENT_CHANGE"; + ContentEditableInput.prototype = copyObj({ + init: function(display) { + var input = this, cm = input.cm; + var div = input.div = display.lineDiv; + div.contentEditable = "true"; + disableBrowserMagic(div); -BI.Input.EVENT_FOCUS = "EVENT_FOCUS"; -BI.Input.EVENT_CLICK = "EVENT_CLICK"; -BI.Input.EVENT_BLUR = "EVENT_BLUR"; -BI.Input.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.Input.EVENT_QUICK_DOWN = "EVENT_QUICK_DOWN"; -BI.Input.EVENT_SPACE = "EVENT_SPACE"; -BI.Input.EVENT_BACKSPACE = "EVENT_BACKSPACE"; + on(div, "paste", function(e) { handlePaste(e, cm); }) -BI.Input.EVENT_START = "EVENT_START"; -BI.Input.EVENT_PAUSE = "EVENT_PAUSE"; -BI.Input.EVENT_STOP = "EVENT_STOP"; -BI.Input.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.Input.EVENT_REMOVE = "EVENT_REMOVE"; -BI.Input.EVENT_EMPTY = "EVENT_EMPTY"; -BI.Input.EVENT_VALID = "EVENT_VALID"; -BI.Input.EVENT_ERROR = "EVENT_ERROR"; -BI.Input.EVENT_ENTER = "EVENT_ENTER"; -BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; -$.shortcut("bi.input", BI.Input);/** - * guy - * @extends BI.Single - * @type {*|void|Object} - */ -BI.Radio = BI.inherit(BI.IconButton, { - _defaultConfig: function() { - var conf = BI.Radio.superclass._defaultConfig.apply(this,arguments); - return BI.extend(conf, { - tagName: "a", - baseCls: (conf.baseCls || "") + " bi-radio radio-icon", - selected: false, - handler: BI.emptyFn, - width: 16, - height: 16, - iconWidth: 16, - iconHeight: 16 - }) - }, + on(div, "compositionstart", function(e) { + var data = e.data; + input.composing = {sel: cm.doc.sel, data: data, startData: data}; + if (!data) return; + var prim = cm.doc.sel.primary(); + var line = cm.getLine(prim.head.line); + var found = line.indexOf(data, Math.max(0, prim.head.ch - data.length)); + if (found > -1 && found <= prim.head.ch) + input.composing.sel = simpleSelection(Pos(prim.head.line, found), + Pos(prim.head.line, found + data.length)); + }); + on(div, "compositionupdate", function(e) { + input.composing.data = e.data; + }); + on(div, "compositionend", function(e) { + var ours = input.composing; + if (!ours) return; + if (e.data != ours.startData && !/\u200b/.test(e.data)) + ours.data = e.data; + // Need a small delay to prevent other code (input event, + // selection polling) from doing damage when fired right after + // compositionend. + setTimeout(function() { + if (!ours.handled) + input.applyComposition(ours); + if (input.composing == ours) + input.composing = null; + }, 50); + }); - _init : function() { - BI.Radio.superclass._init.apply(this, arguments); - }, + on(div, "touchstart", function() { + input.forceCompositionEnd(); + }); - doClick: function(){ - BI.Radio.superclass.doClick.apply(this, arguments); - if(this.isValid()){ - this.fireEvent(BI.Radio.EVENT_CHANGE); + on(div, "input", function() { + if (input.composing) return; + if (!input.pollContent()) + runInOp(input.cm, function() {regChange(cm);}); + }); + + function onCopyCut(e) { + if (cm.somethingSelected()) { + lastCopied = cm.getSelections(); + if (e.type == "cut") cm.replaceSelection("", null, "cut"); + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + lastCopied = ranges.text; + if (e.type == "cut") { + cm.operation(function() { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } } - } -}); -BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; + // iOS exposes the clipboard API, but seems to discard content inserted into it + if (e.clipboardData && !ios) { + e.preventDefault(); + e.clipboardData.clearData(); + e.clipboardData.setData("text/plain", lastCopied.join("\n")); + } else { + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function() { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + }, 50); + } + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }, -$.shortcut("bi.radio", BI.Radio);/** - * Created by GUY on 2015/6/26. - */ + prepareSelection: function() { + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; + return result; + }, -BI.Label = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.Label.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-label", - textAlign: "center", - whiteSpace: "nowrap", //normal or nowrap - forceCenter: false, //是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效 - textWidth: null, - textHeight: null, - hgap: 0, - vgap: 0, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0, - text: "", - py: "", - keyword: "" - }) + showSelection: function(info) { + if (!info || !this.cm.display.view.length) return; + if (info.focus) this.showPrimarySelection(); + this.showMultipleSelections(info); }, - _createJson: function () { - var o = this.options; - return { - type: "bi.text", - textAlign: o.textAlign, - whiteSpace: o.whiteSpace, - lineHeight: o.textHeight, - text: o.text, - value: o.value, - py: o.py, - keyword: o.keyword - }; + showPrimarySelection: function() { + var sel = window.getSelection(), prim = this.cm.doc.sel.primary(); + var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), prim.from()) == 0 && + cmp(maxPos(curAnchor, curFocus), prim.to()) == 0) + return; + + var start = posToDOM(this.cm, prim.from()); + var end = posToDOM(this.cm, prim.to()); + if (!start && !end) return; + + var view = this.cm.display.view; + var old = sel.rangeCount && sel.getRangeAt(0); + if (!start) { + start = {node: view[0].measure.map[2], offset: 0}; + } else if (!end) { // FIXME dangerously hacky + var measure = view[view.length - 1].measure; + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; + } + + try { var rng = range(start.node, start.offset, end.offset, end.node); } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + sel.removeAllRanges(); + sel.addRange(rng); + if (old && sel.anchorNode == null) sel.addRange(old); + else if (gecko) this.startGracePeriod(); + } + this.rememberSelection(); }, - _init: function () { - BI.Label.superclass._init.apply(this, arguments); + startGracePeriod: function() { + var input = this; + clearTimeout(this.gracePeriod); + this.gracePeriod = setTimeout(function() { + input.gracePeriod = false; + if (input.selectionChanged()) + input.cm.operation(function() { input.cm.curOp.selectionChanged = true; }); + }, 20); + }, - if (this.options.textAlign === "center") { - this._createCenterEl(); - } else { - this._createNotCenterEl(); - } + showMultipleSelections: function(info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); }, - _createCenterEl: function () { - var o = this.options; - var json = this._createJson(); - if (BI.isNumber(o.width) && o.width > 0) { - if (BI.isNumber(o.textWidth) && o.textWidth > 0) { - if (BI.isNumber(o.height) && o.height > 0) { - var gap = (o.width - o.textWidth) / 2; - BI.createWidget({ - type: "bi.adaptive", - height: o.height, - scrollable: true, - element: this, - items: [ - { - el: (this.text = BI.createWidget(json)), - left: gap + o.hgap + o.lgap, - right: gap + o.hgap + o.rgap, - top: o.vgap + o.tgap, - bottom: o.vgap + o.bgap - } - ] - }); - this.element.css({"line-height": o.height + "px"}); - return; - } - json.width = o.textWidth; - BI.createWidget({ - type: "bi.center_adapt", - scrollable: true, - element: this, - items: [ - { - el: (this.text = BI.createWidget(json)) - } - ] - }); - return; - } - if (o.whiteSpace == "normal") { - this.text = BI.createWidget(json); - BI.createWidget({ - type: "bi.center_adapt", - scrollable: true, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - element: this, - items: [this.text] - }); - return; - } - if (BI.isNumber(o.height) && o.height > 0) { - this.element.css({ - "line-height": o.height + "px" - }); - BI.createWidget({ - type: "bi.absolute", - scrollable: true, - element: this, - items: [{ - el: (this.text = BI.createWidget(json)), - left: o.hgap + o.lgap, - right: o.hgap + o.rgap, - top: o.vgap + o.tgap, - bottom: o.vgap + o.bgap - }] - }); - return; - } - json.width = o.width - 2 * o.hgap; - BI.createWidget({ - type: "bi.center_adapt", - scrollable: true, - element: this, - items: [{ - el: (this.text = BI.createWidget(json)) - }] - }); - return; - } - if (BI.isNumber(o.textWidth) && o.textWidth > 0) { - json.width = o.textWidth; - BI.createWidget({ - type: "bi.center_adapt", - scrollable: true, - element: this, - items: [ - { - el: (this.text = BI.createWidget(json)) - } - ] - }); - return; - } - if (o.whiteSpace == "normal") { - this.text = BI.createWidget(json); - this.text = BI.createWidget({ - type: "bi.center_adapt", - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - scrollable: true, - element: this, - items: [this.text] - }); - return; - } - if (BI.isNumber(o.height) && o.height > 0) { - if (BI.isNumber(o.textHeight) && o.textHeight > 0) { - this.element.css({ - "line-height": o.height + "px" - }); - BI.createWidget({ - type: "bi.adaptive", - height: o.height, - scrollable: true, - element: this, - items: [{ - el: (this.text = BI.createWidget(json)), - left: o.hgap + o.lgap, - right: o.hgap + o.rgap, - top: o.vgap + o.tgap, - bottom: o.vgap + o.bgap - }] - }); - return; - } - BI.extend(json, { - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap - }); - this.element.css({ - "line-height": o.height + "px" - }); - this.text = BI.createWidget(BI.extend(json, { - element: this - })); - BI.createWidget({ - type: "bi.layout", - element: this.text, - scrollable: true - }); - return; - } - BI.extend(json, { - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap - }); - if (o.forceCenter) { - this.text = BI.createWidget(json); - BI.createWidget({ - type: "bi.center_adapt", - element: this, - items: [this.text] - }); - return; - } - this.text = BI.createWidget(BI.extend(json, { - element: this - })); - BI.createWidget({ - type: "bi.layout", - element: this.text, - scrollable: true - }) + rememberSelection: function() { + var sel = window.getSelection(); + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; }, - _createNotCenterEl: function () { - var o = this.options; - var json = this._createJson(); - if (BI.isNumber(o.width) && o.width > 0) { - if (BI.isNumber(o.textWidth) && o.textWidth > 0) { - if (BI.isNumber(o.height) && o.height > 0) { - BI.createWidget({ - type: "bi.adaptive", - height: o.height, - scrollable: true, - element: this, - items: [ - { - el: (this.text = BI.createWidget(json)), - left: o.hgap + o.lgap, - right: o.hgap + o.rgap, - top: o.vgap + o.tgap, - bottom: o.vgap + o.bgap - } - ] - }); - this.element.css({"line-height": o.height + "px"}); - return; - } - json.width = o.textWidth; - BI.createWidget({ - type: "bi.vertical_adapt", - scrollable: true, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - element: this, - items: [ - { - el: (this.text = BI.createWidget(json)) - } - ] - }); - return; - } - if (o.whiteSpace == "normal") { - this.text = BI.createWidget(json); - BI.createWidget({ - type: "bi.vertical_adapt", - scrollable: true, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - element: this, - items: [this.text] - }); - return; - } - if (BI.isNumber(o.height) && o.height > 0) { - this.element.css({ - "line-height": o.height + "px" - }); - BI.createWidget({ - type: "bi.absolute", - scrollable: true, - element: this, - items: [{ - el: (this.text = BI.createWidget(json)), - left: o.hgap + o.lgap, - right: o.hgap + o.rgap, - top: o.vgap + o.tgap, - bottom: o.vgap + o.bgap - }] - }); - return; - } - json.width = o.width - 2 * o.hgap - o.lgap - o.rgap; - BI.createWidget({ - type: "bi.vertical_adapt", - scrollable: true, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - element: this, - items: [{ - el: (this.text = BI.createWidget(json)) - }] - }); - return; - } - if (BI.isNumber(o.textWidth) && o.textWidth > 0) { - json.width = o.textWidth; - BI.createWidget({ - type: "bi.vertical_adapt", - scrollable: true, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - element: this, - items: [ - { - el: (this.text = BI.createWidget(json)) - } - ] - }); - return; - } - if (o.whiteSpace == "normal") { - this.text = BI.createWidget(json) - this.text = BI.createWidget({ - type: "bi.vertical_adapt", - scrollable: true, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - element: this, - items: [this.text] - }); - return; - } - if (BI.isNumber(o.height) && o.height > 0) { - if (BI.isNumber(o.textHeight) && o.textHeight > 0) { - this.element.css({ - "line-height": o.height + "px" - }); - BI.createWidget({ - type: "bi.adaptive", - height: o.height, - scrollable: true, - element: this, - items: [{ - el: (this.text = BI.createWidget(json)), - left: o.hgap + o.lgap, - right: o.hgap + o.rgap, - top: o.vgap + o.tgap, - bottom: o.vgap + o.bgap - }] - }); - return; - } - BI.extend(json, { - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap - }); - this.element.css({ - "line-height": o.height + "px" - }); - this.text = BI.createWidget(BI.extend(json, { - element: this - })); - BI.createWidget({ - type: "bi.layout", - element: this.text, - scrollable: true - }); - return; - } - BI.extend(json, { - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap - }); - if (o.forceCenter) { - this.text = BI.createWidget(json); - BI.createWidget({ - type: "bi.vertical_adapt", - element: this, - items: [this.text] - }); - return; - } - this.text = BI.createWidget(BI.extend(json, { - element: this - })); - BI.createWidget({ - type: "bi.layout", - element: this.text, - scrollable: true - }) - }, - - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); + selectionInEditor: function() { + var sel = window.getSelection(); + if (!sel.rangeCount) return false; + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node); }, - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); + focus: function() { + if (this.cm.options.readOnly != "nocursor") this.div.focus(); }, + blur: function() { this.div.blur(); }, + getField: function() { return this.div; }, - doHighLight: function () { - this.text.doHighLight.apply(this.text, arguments); - }, + supportsTouch: function() { return true; }, - unHighLight: function () { - this.text.unHighLight.apply(this.text, arguments); - }, + receivedFocus: function() { + var input = this; + if (this.selectionInEditor()) + this.pollSelection(); + else + runInOp(this.cm, function() { input.cm.curOp.selectionChanged = true; }); - setText: function (v) { - this.options.text = v; - this.text.setText(v); + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); }, - getText: function () { - return this.options.text; + selectionChanged: function() { + var sel = window.getSelection(); + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; }, - setValue: function (v) { - BI.Label.superclass.setValue.apply(this, arguments); - if (!this.isReadOnly()) { - this.text.setValue(v); - } + pollSelection: function() { + if (!this.composing && !this.gracePeriod && this.selectionChanged()) { + var sel = window.getSelection(), cm = this.cm; + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) runInOp(cm, function() { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) cm.curOp.selectionChanged = true; + }); + } }, - populate: function () { - BI.Label.superclass.populate.apply(this, arguments); - } -}); + pollContent: function() { + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); + var from = sel.from(), to = sel.to(); + if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false; -$.shortcut("bi.label", BI.Label);/** - * guy a元素 - * @class BI.Link - * @extends BI.Text - */ -BI.Link = BI.inherit(BI.Label, { - _defaultConfig: function() { - var conf = BI.Link.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-link", - href: "", - target: "_blank" - }) - }, - - _createJson: function(){ - var o = this.options; - return { - type:"bi.a", - textAlign: o.textAlign, - whiteSpace: o.whiteSpace, - lineHeight: o.textHeight, - text: o.text, - keyword: o.keyword, - value: o.value, - py: o.py, - href: o.href, - target: o.target - }; - }, - - _init : function() { - BI.Link.superclass._init.apply(this, arguments); - } -}); - -$.shortcut("bi.link", BI.Link);/** - * guy - * tip提示 - * zIndex在10亿级别 - * @class BI.Tip - * @extends BI.Single - * @abstract - */ -BI.Tip = BI.inherit(BI.Single, { - _defaultConfig: function() { - var conf = BI.Link.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-tip", - zIndex: BI.zIndex_tip - }) - }, - - _init : function() { - BI.Tip.superclass._init.apply(this, arguments); - this.element.css({"zIndex": this.options.zIndex}); - } -});/** - * 下拉 - * @class BI.Trigger - * @extends BI.Single - * @abstract - */ -BI.Trigger = BI.inherit(BI.Single, { - _defaultConfig: function() { - var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-trigger cursor-pointer", - height: 30 - }) - }, - - _init : function() { - BI.Trigger.superclass._init.apply(this, arguments); - }, - - setKey: function(){ - - }, - - getKey: function(){ - - } -});/** - * svg绘图 - * - * Created by GUY on 2015/12/3. - * @class BI.Svg - * @extends BI.Widget - */ -BI.Svg = BI.inherit(BI.Widget, { - - _defaultConfig: function () { - return BI.extend(BI.Svg.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-svg" - }) - }, + var fromIndex; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + var fromLine = lineNo(display.view[0].line); + var fromNode = display.view[0].node; + } else { + var fromLine = lineNo(display.view[fromIndex].line); + var fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + if (toIndex == display.view.length - 1) { + var toLine = display.viewTo - 1; + var toNode = display.lineDiv.lastChild; + } else { + var toLine = lineNo(display.view[toIndex + 1].line) - 1; + var toNode = display.view[toIndex + 1].node.previousSibling; + } - _init: function () { - BI.Svg.superclass._init.apply(this, arguments); - this.paper = Raphael(this.element[0]); + var newText = splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } + else break; + } - $(this.paper.canvas).width("100%").height("100%").css({"left": "0", "top": "0"}).appendTo(this.element); + var cutFront = 0, cutEnd = 0; + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + ++cutFront; + var newBot = lst(newText), oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + ++cutEnd; - this.top = this.paper.top; - this.bottom = this.paper.bottom; - this.customAttributes = this.paper.customAttributes; - this.ca = this.paper.ca; - this.raphael = this.paper.raphael; - }, + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd); + newText[0] = newText[0].slice(cutFront); - add: function () { - return this.paper.add.apply(this.paper, arguments); + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true; + } }, - path: function () { - return this.paper.path.apply(this.paper, arguments); + ensurePolled: function() { + this.forceCompositionEnd(); }, - - image: function () { - return this.paper.image.apply(this.paper, arguments); + reset: function() { + this.forceCompositionEnd(); }, - - rect: function () { - return this.paper.rect.apply(this.paper, arguments); + forceCompositionEnd: function() { + if (!this.composing || this.composing.handled) return; + this.applyComposition(this.composing); + this.composing.handled = true; + this.div.blur(); + this.div.focus(); }, - - circle: function () { - return this.paper.circle.apply(this.paper, arguments); + applyComposition: function(composing) { + if (composing.data && composing.data != composing.startData) + operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel); }, - ellipse: function () { - return this.paper.ellipse.apply(this.paper, arguments); + setUneditable: function(node) { + node.setAttribute("contenteditable", "false"); }, - text: function () { - return this.paper.text.apply(this.paper, arguments); + onKeyPress: function(e) { + e.preventDefault(); + operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }, - print: function () { - return this.paper.print.apply(this.paper, arguments); - }, + onContextMenu: nothing, + resetPosition: nothing, + needsContentAttribute: true + }, ContentEditableInput.prototype); - setStart: function () { - return this.paper.setStart.apply(this.paper, arguments); - }, + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) return null; + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); - setFinish: function () { - return this.paper.setFinish.apply(this.paper, arguments); - }, + var order = getOrder(line), side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result; + } - setSize: function () { - return this.paper.setSize.apply(this.paper, arguments); - }, + function badPos(pos, bad) { if (bad) pos.bad = true; return pos; } - setViewBox: function () { - return this.paper.setViewBox.apply(this.paper, arguments); - }, + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); + node = null; offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) return null; + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) break; + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) + return locateNodeInLineView(lineView, node, offset); + } + } + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false; + if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true); + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad); + } + } - getById: function () { - return this.paper.getById.apply(this.paper, arguments); - }, + var textNode = node.nodeType == 3 ? node : null, topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) offset = textNode.nodeValue.length; + } + while (topNode.parentNode != wrapper) topNode = topNode.parentNode; + var measure = lineView.measure, maps = measure.maps; - getElementByPoint: function () { - return this.paper.getElementByPoint.apply(this.paper, arguments); - }, + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map[j] + offset; + if (offset < 0 || curNode != textNode) ch = map[j + (offset ? 1 : 0)]; + return Pos(line, ch); + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) return badPos(found, bad); - getElementsByPoint: function () { - return this.paper.getElementsByPoint.apply(this.paper, arguments); - }, + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) + return badPos(Pos(found.line, found.ch - dist), bad); + else + dist += after.textContent.length; + } + for (var before = topNode.previousSibling, dist = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) + return badPos(Pos(found.line, found.ch + dist), bad); + else + dist += after.textContent.length; + } + } - getFont: function () { - return this.paper.getFont.apply(this.paper, arguments); - }, + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false; + function recognizeMarker(id) { return function(marker) { return marker.id == id; }; } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText != null) { + if (cmText == "") cmText = node.textContent.replace(/\u200b/g, ""); + text += cmText; + return; + } + var markerID = node.getAttribute("cm-marker"), range; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range = found[0].find())) + text += getBetween(cm.doc, range.from, range.to).join("\n"); + return; + } + if (node.getAttribute("contenteditable") == "false") return; + for (var i = 0; i < node.childNodes.length; i++) + walk(node.childNodes[i]); + if (/^(pre|div|p)$/i.test(node.nodeName)) + closing = true; + } else if (node.nodeType == 3) { + var val = node.nodeValue; + if (!val) return; + if (closing) { + text += "\n"; + closing = false; + } + text += val; + } + } + for (;;) { + walk(from); + if (from == to) break; + from = from.nextSibling; + } + return text; + } + CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; - set: function () { - return this.paper.set.apply(this.paper, arguments); + // SELECTION / CURSOR + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + function Selection(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + } + + Selection.prototype = { + primary: function() { return this.ranges[this.primIndex]; }, + equals: function(other) { + if (other == this) return true; + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; + for (var i = 0; i < this.ranges.length; i++) { + var here = this.ranges[i], there = other.ranges[i]; + if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; + } + return true; }, - remove: function () { - return this.paper.remove.apply(this.paper, arguments); + deepCopy: function() { + for (var out = [], i = 0; i < this.ranges.length; i++) + out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); + return new Selection(out, this.primIndex); }, - clear: function () { - return this.paper.clear.apply(this.paper, arguments); - } -}); -$.shortcut("bi.svg", BI.Svg);/** - * - * 表格 - * - * Created by GUY on 2015/9/22. - * @class BI.TableCell - * @extends BI.Single - */ -BI.TableCell = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.TableCell.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-table-cell", - textAlign: "left", - text: "" - }) + somethingSelected: function() { + for (var i = 0; i < this.ranges.length; i++) + if (!this.ranges[i].empty()) return true; + return false; }, - - _init: function () { - BI.TableCell.superclass._init.apply(this, arguments); - BI.createWidget({ - type: "bi.label", - element: this, - whiteSpace: "nowrap", - textAlign: this.options.textAlign, - height: this.options.height, - text: this.options.text, - value: this.options.value, - lgap: 5 - }) + contains: function(pos, end) { + if (!end) end = pos; + for (var i = 0; i < this.ranges.length; i++) { + var range = this.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + return i; + } + return -1; } -}); - -$.shortcut("bi.table_cell", BI.TableCell);/** - * - * 表格单元格 - * - * Created by GUY on 2016/1/12. - * @class BI.CollectionTableCell - * @extends BI.Widget - */ -BI.CollectionTableCell = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.CollectionTableCell.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-collection-table-cell", - width: 0, - height: 0, - _left: 0, - _top: 0, - cell: {} - }) - }, + }; - _init: function () { - BI.CollectionTableCell.superclass._init.apply(this, arguments); - var o = this.options; - this.cell = BI.createWidget(BI.extend({ - type: "bi.label" - }, o.cell, { - cls: (o.cell.cls || "") + "collection-table-cell-wrapper", - width: o.width - (o._left === 0 ? 1 : 0) - 1, - height: o.height - (o._top === 0 ? 1 : 0) - 1 - })); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.cell, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }); - }, + function Range(anchor, head) { + this.anchor = anchor; this.head = head; + } - setWidth: function (width) { - BI.CollectionTableCell.superclass.setWidth.apply(this, arguments); - var o = this.options; - this.cell.setWidth(o.width - (o._left === 0 ? 1 : 0) - 1); - }, + Range.prototype = { + from: function() { return minPos(this.anchor, this.head); }, + to: function() { return maxPos(this.anchor, this.head); }, + empty: function() { + return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + } + }; - setHeight: function (height) { - BI.CollectionTableCell.superclass.setHeight.apply(this, arguments); - var o = this.options; - this.cell.setHeight(o.height - (o._top === 0 ? 1 : 0) - 1); + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex]; + ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1]; + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) --primIndex; + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } } -}); + return new Selection(ranges, primIndex); + } -$.shortcut("bi.collection_table_cell", BI.CollectionTableCell);/** - * CollectionTable - * - * Created by GUY on 2016/1/12. - * @class BI.CollectionTable - * @extends BI.Widget - */ -BI.CollectionTable = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.CollectionTable.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-collection-table", - headerRowSize: 25, - rowSize: 25, - columnSize: [], - isNeedFreeze: false, - freezeCols: [], - isNeedMerge: false, - mergeCols: [], - mergeRule: BI.emptyFn, - header: [], - items: [], - regionColumnSize: [] - }); - }, + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0); + } - _init: function () { - BI.CollectionTable.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this._width = 0; - this._height = 0; - this._scrollBarSize = BI.DOM.getScrollWidth(); - this.topLeftCollection = BI.createWidget({ - type: "bi.collection_view", - cellSizeAndPositionGetter: function (index) { - return self.topLeftItems[index]; - } - }); - this.topLeftCollection.on(BI.Collection.EVENT_SCROLL, function (scroll) { - self.bottomLeftCollection.setScrollLeft(scroll.scrollLeft); - self._populateScrollbar(); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.topRightCollection = BI.createWidget({ - type: "bi.collection_view", - cellSizeAndPositionGetter: function (index) { - return self.topRightItems[index]; - } - }); - this.topRightCollection.on(BI.Collection.EVENT_SCROLL, function (scroll) { - self.bottomRightCollection.setScrollLeft(scroll.scrollLeft); - self._populateScrollbar(); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.bottomLeftCollection = BI.createWidget({ - type: "bi.collection_view", - cellSizeAndPositionGetter: function (index) { - return self.bottomLeftItems[index]; - } - }); - this.bottomLeftCollection.on(BI.Collection.EVENT_SCROLL, function (scroll) { - self.bottomRightCollection.setScrollTop(scroll.scrollTop); - self.topLeftCollection.setScrollLeft(scroll.scrollLeft); - self._populateScrollbar(); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.bottomRightCollection = BI.createWidget({ - type: "bi.collection_view", - cellSizeAndPositionGetter: function (index) { - return self.bottomRightItems[index]; - } - }); - this.bottomRightCollection.on(BI.Collection.EVENT_SCROLL, function (scroll) { - self.bottomLeftCollection.setScrollTop(scroll.scrollTop); - self.topRightCollection.setScrollLeft(scroll.scrollLeft); - self._populateScrollbar(); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.topLeft = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.topLeftCollection] - }); - this.topRight = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.topRightCollection] - }); - this.bottomLeft = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.bottomLeftCollection] - }); - this.bottomRight = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.bottomRightCollection] - }); - this.contextLayout = BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.topLeft, - top: 0, - left: 0 - }, { - el: this.topRight, - top: 0 - }, { - el: this.bottomLeft, - left: 0 - }, { - el: this.bottomRight - }] - }); + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} + function clipPos(doc, pos) { + if (pos.line < doc.first) return Pos(doc.first, 0); + var last = doc.first + doc.size - 1; + if (pos.line > last) return Pos(last, getLine(doc, last).text.length); + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) return Pos(pos.line, linelen); + else if (ch < 0) return Pos(pos.line, 0); + else return pos; + } + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} + function clipPosArray(doc, array) { + for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); + return out; + } - this.topScrollbar = BI.createWidget({ - type: "bi.grid_table_scrollbar", - width: BI.GridTableScrollbar.SIZE - }); - this.topScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function (scrollTop) { - self.bottomLeftCollection.setScrollTop(scrollTop); - self.bottomRightCollection.setScrollTop(scrollTop); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.leftScrollbar = BI.createWidget({ - type: "bi.grid_table_horizontal_scrollbar", - height: BI.GridTableScrollbar.SIZE - }); - this.leftScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function (scrollLeft) { - self.topLeftCollection.setScrollLeft(scrollLeft); - self.bottomLeftCollection.setScrollLeft(scrollLeft); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.rightScrollbar = BI.createWidget({ - type: "bi.grid_table_horizontal_scrollbar", - height: BI.GridTableScrollbar.SIZE - }); - this.rightScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function (scrollLeft) { - self.topRightCollection.setScrollLeft(scrollLeft); - self.bottomRightCollection.setScrollLeft(scrollLeft); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.scrollBarLayout = BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.topScrollbar, - right: 0, - top: 0 - }, { - el: this.leftScrollbar, - left: 0 - }, { - el: this.rightScrollbar, - }] - }); - this._width = o.width - BI.GridTableScrollbar.SIZE; - this._height = o.height - BI.GridTableScrollbar.SIZE; - if (o.items.length > 0 || o.header.length < 0) { - this._digest(); - this._populate(); - } - }, + // SELECTION UPDATES - _getFreezeColLength: function () { - return this.options.isNeedFreeze ? this.options.freezeCols.length : 0; - }, + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. - _populateScrollbar: function () { - var o = this.options; - var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; - var freezeColLength = this._getFreezeColLength(); - BI.each(o.columnSize, function (i, size) { - if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { - totalLeftColumnSize += size; - } else { - totalRightColumnSize += size; - } - totalColumnSize += size; - if (i === 0) { - summaryColumnSizeArray[i] = size; - } else { - summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; - } - }); - this.topScrollbar.setContentSize(o.items.length * o.rowSize); - this.topScrollbar.setSize(this._height - o.header.length * o.headerRowSize); - this.topScrollbar.setPosition(this.bottomRightCollection.getScrollTop()); - this.topScrollbar.populate(); + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(doc, range, head, other) { + if (doc.cm && doc.cm.display.shift || doc.extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; + } + } + return new Range(anchor, head); + } else { + return new Range(other || head, head); + } + } - this.leftScrollbar.setContentSize(totalLeftColumnSize); - this.leftScrollbar.setSize(regionSize); - this.leftScrollbar.setPosition(this.bottomLeftCollection.getScrollLeft()); - this.leftScrollbar.populate(); + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options) { + setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); + } - this.rightScrollbar.setContentSize(totalRightColumnSize); - this.rightScrollbar.setSize(this._width - regionSize); - this.rightScrollbar.setPosition(this.bottomRightCollection.getScrollLeft()); - this.rightScrollbar.populate(); + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + for (var out = [], i = 0; i < doc.sel.ranges.length; i++) + out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } - var items = this.scrollBarLayout.attr("items"); - items[0].top = o.header.length * o.headerRowSize; - items[1].top = this._height; - items[2].top = this._height; - items[2].left = regionSize; - this.scrollBarLayout.attr("items", items); - this.scrollBarLayout.resize(); - }, + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); + } - _populateTable: function () { - var self = this, o = this.options; - var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; - var freezeColLength = this._getFreezeColLength(); - BI.each(o.columnSize, function (i, size) { - if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { - totalLeftColumnSize += size; - } else { - totalRightColumnSize += size; - } - totalColumnSize += size; - if (i === 0) { - summaryColumnSizeArray[i] = size; - } else { - summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; - } - }); + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } - var tlw = regionSize; - var tlh = regionSize >= summaryColumnSizeArray[freezeColLength - 1] ? (o.header.length * o.headerRowSize) : (o.header.length * o.headerRowSize + this._scrollBarSize); - var trw = this._width - regionSize; - var trh = (this._width - regionSize >= totalColumnSize - (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (o.header.length * o.headerRowSize) : (o.header.length * o.headerRowSize + this._scrollBarSize); - var blw = (this._height - o.header.length * o.headerRowSize >= totalRowSize) ? regionSize : (regionSize + this._scrollBarSize); - var blh = (regionSize >= (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (this._height - o.header.length * o.headerRowSize) : (this._height - o.header.length * o.headerRowSize + this._scrollBarSize); - var brw = (this._height - o.header.length * o.headerRowSize >= totalRowSize) ? (this._width - regionSize) : (this._width - regionSize + this._scrollBarSize); - var brh = (this._width - regionSize >= totalColumnSize - (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (this._height - o.header.length * o.headerRowSize) : (this._height - o.header.length * o.headerRowSize + this._scrollBarSize); + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); + } + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); + if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); + else return sel; + } - var otlw = regionSize; - var otlh = o.header.length * o.headerRowSize; - var otrw = this._width - regionSize; - var otrh = o.header.length * o.headerRowSize; - var oblw = regionSize; - var oblh = this._height - o.header.length * o.headerRowSize; - var obrw = this._width - regionSize; - var obrh = this._height - o.header.length * o.headerRowSize; + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } - var digest = function (w, h, tw, th, el) { - if (w >= tw && h >= th) { - el.element.css({ - overflow: "hidden", - overflowX: "hidden", - overflowY: "hidden" - }) - } else if (w >= tw) { - el.element.css({ - overflow: "hidden", - overflowX: "hidden", - overflowY: "auto" - }) - } else if (h >= th) { - el.element.css({ - overflow: "hidden", - overflowX: "auto", - overflowY: "hidden" - }) - } else { - el.element.css({ - overflow: "auto", - overflowX: "auto", - overflowY: "auto" - }) - } - }; + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } - this.topLeft.setWidth(otlw); - this.topLeft.setHeight(otlh); - this.topRight.setWidth(otrw); - this.topRight.setHeight(otrh); - this.bottomLeft.setWidth(oblw); - this.bottomLeft.setHeight(oblh); - this.bottomRight.setWidth(obrw); - this.bottomRight.setHeight(obrh); + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + sel = filterSelectionChange(doc, sel); - this.topLeftCollection.setWidth(tlw); - this.topLeftCollection.setHeight(tlh); - this.topRightCollection.setWidth(trw); - this.topRightCollection.setHeight(trh); - this.bottomLeftCollection.setWidth(blw); - this.bottomLeftCollection.setHeight(blh); - this.bottomRightCollection.setWidth(brw); - this.bottomRightCollection.setHeight(brh); + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - digest(tlw, tlh, totalLeftColumnSize, o.header.length * o.headerRowSize, this.topLeftCollection); - digest(trw, trh, totalRightColumnSize, o.header.length * o.headerRowSize, this.topRightCollection); - digest(blw, blh, totalLeftColumnSize, o.items.length * o.rowSize, this.bottomLeftCollection); - digest(brw, brh, totalRightColumnSize, o.items.length * o.rowSize, this.bottomRightCollection); + if (!(options && options.scroll === false) && doc.cm) + ensureCursorVisible(doc.cm); + } - var items = this.contextLayout.attr("items"); - items[1].left = regionSize; - items[2].top = o.header.length * o.headerRowSize; - items[3].left = regionSize; - items[3].top = o.header.length * o.headerRowSize; - this.contextLayout.attr("items", items); - this.contextLayout.resize(); + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) return; - var leftHeader = [], rightHeader = [], leftItems = [], rightItems = []; - var run = function (positions, items, rendered) { - BI.each(positions, function (i, item) { - var cell = { - type: "bi.collection_table_cell", - cell: items[item.row][item.col] - }; - rendered.push(cell); - }); - }; - run(this.topLeftItems, o.header, leftHeader); - run(this.topRightItems, o.header, rightHeader); - run(this.bottomLeftItems, o.items, leftItems); - run(this.bottomRightItems, o.items, rightItems); + doc.sel = sel; - this.topLeftCollection.populate(leftHeader); - this.topRightCollection.populate(rightHeader); - this.bottomLeftCollection.populate(leftItems); - this.bottomRightCollection.populate(rightItems); - }, + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } - _digest: function () { - var o = this.options; - var freezeColLength = this._getFreezeColLength(); - this.topLeftItems = this._serialize(o.header, 0, freezeColLength, o.headerRowSize, o.columnSize, o.mergeCols); - this.topRightItems = this._serialize(o.header, freezeColLength, o.columnSize.length, o.headerRowSize, o.columnSize, true); - this.bottomLeftItems = this._serialize(o.items, 0, freezeColLength, o.rowSize, o.columnSize, o.mergeCols); - this.bottomRightItems = this._serialize(o.items, freezeColLength, o.columnSize.length, o.rowSize, o.columnSize, o.mergeCols); - }, + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); + } - _serialize: function (items, startCol, endCol, rowHeight, columnSize, mergeCols) { - var self = this, o = this.options; - var result = [], cache = {}, preCol = {}, preRow = {}, map = {}; - var summaryColumnSize = []; - for (var i = startCol; i < endCol; i++) { - if (i === startCol) { - summaryColumnSize[i] = columnSize[i]; - } else { - summaryColumnSize[i] = summaryColumnSize[i - 1] + columnSize[i]; + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) out = sel.ranges.slice(0, i); + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel; + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, bias, mayClear) { + var flipped = false, curPos = pos; + var dir = bias || 1; + doc.cantEdit = false; + search: for (;;) { + var line = getLine(doc, curPos.line); + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) break; + else {--i; continue;} + } + } + if (!m.atomic) continue; + var newPos = m.find(dir < 0 ? -1 : 1); + if (cmp(newPos, curPos) == 0) { + newPos.ch += dir; + if (newPos.ch < 0) { + if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); + else newPos = null; + } else if (newPos.ch > line.text.length) { + if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); + else newPos = null; + } + if (!newPos) { + if (flipped) { + // Driven in a corner -- no valid cursor position found at all + // -- try again *with* clearing, if we didn't already + if (!mayClear) return skipAtomic(doc, pos, bias, true); + // Otherwise, turn off editing until further notice, and return the start of the doc + doc.cantEdit = true; + return Pos(doc.first, 0); + } + flipped = true; newPos = pos; dir = -dir; + } } + curPos = newPos; + continue search; + } } - var mergeRow = function (i, j) { - preCol[j]._height += rowHeight; - preCol[j].__mergeRows.push(i); - }; + } + return curPos; + } + } - var mergeCol = function (i, j) { - preRow[i]._width += columnSize[j]; - preRow[i].__mergeCols.push(j); - }; + // SELECTION DRAWING - var createOneEl = function (r, c) { - var width = columnSize[c]; - var height = rowHeight; - map[r][c]._row = r; - map[r][c]._col = c; - map[r][c]._width = width; - map[r][c]._height = height; - preCol[c] = map[r][c]; - preCol[c].__mergeRows = [r]; - preRow[r] = map[r][c]; - preRow[r].__mergeCols = [c]; + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } - result.push({ - x: summaryColumnSize[c] - columnSize[c], - y: +r * rowHeight, - item: map[r][c] - }); - }; + function prepareSelection(cm, primary) { + var doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); - BI.each(items, function (i, cols) { - for (var j = startCol; j < endCol; j++) { - if (!cache[i]) { - cache[i] = {}; - } - if (!map[i]) { - map[i] = {}; - } - cache[i][j] = cols[j]; - map[i][j] = {}; - if (mergeCols === true || mergeCols.indexOf(j) > -1) { - if (i === 0 && j === startCol) { - createOneEl(0, startCol); - } else if (j === startCol && i > 0) { - var isNeedMergeRow = o.mergeRule(cache[i][j], cache[i - 1][j]); - if (isNeedMergeRow === true) { - mergeRow(i, j); - preRow[i] = preCol[j]; - } else { - createOneEl(i, j); - } - } else if (i === 0 && j > startCol) { - var isNeedMergeCol = o.mergeRule(cache[i][j], cache[i][j - 1]); - if (isNeedMergeCol === true) { - mergeCol(i, j); - preCol[j] = preRow[i]; - } else { - createOneEl(i, j); - } - } else { - var isNeedMergeRow = o.mergeRule(cache[i][j], cache[i - 1][j]); - var isNeedMergeCol = o.mergeRule(cache[i][j], cache[i][j - 1]); - if (isNeedMergeCol && isNeedMergeRow) { - continue; - //mergeRow(i, j);//优先合并列 - } - if (isNeedMergeCol) { - mergeCol(i, j); - } - if (isNeedMergeRow) { - mergeRow(i, j); - } - if (!isNeedMergeCol && !isNeedMergeRow) { - createOneEl(i, j); - } - } - } else { - createOneEl(i, j); - } - } - }); - return BI.map(result, function (i, item) { - return { - x: item.x, - y: item.y, - row: item.item._row, - col: item.item._col, - width: item.item._width, - height: item.item._height - } - }); - }, + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (primary === false && i == doc.sel.primIndex) continue; + var range = doc.sel.ranges[i]; + var collapsed = range.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) + drawSelectionCursor(cm, range, curFragment); + if (!collapsed) + drawSelectionRange(cm, range, selFragment); + } + return result; + } - _populate: function () { - if (this._width <= 0 || this._height <= 0) { - return; - } - if (this._isNeedDigest === true) { - this._digest(); - } - this._populateTable(); - this._populateScrollbar(); - }, + // Draws a cursor for the given range + function drawSelectionCursor(cm, range, output) { + var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine); - getRegionSize: function () { - var o = this.options; - var regionSize = o.regionColumnSize[0] || 0; - if (o.isNeedFreeze === false || o.freezeCols.length === 0) { - return 0; - } - if (!regionSize) { - BI.each(o.freezeCols, function (i, col) { - regionSize += o.columnSize[col]; - }); - } - return regionSize; - }, + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - setVerticalScroll: function (scrollTop) { - this.bottomLeftCollection.setScrollTop(scrollTop); - this.bottomRightCollection.setScrollTop(scrollTop); - }, + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } - setLeftHorizontalScroll: function (scrollLeft) { - this.topLeftCollection.setScrollLeft(scrollLeft); - this.bottomLeftCollection.setScrollLeft(scrollLeft); - }, + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range, output) { + var display = cm.display, doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; - setRightHorizontalScroll: function (scrollLeft) { - this.topRightCollection.setScrollLeft(scrollLeft); - this.bottomRightCollection.setScrollLeft(scrollLeft); - }, + function add(left, top, width, bottom) { + if (top < 0) top = 0; + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + + "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + + "px; height: " + (bottom - top) + "px")); + } - getVerticalScroll: function () { - return this.bottomRightCollection.getScrollTop(); - }, + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias); + } - getLeftHorizontalScroll: function () { - return this.bottomLeftCollection.getScrollLeft(); - }, + iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { + var leftPos = coords(from, "left"), rightPos, left, right; + if (from == to) { + rightPos = leftPos; + left = right = leftPos.left; + } else { + rightPos = coords(to - 1, "right"); + if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; } + left = leftPos.left; + right = rightPos.right; + } + if (fromArg == null && from == 0) left = leftSide; + if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part + add(left, leftPos.top, null, leftPos.bottom); + left = leftSide; + if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); + } + if (toArg == null && to == lineLen) right = rightSide; + if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) + start = leftPos; + if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) + end = rightPos; + if (left < leftSide + 1) left = leftSide; + add(left, rightPos.top, right - left, rightPos.bottom); + }); + return {start: start, end: end}; + } - getRightHorizontalScroll: function () { - return this.bottomRightCollection.getScrollLeft(); - }, + var sFrom = range.from(), sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) + add(leftSide, leftEnd.bottom, null, rightStart.top); + } - setWidth: function (width) { - BI.CollectionTable.superclass.setWidth.apply(this, arguments); - this._width = this.options.width - BI.GridTableScrollbar.SIZE; - }, + output.appendChild(fragment); + } - setHeight: function (height) { - BI.CollectionTable.superclass.setHeight.apply(this, arguments); - this._height = this.options.height - BI.GridTableScrollbar.SIZE; - }, + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) return; + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) + display.blinker = setInterval(function() { + display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + else if (cm.options.cursorBlinkRate < 0) + display.cursorDiv.style.visibility = "hidden"; + } - setColumnSize: function (columnSize) { - this._isNeedDigest = true; - this.options.columnSize = columnSize; - }, + // HIGHLIGHT WORKER - setRegionColumnSize: function (regionColumnSize) { - this._isNeedDigest = true; - this.options.regionColumnSize = regionColumnSize; - }, + function startWorker(cm, time) { + if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) + cm.state.highlight.set(time, bind(highlightWorker, cm)); + } - getColumnSize: function () { - return this.options.columnSize; - }, + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.frontier < doc.first) doc.frontier = doc.first; + if (doc.frontier >= cm.display.viewTo) return; + var end = +new Date + cm.options.workTime; + var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); + var changedLines = []; - getRegionColumnSize: function () { - return this.options.regionColumnSize; - }, + doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { + if (doc.frontier >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles; + var highlighted = highlightLine(cm, line, state, true); + line.styles = highlighted.styles; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) line.styleClasses = newCls; + else if (oldCls) line.styleClasses = null; + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; + if (ischange) changedLines.push(doc.frontier); + line.stateAfter = copyState(doc.mode, state); + } else { + processLine(cm, line.text, state); + line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; + } + ++doc.frontier; + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true; + } + }); + if (changedLines.length) runInOp(cm, function() { + for (var i = 0; i < changedLines.length; i++) + regLineChange(cm, changedLines[i], "text"); + }); + } - populate: function (items, header) { - if (items && items !== this.options.items) { - this._isNeedDigest = true; - this.options.items = items; - this._restore(); - } - if (header && header !== this.options.header) { - this._isNeedDigest = true; - this.options.header = header; - this._restore(); - } - this._populate(); - }, + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) return doc.first; + var line = getLine(doc, search - 1); + if (line.stateAfter && (!precise || search <= doc.frontier)) return search; + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } - _restore: function () { - this.topLeftCollection.restore(); - this.topRightCollection.restore(); - this.bottomLeftCollection.restore(); - this.bottomRightCollection.restore(); - }, + function getStateBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) return true; + var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; + if (!state) state = startState(doc.mode); + else state = copyState(doc.mode, state); + doc.iter(pos, n, function(line) { + processLine(cm, line.text, state); + var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; + line.stateAfter = save ? copyState(doc.mode, state) : null; + ++pos; + }); + if (precise) doc.frontier = pos; + return state; + } - restore: function () { - this._restore(); - } -}); -$.shortcut('bi.collection_table', BI.CollectionTable);/** - * QuickCollectionTable - * - * Created by GUY on 2016/1/12. - * @class BI.QuickCollectionTable - * @extends BI.CollectionTable - */ -BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, { - _defaultConfig: function () { - return BI.extend(BI.QuickCollectionTable.superclass._defaultConfig.apply(this, arguments), { - extraCls: "bi-quick-collection-table" - }); - }, + // POSITION MEASUREMENT - _init: function () { - BI.QuickCollectionTable.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.topLeftCollection.setOverflowX(false); - this.topLeftCollection.setOverflowY(false); - this.topRightCollection.setOverflowX(false); - this.topRightCollection.setOverflowY(false); - this.bottomLeftCollection.setOverflowX(false); - this.bottomLeftCollection.setOverflowY(false); - this.bottomRightCollection.setOverflowX(false); - this.bottomRightCollection.setOverflowY(false); - this._leftWheelHandler = new BI.WheelHandler( - BI.bind(this._onWheelY, this), - BI.bind(this._shouldHandleX, this), - BI.bind(this._shouldHandleY, this) - ); - this._rightWheelHandler = new BI.WheelHandler( - BI.bind(this._onWheelY, this), - BI.bind(this._shouldHandleX, this), - BI.bind(this._shouldHandleY, this) - ); - this.bottomLeftCollection.element.mousewheel(function (e) { - self._leftWheelHandler.onWheel(e.originalEvent); - }); - this.bottomRightCollection.element.mousewheel(function (e) { - self._rightWheelHandler.onWheel(e.originalEvent); - }); - }, + function paddingTop(display) {return display.lineSpace.offsetTop;} + function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} + function paddingH(display) { + if (display.cachedPaddingH) return display.cachedPaddingH; + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; + return data; + } - _shouldHandleX: function (delta) { - return false; - }, + function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; + } - _shouldHandleY: function (delta) { - if (delta > 0) { - return this.bottomRightCollection.getScrollTop() < this.bottomRightCollection.getMaxScrollTop(); - } else { - return this.bottomRightCollection.getScrollTop() > 0; + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) + heights.push((cur.bottom + next.top) / 2 - rect.top); } - }, + } + heights.push(rect.bottom - rect.top); + } + } - _onWheelY: function (deltaX, deltaY) { - var self = this; - var scrollTop = this.bottomRightCollection.getScrollTop(); - scrollTop += deltaY; - this.bottomLeftCollection.setScrollTop(scrollTop); - this.bottomRightCollection.setScrollTop(scrollTop); - self._populateScrollbar(); - this.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }, + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + return {map: lineView.measure.map, cache: lineView.measure.cache}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineView.rest[i] == line) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineNo(lineView.rest[i]) > lineN) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; + } - _populateTable: function () { - var self = this, o = this.options; - var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; - var freezeColLength = this._getFreezeColLength(); - BI.each(o.columnSize, function (i, size) { - if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { - totalLeftColumnSize += size; - } else { - totalRightColumnSize += size; - } - totalColumnSize += size; - if (i === 0) { - summaryColumnSizeArray[i] = size; - } else { - summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; - } - }); + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view; + } - var otlw = regionSize; - var otlh = o.header.length * o.headerRowSize; - var otrw = this._width - regionSize; - var otrh = o.header.length * o.headerRowSize; - var oblw = regionSize; - var oblh = this._height - o.header.length * o.headerRowSize; - var obrw = this._width - regionSize; - var obrh = this._height - o.header.length * o.headerRowSize; + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); + } - this.topLeft.setWidth(otlw); - this.topLeft.setHeight(otlh); - this.topRight.setWidth(otrw); - this.topRight.setHeight(otrh); - this.bottomLeft.setWidth(oblw); - this.bottomLeft.setHeight(oblh); - this.bottomRight.setWidth(obrw); - this.bottomRight.setHeight(obrh); - - this.topLeftCollection.setWidth(otlw); - this.topLeftCollection.setHeight(otlh); - this.topRightCollection.setWidth(otrw); - this.topRightCollection.setHeight(otrh); - this.bottomLeftCollection.setWidth(oblw); - this.bottomLeftCollection.setHeight(oblh); - this.bottomRightCollection.setWidth(obrw); - this.bottomRightCollection.setHeight(obrh); + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + return cm.display.view[findViewIndex(cm, lineN)]; + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + return ext; + } - var items = this.contextLayout.attr("items"); - items[1].left = regionSize; - items[2].top = o.header.length * o.headerRowSize; - items[3].left = regionSize; - items[3].top = o.header.length * o.headerRowSize; - this.contextLayout.attr("items", items); - this.contextLayout.resize(); + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) + view = null; + else if (view && view.changes) + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + if (!view) + view = updateExternalMeasurement(cm, line); - var leftHeader = [], rightHeader = [], leftItems = [], rightItems = []; - var run = function (positions, items, rendered) { - BI.each(positions, function (i, item) { - var cell = { - type: "bi.collection_table_cell", - cell: items[item.row][item.col] - }; - rendered.push(cell); - }); - }; - run(this.topLeftItems, o.header, leftHeader); - run(this.topRightItems, o.header, rightHeader); - run(this.bottomLeftItems, o.items, leftItems); - run(this.bottomRightItems, o.items, rightItems); + var info = mapFromLineView(view, line, lineN); + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + }; + } - this.topLeftCollection.populate(leftHeader); - this.topRightCollection.populate(rightHeader); - this.bottomLeftCollection.populate(leftItems); - this.bottomRightCollection.populate(rightItems); + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) ch = -1; + var key = ch + (bias || ""), found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) + prepared.rect = prepared.view.text.getBoundingClientRect(); + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) prepared.cache[key] = found; } -}); -$.shortcut('bi.quick_collection_table', BI.QuickCollectionTable);/** - * - * 表格单元格 - * - * Created by GUY on 2016/1/12. - * @class BI.GridTableCell - * @extends BI.Widget - */ -BI.GridTableCell = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.GridTableCell.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-grid-table-cell", - width: 0, - height: 0, - _rowIndex: 0, - _columnIndex: 0, - _left: 0, - _top: 0, - cell: {} - }) - }, + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom}; + } - _init: function () { - BI.GridTableCell.superclass._init.apply(this, arguments); - var o = this.options; - this.cell = BI.createWidget(BI.extend({ - type: "bi.label" - }, o.cell, { - cls: (o.cell.cls || "") + "grid-table-cell-wrapper", - width: o.width - (o._columnIndex === 0 ? 1 : 0) - 1, - height: o.height - (o._rowIndex === 0 ? 1 : 0) - 1 - })); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.cell, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }); - }, + var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; - setWidth: function (width) { - BI.GridTableCell.superclass.setWidth.apply(this, arguments); - var o = this.options; - this.cell.setWidth(o.width - (o._columnIndex === 0 ? 1 : 0) - 1); - }, + function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + var mStart = map[i], mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) collapse = "right"; + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + collapse = bias; + if (bias == "left" && start == 0) + while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } + if (bias == "right" && start == mEnd - mStart) + while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } + break; + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}; + } - setHeight: function (height) { - BI.GridTableCell.superclass.setHeight.apply(this, arguments); - var o = this.options; - this.cell.setHeight(o.height - (o._rowIndex === 0 ? 1 : 0) - 1); + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, start = place.start, end = place.end, collapse = place.collapse; + + var rect; + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) --start; + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) ++end; + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { + rect = node.parentNode.getBoundingClientRect(); + } else if (ie && cm.options.lineWrapping) { + var rects = range(node, start, end).getClientRects(); + if (rects.length) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = nullRect; + } else { + rect = range(node, start, end).getBoundingClientRect() || nullRect; + } + if (rect.left || rect.right || start == 0) break; + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) collapse = bias = "right"; + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = node.getBoundingClientRect(); + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) + rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; + else + rect = nullRect; } -}); -$.shortcut("bi.grid_table_cell", BI.GridTableCell);/** - * GridTable - * - * Created by GUY on 2016/1/12. - * @class BI.GridTable - * @extends BI.Widget - */ -BI.GridTable = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.GridTable.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-grid-table", - headerRowSize: 25, - rowSize: 25, - columnSize: [], - isNeedFreeze: false, - freezeCols: [], - header: [], - items: [], - regionColumnSize: [] - }); - }, + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + for (var i = 0; i < heights.length - 1; i++) + if (mid < heights[i]) break; + var top = i ? heights[i - 1] : 0, bot = heights[i]; + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot}; + if (!rect.left && !rect.right) result.bogus = true; + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } - _init: function () { - BI.GridTable.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this._width = 0; - this._height = 0; - this._scrollBarSize = BI.DOM.getScrollWidth(); - var rowHeightGetter = function () { - return o.rowSize; - }; - var columnLeftWidthGetter = function (index) { - return o.columnSize[index]; - }; - var columnRightWidthGetter = function (index) { - return o.columnSize[index + self._getFreezeColLength()]; - }; - this.topLeftGrid = BI.createWidget({ - type: "bi.grid_view", - rowHeightGetter: rowHeightGetter, - columnWidthGetter: columnLeftWidthGetter, - }); - this.topLeftGrid.on(BI.Grid.EVENT_SCROLL, function (scroll) { - self.bottomLeftGrid.setScrollLeft(scroll.scrollLeft); - self._populateScrollbar(); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.topRightGrid = BI.createWidget({ - type: "bi.grid_view", - rowHeightGetter: rowHeightGetter, - columnWidthGetter: columnRightWidthGetter, - }); - this.topRightGrid.on(BI.Grid.EVENT_SCROLL, function (scroll) { - self.bottomRightGrid.setScrollLeft(scroll.scrollLeft); - self._populateScrollbar(); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.bottomLeftGrid = BI.createWidget({ - type: "bi.grid_view", - rowHeightGetter: rowHeightGetter, - columnWidthGetter: columnLeftWidthGetter, - }); - this.bottomLeftGrid.on(BI.Grid.EVENT_SCROLL, function (scroll) { - self.bottomRightGrid.setScrollTop(scroll.scrollTop); - self.topLeftGrid.setScrollLeft(scroll.scrollLeft); - self._populateScrollbar(); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.bottomRightGrid = BI.createWidget({ - type: "bi.grid_view", - rowHeightGetter: rowHeightGetter, - columnWidthGetter: columnRightWidthGetter, - }); - this.bottomRightGrid.on(BI.Grid.EVENT_SCROLL, function (scroll) { - self.bottomLeftGrid.setScrollTop(scroll.scrollTop); - self.topRightGrid.setScrollLeft(scroll.scrollLeft); - self._populateScrollbar(); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.topLeft = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.topLeftGrid] - }); - this.topRight = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.topRightGrid] - }); - this.bottomLeft = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.bottomLeftGrid] - }); - this.bottomRight = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.bottomRightGrid] - }); - this.contextLayout = BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.topLeft, - top: 0, - left: 0 - }, { - el: this.topRight, - top: 0 - }, { - el: this.bottomLeft, - left: 0 - }, { - el: this.bottomRight - }] - }); + return result; + } - this.topScrollbar = BI.createWidget({ - type: "bi.grid_table_scrollbar", - width: BI.GridTableScrollbar.SIZE - }); - this.topScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function (scrollTop) { - self.bottomLeftGrid.setScrollTop(scrollTop); - self.bottomRightGrid.setScrollTop(scrollTop); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.leftScrollbar = BI.createWidget({ - type: "bi.grid_table_horizontal_scrollbar", - height: BI.GridTableScrollbar.SIZE - }); - this.leftScrollbar.on(BI.GridTableHorizontalScrollbar.EVENT_SCROLL, function (scrollLeft) { - self.topLeftGrid.setScrollLeft(scrollLeft); - self.bottomLeftGrid.setScrollLeft(scrollLeft); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.rightScrollbar = BI.createWidget({ - type: "bi.grid_table_horizontal_scrollbar", - height: BI.GridTableScrollbar.SIZE - }); - this.rightScrollbar.on(BI.GridTableHorizontalScrollbar.EVENT_SCROLL, function (scrollLeft) { - self.topRightGrid.setScrollLeft(scrollLeft); - self.bottomRightGrid.setScrollLeft(scrollLeft); - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }); - this.scrollBarLayout = BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.topScrollbar, - right: 0, - top: 0 - }, { - el: this.leftScrollbar, - left: 0 - }, { - el: this.rightScrollbar, - }] - }); - this._width = o.width - BI.GridTableScrollbar.SIZE; - this._height = o.height - BI.GridTableScrollbar.SIZE; - this.header = this._getHeader(); - this.items = this._getItems(); - if (o.items.length > 0) { - this._populate(); - } - }, + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + return rect; + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY}; + } - _getFreezeColLength: function () { - return this.options.isNeedFreeze ? this.options.freezeCols.length : 0; - }, + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + lineView.measure.caches[i] = {}; + } + } - _populateScrollbar: function () { - var o = this.options; - var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; - var freezeColLength = this._getFreezeColLength(); - BI.each(o.columnSize, function (i, size) { - if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { - totalLeftColumnSize += size; - } else { - totalRightColumnSize += size; - } - totalColumnSize += size; - if (i === 0) { - summaryColumnSizeArray[i] = size; - } else { - summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; - } - }); - this.topScrollbar.setContentSize(o.items.length * o.rowSize); - this.topScrollbar.setSize(this._height - o.header.length * o.headerRowSize); - this.topScrollbar.setPosition(Math.min(this.bottomLeftGrid.getScrollTop(), this.bottomRightGrid.getScrollTop())); - this.topScrollbar.populate(); + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) + clearLineMeasurementCacheFor(cm.display.view[i]); + } - this.leftScrollbar.setContentSize(totalLeftColumnSize); - this.leftScrollbar.setSize(regionSize); - this.leftScrollbar.setPosition(this.bottomLeftGrid.getScrollLeft()); - this.leftScrollbar.populate(); + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; + cm.display.lineNumChars = null; + } - this.rightScrollbar.setContentSize(totalRightColumnSize); - this.rightScrollbar.setSize(this._width - regionSize); - this.rightScrollbar.setPosition(this.bottomRightGrid.getScrollLeft()); - this.rightScrollbar.populate(); + function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } + function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } - var items = this.scrollBarLayout.attr("items"); - items[0].top = o.header.length * o.headerRowSize; - items[1].top = this._height; - items[2].top = this._height; - items[2].left = regionSize; - this.scrollBarLayout.attr("items", items); - this.scrollBarLayout.resize(); - }, + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"/null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context) { + if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { + var size = widgetHeight(lineObj.widgets[i]); + rect.top += size; rect.bottom += size; + } + if (context == "line") return rect; + if (!context) context = "local"; + var yOff = heightAtLine(lineObj); + if (context == "local") yOff += paddingTop(cm.display); + else yOff -= cm.display.viewOffset; + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect; + } - _getHeader: function () { - var o = this.options; - var freezeColLength = this._getFreezeColLength(); - var leftHeader = [], rightHeader = []; - BI.each(o.header, function (i, cols) { - leftHeader[i] = []; - rightHeader[i] = []; - BI.each(cols, function (j, col) { - var cell = { - type: "bi.grid_table_cell", - cell: col - }; - if (j < freezeColLength) { - leftHeader[i].push(cell); - } else { - rightHeader[i].push(cell); - } - }); - }); - return [leftHeader, rightHeader]; - }, + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"/null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") return coords; + var left = coords.left, top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } - _getItems: function () { - var o = this.options; - var freezeColLength = this._getFreezeColLength(); - var leftItems = [], rightItems = []; - BI.each(o.items, function (i, cols) { - leftItems[i] = []; - rightItems[i] = []; - BI.each(cols, function (j, col) { - var cell = { - type: "bi.grid_table_cell", - cell: col - }; - if (j < freezeColLength) { - leftItems[i].push(cell); - } else { - rightItems[i].push(cell); - } - }); - }); - return [leftItems, rightItems]; - }, + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; + } - _populateTable: function () { - var self = this, o = this.options; - var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; - var freezeColLength = this._getFreezeColLength(); - BI.each(o.columnSize, function (i, size) { - if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { - totalLeftColumnSize += size; - } else { - totalRightColumnSize += size; - } - totalColumnSize += size; - if (i === 0) { - summaryColumnSizeArray[i] = size; - } else { - summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; - } - }); + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) lineObj = getLine(cm.doc, pos.line); + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); + } - var tlw = regionSize; - var tlh = regionSize >= summaryColumnSizeArray[freezeColLength - 1] ? (o.header.length * o.headerRowSize) : (o.header.length * o.headerRowSize + this._scrollBarSize); - var trw = this._width - regionSize; - var trh = (this._width - regionSize >= totalColumnSize - (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (o.header.length * o.headerRowSize) : (o.header.length * o.headerRowSize + this._scrollBarSize); - var blw = (this._height - o.header.length * o.headerRowSize >= totalRowSize) ? regionSize : (regionSize + this._scrollBarSize); - var blh = (regionSize >= (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (this._height - o.header.length * o.headerRowSize) : (this._height - o.header.length * o.headerRowSize + this._scrollBarSize); - var brw = (this._height - o.header.length * o.headerRowSize >= totalRowSize) ? (this._width - regionSize) : (this._width - regionSize + this._scrollBarSize); - var brh = (this._width - regionSize >= totalColumnSize - (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (this._height - o.header.length * o.headerRowSize) : (this._height - o.header.length * o.headerRowSize + this._scrollBarSize); + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) m.left = m.right; else m.right = m.left; + return intoCoordSystem(cm, lineObj, m, context); + } + function getBidi(ch, partPos) { + var part = order[partPos], right = part.level % 2; + if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { + part = order[--partPos]; + ch = bidiRight(part) - (part.level % 2 ? 0 : 1); + right = true; + } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { + part = order[++partPos]; + ch = bidiLeft(part) - part.level % 2; + right = false; + } + if (right && ch == part.to && ch > part.from) return get(ch - 1); + return get(ch, right); + } + var order = getOrder(lineObj), ch = pos.ch; + if (!order) return get(ch); + var partPos = getBidiPartAt(order, ch); + var val = getBidi(ch, partPos); + if (bidiOther != null) val.other = getBidi(ch, bidiOther); + return val; + } - var otlw = regionSize; - var otlh = o.header.length * o.headerRowSize; - var otrw = this._width - regionSize; - var otrh = o.header.length * o.headerRowSize; - var oblw = regionSize; - var oblh = this._height - o.header.length * o.headerRowSize; - var obrw = this._width - regionSize; - var obrh = this._height - o.header.length * o.headerRowSize; + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0, pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return {left: left, right: left, top: top, bottom: top + lineObj.height}; + } - var digest = function (w, h, tw, th, el) { - if (w >= tw && h >= th) { - el.element.css({ - overflow: "hidden", - overflowX: "hidden", - overflowY: "hidden" - }) - } else if (w >= tw) { - el.element.css({ - overflow: "hidden", - overflowX: "hidden", - overflowY: "auto" - }) - } else if (h >= th) { - el.element.css({ - overflow: "hidden", - overflowX: "auto", - overflowY: "hidden" - }) - } else { - el.element.css({ - overflow: "auto", - overflowX: "auto", - overflowY: "auto" - }) - } - }; + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, outside, xRel) { + var pos = Pos(line, ch); + pos.xRel = xRel; + if (outside) pos.outside = true; + return pos; + } - this.topLeft.setWidth(otlw); - this.topLeft.setHeight(otlh); - this.topRight.setWidth(otrw); - this.topRight.setHeight(otrh); - this.bottomLeft.setWidth(oblw); - this.bottomLeft.setHeight(oblh); - this.bottomRight.setWidth(obrw); - this.bottomRight.setHeight(obrh); + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) return PosWithInfo(doc.first, 0, true, -1); + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineN > last) + return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); + if (x < 0) x = 0; - this.topLeftGrid.setWidth(tlw); - this.topLeftGrid.setHeight(tlh); - this.topRightGrid.setWidth(trw); - this.topRightGrid.setHeight(trh); - this.bottomLeftGrid.setWidth(blw); - this.bottomLeftGrid.setHeight(blh); - this.bottomRightGrid.setWidth(brw); - this.bottomRightGrid.setHeight(brh); + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var merged = collapsedSpanAtEnd(lineObj); + var mergedPos = merged && merged.find(0, true); + if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) + lineN = lineNo(lineObj = mergedPos.to.line); + else + return found; + } + } - digest(tlw, tlh, totalLeftColumnSize, o.header.length * o.headerRowSize, this.topLeftGrid); - digest(trw, trh, totalRightColumnSize, o.header.length * o.headerRowSize, this.topRightGrid); - digest(blw, blh, totalLeftColumnSize, o.items.length * o.rowSize, this.bottomLeftGrid); - digest(brw, brh, totalRightColumnSize, o.items.length * o.rowSize, this.bottomRightGrid); + function coordsCharInner(cm, lineObj, lineNo, x, y) { + var innerOff = y - heightAtLine(lineObj); + var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; + var preparedMeasure = prepareMeasureForLine(cm, lineObj); - this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); - this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); - this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); - this.topRightGrid.setEstimatedRowSize(o.headerRowSize); - this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); - this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); - this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); - this.bottomRightGrid.setEstimatedRowSize(o.rowSize); + function getX(ch) { + var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); + wrongLine = true; + if (innerOff > sp.bottom) return sp.left - adjust; + else if (innerOff < sp.top) return sp.left + adjust; + else wrongLine = false; + return sp.left; + } - var items = this.contextLayout.attr("items"); - items[1].left = regionSize; - items[2].top = o.header.length * o.headerRowSize; - items[3].left = regionSize; - items[3].top = o.header.length * o.headerRowSize; - this.contextLayout.attr("items", items); - this.contextLayout.resize(); + var bidi = getOrder(lineObj), dist = lineObj.text.length; + var from = lineLeft(lineObj), to = lineRight(lineObj); + var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; - this.topLeftGrid.populate(this.header[0]); - this.topRightGrid.populate(this.header[1]); - this.bottomLeftGrid.populate(this.items[0]); - this.bottomRightGrid.populate(this.items[1]); - }, + if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1); + // Do a binary search between these bounds. + for (;;) { + if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { + var ch = x < fromX || x - fromX <= toX - x ? from : to; + var xDiff = x - (ch == from ? fromX : toX); + while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; + var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside, + xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); + return pos; + } + var step = Math.ceil(dist / 2), middle = from + step; + if (bidi) { + middle = from; + for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); + } + var middleX = getX(middle); + if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;} + else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;} + } + } - _populate: function () { - if (this._width <= 0 || this._height <= 0) { - return; - } - this._populateTable(); - this._populateScrollbar(); - }, + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) return display.cachedTextHeight; + if (measureText == null) { + measureText = elt("pre"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) display.cachedTextHeight = height; + removeChildren(display.measure); + return height || 1; + } - getRegionSize: function () { - var o = this.options; - var regionSize = o.regionColumnSize[0] || 0; - if (o.isNeedFreeze === false || o.freezeCols.length === 0) { - return 0; - } - if (!regionSize) { - BI.each(o.freezeCols, function (i, col) { - regionSize += o.columnSize[col]; - }); - } - return regionSize; - }, + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) return display.cachedCharWidth; + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; + if (width > 2) display.cachedCharWidth = width; + return width || 10; + } - setVerticalScroll: function (scrollTop) { - this.bottomLeftGrid.setScrollTop(scrollTop); - this.bottomRightGrid.setScrollTop(scrollTop); - }, + // OPERATIONS - setLeftHorizontalScroll: function (scrollLeft) { - this.topLeftGrid.setScrollLeft(scrollLeft); - this.bottomLeftGrid.setScrollLeft(scrollLeft); - }, + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. - setRightHorizontalScroll: function (scrollLeft) { - this.topRightGrid.setScrollLeft(scrollLeft); - this.bottomRightGrid.setScrollLeft(scrollLeft); - }, + var operationGroup = null; - getVerticalScroll: function () { - return this.bottomRightGrid.getScrollTop(); - }, + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: null, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + }; + if (operationGroup) { + operationGroup.ops.push(cm.curOp); + } else { + cm.curOp.ownsGroup = operationGroup = { + ops: [cm.curOp], + delayedCallbacks: [] + }; + } + } - getLeftHorizontalScroll: function () { - return this.bottomLeftGrid.getScrollLeft(); - }, + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0; + do { + for (; i < callbacks.length; i++) + callbacks[i](); + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) + while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm); + } + } while (i < callbacks.length); + } - getRightHorizontalScroll: function () { - return this.bottomRightGrid.getScrollLeft(); - }, + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp, group = op.ownsGroup; + if (!group) return; - setWidth: function (width) { - BI.GridTable.superclass.setWidth.apply(this, arguments); - this._width = this.options.width - BI.GridTableScrollbar.SIZE; - }, + try { fireCallbacksForOps(group); } + finally { + operationGroup = null; + for (var i = 0; i < group.ops.length; i++) + group.ops[i].cm.curOp = null; + endOperations(group); + } + } - setHeight: function (height) { - BI.GridTable.superclass.setHeight.apply(this, arguments); - this._height = this.options.height - BI.GridTableScrollbar.SIZE; - }, + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R1(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W1(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R2(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W2(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_finish(ops[i]); + } - setColumnSize: function (columnSize) { - this.options.columnSize = columnSize; - }, + function endOperation_R1(op) { + var cm = op.cm, display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) findMaxLine(cm); - setRegionColumnSize: function (regionColumnSize) { - this.options.regionColumnSize = regionColumnSize; - }, + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + } - getColumnSize: function () { - return this.options.columnSize; - }, + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } - getRegionColumnSize: function () { - return this.options.regionColumnSize; - }, + function endOperation_R2(op) { + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) updateHeightsInViewport(cm); - populate: function (items, header) { - if (items && this.options.items !== items) { - this.options.items = items; - this.items = this._getItems(); - this._restore(); - } - if (header && this.options.header !== header) { - this.options.header = header; - this.header = this._getHeader(); - this._restore(); - } - this._populate(); - }, + op.barMeasure = measureForScrollbars(cm); - _restore: function () { - this.topLeftGrid.restore(); - this.topRightGrid.restore(); - this.bottomLeftGrid.restore(); - this.bottomRightGrid.restore(); - }, + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } - restore: function () { - this._restore(); + if (op.updatedDisplay || op.selectionChanged) + op.preparedSelection = display.input.prepareSelection(); + } + + function endOperation_W2(op) { + var cm = op.cm; + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) + setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); + cm.display.maxLineChanged = false; } -}); -$.shortcut('bi.grid_table', BI.GridTable);/** - * QuickGridTable - * - * Created by GUY on 2016/1/12. - * @class BI.QuickGridTable - * @extends BI.GridTable - */ -BI.QuickGridTable = BI.inherit(BI.GridTable, { - _defaultConfig: function () { - return BI.extend(BI.QuickGridTable.superclass._defaultConfig.apply(this, arguments), { - extraCls: "bi-quick-grid-table" - }); - }, - _init: function () { - BI.QuickGridTable.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.topLeftGrid.setOverflowX(false); - this.topLeftGrid.setOverflowY(false); - this.topRightGrid.setOverflowX(false); - this.topRightGrid.setOverflowY(false); - this.bottomLeftGrid.setOverflowX(false); - this.bottomLeftGrid.setOverflowY(false); - this.bottomRightGrid.setOverflowX(false); - this.bottomRightGrid.setOverflowY(false); - this._leftWheelHandler = new BI.WheelHandler( - BI.bind(this._onWheelY, this), - BI.bind(this._shouldHandleX, this), - BI.bind(this._shouldHandleY, this) - ); - this._rightWheelHandler = new BI.WheelHandler( - BI.bind(this._onWheelY, this), - BI.bind(this._shouldHandleX, this), - BI.bind(this._shouldHandleY, this) - ); - this.bottomLeftGrid.element.mousewheel(function (e) { - self._leftWheelHandler.onWheel(e.originalEvent); - }); - this.bottomRightGrid.element.mousewheel(function (e) { - self._rightWheelHandler.onWheel(e.originalEvent); - }); - }, + if (op.preparedSelection) + cm.display.input.showSelection(op.preparedSelection); + if (op.updatedDisplay) + setDocumentHeight(cm, op.barMeasure); + if (op.updatedDisplay || op.startHeight != cm.doc.height) + updateScrollbars(cm, op.barMeasure); - _shouldHandleX: function (delta) { - return false; - }, + if (op.selectionChanged) restartBlink(cm); - _shouldHandleY: function (delta) { - if (delta > 0) { - return this.bottomRightGrid.getScrollTop() < this.bottomRightGrid.getMaxScrollTop(); - } else { - return this.bottomRightGrid.getScrollTop() > 0; - } - }, + if (cm.state.focused && op.updateInput) + cm.display.input.reset(op.typing); + if (op.focus && op.focus == activeElt()) ensureFocus(op.cm); + } - _onWheelY: function (deltaX, deltaY) { - var self = this; - var scrollTop = this.bottomRightGrid.getScrollTop(); - scrollTop += deltaY; - this.bottomLeftGrid.setScrollTop(scrollTop); - this.bottomRightGrid.setScrollTop(scrollTop); - self._populateScrollbar(); - this.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); - }, + function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc; - _populateTable: function () { - var self = this, o = this.options; - var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; - var freezeColLength = this._getFreezeColLength(); - BI.each(o.columnSize, function (i, size) { - if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { - totalLeftColumnSize += size; - } else { - totalRightColumnSize += size; - } - totalColumnSize += size; - if (i === 0) { - summaryColumnSizeArray[i] = size; - } else { - summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; - } - }); + if (op.updatedDisplay) postUpdateDisplay(cm, op.update); - var otlw = regionSize; - var otlh = o.header.length * o.headerRowSize; - var otrw = this._width - regionSize; - var otrh = o.header.length * o.headerRowSize; - var oblw = regionSize; - var oblh = this._height - o.header.length * o.headerRowSize; - var obrw = this._width - regionSize; - var obrh = this._height - o.header.length * o.headerRowSize; + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + display.wheelStartX = display.wheelStartY = null; - this.topLeft.setWidth(otlw); - this.topLeft.setHeight(otlh); - this.topRight.setWidth(otrw); - this.topRight.setHeight(otrh); - this.bottomLeft.setWidth(oblw); - this.bottomLeft.setHeight(oblh); - this.bottomRight.setWidth(obrw); - this.bottomRight.setHeight(obrh); + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { + doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); + display.scrollbars.setScrollTop(doc.scrollTop); + display.scroller.scrollTop = doc.scrollTop; + } + if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { + doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - displayWidth(cm), op.scrollLeft)); + display.scrollbars.setScrollLeft(doc.scrollLeft); + display.scroller.scrollLeft = doc.scrollLeft; + alignHorizontally(cm); + } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); + } - this.topLeftGrid.setWidth(otlw); - this.topLeftGrid.setHeight(otlh); - this.topRightGrid.setWidth(otrw); - this.topRightGrid.setHeight(otrh); - this.bottomLeftGrid.setWidth(oblw); - this.bottomLeftGrid.setHeight(oblh); - this.bottomRightGrid.setWidth(obrw); - this.bottomRightGrid.setHeight(obrh); + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; + if (hidden) for (var i = 0; i < hidden.length; ++i) + if (!hidden[i].lines.length) signal(hidden[i], "hide"); + if (unhidden) for (var i = 0; i < unhidden.length; ++i) + if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); - this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); - this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); - this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); - this.topRightGrid.setEstimatedRowSize(o.headerRowSize); - this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); - this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); - this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); - this.bottomRightGrid.setEstimatedRowSize(o.rowSize); + if (display.wrapper.offsetHeight) + doc.scrollTop = cm.display.scroller.scrollTop; - var items = this.contextLayout.attr("items"); - items[1].left = regionSize; - items[2].top = o.header.length * o.headerRowSize; - items[3].left = regionSize; - items[3].top = o.header.length * o.headerRowSize; - this.contextLayout.attr("items", items); - this.contextLayout.resize(); + // Fire change events, and delayed event handlers + if (op.changeObjs) + signal(cm, "changes", cm, op.changeObjs); + if (op.update) + op.update.finish(); + } - var leftHeader = [], rightHeader = [], leftItems = [], rightItems = []; - BI.each(o.header, function (i, cols) { - leftHeader[i] = []; - rightHeader[i] = []; - BI.each(cols, function (j, col) { - var cell = { - type: "bi.grid_table_cell", - cell: col - }; - if (j < freezeColLength) { - leftHeader[i].push(cell); - } else { - rightHeader[i].push(cell); - } - }); - }); - BI.each(o.items, function (i, cols) { - leftItems[i] = []; - rightItems[i] = []; - BI.each(cols, function (j, col) { - var cell = { - type: "bi.grid_table_cell", - cell: col - }; - if (j < freezeColLength) { - leftItems[i].push(cell); - } else { - rightItems[i].push(cell); - } - }); - }); - this.topLeftGrid.populate(leftHeader); - this.topRightGrid.populate(rightHeader); - this.bottomLeftGrid.populate(leftItems); - this.bottomRightGrid.populate(rightItems); - } -}); -$.shortcut('bi.quick_grid_table', BI.QuickGridTable);/** - * - * 表格滚动条 - * - * Created by GUY on 2016/1/12. - * @class BI.GridTableScrollbar - * @extends BI.Widget - */ -BI.GridTableScrollbar = BI.inherit(BI.Widget, { - _const: { - FACE_MARGIN: 4, - FACE_MARGIN_2: 4 * 2, - FACE_SIZE_MIN: 30, - KEYBOARD_SCROLL_AMOUNT: 40 - }, - _defaultConfig: function () { - return BI.extend(BI.GridTableScrollbar.superclass._defaultConfig.apply(this, arguments), { - baseCls: "scrollbar-layout-main public-scrollbar-main", - attributes: { - tabIndex: 0 - }, - contentSize: 0, - defaultPosition: 0, - isOpaque: false, - orientation: "vertical", - position: 0, - size: 0 - }) - }, + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) return f(); + startOperation(cm); + try { return f(); } + finally { endOperation(cm); } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function() { + if (cm.curOp) return f.apply(cm, arguments); + startOperation(cm); + try { return f.apply(cm, arguments); } + finally { endOperation(cm); } + }; + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function() { + if (this.curOp) return f.apply(this, arguments); + startOperation(this); + try { return f.apply(this, arguments); } + finally { endOperation(this); } + }; + } + function docMethodOp(f) { + return function() { + var cm = this.cm; + if (!cm || cm.curOp) return f.apply(this, arguments); + startOperation(cm); + try { return f.apply(this, arguments); } + finally { endOperation(cm); } + }; + } - _init: function () { - BI.GridTableScrollbar.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.focused = false; - this.isDragging = false; - this.face = BI.createWidget({ - type: "bi.layout", - cls: "scrollbar-layout-face public-scrollbar-face " - + (this._isHorizontal() ? "scrollbar-layout-face-horizontal" : "scrollbar-layout-face-vertical") - }); - this.contextLayout = BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.face, - left: 0, - top: 0 - }] - }); - var onWheel = o.orientation === 'horizontal' ? this._onWheelX : this._onWheelY; - this._wheelHandler = new BI.WheelHandler( - BI.bind(onWheel, this), - BI.bind(this._shouldHandleX, this), - BI.bind(this._shouldHandleY, this) - ); - this._mouseMoveTracker = new BI.MouseMoveTracker( - BI.bind(this._onMouseMove, this), - BI.bind(this._onMouseMoveEnd, this), - document - ); - this.element.on("mousedown", BI.bind(this._onMouseDown, this)); - this.element.on("mousewheel", function (e) { - self._wheelHandler.onWheel(e.originalEvent); - }); - this.element.on("keydown", BI.bind(this._onKeyDown, this)); - this.element.on("focus", function () { - self.focused = true; - self._populate(); - }); - this.element.on("blur", function () { - self.focused = false; - self._populate(); - }); - if (this._isHorizontal()) { - this.element.addClass("scrollbar-layout-main-horizontal"); - } else { - this.element.addClass("scrollbar-layout-main-vertical"); - } - this._populate(); - }, - - _isHorizontal: function () { - return this.options.orientation === 'horizontal' - }, - - _getScale: function () { - var o = this.options; - var scale = o.size / o.contentSize; - var faceSize = o.size * scale; + // VIEW TRACKING - if (faceSize < this._const.FACE_SIZE_MIN) { - scale = (o.size - this._const.FACE_SIZE_MIN) / (o.contentSize - o.size); - } - return scale; - }, + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } - _getFaceSize: function () { - var o = this.options; - var scale = o.size / o.contentSize; - var faceSize = o.size * scale; + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array; + } - if (faceSize < this._const.FACE_SIZE_MIN) { - faceSize = this._const.FACE_SIZE_MIN; - } - return faceSize; - }, + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) from = cm.doc.first; + if (to == null) to = cm.doc.first + cm.doc.size; + if (!lendiff) lendiff = 0; - _shouldHandleX: function (delta) { - return this.options.orientation === 'horizontal' ? - this._shouldHandleChange(delta) : - false; - }, + var display = cm.display; + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + display.updateLineNumbers = from; - _shouldHandleY: function (delta) { - return this.options.orientation !== 'horizontal' ? - this._shouldHandleChange(delta) : - false; - }, + cm.curOp.viewChanged = true; - _shouldHandleChange: function (delta) { - return this.options.position + delta !== this.options.position; - }, + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + resetView(cm); + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut = viewCuttingPoint(cm, from, from, -1); + if (cut) { + display.view = display.view.slice(0, cut.index); + display.viewTo = cut.lineN; + } else { + resetView(cm); + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } - _onWheelY: function (deltaX, deltaY) { - this._onWheel(deltaY); - }, + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) + ext.lineN += lendiff; + else if (from < ext.lineN + ext.size) + display.externalMeasured = null; + } + } - _onWheelX: function (deltaX, deltaY) { - this._onWheel(deltaX); - }, + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + display.externalMeasured = null; - _onWheel: function (delta) { - var maxPosition = this.options.contentSize - this.options.size; - this.options.position += delta; - if (this.options.position < 0) { - this.options.position = 0; - } else if (this.options.position > maxPosition) { - this.options.position = maxPosition; - } - this._populate(); - this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL, this.options.position); - }, + if (line < display.viewFrom || line >= display.viewTo) return; + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) return; + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) arr.push(type); + } - _onMouseDown: function (e) { - if (e.target !== this.face.element[0]) { - var position = this._isHorizontal() ? e.offsetX : e.offsetY; - position /= this._getScale(); - this.options.position = BI.clamp(position - (this._getFaceSize() * 0.5 / this._getScale()), 0, this.options.contentSize - this.options.size); - this._populate(); - this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL, this.options.position); - } else { - this._mouseMoveTracker.captureMouseMoves(e); - } - this.element[0].focus(); - }, + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } - _onMouseMove: function (deltaX, deltaY) { - var delta = this._isHorizontal() ? deltaX : deltaY; - delta /= this._getScale(); - this.options.position = BI.clamp(this.options.position + delta, 0, this.options.contentSize - this.options.size); - this.isDragging = this._mouseMoveTracker.isDragging(); - this._populate(); - this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL, this.options.position); - }, + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) return null; + n -= cm.display.viewFrom; + if (n < 0) return null; + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) return i; + } + } - _onMouseMoveEnd: function (event) { - this._mouseMoveTracker.releaseMouseMoves(); - if (this.isDragging === true) { - this.isDragging = false; - this._populate(); - } - }, + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + return {index: index, lineN: newN}; + for (var i = 0, n = cm.display.viewFrom; i < index; i++) + n += view[i].size; + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) return null; + diff = (n + view[index].size) - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) return null; + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return {index: index, lineN: newN}; + } - _onKeyDown: function (event) { - var Keys = { - BACKSPACE: 8, - TAB: 9, - RETURN: 13, - ALT: 18, - ESC: 27, - SPACE: 32, - PAGE_UP: 33, - PAGE_DOWN: 34, - END: 35, - HOME: 36, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - DELETE: 46, - COMMA: 188, - PERIOD: 190, - A: 65, - Z: 90, - ZERO: 48, - NUMPAD_0: 96, - NUMPAD_9: 105 - }; - var keyCode = event.keyCode; - - if (keyCode === Keys.TAB) { - return; - } - - var distance = 40; - var direction = 0; + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) + display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); + else if (display.viewFrom < from) + display.view = display.view.slice(findViewIndex(cm, from)); + display.viewFrom = from; + if (display.viewTo < to) + display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); + else if (display.viewTo > to) + display.view = display.view.slice(0, findViewIndex(cm, to)); + } + display.viewTo = to; + } - if (this._isHorizontal()) { - switch (keyCode) { - case Keys.HOME: - direction = -1; - distance = this.options.contentSize; - break; + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; + } + return dirty; + } - case Keys.LEFT: - direction = -1; - break; + // EVENT HANDLERS - case Keys.RIGHT: - direction = 1; - break; + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + on(d.scroller, "dblclick", operation(cm, function(e) { + if (signalDOMEvent(cm, e)) return; + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); + else + on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); - default: - return; - } + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0}; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date; + } + }; + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) return false; + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1; + } + function farAway(touch, other) { + if (other.left == null) return true; + var dx = other.left - touch.left, dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20; + } + on(d.scroller, "touchstart", function(e) { + if (!isMouseLikeTouchEvent(e)) { + clearTimeout(touchFinished); + var now = +new Date; + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null}; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; } + } + }); + on(d.scroller, "touchmove", function() { + if (d.activeTouch) d.activeTouch.moved = true; + }); + on(d.scroller, "touchend", function(e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range; + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + range = new Range(pos, pos); + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + range = cm.findWordAt(pos); + else // Triple tap + range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); - if (!this._isHorizontal()) { - switch (keyCode) { - case Keys.SPACE: - if (event.shiftKey) { - direction = -1; - } else { - direction = 1; - } - break; - - case Keys.HOME: - direction = -1; - distance = this.options.contentSize; - break; + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function() { + if (d.scroller.clientHeight) { + setScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); - case Keys.UP: - direction = -1; - break; + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); + on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); - case Keys.DOWN: - direction = 1; - break; + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - case Keys.PAGE_UP: - direction = -1; - distance = this.options.size; - break; + d.dragFunctions = { + simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);}, + start: function(e){onDragStart(cm, e);}, + drop: operation(cm, onDrop) + }; - case Keys.PAGE_DOWN: - direction = 1; - distance = this.options.size; - break; + var inp = d.input.getField(); + on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", bind(onFocus, cm)); + on(inp, "blur", bind(onBlur, cm)); + } - default: - return; - } - } + function dragDropChanged(cm, value, old) { + var wasOn = old && old != CodeMirror.Init; + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.simple); + toggle(cm.display.scroller, "dragover", funcs.simple); + toggle(cm.display.scroller, "drop", funcs.drop); + } + } - this.options.position = BI.clamp(this.options.position + (distance * direction), 0, this.options.contentSize - this.options.size); - event.preventDefault(); - this._populate(); - this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL, this.options.position); - }, + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) + return; + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } - _populate: function () { - var self = this, o = this.options; - if (o.size < 1 || o.contentSize <= o.size) { - this.setVisible(false); - return; - } - this.setVisible(true); + // MOUSE EVENTS - var size = o.size; - var isHorizontal = this._isHorizontal(); - var isActive = this.focused || this.isDragging; + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + return true; + } + } - var faceSize = this._getFaceSize(); - var isOpaque = o.isOpaque; - this.element[isOpaque === true ? "addClass" : "removeClass"]("public-scrollbar-main-opaque"); - this.element[isActive === true ? "addClass" : "removeClass"]("public-scrollbar-main-active"); - - this.face.element[isActive === true ? "addClass" : "removeClass"]("public-scrollbar-face-active"); - - var position = o.position * this._getScale() + this._const.FACE_MARGIN; - - var items = this.contextLayout.attr("items"); - if (isHorizontal) { - this.setWidth(size); - this.face.setWidth(faceSize - this._const.FACE_MARGIN_2); - items[0].left = position; - items[0].top = 0; - } else { - this.setHeight(size); - this.face.setHeight(faceSize - this._const.FACE_MARGIN_2); - items[0].left = 0; - items[0].top = position; - } - this.contextLayout.attr("items", items); - this.contextLayout.resize(); - }, - - setContentSize: function (contentSize) { - this.options.contentSize = contentSize; - }, + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") return null; - setPosition: function (position) { - this.options.position = position; - }, + var x, y, space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top; } + catch (e) { return null; } + var coords = coordsChar(cm, x, y), line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords; + } - setSize: function (size) { - this.options.size = size; - }, + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, display = cm.display; + if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return; + display.shift = e.shiftKey; - populate: function () { - this._populate(); + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function(){display.scroller.draggable = true;}, 100); + } + return; } -}); -BI.GridTableScrollbar.SIZE = 10; -BI.GridTableScrollbar.EVENT_SCROLL = "EVENT_SCROLL"; -$.shortcut("bi.grid_table_scrollbar", BI.GridTableScrollbar); + if (clickInGutter(cm, e)) return; + var start = posFromMouse(cm, e); + window.focus(); + switch (e_button(e)) { + case 1: + if (start) + leftButtonDown(cm, e, start); + else if (e_target(e) == display.scroller) + e_preventDefault(e); + break; + case 2: + if (webkit) cm.state.lastMiddleDown = +new Date; + if (start) extendSelection(cm.doc, start); + setTimeout(function() {display.input.focus();}, 20); + e_preventDefault(e); + break; + case 3: + if (captureRightClick) onContextMenu(cm, e); + else delayBlurEvent(cm); + break; + } + } -BI.GridTableHorizontalScrollbar = BI.inherit(BI.Widget, { - _const: { - FACE_MARGIN: 4, - FACE_MARGIN_2: 4 * 2, - FACE_SIZE_MIN: 30, - KEYBOARD_SCROLL_AMOUNT: 40 - }, - _defaultConfig: function () { - return BI.extend(BI.GridTableHorizontalScrollbar.superclass._defaultConfig.apply(this, arguments), { - attributes: { - tabIndex: 0 - }, - contentSize: 0, - position: 0, - size: 0 - }) - }, + var lastClick, lastDoubleClick; + function leftButtonDown(cm, e, start) { + if (ie) setTimeout(bind(ensureFocus, cm), 0); + else cm.curOp.focus = activeElt(); - _init: function () { - BI.GridTableHorizontalScrollbar.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.scrollbar = BI.createWidget({ - type: "bi.grid_table_scrollbar", - orientation: "horizontal", - isOpaque: true, - position: o.position, - contentSize: o.contentSize, - size: o.size - }); - this.scrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function () { - self.fireEvent(BI.GridTableHorizontalScrollbar.EVENT_SCROLL, arguments); - }); - BI.createWidget({ - type: "bi.absolute", - cls: "horizontal-scrollbar", - element: this, - width: o.size, - height: BI.GridTableScrollbar.SIZE, - items: [{ - el: { - type: "bi.absolute", - scrollable: false, - height: BI.GridTableScrollbar.SIZE, - items: [{ - el: this.scrollbar, - left: 0, - top: 0 - }] - }, - top: 0, - left: 0, - right: 0 - }] - }); - }, + var now = +new Date, type; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { + type = "triple"; + } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { + type = "double"; + lastDoubleClick = {time: now, pos: start}; + } else { + type = "single"; + lastClick = {time: now, pos: start}; + } - setContentSize: function (contentSize) { - this.options.contentSize = contentSize; - this.scrollbar.setContentSize(contentSize); - }, + var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; + if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && + type == "single" && (contained = sel.contains(start)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) && + (cmp(contained.to(), start) > 0 || start.xRel < 0)) + leftButtonStartDrag(cm, e, start, modifier); + else + leftButtonSelect(cm, e, start, type, modifier); + } - setPosition: function (position) { - this.options.position = position; - this.scrollbar.setPosition(position); - }, + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, e, start, modifier) { + var display = cm.display, startTime = +new Date; + var dragEnd = operation(cm, function(e2) { + if (webkit) display.scroller.draggable = false; + cm.state.draggingText = false; + off(document, "mouseup", dragEnd); + off(display.scroller, "drop", dragEnd); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); + if (!modifier && +new Date - 200 < startTime) + extendSelection(cm.doc, start); + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) + setTimeout(function() {document.body.focus(); display.input.focus();}, 20); + else + display.input.focus(); + } + }); + // Let the drag handler handle this. + if (webkit) display.scroller.draggable = true; + cm.state.draggingText = dragEnd; + // IE's approach to draggable + if (display.scroller.dragDrop) display.scroller.dragDrop(); + on(document, "mouseup", dragEnd); + on(display.scroller, "drop", dragEnd); + } - setSize: function (size) { - this.setWidth(size); - this.options.size = size; - this.scrollbar.setSize(size); - }, + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, e, start, type, addNew) { + var display = cm.display, doc = cm.doc; + e_preventDefault(e); - populate: function () { - this.scrollbar.populate(); + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; + if (addNew && !e.shiftKey) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) + ourRange = ranges[ourIndex]; + else + ourRange = new Range(start, start); + } else { + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; } -}); -BI.GridTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL"; -$.shortcut("bi.grid_table_horizontal_scrollbar", BI.GridTableHorizontalScrollbar);/** - * - * 表格 - * - * Created by GUY on 2015/9/22. - * @class BI.TableHeaderCell - * @extends BI.Single - */ -BI.TableHeaderCell = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.TableHeaderCell.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-table-header-cell", - text: "" - }) - }, - _init: function () { - BI.TableHeaderCell.superclass._init.apply(this, arguments); - BI.createWidget({ - type: "bi.label", - element: this, - textAlign: "center", - height: this.options.height, - text: this.options.text, - value: this.options.value - }) - } -}); + if (e.altKey) { + type = "rect"; + if (!addNew) ourRange = new Range(start, start); + start = posFromMouse(cm, e, true, true); + ourIndex = -1; + } else if (type == "double") { + var word = cm.findWordAt(start); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, word.anchor, word.head); + else + ourRange = word; + } else if (type == "triple") { + var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, line.anchor, line.head); + else + ourRange = line; + } else { + ourRange = extendRange(doc, ourRange, start); + } -$.shortcut("bi.table_header_cell", BI.TableHeaderCell);/** - * - * 表格 - * - * 能处理静态宽度以及动态宽度的表, 百分比宽度的表请使用PreviewTable - * - * Created by GUY on 2015/9/22. - * @class BI.Table - * @extends BI.Widget - */ -BI.Table = BI.inherit(BI.Widget, { + if (!addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0)); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } - _defaultConfig: function () { - return BI.extend(BI.Table.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-table", - logic: { //冻结的页面布局逻辑 - dynamic: false - }, + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) return; + lastPos = pos; - isNeedResize: false,//是否需要调整列宽 - isResizeAdapt: true,//是否需要在调整列宽或区域宽度的时候它们自适应变化 + if (type == "rect") { + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); + if (left == right) + ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); + else if (text.length > leftPos) + ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); + } + if (!ranges.length) ranges.push(new Range(start, start)); + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var anchor = oldRange.anchor, head = pos; + if (type != "single") { + if (type == "double") + var range = cm.findWordAt(pos); + else + var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); + if (cmp(range.anchor, anchor) > 0) { + head = range.head; + anchor = minPos(oldRange.from(), range.anchor); + } else { + head = range.anchor; + anchor = maxPos(oldRange.to(), range.head); + } + } + var ranges = startSel.ranges.slice(0); + ranges[ourIndex] = new Range(clipPos(doc, anchor), head); + setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); + } + } - isNeedFreeze: false,//是否需要冻结单元格 - freezeCols: [], //冻结的列号,从0开始,isNeedFreeze为true时生效 + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; - isNeedMerge: false,//是否需要合并单元格 - mergeCols: [], //合并的单元格列号 - mergeRule: function (row1, row2) { //合并规则, 默认相等时合并 - return BI.isEqual(row1, row2); - }, + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, type == "rect"); + if (!cur) return; + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) setTimeout(operation(cm, function() { + if (counter != curCount) return; + display.scroller.scrollTop += outside; + extend(e); + }), 50); + } + } - columnSize: [], - headerRowSize: 25, - footerRowSize: 25, - rowSize: 25, + function done(e) { + counter = Infinity; + e_preventDefault(e); + display.input.focus(); + off(document, "mousemove", move); + off(document, "mouseup", up); + doc.history.lastSelOrigin = null; + } - regionColumnSize: false, + var move = operation(cm, function(e) { + if (!e_button(e)) done(e); + else extend(e); + }); + var up = operation(cm, done); + on(document, "mousemove", move); + on(document, "mouseup", up); + } - header: [], - footer: false, - items: [] //二维数组 - }) - }, + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent, signalfn) { + try { var mX = e.clientX, mY = e.clientY; } + catch(e) { return false; } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; + if (prevent) e_preventDefault(e); - _calculateWidth: function (width) { - if (!width || width === "0") { - return ""; - } - width = BI.parseFloat(width); - if (width < 0) { - width = 0; - } - return width > 1.01 ? width : (width * 100 + "%"); - }, + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); - _calculateHeight: function (height) { - return height ? height : ""; - }, + if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); + mY -= lineBox.top - display.viewOffset; - _isRightFreeze: function () { - return BI.isNotEmptyArray(this.options.freezeCols) && BI.first(this.options.freezeCols) !== 0; - }, + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.options.gutters[i]; + signalfn(cm, type, cm, line, gutter, e); + return e_defaultPrevented(e); + } + } + } - _createTopLeft: function () { - var o = this.options, isRight = this._isRightFreeze(); - this.topLeftColGroupTds = {}; - this.topLeftBodyTds = {}; - this.topLeftBodyItems = {}; - var table = this._table(); - var colgroup = this._createColGroup(this.columnLeft, this.topLeftColGroupTds); - var body = this.topLeftBody = this._body(); - body.element.append(this._createHeaderCells(this.topLeftItems, this.columnLeft, this.mergeLeft, this.topLeftBodyTds, this.topLeftBodyItems)); - BI.createWidget({ - type: "bi.adaptive", - element: table, - items: [colgroup, body] - }); - if (isRight) { - var w = 0; - BI.each(o.columnSize, function (i, col) { - if (!o.freezeCols.contains(i)) { - w += col; - } - }); - if (BI.isNumeric(w) && w > 1) { - w = BI.parseFloat(w) + o.columnSize.length - o.freezeCols.length; - } - } - return (this.topLeftContainer = BI.createWidget({ - type: "bi.adaptive", - width: this._calculateWidth(w), - items: [table] - })); - }, + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true, signalLater); + } - _createTopRight: function () { - var o = this.options, isRight = this._isRightFreeze(); - this.topRightColGroupTds = {}; - this.topRightBodyTds = {}; - this.topRightBodyItems = {}; - var table = this._table(); - var colgroup = this._createColGroup(this.columnRight, this.topRightColGroupTds); - var body = this.topRightBody = this._body(); - body.element.append(this._createHeaderCells(this.topRightItems, this.columnRight, this.mergeRight, this.topRightBodyTds, this.topRightBodyItems, this.columnLeft.length)); - BI.createWidget({ - type: "bi.adaptive", - element: table, - items: [colgroup, body] - }); - if (!isRight) { - var w = 0; - BI.each(o.columnSize, function (i, col) { - if (!o.freezeCols.contains(i)) { - w += col; - } - }); - if (BI.isNumeric(w)) { - w = BI.parseFloat(w) + o.columnSize.length - o.freezeCols.length; - } - } - return (this.topRightContainer = BI.createWidget({ - type: "bi.adaptive", - width: w || undefined, - items: [table] - })); - }, + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; - _createBottomLeft: function () { - var o = this.options, isRight = this._isRightFreeze(); - this.bottomLeftColGroupTds = {}; - this.bottomLeftBodyTds = {}; - this.bottomLeftBodyItems = {}; - var table = this._table(); - var colgroup = this._createColGroup(this.columnLeft, this.bottomLeftColGroupTds); - var body = this._createBottomLeftBody(); - BI.createWidget({ - type: "bi.adaptive", - element: table, - items: [colgroup, body] + function onDrop(e) { + var cm = this; + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + return; + e_preventDefault(e); + if (ie) lastDrop = +new Date; + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || isReadOnly(cm)) return; + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var loadFile = function(file, i) { + var reader = new FileReader; + reader.onload = operation(cm, function() { + text[i] = reader.result; + if (++read == n) { + pos = clipPos(cm.doc, pos); + var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + } }); - if (isRight) { - var w = 0; - BI.each(o.columnSize, function (i, col) { - if (!o.freezeCols.contains(i)) { - w += col; - } - }); - if (BI.isNumeric(w) && w > 1) { - w = BI.parseFloat(w) + o.columnSize.length - o.freezeCols.length; - } + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) loadFile(files[i], i); + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function() {cm.display.input.focus();}, 20); + return; + } + try { + var text = e.dataTransfer.getData("Text"); + if (text) { + if (cm.state.draggingText && !(mac ? e.altKey : e.ctrlKey)) + var selected = cm.listSelections(); + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) for (var i = 0; i < selected.length; ++i) + replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); + cm.replaceSelection(text, "around", "paste"); + cm.display.input.focus(); } - return (this.bottomLeftContainer = BI.createWidget({ - type: "bi.adaptive", - width: this._calculateWidth(w), - items: [table] - })); - }, + } + catch(e){} + } + } - _createBottomLeftBody: function () { - var body = this.bottomLeftBody = this._body(); - body.element.append(this._createCells(this.bottomLeftItems, this.columnLeft, this.mergeLeft, this.bottomLeftBodyTds, this.bottomLeftBodyItems)); - return body; - }, + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; - _createBottomRight: function () { - var o = this.options, isRight = this._isRightFreeze(); - this.bottomRightColGroupTds = {}; - this.bottomRightBodyTds = {}; - this.bottomRightBodyItems = {}; - var table = this._table(); - var colgroup = this._createColGroup(this.columnRight, this.bottomRightColGroupTds); - var body = this._createBottomRightBody(); - BI.createWidget({ - type: "bi.adaptive", - element: table, - items: [colgroup, body] - }); - if (!isRight) { - var w = 0; - BI.each(o.columnSize, function (i, col) { - if (!o.freezeCols.contains(i)) { - w += col; - } - }); - if (BI.isNumeric(w) && w > 1) { - w = BI.parseFloat(w) + o.columnSize.length - o.freezeCols.length; - } - } - return (this.bottomRightContainer = BI.createWidget({ - type: "bi.adaptive", - width: this._calculateWidth(w), - items: [table] - })); - }, + e.dataTransfer.setData("Text", cm.getSelection()); - _createBottomRightBody: function () { - var body = this.bottomRightBody = this._body(); - body.element.append(this._createCells(this.bottomRightItems, this.columnRight, this.mergeRight, this.bottomRightBodyTds, this.bottomRightBodyItems, this.columnLeft.length)); - return body; - }, + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) img.parentNode.removeChild(img); + } + } - _createFreezeTable: function () { - var self = this, o = this.options; - var isRight = this._isRightFreeze(); - var split = this._split(o.header); - this.topLeftItems = split.left; - this.topRightItems = split.right; - split = this._split(o.items); - this.bottomLeftItems = split.left; - this.bottomRightItems = split.right; + // SCROLL EVENTS - this.columnLeft = []; - this.columnRight = []; - BI.each(o.columnSize, function (i, size) { - if (o.freezeCols.contains(i)) { - self[isRight ? "columnRight" : "columnLeft"].push(size); - } else { - self[isRight ? "columnLeft" : "columnRight"].push(size); - } - }); - this.mergeLeft = []; - this.mergeRight = []; - BI.each(o.mergeCols, function (i, col) { - if (o.freezeCols.contains(col)) { - self[isRight ? "mergeRight" : "mergeLeft"].push(col); - } else { - self[isRight ? "mergeLeft" : "mergeRight"].push(col); - } - }); + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function setScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) return; + cm.doc.scrollTop = val; + if (!gecko) updateDisplaySimple(cm, {top: val}); + if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (gecko) updateDisplaySimple(cm); + startWorker(cm, 100); + } + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller) { + if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; + cm.display.scrollbars.setScrollLeft(val); + } - var topLeft = this._createTopLeft(); - var topRight = this._createTopRight(); - var bottomLeft = this._createBottomLeft(); - var bottomRight = this._createBottomRight(); + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. - this.scrollTopLeft = BI.createWidget({ - type: "bi.adaptive", - cls: "scroll-top-left", - width: "100%", - height: "100%", - scrollable: false, - items: [topLeft] - }); - this.scrollTopRight = BI.createWidget({ - type: "bi.adaptive", - cls: "scroll-top-right", - width: "100%", - height: "100%", - scrollable: false, - items: [topRight] - }); - this.scrollBottomLeft = BI.createWidget({ - type: "bi.adaptive", - cls: "scroll-bottom-left", - width: "100%", - height: "100%", - scrollable: isRight || null, - scrollx: !isRight, - items: [bottomLeft] - }); - this.scrollBottomRight = BI.createWidget({ - type: "bi.adaptive", - cls: "scroll-bottom-right", - width: "100%", - height: "100%", - scrollable: !isRight || null, - scrollx: isRight, - items: [bottomRight] - }); - this.topLeft = BI.createWidget({ - type: "bi.adaptive", - cls: "top-left", - scrollable: false, - items: [this.scrollTopLeft] - }); - this.topRight = BI.createWidget({ - type: "bi.adaptive", - cls: "top-right", - scrollable: false, - items: [this.scrollTopRight] - }); - this.bottomLeft = BI.createWidget({ - type: "bi.adaptive", - cls: "bottom-left", - // scrollable: false, - items: [this.scrollBottomLeft] - }); - this.bottomRight = BI.createWidget({ - type: "bi.adaptive", - cls: "bottom-right", - scrollable: false, - items: [this.scrollBottomRight] - }); + var wheelSamples = 0, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) wheelPixelsPerUnit = -.53; + else if (gecko) wheelPixelsPerUnit = 15; + else if (chrome) wheelPixelsPerUnit = -.7; + else if (safari) wheelPixelsPerUnit = -1/3; - var headerHeight = o.header.length * ((o.headerRowSize || o.rowSize) + 1) + 1; - var leftWidth = BI.sum(o.freezeCols, function (i, col) { - return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col]; - }); + var wheelEventDelta = function(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; + else if (dy == null) dy = e.wheelDelta; + return {x: dx, y: dy}; + }; + CodeMirror.wheelEventPixels = function(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta; + }; - if (o.isNeedResize) { - var resizer; - var createResizer = function (size, position) { - var rowSize = self.getCalculateRegionRowSize(); - resizer = BI.createWidget({ - type: "bi.layout", - cls: "bi-resizer", - width: size.width, - height: rowSize[0] + rowSize[1] - }); - BI.createWidget({ - type: "bi.absolute", - element: "body", - items: [{ - el: resizer, - left: position.left, - top: position.top - rowSize[0] - }] - }); - }; - var resizeResizer = function (size, position) { - var rowSize = self.getCalculateRegionRowSize(); - var columnSize = self.getCalculateRegionColumnSize(); - var height = rowSize[0] + rowSize[1]; - var sumSize = columnSize[0] + columnSize[1]; - if (size.width > sumSize / 5 * 4) { - size.width = sumSize / 5 * 4; - } - if (size.width < 10) { - size.width = 10; - } - resizer.element.css({ - "left": position.left + "px", - "width": size.width + "px", - "height": height + "px" - }); - }; - var stopResizer = function () { - resizer && resizer.destroy(); - resizer = null; - }; - var handle; - if (o.freezeCols.length > 0 && o.freezeCols.length < o.columnSize.length) { - if (isRight) { - var options = { - handles: "w", - minWidth: 15, - helper: "clone", - start: function (event, ui) { - createResizer(ui.size, ui.position); - self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE); - }, - resize: function (e, ui) { - resizeResizer(ui.size, ui.position); - self.fireEvent(BI.Table.EVENT_TABLE_REGION_RESIZE); - e.stopPropagation(); - //return false; - }, - stop: function (e, ui) { - stopResizer(); - if (o.isResizeAdapt) { - var increment = ui.size.width - (BI.sum(self.columnRight) + self.columnRight.length); - o.columnSize[self.columnLeft.length] += increment; - } else { - self.setRegionColumnSize(["fill", ui.size.width]); - } - self._resize(); - ui.element.css("left", ""); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE); - } - }; - self.bottomRight.element.resizable(options); - handle = $(".ui-resizable-handle", this.bottomRight.element).css("top", -1 * headerHeight); - } else { - var options = { - handles: "e", - minWidth: 15, - helper: "clone", - start: function (event, ui) { - createResizer(ui.size, ui.position); - self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE); - }, - resize: function (e, ui) { - resizeResizer(ui.size, ui.position); - self.fireEvent(BI.Table.EVENT_TABLE_REGION_RESIZE); - e.stopPropagation(); - //return false; - }, - stop: function (e, ui) { - stopResizer(); - if (o.isResizeAdapt) { - var increment = ui.size.width - (BI.sum(self.columnLeft) + self.columnLeft.length); - o.columnSize[self.columnLeft.length - 1] += increment; - } else { - self.setRegionColumnSize([ui.size.width, "fill"]); - } - self._resize(); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE); - } - }; - self.bottomLeft.element.resizable(options); - handle = $(".ui-resizable-handle", this.bottomLeft.element).css("top", -1 * headerHeight); - } - } - } - this._resize = function () { - if (self.scrollBottomLeft.element.is(":visible")) { - self.scrollBottomLeft.element.css({"overflow-x": "auto"}); - self.scrollBottomRight.element.css({"overflow-x": "auto"}); - self.setColumnSize(o.columnSize); - if (isRight) { - self.scrollBottomLeft.element.css({"overflow-y": "auto"}); - } else { - self.scrollBottomRight.element.css({"overflow-y": "auto"}); - } - if (self.scrollBottomLeft.element.hasHorizonScroll() || self.scrollBottomRight.element.hasHorizonScroll()) { - self.scrollBottomLeft.element.css("overflow-x", "scroll"); - self.scrollBottomRight.element.css("overflow-x", "scroll"); - } - if (self.scrollBottomRight.element.hasVerticalScroll()) { - self.scrollTopRight.element.css("overflow-y", "scroll"); - } else { - self.scrollTopRight.element.css("overflow-y", "hidden"); - } - if (self.scrollBottomLeft.element.hasVerticalScroll()) { - self.scrollTopLeft.element.css("overflow-y", "scroll"); - } else { - self.scrollTopLeft.element.css("overflow-y", "hidden"); - } - self.scrollTopLeft.element[0].scrollLeft = self.scrollBottomLeft.element[0].scrollLeft; - self.scrollTopRight.element[0].scrollLeft = self.scrollBottomRight.element[0].scrollLeft; - self.scrollBottomLeft.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop; - //调整拖拽handle的高度 - if (o.isNeedResize) { - handle && handle.css("height", self.bottomLeft.element.height() + headerHeight); - } - } - }; + function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; - var regionColumnSize = o.regionColumnSize; - if (o.freezeCols.length === 0) { - regionColumnSize = isRight ? ['fill', 0] : [0, 'fill']; - } else if (o.freezeCols.length >= o.columnSize.length) { - regionColumnSize = isRight ? [0, 'fill'] : ['fill', 0]; - } - this.partitions = BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("table", BI.extend({}, o.logic, { - rows: 2, - columns: 2, - columnSize: regionColumnSize || (isRight ? ['fill', leftWidth] : [leftWidth, 'fill']), - rowSize: [headerHeight, 'fill'], - items: [[{ - el: this.topLeft - }, { - el: this.topRight - }], [{ - el: this.bottomLeft - }, { - el: this.bottomRight - }]] - })))); + var display = cm.display, scroll = display.scroller; + // Quit if there's nothing to scroll here + if (!(dx && scroll.scrollWidth > scroll.clientWidth || + dy && scroll.scrollHeight > scroll.clientHeight)) return; - //var scrollElement = isRight ? scrollBottomLeft.element : scrollBottomRight.element; - //var scrollTopElement = isRight ? scrollTopLeft.element : scrollTopRight.element; - //var otherElement = isRight ? scrollBottomRight.element : scrollBottomLeft.element; + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer; + } + } + } + } - this._initFreezeScroll(); - BI.nextTick(function () { - if (self.element.is(":visible")) { - self._resize(); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); - } - }); - BI.Resizers.add(this.getName(), function (e) { - if (BI.isWindow(e.target) && self.element.is(":visible")) { - self._resize(); - self.fireEvent(BI.Table.EVENT_TABLE_RESIZE); - } - }); - }, + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy) + setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); + setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); + e_preventDefault(e); + display.wheelStartX = null; // Abort measurement, if in progress + return; + } - _initFreezeScroll: function () { - var self = this, o = this.options; - scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element); - scroll(this.scrollBottomLeft.element, this.scrollTopLeft.element, this.scrollBottomRight.element); - - function scroll(scrollElement, scrollTopElement, otherElement) { - var scrolling, scrollingX; - var fn = function (event, delta, deltaX, deltaY) { - var inf = self._getScrollOffsetAndDur(event); - if (deltaY < 0 || deltaY > 0) { - if (scrolling) { - scrollElement[0].scrollTop = scrolling; - } - scrolling = scrollElement[0].scrollTop - delta * inf.offset; - var stopPropagation = false; - var st = scrollElement[0].scrollTop; - scrollElement[0].scrollTop = scrolling; - if (scrollElement[0].scrollTop !== st) { - stopPropagation = true; - } - scrollElement[0].scrollTop = st; - self._animateScrollTo(scrollElement, scrollElement[0].scrollTop, scrolling, inf.dur, "linear", { - onStart: function () { - }, - onUpdate: function (top) { - otherElement[0].scrollTop = top; - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top); - }, - onComplete: function () { - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling); - scrolling = null; - } - }); + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) top = Math.max(0, top + pixels - 50); + else bot = Math.min(cm.doc.height, bot + pixels + 50); + updateDisplaySimple(cm, {top: top, bottom: bot}); + } + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function() { + if (display.wheelStartX == null) return; + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) return; + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } + } + } - //otherElement[0].scrollTop = scrollTop; - //scrollElement[0].scrollTop = scrollTop; - //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop); - if (stopPropagation === true) { - event.stopPropagation(); - return false; - } - return; - } - //if (deltaX < 0 || deltaX > 0) { - // if (scrollingX) { - // scrollElement[0].scrollLeft = scrollingX; - // } - // scrollingX = scrollElement[0].scrollLeft + delta * inf.offset; - // var stopPropagation = false; - // var sl = scrollElement[0].scrollLeft; - // scrollElement[0].scrollLeft = scrollingX; - // if (scrollElement[0].scrollLeft !== sl) { - // stopPropagation = true; - // } - // scrollElement[0].scrollLeft = sl; - // self._animateScrollTo(scrollElement, scrollElement[0].scrollLeft, scrollingX, inf.dur, "linear", { - // direction: "left", - // onStart: function () { - // }, - // onUpdate: function (left) { - // scrollTopElement[0].scrollLeft = left; - // self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, left); - // }, - // onComplete: function () { - // self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, scrollingX); - // scrollingX = null; - // } - // }); - // - // - // //otherElement[0].scrollTop = scrollTop; - // //scrollElement[0].scrollTop = scrollTop; - // //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop); - // if (stopPropagation === true) { - // event.stopPropagation(); - // return false; - // } - //} - }; - scrollElement.mousewheel(fn); - var scrollTop = 0, scrollLeft = 0; - scrollElement.scroll(function (e) { - var change = false; - if (scrollElement.scrollTop() != scrollTop) { - var old = otherElement.scrollTop(); - otherElement.scrollTop(scrollElement.scrollTop()); - scrollTop = scrollElement.scrollTop(); - if (Math.abs(old - otherElement[0].scrollTop) > 0.1) { - e.stopPropagation(); - change = true; - } - } - if (scrollElement.scrollLeft() != scrollLeft) { - var old = scrollTopElement.scrollLeft(); - scrollTopElement.scrollLeft(scrollElement.scrollLeft()); - scrollLeft = scrollElement.scrollLeft(); - if (Math.abs(old - scrollTopElement[0].scrollLeft) > 0.1) { - e.stopPropagation(); - change = true; - } - } - // self.fireEvent(BI.Table.EVENT_TABLE_SCROLL); - if (change === true) { - e.stopPropagation(); - //return false; - } - }); - } - }, + // KEY EVENTS - _animateScrollTo: function (el, from, to, duration, easing, op) { - var self = this; - var onStart = op.onStart, onComplete = op.onComplete, onUpdate = op.onUpdate; - var startTime = BI.getTime(), _delay, progress = 0, _request; - _cancelTween(); - _startTween(); - var diff = to - from; - el._stop = 0; - function _step() { - if (el._stop) { - return; - } - if (!progress) { - onStart.call(); - } - progress = BI.getTime() - startTime; - _tween(); - if (progress >= el.time) { - el.time = (progress > el.time) ? progress + _delay - (progress - el.time) : progress + _delay - 1; - if (el.time < progress + 1) { - el.time = progress + 1; - } - } - if (el.time < duration) { - el._id = _request(_step); - } else { - el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to); - onComplete.call(); - } - } + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) return false; + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, done = false; + try { + if (isReadOnly(cm)) cm.state.suppressEdits = true; + if (dropShift) cm.display.shift = false; + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done; + } - function _tween() { - var top = to; - if (duration > 0) { - el.currVal = _ease(el.time, from, diff, duration, easing); - el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](top = Math.round(el.currVal)); - } else { - el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to); - } - onUpdate(top); - } + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) return result; + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm); + } - function _startTween() { - _delay = 1000 / 60; - el.time = progress + _delay; - _request = (!requestAnimationFrame()) ? function (f) { - _tween(); - return setTimeout(f, 0.01); - } : requestAnimationFrame(); - el._id = _request(_step); + var stopSeq = new Delayed; + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) return "handled"; + stopSeq.set(50, function() { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); } + }); + name = seq + " " + name; + } + var result = lookupKeyForEditor(cm, name, handle); - function requestAnimationFrame() { - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.msRequestAnimationFrame || - window.oRequestAnimationFrame; - } + if (result == "multi") + cm.state.keySeq = name; + if (result == "handled") + signalLater(cm, "keyHandled", cm, name, e); - function cancelAnimationFrame() { - return window.cancelAnimationFrame || - window.webkitCancelAnimationFrame || - window.mozCancelAnimationFrame || - window.msCancelAnimationFrame || - window.oCancelAnimationFrame || - window.cancelRequestAnimationFrame || - window.webkitCancelRequestAnimationFrame || - window.mozCancelRequestAnimationFrame || - window.msCancelRequestAnimationFrame || - window.oCancelRequestAnimationFrame - } + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } - function _cancelTween() { - if (el._id == null) { - return; - } - if (!cancelAnimationFrame()) { - clearTimeout(el._id); - } else { - cancelAnimationFrame()(el._id); - } - el._id = null; - } + if (seq && !result && /\'$/.test(name)) { + e_preventDefault(e); + return true; + } + return !!result; + } - function _ease(t, b, c, d, type) { - switch (type) { - case "linear": - return c * t / d + b; - break; - case "mcsLinearOut": - t /= d; - t--; - return c * Math.sqrt(1 - t * t) + b; - break; - case "easeInOutSmooth": - t /= d / 2; - if (t < 1) { - return c / 2 * t * t + b; - } - t--; - return -c / 2 * (t * (t - 2) - 1) + b; - break; - case "easeInOutStrong": - t /= d / 2; - if (t < 1) { - return c / 2 * Math.pow(2, 10 * (t - 1)) + b; - } - t--; - return c / 2 * ( -Math.pow(2, -10 * t) + 2 ) + b; - break; - case "easeInOut": - case "mcsEaseInOut": - t /= d / 2; - if (t < 1) { - return c / 2 * t * t * t + b; - } - t -= 2; - return c / 2 * (t * t * t + 2) + b; - break; - case "easeOutSmooth": - t /= d; - t--; - return -c * (t * t * t * t - 1) + b; - break; - case "easeOutStrong": - return c * ( -Math.pow(2, -10 * t / d) + 1 ) + b; - break; - case "easeOut": - case "mcsEaseOut": - default: - var ts = (t /= d) * t, tc = ts * t; - return b + c * (0.499999999999997 * tc * ts + -2.5 * ts * ts + 5.5 * tc + -6.5 * ts + 4 * t); - } - } - }, + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) return false; - _getScrollOffsetAndDur: function (event) { - var offset = 40, dur = 200; - if (event.originalEvent.wheelDelta) { - offset = Math.abs(event.originalEvent.wheelDelta); - } - if (event.deltaFactor < 2) { - offset = 3; - dur = 17; - } - return { - offset: offset, - dur: dur - }; - }, + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) + || dispatchKey(cm, name, e, function(b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + return doHandleBinding(cm, b); + }); + } else { + return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); + } + } - resize: function () { - this._resize(); - }, + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, + function(b) { return doHandleBinding(cm, b, true); }); + } - _createCells: function (items, columnSize, mergeCols, TDs, Ws, start, rowSize) { - var self = this, o = this.options, preCol = {}, preRow = {}, preRW = {}, preCW = {}, map = {}; - columnSize = columnSize || o.columnSize; - mergeCols = mergeCols || o.mergeCols; - TDs = TDs || {}; - Ws = Ws || {}; - start = start || 0; - rowSize || (rowSize = o.rowSize); - var frag = document.createDocumentFragment(); - BI.each(items, function (i, rows) { - var tr = $("").addClass((i & 1) === 0 ? "odd" : "even"); - BI.each(rows, function (j, row) { - if (!map[i]) { - map[i] = {}; - } - if (!TDs[i]) { - TDs[i] = {}; - } - if (!Ws[i]) { - Ws[i] = {}; - } - map[i][j] = row; + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + cm.curOp.focus = activeElt(); + if (signalDOMEvent(cm, e)) return; + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + cm.replaceSelection("", null, "cut"); + } - if (o.isNeedMerge && mergeCols.contains(j)) { - if (i === 0 && j === 0) { - createOneEl(0, 0); - } else if (j === 0 && i > 0) { - var isNeedMergeRow = o.mergeRule(map[i][j], map[i - 1][j]); - if (isNeedMergeRow === true) { - mergeRow(i, j); - preRow[i] = preCol[j]; - preRW[i] = preCW[j]; - } else { - createOneEl(i, j); - } - } else if (i === 0 && j > 0) { - var isNeedMergeCol = o.mergeRule(map[i][j], map[i][j - 1]); - if (isNeedMergeCol === true) { - mergeCol(i, j); - preCol[j] = preRow[j - 1]; - preCW[j] = preRW[j - 1]; - } else { - createOneEl(i, j); - } - } else { - var isNeedMergeRow = o.mergeRule(map[i][j], map[i - 1][j]); - var isNeedMergeCol = o.mergeRule(map[i][j], map[i][j - 1]); - if (isNeedMergeCol && isNeedMergeRow) { - return; - } - if (isNeedMergeCol) { - mergeCol(i, j); - } - if (isNeedMergeRow) { - mergeRow(i, j); - } - if (!isNeedMergeCol && !isNeedMergeRow) { - createOneEl(i, j); - } - } - } else { - createOneEl(i, j); - } - }); - function mergeRow(i, j) { - var height = (preCol[j].attr("height") | 0) + rowSize + 1; - preCol[j].attr("height", height).css("height", height); - //preCW[j].element.css("height", height); - var rowspan = ((preCol[j].attr("rowspan") || 1) | 0) + 1; - preCol[j].attr("rowspan", rowspan); - preCol[j].__mergeRows.pushDistinct(i); - TDs[i][j] = preCol[j]; - Ws[i][j] = preCW[j]; - } + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + showCrossHair(cm); + } - function mergeCol(i, j) { - if (columnSize[j]) { - var width = preRow[i].attr("width") | 0; - if (width > 1.05 && columnSize[j]) { - width = width + columnSize[j] + 1; - if (j === columnSize.length - 1) { - width--; - } - } else { - width = width + columnSize[j] - } - width = self._calculateWidth(width); - preRow[i].attr("width", width).css("width", width); - preRW[i].element.width(width); - } - var colspan = ((preRow[i].attr("colspan") || 1) | 0) + 1; - preRow[i].attr("colspan", colspan); - preRow[i].__mergeCols.pushDistinct(j); - TDs[i][j] = preRow[i]; - Ws[i][j] = preRW[i]; - } + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); - function createOneEl(r, c) { - var width = self._calculateWidth(columnSize[c]); - if (width > 1.05 && c === columnSize.length - 1) { - width--; - } - var height = self._calculateHeight(rowSize); - var td = $("").attr("height", height) - .attr("width", width).css({"width": width, "height": height, "position": "relative"}) - .addClass((c & 1) === 0 ? "odd-col" : "even-col") - .addClass(r === 0 ? "first-row" : "") - .addClass(c === 0 ? "first-col" : "") - .addClass(c === rows.length - 1 ? "last-col" : ""); - var w = BI.createWidget(map[r][c], { - type: "bi.table_cell", - textAlign: "left", - width: BI.isNumeric(width) ? width : "", - height: BI.isNumeric(height) ? height : "", - _row: r, - _col: c + start - }); - w.element.css("position", "relative"); - td.append(w.element); - tr.append(td); - preCol[c] = td; - preCol[c].__mergeRows = [r]; - preCW[c] = w; - preRow[r] = td; - preRow[r].__mergeCols = [c]; - preRW[r] = w; - TDs[r][c] = td; - Ws[r][c] = w; - } + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } - frag.appendChild(tr[0]); - }); - return frag; - }, + function onKeyUp(e) { + if (e.keyCode == 16) this.doc.sel.shift = false; + signalDOMEvent(this, e); + } - _createColGroupCells: function (columnSize, store) { - var self = this, o = this.options; - columnSize = columnSize || o.columnSize; - store = store || {}; - var frag = document.createDocumentFragment(); - BI.each(columnSize, function (i, size) { - var width = self._calculateWidth(size); - var col = $("").attr("width", width).css("width", width); - store[i] = col; - frag.appendChild(col[0]); - }); - return frag; - }, + function onKeyPress(e) { + var cm = this; + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; + var keyCode = e.keyCode, charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return; + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + if (handleCharBinding(cm, e, ch)) return; + cm.display.input.onKeyPress(e); + } - _createHeaderCells: function (items, columnSize, mergeCols, TDs, Ws, start) { - var self = this, o = this.options; - start || (start = 0); - var frag = this._createCells(items, columnSize, BI.range(o.columnSize.length), TDs, Ws, start, o.headerRowSize || o.rowSize); + // FOCUS/BLUR EVENTS - if (o.isNeedResize === true) { - var tds = TDs[BI.size(TDs) - 1]; - BI.each(tds, function (j, td) { - j = j | 0; - var resizer; - var getHeight = function (size, position) { - var rowSize = self.getCalculateRegionRowSize(); - if (o.isNeedFreeze === true) { - var tableHeight = self.bottomRightContainer.element.outerHeight(); - return size.height + Math.min(rowSize[1], tableHeight); - } else { - var tableHeight = self.tableContainer.element.outerHeight(); - var offset = self.tableContainer.element.offset(); - var offsetTop = position.top - offset.top; - var height = tableHeight - offsetTop; - height = Math.min(height, rowSize[0] - offsetTop); - return height; - } - }; - if (j < BI.size(tds) - 1) { - td.resizable({ - handles: "e", - minWidth: 15, - helper: "clone", - start: function (event, ui) { - var height = getHeight(ui.size, ui.position); - resizer = BI.createWidget({ - type: "bi.layout", - cls: "bi-resizer", - width: ui.size.width, - height: height - }); + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function() { + if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + onBlur(cm); + } + }, 100); + } - BI.createWidget({ - type: "bi.absolute", - element: "body", - items: [{ - el: resizer, - left: ui.position.left, - top: ui.position.top - }] - }); - self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_COLUMN_RESIZE); - }, - resize: function (e, ui) { - var height = getHeight(ui.size, ui.position); - resizer.element.css({"width": ui.size.width + "px", "height": height + "px"}); - //o.columnSize[start + j] = ui.size.width; - //self.setColumnSize(o.columnSize); - self.fireEvent(BI.Table.EVENT_TABLE_COLUMN_RESIZE); - e.stopPropagation(); - //return false; - }, - stop: function (e, ui) { - resizer.destroy(); - resizer = null; - o.columnSize[start + j] = ui.size.width - 1; - self.setColumnSize(o.columnSize); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE); - } - }) - } - }) - } - return frag; - }, + function onFocus(cm) { + if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false; - _createFooterCells: function (items, columnSize, TDs, Ws) { - var o = this.options; - var frag = this._createCells(items, columnSize, [], TDs, Ws, 0); - return frag; - }, + if (cm.options.readOnly == "nocursor") return; + if (!cm.state.focused) { + signal(cm, "focus", cm); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) setTimeout(function() { cm.display.input.reset(true); }, 20); // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm) { + if (cm.state.delayingBlurEvent) return; - _createColGroup: function (columnSize, store, widgets) { - var self = this, o = this.options; - this.colgroup = this._colgroup(); - this.colgroup.element.append(this._createColGroupCells(columnSize, store, widgets)); - return this.colgroup; - }, + if (cm.state.focused) { + signal(cm, "blur", cm); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); + } - _createHeader: function () { - var self = this, o = this.options; - if (o.header === false) { - return; - } - this.header = this._header(); - this.header.element.append(this._createHeaderCells(o.header, null, null, this.headerTds, this.headerItems)); - return this.header; - }, + // CONTEXT MENU HANDLING - _createFooter: function (columnSize, store, widgets) { - var self = this, o = this.options; - if (o.footer === false) { - return; - } - this.footer = this._footer(); - this.footer.element.append(this._createFooterCells(o.footer, null, this.footerTds, this.footerItems)); - return this.footer; - }, + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return; + cm.display.input.onContextMenu(e); + } - _createBody: function () { - var self = this, o = this.options; - this.body = this._body(); - this.body.element.append(this._createCells(o.items, null, null, this.bodyTds, this.bodyItems)); - return this.body; - }, + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) return false; + return gutterEvent(cm, e, "gutterContextMenu", false, signal); + } - _createNormalTable: function () { - var self = this, o = this.options, table = this._table(); - this.colgroupTds = {}; - this.headerTds = {}; - this.footerTds = {}; - this.bodyTds = {}; + // UPDATING - this.headerItems = {}; - this.footerItems = {}; - this.bodyItems = {}; - var colgroup = this._createColGroup(null, this.colgroupTds); - var header = this._createHeader(); - var footer = this._createFooter(); - var body = this._createBody(); + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + var changeEnd = CodeMirror.changeEnd = function(change) { + if (!change.text) return change.to; + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); + }; - BI.createWidget({ - type: "bi.adaptive", - element: table, - items: [colgroup, header, footer, body] - }); + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) return pos; + if (cmp(pos, change.to) <= 0) return changeEnd(change); - var w = BI.sum(this.options.columnSize) || undefined; - w = this._calculateWidth(w); - if (BI.isNumeric(w) && w > 1) { - w += o.columnSize.length; - } - this.tableContainer = BI.createWidget({ - type: "bi.adaptive", - width: this._calculateWidth(w), - items: [table] - }); + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; + return Pos(line, ch); + } - this.scrollBottomRight = BI.createWidget({ - type: "bi.adaptive", - width: "100%", - height: "100%", - cls: "scroll-bottom-right", - scrollable: true, - items: [this.tableContainer] - }); + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))); + } + return normalizeSelection(out, doc.sel.primIndex); + } - BI.createWidget({ - type: "bi.adaptive", - cls: "bottom-right", - element: this, - scrollable: false, - items: [this.scrollBottomRight] - }); + function offsetPos(pos, old, nw) { + if (pos.line == old.line) + return Pos(nw.line, pos.ch - old.ch + nw.ch); + else + return Pos(nw.line + (pos.line - old.line), pos.ch); + } - this._resize = function () { - if (self.element.is(":visible")) { - self.setColumnSize(o.columnSize); - } - }; + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex); + } - this._initNormalScroll(); - BI.Resizers.add(this.getName(), function (e) { - if (self.element.is(":visible") && BI.isWindow(e.target)) { - self._resize(); - self.fireEvent(BI.Table.EVENT_TABLE_RESIZE); - } - }); - BI.nextTick(function () { - if (self.element.is(":visible")) { - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); - } - }); - }, + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function() { this.canceled = true; } + }; + if (update) obj.update = function(from, to, text, origin) { + if (from) this.from = clipPos(doc, from); + if (to) this.to = clipPos(doc, to); + if (text) this.text = text; + if (origin !== undefined) this.origin = origin; + }; + signal(doc, "beforeChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); - _initNormalScroll: function () { - var self = this; - var scrolling, scrollX; - this.scrollBottomRight.element.mousewheel(function (event, delta, deltaX, deltaY) { - var inf = self._getScrollOffsetAndDur(event); - if (deltaY < 0 || deltaY > 0) { - var ele = self.scrollBottomRight.element; - if (scrolling) { - ele[0].scrollTop = scrolling; - } + if (obj.canceled) return null; + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; + } - scrolling = ele[0].scrollTop - delta * inf.offset; - var stopPropagation = false; - var st = ele[0].scrollTop; - ele[0].scrollTop = scrolling; - if (ele[0].scrollTop !== st) { - stopPropagation = true; - } - ele[0].scrollTop = st; - self._animateScrollTo(ele, ele[0].scrollTop, scrolling, inf.dur, "linear", { - onStart: function () { - }, - onUpdate: function (top) { - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top); - }, - onComplete: function () { - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling); - scrolling = null; - } - }); - //var scrollTop = self.scrollBottomRight.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop - delta * offset; - //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop); - if (stopPropagation === true) { - event.stopPropagation(); - return false; - } - } - }); - var scrollTop = 0, scrollLeft = 0; - this.scrollBottomRight.element.scroll(function (e) { - var change = false; - var scrollElement = self.scrollBottomRight.element; - if (scrollElement.scrollTop() != scrollTop) { - if (Math.abs(scrollElement.scrollTop() - scrollTop) > 0.1) { - e.stopPropagation(); - change = true; - } - scrollTop = scrollElement.scrollTop(); - } - if (scrollElement.scrollLeft() != scrollLeft) { - if (Math.abs(scrollElement.scrollLeft() - scrollLeft) > 0.1) { - e.stopPropagation(); - change = true; - } - scrollLeft = scrollElement.scrollLeft(); - } - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL); - if (change === true) { - e.stopPropagation(); - //return false; - } - return false; - }); - }, + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); + if (doc.cm.state.suppressEdits) return; + } - _split: function (items) { - var o = this.options, left = [], right = [], isRight = this._isRightFreeze(); - BI.each(items, function (i, rows) { - left.push([]); - right.push([]); - BI.each(rows, function (j, cell) { - if (o.freezeCols.contains(j)) { - (isRight ? right : left)[i].push(cell); - } else { - (isRight ? left : right)[i].push(cell); - } - }) - }); - return { - left: left, - right: right - } - }, + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) return; + } - _table: function () { - return BI.createWidget({ - type: "bi.layout", - tagName: "table", - cls: "table", - attribute: {"cellspacing": 0, "cellpadding": 0} - }); - }, + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) + makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); + } else { + makeChangeInner(doc, change); + } + } - _header: function () { - return BI.createWidget({ - type: "bi.layout", - cls: "header", - tagName: "thead" - }); - }, + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - _footer: function () { - return BI.createWidget({ - type: "bi.layout", - cls: "footer", - tagName: "tfoot" - }); - }, + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; - _body: function () { - return BI.createWidget({ - type: "bi.layout", - tagName: "tbody", - cls: "body" - }); - }, + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } - _colgroup: function () { - return BI.createWidget({ - type: "bi.layout", - tagName: "colgroup" - }); - }, + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + if (doc.cm && doc.cm.state.suppressEdits) return; - _init: function () { - BI.Table.superclass._init.apply(this, arguments); + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; - this.populate(this.options.items); - }, + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + for (var i = 0; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + break; + } + if (i == source.length) return; + hist.lastOrigin = hist.lastSelOrigin = null; - setColumnSize: function (columnSize) { - var self = this, o = this.options; - var isRight = this._isRightFreeze(); - o.columnSize = columnSize || []; - if (o.isNeedFreeze) { - var columnLeft = []; - var columnRight = []; - BI.each(o.columnSize, function (i, size) { - if (o.freezeCols.contains(i)) { - isRight ? columnRight.push(size) : columnLeft.push(size); - } else { - isRight ? columnLeft.push(size) : columnRight.push(size); - } - }); - var topleft = 0, topright = 1, bottomleft = 2, bottomright = 3; - var run = function (direction) { - var colgroupTds, bodyTds, bodyItems, sizes; - switch (direction) { - case topleft: - colgroupTds = self.topLeftColGroupTds; - bodyTds = self.topLeftBodyTds; - bodyItems = self.topLeftBodyItems; - sizes = columnLeft; - break; - case topright: - colgroupTds = self.topRightColGroupTds; - bodyTds = self.topRightBodyTds; - bodyItems = self.topRightBodyItems; - sizes = columnRight; - break; - case bottomleft: - colgroupTds = self.bottomLeftColGroupTds; - bodyTds = self.bottomLeftBodyTds; - bodyItems = self.bottomLeftBodyItems; - sizes = columnLeft; + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}); + return; + } + selAfter = event; + } + else break; + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); + hist.generation = event.generation || ++hist.maxGeneration; + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + + for (var i = event.changes.length - 1; i >= 0; --i) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return; + } + + antiChanges.push(historyChangeFromChange(doc, change)); + + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) return; + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function(range) { + return new Range(Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch)); + }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + regLineChange(doc.cm, l, "gutter"); + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return; + } + if (change.from.line > doc.lastLine()) return; + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin}; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin}; + } + + change.removed = getBetween(doc, change.from, change.to); + + if (!selAfter) selAfter = computeSelAfterChange(doc, change); + if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); + else updateDoc(doc, change, spans); + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function(line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true; + } + }); + } + + if (doc.sel.contains(change.from, change.to) > -1) + signalCursorActivity(cm); + + updateDoc(doc, change, spans, estimateHeight(cm)); + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function(line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) cm.curOp.updateMaxLine = true; + } + + // Adjust frontier, schedule worker + doc.frontier = Math.min(doc.frontier, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) + regChange(cm); + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + regLineChange(cm, from.line, "text"); + else + regChange(cm, from.line, to.line + 1, lendiff); + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) signalLater(cm, "change", cm, obj); + if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); + } + cm.display.selForContextMenu = null; + } + + function replaceRange(doc, code, from, to, origin) { + if (!to) to = from; + if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } + if (typeof code == "string") code = splitLines(code); + makeChange(doc, {from: from, to: to, text: code, origin: origin}); + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, coords) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) return; + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + if (coords.top + box.top < 0) doScroll = true; + else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px; left: " + + coords.left + "px; width: 2px;"); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) margin = 0; + for (var limit = 0; limit < 5; limit++) { + var changed = false, coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), + Math.min(coords.top, endCoords.top) - margin, + Math.max(coords.left, endCoords.left), + Math.max(coords.bottom, endCoords.bottom) + margin); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + setScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; + } + if (!changed) break; + } + return coords; + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, x1, y1, x2, y2) { + var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); + if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); + if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, x1, y1, x2, y2) { + var display = cm.display, snapMargin = textHeight(cm.display); + if (y1 < 0) y1 = 0; + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), result = {}; + if (y2 - y1 > screen) y2 = y1 + screen; + var docBottom = cm.doc.height + paddingVert(display); + var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; + if (y1 < screentop) { + result.scrollTop = atTop ? 0 : y1; + } else if (y2 > screentop + screen) { + var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); + if (newTop != screentop) result.scrollTop = newTop; + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = x2 - x1 > screenw; + if (tooWide) x2 = x1 + screenw; + if (x1 < 10) + result.scrollLeft = 0; + else if (x1 < screenleft) + result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); + else if (x2 > screenw + screenleft - 3) + result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; + return result; + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollPos(cm, left, top) { + if (left != null || top != null) resolveScrollToPos(cm); + if (left != null) + cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; + if (top != null) + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(), from = cur, to = cur; + if (!cm.options.lineWrapping) { + from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; + to = Pos(cur.line, cur.ch + 1); + } + cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); + var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), + Math.min(from.top, to.top) - range.margin, + Math.max(from.right, to.right), + Math.max(from.bottom, to.bottom) + range.margin); + cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } + } + + // API UTILITIES + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state; + if (how == null) how = "add"; + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) how = "prev"; + else state = getStateBefore(cm, n); + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) line.stateAfter = null; + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) return; + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); + else indentation = 0; + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} + if (pos < indentation) indentString += spaceStr(indentation - pos); + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + return true; + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i, new Range(pos, pos)); + break; + } + } + } + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle; + if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); + else no = lineNo(handle); + if (no == null) return null; + if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); + return line; + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break; + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function() { + for (var i = kill.length - 1; i >= 0; i--) + replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); + ensureCursorVisible(cm); + }); + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var line = pos.line, ch = pos.ch, origDir = dir; + var lineObj = getLine(doc, line); + var possible = true; + function findNextLine() { + var l = line + dir; + if (l < doc.first || l >= doc.first + doc.size) return (possible = false); + line = l; + return lineObj = getLine(doc, l); + } + function moveOnce(boundToLine) { + var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); + if (next == null) { + if (!boundToLine && findNextLine()) { + if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); + else ch = dir < 0 ? lineObj.text.length : 0; + } else return (possible = false); + } else ch = next; + return true; + } + + if (unit == "char") moveOnce(); + else if (unit == "column") moveOnce(true); + else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) break; + var cur = lineObj.text.charAt(ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p"; + if (group && !first && !type) type = "s"; + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce();} + break; + } + + if (type) sawType = type; + if (dir > 0 && !moveOnce(!first)) break; + } + } + var result = skipAtomic(doc, Pos(line, ch), origDir, true); + if (!possible) result.hitSide = true; + return result; + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + for (;;) { + var target = coordsChar(cm, x, y); + if (!target.outside) break; + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } + y += dir * 5; + } + return target; + } + + // EDITOR METHODS + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){window.focus(); this.display.input.focus();}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") return; + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + operation(this, optionHandlers[option])(this, value, old); + }, + + getOption: function(option) {return this.options[option];}, + getDoc: function() {return this.doc;}, + + addKeyMap: function(map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); + }, + removeKeyMap: function(map) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) + if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1); + return true; + } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) throw new Error("Overlays may not be stateful."); + this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function(spec) { + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this.state.modeGen++; + regChange(this); + return; + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; + else dir = dir ? "add" : "subtract"; + } + if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); + }), + indentSelection: methodOp(function(how) { + var ranges = this.doc.sel.ranges, end = -1; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) { + var from = range.from(), to = range.to(); + var start = Math.max(end, from.line); + end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) + indentLine(this, j, how); + var newRanges = this.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); + } else if (range.head.line > end) { + indentLine(this, range.head.line, how, true); + end = range.head.line; + if (i == this.doc.sel.primIndex) ensureCursorVisible(this); + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise); + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true); + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; + var type; + if (ch == 0) type = styles[2]; + else for (;;) { + var mid = (before + after) >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; + else if (styles[mid * 2 + 1] < ch) before = mid + 1; + else { type = styles[mid * 2 + 2]; break; } + } + var cut = type ? type.indexOf("cm-overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); + }, + + getModeAt: function(pos) { + var mode = this.doc.mode; + if (!mode.innerMode) return mode; + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0]; + }, + + getHelpers: function(pos, type) { + var found = []; + if (!helpers.hasOwnProperty(type)) return found; + var help = helpers[type], mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) found.push(help[mode[type]]); + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) found.push(val); + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i = 0; i < help._global.length; i++) { + var cur = help._global[i]; + if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) + found.push(cur.val); + } + return found; + }, + + getStateAfter: function(line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getStateBefore(this, line + 1, precise); + }, + + cursorCoords: function(start, mode) { + var pos, range = this.doc.sel.primary(); + if (start == null) pos = range.head; + else if (typeof start == "object") pos = clipPos(this.doc, start); + else pos = start ? range.from() : range.to(); + return cursorCoords(this, pos, mode || "page"); + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page"); + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top); + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset); + }, + heightAtLine: function(line, mode) { + var end = false, lineObj; + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) line = this.doc.first; + else if (line > last) { line = last; end = true; } + lineObj = getLine(this.doc, line); + } else { + lineObj = line; + } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + + (end ? this.doc.height - heightAtLine(lineObj) : 0); + }, + + defaultTextHeight: function() { return textHeight(this.display); }, + defaultCharWidth: function() { return charWidth(this.display); }, + + setGutterMarker: methodOp(function(line, gutterID, value) { + return changeLine(this.doc, line, "gutter", function(line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) line.gutterMarkers = null; + return true; + }); + }), + + clearGutter: methodOp(function(gutterID) { + var cm = this, doc = cm.doc, i = doc.first; + doc.iter(function(line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + line.gutterMarkers[gutterID] = null; + regLineChange(cm, i, "gutter"); + if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; + } + ++i; + }); + }), + + lineInfo: function(line) { + if (typeof line == "number") { + if (!isLine(this.doc, line)) return null; + var n = line; + line = getLine(this.doc, line); + if (!line) return null; + } else { + var n = lineNo(line); + if (n == null) return null; + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets}; + }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + top = pos.top - node.offsetHeight; + else if (pos.bottom + node.offsetHeight <= vspace) + top = pos.bottom; + if (left + node.offsetWidth > hspace) + left = hspace - node.offsetWidth; + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") left = 0; + else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; + node.style.left = left + "px"; + } + if (scroll) + scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + return commands[cmd](this); + }, + + triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), + + findPosH: function(from, amount, unit, visually) { + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + cur = findPosH(this.doc, cur, dir, unit, visually); + if (cur.hitSide) break; + } + return cur; + }, + + moveH: methodOp(function(dir, unit) { + var cm = this; + cm.extendSelectionsBy(function(range) { + if (cm.display.shift || cm.doc.extend || range.empty()) + return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); + else + return dir < 0 ? range.from() : range.to(); + }, sel_move); + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc; + if (sel.somethingSelected()) + doc.replaceSelection("", null, "+delete"); + else + deleteNearSelection(this, function(range) { + var other = findPosH(doc, range.head, dir, unit, false); + return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; + }); + }), + + findPosV: function(from, amount, unit, goalColumn) { + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + var coords = cursorCoords(this, cur, "div"); + if (x == null) x = coords.left; + else coords.left = x; + cur = findPosV(this, coords, dir, unit); + if (cur.hitSide) break; + } + return cur; + }, + + moveV: methodOp(function(dir, unit) { + var cm = this, doc = this.doc, goals = []; + var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function(range) { + if (collapse) + return dir < 0 ? range.from() : range.to(); + var headPos = cursorCoords(cm, range.head, "div"); + if (range.goalColumn != null) headPos.left = range.goalColumn; + goals.push(headPos.left); + var pos = findPosV(cm, headPos, dir, unit); + if (unit == "page" && range == doc.sel.primary()) + addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); + return pos; + }, sel_move); + if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) + doc.sel.ranges[i].goalColumn = goals[i]; + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) + ? function(ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} + : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; + while (start > 0 && check(line.charAt(start - 1))) --start; + while (end < line.length && check(line.charAt(end))) ++end; + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)); + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) return; + if (this.state.overwrite = !this.state.overwrite) + addClass(this.display.cursorDiv, "CodeMirror-overwrite"); + else + rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); + + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function() { return this.display.input.getField() == activeElt(); }, + + scrollTo: methodOp(function(x, y) { + if (x != null || y != null) resolveScrollToPos(this); + if (x != null) this.curOp.scrollLeft = x; + if (y != null) this.curOp.scrollTop = y; + }), + getScrollInfo: function() { + var scroller = this.display.scroller; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)}; + }, + + scrollIntoView: methodOp(function(range, margin) { + if (range == null) { + range = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) margin = this.options.cursorScrollMargin; + } else if (typeof range == "number") { + range = {from: Pos(range, 0), to: null}; + } else if (range.from == null) { + range = {from: range, to: null}; + } + if (!range.to) range.to = range.from; + range.margin = margin || 0; + + if (range.from.line != null) { + resolveScrollToPos(this); + this.curOp.scrollToPos = range; + } else { + var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), + Math.min(range.from.top, range.to.top) - range.margin, + Math.max(range.from.right, range.to.right), + Math.max(range.from.bottom, range.to.bottom) + range.margin); + this.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } + }), + + setSize: methodOp(function(width, height) { + var cm = this; + function interpret(val) { + return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; + } + if (width != null) cm.display.wrapper.style.width = interpret(width); + if (height != null) cm.display.wrapper.style.height = interpret(height); + if (cm.options.lineWrapping) clearLineMeasurementCache(this); + var lineNo = cm.display.viewFrom; + cm.doc.iter(lineNo, cm.display.viewTo, function(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) + if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } + ++lineNo; + }); + cm.curOp.forceUpdate = true; + signal(cm, "refresh", this); + }), + + operation: function(f){return runInOp(this, f);}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) + estimateLineHeights(this); + signal(this, "refresh", this); + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc; + old.cm = null; + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + this.scrollTo(doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old; + }), + + getInputField: function(){return this.display.input.getField();}, + getWrapperElement: function(){return this.display.wrapper;}, + getScrollerElement: function(){return this.display.scroller;}, + getGutterElement: function(){return this.display.gutters;} + }; + eventMixin(CodeMirror); + + // OPTION DEFAULTS + + // The default configuration options. + var defaults = CodeMirror.defaults = {}; + // Functions to run when options are changed. + var optionHandlers = CodeMirror.optionHandlers = {}; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) optionHandlers[name] = + notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; + } + + // Passed to option handlers when there is no old value. + var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function(cm, val) { + cm.setValue(val); + }, true); + option("mode", null, function(cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function(cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != CodeMirror.Init) cm.refresh(); + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function() { + throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME + }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + + option("theme", "default", function(cm) { + themeChanged(cm); + guttersChanged(cm); + }, true); + option("keyMap", "default", function(cm, val, old) { + var next = getKeyMap(val); + var prev = old != CodeMirror.Init && getKeyMap(old); + if (prev && prev.detach) prev.detach(cm, next); + if (next.attach) next.attach(cm, prev || null); + }); + option("extraKeys", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("fixedGutter", true, function(cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function(cm) {updateScrollbars(cm);}, true); + option("scrollbarStyle", "native", function(cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + + option("readOnly", false, function(cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + cm.display.disabled = true; + } else { + cm.display.disabled = false; + if (!val) cm.display.input.reset(); + } + }); + option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); + option("dragDrop", true, dragDropChanged); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function(cm){cm.refresh();}, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function(cm, val) { + if (!val) cm.display.input.resetPosition(); + }); + + option("tabindex", null, function(cm, val) { + cm.display.input.getField().tabIndex = val || ""; + }); + option("autofocus", null); + + // MODE DEFINITION AND QUERYING + + // Known modes, by name and by MIME + var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function(name, mode) { + if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; + if (arguments.length > 2) + mode.dependencies = Array.prototype.slice.call(arguments, 2); + modes[name] = mode; + }; + + CodeMirror.defineMIME = function(mime, spec) { + mimeModes[mime] = spec; + }; + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + CodeMirror.resolveMode = function(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") found = {name: found}; + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return CodeMirror.resolveMode("application/xml"); + } + if (typeof spec == "string") return {name: spec}; + else return spec || {name: "null"}; + }; + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + CodeMirror.getMode = function(options, spec) { + var spec = CodeMirror.resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) return CodeMirror.getMode(options, "text/plain"); + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) continue; + if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) modeObj.helperType = spec.helperType; + if (spec.modeProps) for (var prop in spec.modeProps) + modeObj[prop] = spec.modeProps[prop]; + + return modeObj; + }; + + // Minimal default mode. + CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; + }); + CodeMirror.defineMIME("text/plain", "null"); + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = CodeMirror.modeExtensions = {}; + CodeMirror.extendMode = function(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); + }; + + // EXTENSIONS + + CodeMirror.defineExtension = function(name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function(name, func) { + Doc.prototype[name] = func; + }; + CodeMirror.defineOption = option; + + var initHooks = []; + CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; + + var helpers = CodeMirror.helpers = {}; + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []}; + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({pred: predicate, val: value}); + }; + + // MODE STATE HANDLING + + // Utility functions for working with state. Exported because nested + // modes need to do this for their inner modes. + + var copyState = CodeMirror.copyState = function(mode, state) { + if (state === true) return state; + if (mode.copyState) return mode.copyState(state); + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) val = val.concat([]); + nstate[n] = val; + } + return nstate; + }; + + var startState = CodeMirror.startState = function(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + }; + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + CodeMirror.innerMode = function(mode, state) { + while (mode.innerMode) { + var info = mode.innerMode(state); + if (!info || info.mode == mode) break; + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state}; + }; + + // STANDARD COMMANDS + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = CodeMirror.commands = { + selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, + singleSelection: function(cm) { + cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); + }, + killLine: function(cm) { + deleteNearSelection(cm, function(range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) + return {from: range.head, to: Pos(range.head.line + 1, 0)}; + else + return {from: range.head, to: Pos(range.head.line, len)}; + } else { + return {from: range.from(), to: range.to()}; + } + }); + }, + deleteLine: function(cm) { + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; + }); + }, + delLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), to: range.from()}; + }); + }, + delWrappedLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); + return {from: leftPos, to: range.from()}; + }); + }, + delWrappedLineRight: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + return {from: range.from(), to: rightPos }; + }); + }, + undo: function(cm) {cm.undo();}, + redo: function(cm) {cm.redo();}, + undoSelection: function(cm) {cm.undoSelection();}, + redoSelection: function(cm) {cm.redoSelection();}, + goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, + goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, + goLineStart: function(cm) { + cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1}); + }, + goLineStartSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + return lineStartSmart(cm, range.head); + }, {origin: "+move", bias: 1}); + }, + goLineEnd: function(cm) { + cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1}); + }, + goLineRight: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + }, sel_move); + }, + goLineLeft: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: 0, top: top}, "div"); + }, sel_move); + }, + goLineLeftSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); + return pos; + }, sel_move); + }, + goLineUp: function(cm) {cm.moveV(-1, "line");}, + goLineDown: function(cm) {cm.moveV(1, "line");}, + goPageUp: function(cm) {cm.moveV(-1, "page");}, + goPageDown: function(cm) {cm.moveV(1, "page");}, + goCharLeft: function(cm) {cm.moveH(-1, "char");}, + goCharRight: function(cm) {cm.moveH(1, "char");}, + goColumnLeft: function(cm) {cm.moveH(-1, "column");}, + goColumnRight: function(cm) {cm.moveH(1, "column");}, + goWordLeft: function(cm) {cm.moveH(-1, "word");}, + goGroupRight: function(cm) {cm.moveH(1, "group");}, + goGroupLeft: function(cm) {cm.moveH(-1, "group");}, + goWordRight: function(cm) {cm.moveH(1, "word");}, + delCharBefore: function(cm) {cm.deleteH(-1, "char");}, + delCharAfter: function(cm) {cm.deleteH(1, "char");}, + delWordBefore: function(cm) {cm.deleteH(-1, "word");}, + delWordAfter: function(cm) {cm.deleteH(1, "word");}, + delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, + delGroupAfter: function(cm) {cm.deleteH(1, "group");}, + indentAuto: function(cm) {cm.indentSelection("smart");}, + indentMore: function(cm) {cm.indentSelection("add");}, + indentLess: function(cm) {cm.indentSelection("subtract");}, + insertTab: function(cm) {cm.replaceSelection("\t");}, + insertSoftTab: function(cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(new Array(tabSize - col % tabSize + 1).join(" ")); + } + cm.replaceSelections(spaces); + }, + defaultTab: function(cm) { + if (cm.somethingSelected()) cm.indentSelection("add"); + else cm.execCommand("insertTab"); + }, + transposeChars: function(cm) { + runInOp(cm, function() { + var ranges = cm.listSelections(), newSel = []; + for (var i = 0; i < ranges.length; i++) { + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) + cm.replaceRange(line.charAt(0) + "\n" + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); + }, + newlineAndIndent: function(cm) { + runInOp(cm, function() { + var len = cm.listSelections().length; + for (var i = 0; i < len; i++) { + var range = cm.listSelections()[i]; + cm.replaceRange("\n", range.anchor, range.head, "+input"); + cm.indentLine(range.from().line + 1, null, true); + ensureCursorVisible(cm); + } + }); + }, + toggleOverwrite: function(cm) {cm.toggleOverwrite();} + }; + + + // STANDARD KEYMAPS + + var keyMap = CodeMirror.keyMap = {}; + + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + fallthrough: "basic" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + fallthrough: ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/), name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) cmd = true; + else if (/^a(lt)?$/i.test(mod)) alt = true; + else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true; + else if (/^s(hift)$/i.test(mod)) shift = true; + else throw new Error("Unrecognized modifier name: " + mod); + } + if (alt) name = "Alt-" + name; + if (ctrl) name = "Ctrl-" + name; + if (cmd) name = "Cmd-" + name; + if (shift) name = "Shift-" + name; + return name; + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + CodeMirror.normalizeKeyMap = function(keymap) { + var copy = {}; + for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue; + if (value == "...") { delete keymap[keyname]; continue; } + + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val, name; + if (i == keys.length - 1) { + name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) copy[name] = val; + else if (prev != val) throw new Error("Inconsistent bindings for " + name); + } + delete keymap[keyname]; + } + for (var prop in copy) keymap[prop] = copy[prop]; + return keymap; + }; + + var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) { + map = getKeyMap(map); + var found = map.call ? map.call(key, context) : map[key]; + if (found === false) return "nothing"; + if (found === "...") return "multi"; + if (found != null && handle(found)) return "handled"; + + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") + return lookupKey(key, map.fallthrough, handle, context); + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context); + if (result) return result; + } + } + }; + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + var isModifierKey = CodeMirror.isModifierKey = function(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + }; + + // Look up the name of a key as indicated by an event object. + var keyName = CodeMirror.keyName = function(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) return false; + var base = keyNames[event.keyCode], name = base; + if (name == null || event.altGraphKey) return false; + if (event.altKey && base != "Alt") name = "Alt-" + name; + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") name = "Ctrl-" + name; + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") name = "Cmd-" + name; + if (!noShift && event.shiftKey && base != "Shift") name = "Shift-" + name; + return name; + }; + + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val; + } + + // FROMTEXTAREA + + CodeMirror.fromTextArea = function(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) + options.tabindex = textarea.tabIndex; + if (!options.placeholder && textarea.placeholder) + options.placeholder = textarea.placeholder; + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(); + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form, realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function() { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + } + + options.finishInit = function(cm) { + cm.save = save; + cm.getTextArea = function() { return textarea; }; + cm.toTextArea = function() { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") + textarea.form.submit = realSubmit; + } + }; + }; + + textarea.style.display = "none"; + var cm = CodeMirror(function(node) { + textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + return cm; + }; + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = CodeMirror.StringStream = function(string, tabSize) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + }; + + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == this.lineStart;}, + peek: function() {return this.string.charAt(this.pos) || undefined;}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }, + indentation: function() { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) return null; + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);}, + hideFirstChars: function(n, inner) { + this.lineStart += n; + try { return inner(); } + finally { this.lineStart -= n; } + } + }; + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + var nextMarkerId = 0; + + var TextMarker = CodeMirror.TextMarker = function(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + eventMixin(TextMarker); + + // Clear the marker. + TextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) startOperation(cm); + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) signalLater(this, "clear", found.from, found.to); + } + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); + else if (cm) { + if (span.to != null) max = lineNo(line); + if (span.from != null) min = lineNo(line); + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) + updateLineHeight(line, textHeight(cm.display)); + } + if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { + var visual = visualLine(this.lines[i]), len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } + + if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) reCheckSelection(cm.doc); + } + if (cm) signalLater(cm, "markerCleared", cm, this); + if (withOp) endOperation(cm); + if (this.parent) this.parent.clear(); + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function(side, lineObj) { + if (side == null && this.type == "bookmark") side = 1; + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) return from; + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) return to; + } + } + return from && {from: from, to: to}; + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function() { + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; + if (!pos || !cm) return; + runInOp(cm, function() { + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) + updateLineHeight(line, line.height + dHeight); + } + }); + }; + + TextMarker.prototype.attachLine = function(line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); + } + this.lines.push(line); + }; + TextMarker.prototype.detachLine = function(line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) return markTextShared(doc, from, to, options, type); + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); + + var marker = new TextMarker(doc, type), diff = cmp(from, to); + if (options) copyObj(options, marker, false); + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + return marker; + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) marker.widgetNode.setAttribute("cm-ignore-events", "true"); + if (options.insertLeft) marker.widgetNode.insertLeft = true; + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + throw new Error("Inserting collapsed marker partially overlapping an existing one"); + sawCollapsedSpans = true; + } + + if (marker.addToHistory) + addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); + + var curLine = from.line, cm = doc.cm, updateMaxLine; + doc.iter(curLine, to.line + 1, function(line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + updateMaxLine = true; + if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { + if (lineIsHidden(doc, line)) updateLineHeight(line, 0); + }); + + if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); + + if (marker.readOnly) { + sawReadOnlySpans = true; + if (doc.history.done.length || doc.history.undone.length) + doc.clearHistory(); + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) cm.curOp.updateMaxLine = true; + if (marker.collapsed) + regChange(cm, from.line, to.line + 1); + else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) + for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); + if (marker.atomic) reCheckSelection(cm.doc); + signalLater(cm, "markerAdded", cm, marker); + } + return marker; + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) + markers[i].parent = this; + }; + eventMixin(SharedTextMarker); + + SharedTextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) + this.markers[i].clear(); + signalLater(this, "clear"); + }; + SharedTextMarker.prototype.find = function(side, lineObj) { + return this.primary.find(side, lineObj); + }; + + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function(doc) { + if (widget) options.widgetNode = widget.cloneNode(true); + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) + if (doc.linked[i].isParent) return; + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary); + } + + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), + function(m) { return m.parent; }); + } + + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + + function detachSharedMarkers(markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], linked = [marker.primary.doc];; + linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + } + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) return span; + } + } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + for (var r, i = 0; i < spans.length; ++i) + if (spans[i] != span) (r || (r = [])).push(spans[i]); + return r; + } + // Add a span to a line. + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } + return nw; + } + function markedSpansAfter(old, endCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); + } + } + return nw; + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) return null; + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) return null; + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) span.to = startCh; + else if (sameLine) span.to = found.to == null ? null : found.to + offset; + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i = 0; i < last.length; ++i) { + var span = last[i]; + if (span.to != null) span.to += offset; + if (span.from == null) { + var found = getMarkedSpanFor(first, span.marker); + if (!found) { + span.from = offset; + if (sameLine) (first || (first = [])).push(span); + } + } else { + span.from += offset; + if (sameLine) (first || (first = [])).push(span); + } + } + } + // Make sure we didn't create any zero-length spans + if (first) first = clearEmptySpans(first); + if (last && last != first) last = clearEmptySpans(last); + + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers; + if (gap > 0 && first) + for (var i = 0; i < first.length; ++i) + if (first[i].to == null) + (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); + for (var i = 0; i < gap; ++i) + newMarkers.push(gapMarkers); + newMarkers.push(last); + } + return newMarkers; + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + spans.splice(i--, 1); + } + if (!spans.length) return null; + return spans; + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) return stretched; + if (!stretched) return old; + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) + if (oldCur[k].marker == span.marker) continue spans; + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old; + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function(line) { + if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + (markers || (markers = [])).push(mark); + } + }); + if (!markers) return null; + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + newParts.push({from: p.from, to: m.from}); + if (dto > 0 || !mk.inclusiveRight && !dto) + newParts.push({from: m.to, to: p.to}); + parts.splice.apply(parts, newParts); + j += newParts.length - 1; + } + } + return parts; + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.detachLine(line); + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.attachLine(line); + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } + function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) return lenDiff; + var aPos = a.find(), bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) return -fromCmp; + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) return toCmp; + return b.id - a.id; + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + found = sp.marker; + } + return found; + } + function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } + function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) continue; + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; + if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) || + fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight))) + return true; + } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + line = merged.find(-1, true).line; + return line; + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + (lines || (lines = [])).push(line); + } + return lines; + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line); + if (line == vis) return lineN; + return lineNo(vis); + } + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) return lineN; + var line = getLine(doc, lineN), merged; + if (!lineIsHidden(doc, line)) return lineN; + while (merged = collapsedSpanAtEnd(line)) + line = merged.find(1, true).line; + return lineNo(line) + 1; + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) continue; + if (sp.from == null) return true; + if (sp.marker.widgetNode) continue; + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + return true; + } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); + } + if (span.marker.inclusiveRight && span.to == line.text.length) + return true; + for (var sp, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) return true; + } + } + + // LINE WIDGETS + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = CodeMirror.LineWidget = function(doc, node, options) { + if (options) for (var opt in options) if (options.hasOwnProperty(opt)) + this[opt] = options[opt]; + this.doc = doc; + this.node = node; + }; + eventMixin(LineWidget); + + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + addToScrollPos(cm, null, diff); + } + + LineWidget.prototype.clear = function() { + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); + if (no == null || !ws) return; + for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); + if (!ws.length) line.widgets = null; + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) runInOp(cm, function() { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + }; + LineWidget.prototype.changed = function() { + var oldH = this.height, cm = this.doc.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) return; + updateLineHeight(line, line.height + diff); + if (cm) runInOp(cm, function() { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + }); + }; + + function widgetHeight(widget) { + if (widget.height != null) return widget.height; + var cm = widget.doc.cm; + if (!cm) return 0; + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; + if (widget.noHScroll) + parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.offsetHeight; + } + + function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) cm.display.alignWidgets = true; + changeLine(doc, handle, "widget", function(line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) widgets.push(widget); + else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); + widget.line = line; + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) addToScrollPos(cm, null, widget.height); + cm.curOp.forceUpdate = true; + } + return true; + }); + return widget; + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + eventMixin(Line); + Line.prototype.lineNo = function() { return lineNo(this); }; + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + if (line.order != null) line.order = null; + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) updateLineHeight(line, estHeight); + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + function extractLineClasses(type, output) { + if (type) for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) break; + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) + output[prop] = lineClass[2]; + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + output[prop] += " " + lineClass[2]; + } + return type; + } + + function callBlankLine(mode, state) { + if (mode.blankLine) return mode.blankLine(state); + if (!mode.innerMode) return; + var inner = CodeMirror.innerMode(mode, state); + if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); + } + + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; + var style = mode.token(stream, state); + if (stream.pos > stream.start) return style; + } + throw new Error("Mode " + mode.name + " failed to advance stream."); + } + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + function getObj(copy) { + return {start: stream.start, end: stream.pos, + string: stream.current(), + type: style || null, + state: copy ? copyState(doc.mode, state) : state}; + } + + var doc = cm.doc, mode = doc.mode, style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize), tokens; + if (asArray) tokens = []; + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, state); + if (asArray) tokens.push(getObj(true)); + } + return asArray ? tokens : getObj(); + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; + var curStart = 0, curStyle = null; + var stream = new StringStream(text, cm.options.tabSize), style; + var inner = cm.options.addModeClass && [null]; + if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) processLine(cm, text, state, stream.pos); + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) style = "m-" + (style ? mName + " " + style : mName); + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 50000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 characters + var pos = Math.min(stream.pos, curStart + 50000); + f(pos, curStyle); + curStart = pos; + } + } + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, state, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, state, function(end, style) { + st.push(end, style); + }, lineClasses, forceToEnd); + + // Run overlays, adjust style array. + for (var o = 0; o < cm.state.overlays.length; ++o) { + var overlay = cm.state.overlays[o], i = 1, at = 0; + runMode(cm, line.text, overlay.mode, true, function(end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) + st.splice(i, 1, end, st[i+1], i_end); + i += 2; + at = Math.min(end, i_end); + } + if (!style) return; + if (overlay.opaque) { + st.splice(start, i - start, end, "cm-overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start+1]; + st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; + } + } + }, lineClasses); + } + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; + } + + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); + line.styles = result.styles; + if (result.classes) line.styleClasses = result.classes; + else if (line.styleClasses) line.styleClasses = null; + if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; + } + return line.styles; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, state, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize); + stream.start = stream.pos = startAt || 0; + if (text == "") callBlankLine(mode, state); + while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) { + readToken(mode, stream, state); + stream.start = stream.pos; + } + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}, styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) return null; + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")); + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content, + col: 0, pos: 0, cm: cm, + splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order; + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) + builder.addToken = buildTokenBadBidi(builder.addToken, order); + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) + builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); + if (line.styleClasses.textClass) + builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); + (lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit && /\bcm-tab\b/.test(builder.content.lastChild.className)) + builder.content.className = "cm-tab-wrap-hack"; + + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) + builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); + + return builder; + } + + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token; + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) return; + var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text; + var special = builder.cm.state.specialChars, mustWrap = false; + if (!special.test(text)) { + builder.col += text.length; + var content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) mustWrap = true; + builder.pos += text.length; + } else { + var content = document.createDocumentFragment(), pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) break; + pos += skipped + 1; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt.setAttribute("role", "presentation"); + txt.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else { + var txt = builder.cm.options.specialCharPlaceholder(m[0]); + txt.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt); + builder.pos++; + } + } + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || ""; + if (startStyle) fullStyle += startStyle; + if (endStyle) fullStyle += endStyle; + var token = elt("span", [content], fullStyle, css); + if (title) token.title = title; + return builder.content.appendChild(token); + } + builder.content.appendChild(content); + } + + function splitSpaces(old) { + var out = " "; + for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; + out += " "; + return out; + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function(builder, text, style, startStyle, endStyle, title, css) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + for (var i = 0; i < order.length; i++) { + var part = order[i]; + if (part.to > start && part.from <= start) break; + } + if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css); + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + }; + } + + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) builder.map.push(builder.pos, builder.pos + size, widget); + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + widget = builder.content.appendChild(document.createElement("span")); + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0; + if (!spans) { + for (var i = 1; i < styles.length; i+=2) + builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); + return; + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = title = css = ""; + collapsed = null; nextChange = Infinity; + var foundBookmarks = []; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) spanStyle += " " + m.className; + if (m.css) css = m.css; + if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; + if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; + if (m.title && !title) title = m.title; + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + collapsed = sp; + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null); + if (collapsed.to == null) return; + if (collapsed.to == pos) collapsed = false; + } + if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) + buildCollapsedSpan(builder, 0, foundBookmarks[j]); + } + if (pos >= len) break; + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore); + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null;} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + for (var i = start, result = []; i < end; ++i) + result.push(new Line(text[i], spansFor(i), estimateHeight)); + return result; + } + + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) doc.remove(from.line, nlines); + if (added.length) doc.insert(from.line, added); + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added = linesFor(1, text.length - 1); + added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added = linesFor(1, text.length - 1); + if (nlines > 1) doc.remove(from.line + 1, nlines - 1); + doc.insert(from.line + 1, added); + } + + signalLater(doc, "change", doc, change); + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + this.lines = lines; + this.parent = null; + for (var i = 0, height = 0; i < lines.length; ++i) { + lines[i].parent = this; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length; }, + // Remove the n lines at offset 'at'. + removeInner: function(at, n) { + for (var i = at, e = at + n; i < e; ++i) { + var line = this.lines[i]; + this.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + // Helper used to collapse a small branch into a single leaf. + collapse: function(lines) { + lines.push.apply(lines, this.lines); + }, + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function(at, lines, height) { + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) lines[i].parent = this; + }, + // Used to iterate over a part of the tree. + iterN: function(at, n, op) { + for (var e = at + n; at < e; ++at) + if (op(this.lines[at])) return true; + } + }; + + function BranchChunk(children) { + this.children = children; + var size = 0, height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size; }, + removeInner: function(at, n) { + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this.height -= oldHeight - child.height; + if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) break; + at = 0; + } else at -= sz; + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function(lines) { + for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); + }, + insertInner: function(at, lines, height) { + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + while (child.lines.length > 50) { + var spilled = child.lines.splice(child.lines.length - 25, 25); + var newleaf = new LeafChunk(spilled); + child.height -= newleaf.height; + this.children.splice(i + 1, 0, newleaf); + newleaf.parent = this; + } + this.maybeSpill(); + } + break; + } + at -= sz; + } + }, + // When a node has grown, check whether it should be split. + maybeSpill: function() { + if (this.children.length <= 10) return; + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iterN: function(at, n, op) { + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) return true; + if ((n -= used) == 0) break; + at = 0; + } else at -= sz; + } + } + }; + + var nextDocId = 0; + var Doc = CodeMirror.Doc = function(text, mode, firstLine) { + if (!(this instanceof Doc)) return new Doc(text, mode, firstLine); + if (firstLine == null) firstLine = 0; + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.frontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + + if (typeof text == "string") text = splitLines(text); + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) this.iterN(from - this.first, to - from, op); + else this.iterN(this.first, this.first + this.size, from); + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) height += lines[i].height; + this.insertInner(at - this.first, lines, height); + }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep, lineFilter) { + var lines = getLines(this, this.first, this.first + this.size, lineFilter); + if (lineSep === false) return lines; + return lines.join(lineSep || "\n"); + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1; + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: splitLines(code), origin: "setValue", full: true}, true); + setSelection(this, simpleSelection(top)); + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) return lines; + return lines.join(lineSep || "\n"); + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, + + getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, + getLineNumber: function(line) {return lineNo(line);}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") line = getLine(this, line); + return visualLine(line); + }, + + lineCount: function() {return this.size;}, + firstLine: function() {return this.first;}, + lastLine: function() {return this.first + this.size - 1;}, + + clipPos: function(pos) {return clipPos(this, pos);}, + + getCursor: function(start) { + var range = this.sel.primary(), pos; + if (start == null || start == "head") pos = range.head; + else if (start == "anchor") pos = range.anchor; + else if (start == "end" || start == "to" || start === false) pos = range.to(); + else pos = range.from(); + return pos; + }, + listSelections: function() { return this.sel.ranges; }, + somethingSelected: function() {return this.sel.somethingSelected();}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads, options)); + }), + extendSelectionsBy: docMethodOp(function(f, options) { + extendSelections(this, map(this.sel.ranges, f), options); + }), + setSelections: docMethodOp(function(ranges, primary, options) { + if (!ranges.length) return; + for (var i = 0, out = []; i < ranges.length; i++) + out[i] = new Range(clipPos(this, ranges[i].anchor), + clipPos(this, ranges[i].head)); + if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); + setSelection(this, normalizeSelection(out, primary), options); + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); + }), + + getSelection: function(lineSep) { + var ranges = this.sel.ranges, lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) return lines; + else return lines.join(lineSep || "\n"); + }, + getSelections: function(lineSep) { + var parts = [], ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) sel = sel.join(lineSep || "\n"); + parts[i] = sel; + } + return parts; + }, + replaceSelection: function(code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) + dup[i] = code; + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var changes = [], sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin}; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i = changes.length - 1; i >= 0; i--) + makeChange(this, changes[i]); + if (newSel) setSelectionReplaceHistory(this, newSel); + else if (this.cm) ensureCursorVisible(this.cm); + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), + + setExtending: function(val) {this.extend = val;}, + getExtending: function() {return this.extend;}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; + for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; + return {undo: done, redo: undone}; + }, + clearHistory: function() {this.history = new History(this.history.maxGeneration);}, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; + return this.history.generation; + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration); + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)}; + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) line[prop] = cls; + else if (classTest(cls).test(line[prop])) return false; + else line[prop] += " " + cls; + return true; + }); + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) return false; + else if (cls == null) line[prop] = null; + else { + var found = cur.match(classTest(cls)); + if (!found) return false; + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true; + }); + }), + + addLineWidget: docMethodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options); + }), + removeLineWidget: function(widget) { widget.clear(); }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark"); + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + markers.push(span.marker.parent || span.marker); + } + return markers; + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo = from.line; + this.iter(from.line, to.line + 1, function(line) { + var spans = line.markedSpans; + if (spans) for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(lineNo == from.line && from.ch > span.to || + span.from == null && lineNo != from.line|| + lineNo == to.line && span.from > to.ch) && + (!filter || filter(span.marker))) + found.push(span.marker.parent || span.marker); + } + ++lineNo; + }); + return found; + }, + getAllMarks: function() { + var markers = []; + this.iter(function(line) { + var sps = line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) + if (sps[i].from != null) markers.push(sps[i].marker); + }); + return markers; + }, + + posFromIndex: function(off) { + var ch, lineNo = this.first; + this.iter(function(line) { + var sz = line.text.length + 1; + if (sz > off) { ch = off; return true; } + off -= sz; + ++lineNo; + }); + return clipPos(this, Pos(lineNo, ch)); + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) return 0; + this.iter(this.first, coords.line, function (line) { + index += line.text.length + 1; + }); + return index; + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc; + }, + + linkedDoc: function(options) { + if (!options) options = {}; + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) from = options.from; + if (options.to != null && options.to < to) to = options.to; + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from); + if (options.sharedHist) copy.history = this.history; + (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy; + }, + unlinkDoc: function(other) { + if (other instanceof CodeMirror) other = other.doc; + if (this.linked) for (var i = 0; i < this.linked.length; ++i) { + var link = this.linked[i]; + if (link.doc != other) continue; + this.linked.splice(i, 1); + other.unlinkDoc(this); + detachSharedMarkers(findSharedMarkers(this)); + break; + } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, + + getMode: function() {return this.mode;}, + getEditor: function() {return this.cm;} + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); + for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments);}; + })(Doc.prototype[prop]); + + eventMixin(Doc); + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) continue; + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) continue; + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) throw new Error("This document is already in use."); + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + if (!cm.options.lineWrapping) findMaxLine(cm); + cm.options.mode = doc.modeOption; + regChange(cm); + } + + // LINE UTILITIES + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); + for (var chunk = doc; !chunk.lines;) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break; } + n -= sz; + } + } + return chunk.lines[n]; + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], n = start.line; + doc.iter(start.line, end.line + 1, function(line) { + var text = line.text; + if (n == end.line) text = text.slice(0, end.ch); + if (n == start.line) text = text.slice(start.ch); + out.push(text); + ++n; + }); + return out; + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to, lineFilter) { + var out = []; + doc.iter(from, to, function(line) { + var text = line.text; + if(lineFilter){ + text = lineFilter(line); + } + out.push(text); + }); + return out; + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) for (var n = line; n; n = n.parent) n.height += diff; + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) return null; + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) break; + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first; + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i = 0; i < chunk.children.length; ++i) { + var child = chunk.children[i], ch = child.height; + if (h < ch) { chunk = child; continue outer; } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) break; + h -= lh; + } + return n + i; + } + + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) break; + else h += line.height; + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i = 0; i < p.children.length; ++i) { + var cur = p.children[i]; + if (cur == chunk) break; + else h += cur.height; + } + } + return h; + } + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line) { + var order = line.order; + if (order == null) order = line.order = bidiOrdering(line.text); + return order; + } + + // HISTORY + + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); + return histChange; + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) array.pop(); + else break; + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done); + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done); + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done); + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, ore are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur; + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + var last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) + pushSelectionToHistory(doc.sel, hist.done); + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation}; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) hist.done.shift(); + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + + if (!last) signal(doc, "historyAdded"); + } + + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + hist.done[hist.done.length - 1] = sel; + else + pushSelectionToHistory(sel, hist.done); + + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) + clearSelectionEvents(hist.undone); + } + + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) + dest.push(sel); + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { + if (line.markedSpans) + (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) return null; + for (var i = 0, out; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } + else if (out) out.push(spans[i]); + } + return !out ? spans : out.length ? out : null; + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) return null; + for (var i = 0, nw = []; i < change.text.length; ++i) + nw.push(removeClearedSpans(found[i])); + return nw; + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + for (var i = 0, copy = []; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue; + } + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m; + newChanges.push({from: change.from, to: change.to, text: change.text}); + if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } + } + } + return copy; + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true; + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue; + } + for (var j = 0; j < sub.changes.length; ++j) { + var cur = sub.changes[j]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break; + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + + function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // EVENT UTILITIES + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + var e_preventDefault = CodeMirror.e_preventDefault = function(e) { + if (e.preventDefault) e.preventDefault(); + else e.returnValue = false; + }; + var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { + if (e.stopPropagation) e.stopPropagation(); + else e.cancelBubble = true; + }; + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; + } + var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; + + function e_target(e) {return e.target || e.srcElement;} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) b = 1; + else if (e.button & 2) b = 3; + else if (e.button & 4) b = 2; + } + if (mac && e.ctrlKey && b == 1) b = 3; + return b; + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var on = CodeMirror.on = function(emitter, type, f) { + if (emitter.addEventListener) + emitter.addEventListener(type, f, false); + else if (emitter.attachEvent) + emitter.attachEvent("on" + type, f); + else { + var map = emitter._handlers || (emitter._handlers = {}); + var arr = map[type] || (map[type] = []); + arr.push(f); + } + }; + + var off = CodeMirror.off = function(emitter, type, f) { + if (emitter.removeEventListener) + emitter.removeEventListener(type, f, false); + else if (emitter.detachEvent) + emitter.detachEvent("on" + type, f); + else { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + for (var i = 0; i < arr.length; ++i) + if (arr[i] == f) { arr.splice(i, 1); break; } + } + }; + + var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); + }; + + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2), list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + function bnd(f) {return function(){f.apply(null, args);};}; + for (var i = 0; i < arr.length; ++i) + list.push(bnd(arr[i])); + } + + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) delayed[i](); + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore; + } + + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) return; + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) + set.push(arr[i]); + } + + function hasHandler(emitter, type) { + var arr = emitter._handlers && emitter._handlers[type]; + return arr && arr.length > 0; + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f);}; + ctor.prototype.off = function(type, f) {off(this, type, f);}; + } + + // MISC UTILITIES + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; + + // Reused option objects for setSelection & friends + var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; + + function Delayed() {this.id = null;} + Delayed.prototype.set = function(ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) end = string.length; + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) + return n + (end - i); + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; + } + }; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) nextTab = string.length; + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) + return pos + Math.min(skipped, goal - col); + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; + if (col >= goal) return pos; + } + } + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + spaceStrs.push(lst(spaceStrs) + " "); + return spaceStrs[n]; + } + + function lst(arr) { return arr[arr.length-1]; } + + var selectInput = function(node) { node.select(); }; + if (ios) // Mobile Safari apparently has a bug where select() is broken. + selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; + else if (ie) // Suppress mysterious IE10 errors + selectInput = function(node) { try { node.select(); } catch(_e) {} }; + + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + if (array[i] == elt) return i; + return -1; + } + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); + return out; + } + + function nothing() {} + + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) copyObj(props, inst); + return inst; + }; + + function copyObj(obj, target, overwrite) { + if (!target) target = {}; + for (var prop in obj) + if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + target[prop] = obj[prop]; + return target; + } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args);}; + } + + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + var isWordCharBasic = CodeMirror.isWordChar = function(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + }; + function isWordChar(ch, helper) { + if (!helper) return isWordCharBasic(ch); + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; + return helper.test(ch); + } + + function isEmpty(obj) { + for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; + return true; + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; + function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } + + // DOM UTILITIES + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) e.className = className; + if (style) e.style.cssText = style; + if (typeof content == "string") e.appendChild(document.createTextNode(content)); + else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); + return e; + } + + var range; + if (document.createRange) range = function(node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r; + }; + else range = function(node, start, end) { + var r = document.body.createTextRange(); + try { r.moveToElementText(node.parentNode); } + catch(e) { return r; } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r; + }; + + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + e.removeChild(e.firstChild); + return e; + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); + } + + var contains = CodeMirror.contains = function(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + child = child.parentNode; + if (parent.contains) + return parent.contains(child); + do { + if (child.nodeType == 11) child = child.host; + if (child == parent) return true; + } while (child = child.parentNode); + }; + + function activeElt() { return document.activeElement; } + // Older versions of IE throws unspecified error when touching + // document.activeElement in some cases (during loading, in iframe) + if (ie && ie_version < 11) activeElt = function() { + try { return document.activeElement; } + catch(e) { return document.body; } + }; + + function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); } + var rmClass = CodeMirror.rmClass = function(node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + var addClass = CodeMirror.addClass = function(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) node.className += (current ? " " : "") + cls; + }; + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) + if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; + return b; + } + + // WINDOW-WIDE EVENTS + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.body.getElementsByClassName) return; + var byClass = document.body.getElementsByClassName("CodeMirror"); + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) f(cm); + } + } + + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) return; + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function() { + if (resizeTimer == null) resizeTimer = setTimeout(function() { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function() { + forEachCodeMirror(onBlur); + }); + } + + // FEATURE DETECTION + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) return false; + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node; + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) return badBidiRects; + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) + var r1 = range(txt, 1, 2).getBoundingClientRect(); + return badBidiRects = (r1.right - r0.right < 3); + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLines = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) nl = string.length; + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function(string){return string.split(/\r\n?|\n/);}; + + var hasSelection = window.getSelection ? function(te) { + try { return te.selectionStart != te.selectionEnd; } + catch(e) { return false; } + } : function(te) { + try {var range = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range || range.parentElement() != te) return false; + return range.compareEndPoints("StartToEnd", range) != 0; + }; + + var hasCopyEvent = (function() { + var e = elt("div"); + if ("oncopy" in e) return true; + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function"; + })(); + + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) return badZoomedRects; + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; + } + + // KEY NAMES + + var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"}; + CodeMirror.keyNames = keyNames; + (function() { + // Number keys + for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); + // Alphabetic keys + for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); + // Function keys + for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; + })(); + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) return f(from, to, "ltr"); + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); + found = true; + } + } + if (!found) f(from, to, "ltr"); + } + + function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } + function bidiRight(part) { return part.level % 2 ? part.from : part.to; } + + function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } + function lineRight(line) { + var order = getOrder(line); + if (!order) return line.text.length; + return bidiRight(lst(order)); + } + + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) lineN = lineNo(visual); + var order = getOrder(visual); + var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); + return Pos(lineN, ch); + } + function lineEnd(cm, lineN) { + var merged, line = getLine(cm.doc, lineN); + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + lineN = null; + } + var order = getOrder(line); + var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); + return Pos(lineN == null ? lineNo(line) : lineN, ch); + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS); + } + return start; + } + + function compareBidiLevel(order, a, b) { + var linedir = order[0].level; + if (a == linedir) return true; + if (b == linedir) return false; + return a < b; + } + var bidiOther; + function getBidiPartAt(order, pos) { + bidiOther = null; + for (var i = 0, found; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < pos && cur.to > pos) return i; + if ((cur.from == pos || cur.to == pos)) { + if (found == null) { + found = i; + } else if (compareBidiLevel(order, cur.level, order[found].level)) { + if (cur.from != cur.to) bidiOther = found; + return i; + } else { + if (cur.from != cur.to) bidiOther = i; + return found; + } + } + } + return found; + } + + function moveInLine(line, pos, dir, byUnit) { + if (!byUnit) return pos + dir; + do pos += dir; + while (pos > 0 && isExtendingChar(line.text.charAt(pos))); + return pos; + } + + // This is needed in order to move 'visually' through bi-directional + // text -- i.e., pressing left should make the cursor go left, even + // when in RTL text. The tricky part is the 'jumps', where RTL and + // LTR text touch each other. This often requires the cursor offset + // to move more than one unit, in order to visually move one unit. + function moveVisually(line, start, dir, byUnit) { + var bidi = getOrder(line); + if (!bidi) return moveLogically(line, start, dir, byUnit); + var pos = getBidiPartAt(bidi, start), part = bidi[pos]; + var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit); + + for (;;) { + if (target > part.from && target < part.to) return target; + if (target == part.from || target == part.to) { + if (getBidiPartAt(bidi, target) == pos) return target; + part = bidi[pos += dir]; + return (dir > 0) == part.level % 2 ? part.to : part.from; + } else { + part = bidi[pos += dir]; + if (!part) return null; + if ((dir > 0) == part.level % 2) + target = moveInLine(line, part.to, -1, byUnit); + else + target = moveInLine(line, part.from, 1, byUnit); + } + } + } + + function moveLogically(line, start, dir, byUnit) { + var target = start + dir; + if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir; + return target < 0 || target > line.text.length ? null : target; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6ff + var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; + function charType(code) { + if (code <= 0xf7) return lowTypes.charAt(code); + else if (0x590 <= code && code <= 0x5f4) return "R"; + else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); + else if (0x6ee <= code && code <= 0x8ac) return "r"; + else if (0x2000 <= code && code <= 0x200b) return "w"; + else if (code == 0x200c) return "b"; + else return "L"; + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + // Browsers seem to always treat the boundaries of block elements as being L. + var outerType = "L"; + + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; this.to = to; + } + + return function(str) { + if (!bidiRE.test(str)) return false; + var len = str.length, types = []; + for (var i = 0, type; i < len; ++i) + types.push(type = charType(str.charCodeAt(i))); + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i = 0, prev = outerType; i < len; ++i) { + var type = types[i]; + if (type == "m") types[i] = prev; + else prev = type; + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (type == "1" && cur == "r") types[i] = "n"; + else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i = 1, prev = types[0]; i < len - 1; ++i) { + var type = types[i]; + if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; + else if (type == "," && prev == types[i+1] && + (prev == "1" || prev == "n")) types[i] = prev; + prev = type; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i = 0; i < len; ++i) { + var type = types[i]; + if (type == ",") types[i] = "N"; + else if (type == "%") { + for (var end = i + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (cur == "L" && type == "1") types[i] = "L"; + else if (isStrong.test(type)) cur = type; + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i = 0; i < len; ++i) { + if (isNeutral.test(types[i])) { + for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} + var before = (i ? types[i-1] : outerType) == "L"; + var after = (end < len ? types[end] : outerType) == "L"; + var replace = before || after ? "L" : "R"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i = 0; i < len;) { + if (countsAsLeft.test(types[i])) { + var start = i; + for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} + order.push(new BidiSpan(0, start, i)); + } else { + var pos = i, at = order.length; + for (++i; i < len && types[i] != "L"; ++i) {} + for (var j = pos; j < i;) { + if (countsAsNum.test(types[j])) { + if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); + var nstart = j; + for (++j; j < i && countsAsNum.test(types[j]); ++j) {} + order.splice(at, 0, new BidiSpan(2, nstart, j)); + pos = j; + } else ++j; + } + if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); + } + } + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + if (order[0].level == 2) + order.unshift(new BidiSpan(1, order[0].to, order[0].to)); + if (order[0].level != lst(order).level) + order.push(new BidiSpan(order[0].level, len, len)); + + return order; + }; + })(); + + // THE END + + CodeMirror.version = "5.4.1"; + + return CodeMirror; +});; +(function ($) { + /** + * 公式编辑控件 + * @class BI.FormulaEditor + * @extends BI.Widget + */ + BI.FormulaEditor = BI.inherit(BI.Single, { + _defaultConfig: function () { + return $.extend(BI.FormulaEditor.superclass._defaultConfig.apply(), { + baseCls: 'bi-formula-editor', + watermark: '', + value: '', + fieldTextValueMap: {}, + showHint: true + }); + }, + _init: function () { + BI.FormulaEditor.superclass._init.apply(this, arguments); + var o = this.options, self = this; + this.editor = CodeMirror(this.element[0], { + textWrapping: true, + lineWrapping: true, + lineNumbers: false, + mode: 'formula' + }); + this.editor.on("change", function (cm, change) { + self._checkWaterMark(); + if(o.showHint){ + CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false}); + } + BI.nextTick(function () { + self.fireEvent(BI.FormulaEditor.EVENT_CHANGE) + }); + }); + + this.editor.on("focus", function () { + self._checkWaterMark(); + self.fireEvent(BI.FormulaEditor.EVENT_FOCUS); + }); + + this.editor.on("blur", function () { + self.fireEvent(BI.FormulaEditor.EVENT_BLUR); + }); + + + if (BI.isKey(o.value)) { + self.setValue(o.value); + } + + if (BI.isKey(this.options.watermark)) { + var self = this; + this.watermark = BI.createWidget({ + type: "bi.label", + cls: "bi-water-mark", + text: this.options.watermark, + whiteSpace: "nowrap", + textAlign: "left" + }); + BI.createWidget({ + type: "bi.absolute", + element: self, + items: [{ + el: self.watermark, + left: 0, + top: 0 + }] + }); + + this.watermark.element.bind( + "mousedown", function (e) { + self.insertString(""); + self.editor.focus(); + e.stopEvent(); + } + ); + this.watermark.element.bind("click", function (e) { + self.editor.focus(); + e.stopEvent(); + }); + this.watermark.element.css({ + position: "absolute", + left: 3, + right: 3, + top: 6, + bottom: 0 + }); + } + }, + + _checkWaterMark: function () { + var o = this.options; + if (!this.disabledWarterMark && BI.isEmptyString(this.editor.getValue()) && BI.isKey(o.watermark)) { + this.watermark && this.watermark.visible(); + } else { + this.watermark && this.watermark.invisible(); + } + }, + + disableWarterMark: function () { + this.disabledWarterMark = true; + this._checkWaterMark(); + }, + + focus: function() { + this.editor.focus(); + }, + + /** + * 添加字段 + * @param field + */ + insertField: function (field) { + var from = this.editor.getCursor(); + this.editor.replaceSelection(field); + var to = this.editor.getCursor(); + this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle : "start", endStyle:"end"}); + this.editor.replaceSelection(" "); + this.editor.focus(); + }, + + insertFunction: function (fn) { + var from = this.editor.getCursor(); + this.editor.replaceSelection(fn); + var to = this.editor.getCursor(); + this.editor.markText(from, to, {className: "#function", atomic: true}); + this.editor.replaceSelection("() "); + to = this.editor.getCursor(); + to.ch = to.ch - 2; + this.editor.setCursor(to); + this.editor.focus(); + }, + insertOperator: function (op) { + var from = this.editor.getCursor(); + this.editor.replaceSelection(op); + var to = this.editor.getCursor(); + this.editor.markText(from, to, {className: "%operator", atomic: true}); + this.editor.replaceSelection(" "); + this.editor.focus(); + }, + + setFunction: function (v) { + var from = this.editor.getCursor(); + this.editor.replaceSelection(v); + var to = this.editor.getCursor(); + this.editor.markText(from, to, {className: "#function", atomic: true}); + }, + + insertString: function (str) { + this.editor.replaceSelection(str); + this.editor.focus(); + }, + + getFormulaString: function () { + return this.editor.getValue(); + }, + + getUsedFields: function () { + var fieldMap = this.options.fieldTextValueMap; + var fields = []; + this.editor.getValue(true, function (line) { + var value = line.text; + _.forEach(line.markedSpans, function (i, ms) { + switch (i.marker.className) { + case "fieldName": + var dId = fieldMap[value.substr(i.from, i.to - i.from)]; + if (!fields.contains(dId)) { + fields.push(dId); + } + + } + }); + }); + return fields; + }, + + getCheckString: function () { + return this.editor.getValue(true, function (line) { + var rawText = line.text, value = line.text, num = 0; + value.text = rawText; + _.forEach(line.markedSpans, function (i, ms) { + + switch (i.marker.className) { + case "fieldName": + var fieldNameLength = i.to - i.from; + value = value.substr(0, i.from + num) + "$a" + value.substr(i.to + num, value.length); + num = num + 2 - fieldNameLength; + break; + } + + }); + return value; + }); + }, + + getValue: function () { + var fieldMap = this.options.fieldTextValueMap; + return this.editor.getValue("\n", function (line) { + var rawText = line.text, value = line.text, num = 0; + value.text = rawText; + _.forEach(line.markedSpans, function (i, ms) { + switch (i.marker.className) { + case "fieldName": + var fieldNameLength = i.to - i.from; + var fieldId = fieldMap[value.substr(i.from + num, fieldNameLength)]; + value = value.substr(0, i.from + num) + "$\{" + fieldMap[value.substr(i.from + num, fieldNameLength)] + "\}" + value.substr(i.to + num, value.length); + num += fieldId.length - fieldNameLength + 3; + break; + } + }); + return value; + }); + }, + + setValue: function (value) { + this.editor.setValue(value); + }, + + setFieldTextValueMap: function (fieldTextValueMap) { + this.options.fieldTextValueMap = fieldTextValueMap; + }, + + refresh: function () { + var self = this; + BI.nextTick(function () { + self.editor.refresh(); + }); + } + + }); + BI.FormulaEditor.EVENT_CHANGE = "EVENT_CHANGE"; + BI.FormulaEditor.EVENT_BLUR = "EVENT_BLUR"; + BI.FormulaEditor.EVENT_FOCUS = "EVENT_FOCUS"; + $.shortcut("bi.formula", BI.FormulaEditor); +})(jQuery); +/** + * z-index在1亿层级 + * 弹出提示消息框,用于模拟阻塞操作(通过回调函数实现) + * @class BI.Msg + */ +$.extend(BI, { + Msg: function () { + + var messageShow, $mask, $pop; + + return { + alert: function (title, message, callback) { + this._show(false, title, message, callback); + }, + confirm: function (title, message, callback, min_width) { + this._show(true, title, message, callback); + }, + prompt: function (title, message, value, callback, min_width) { + FR.Msg.prompt(title, message, value, callback, min_width); + }, + toast: function (message, level, context) { + context = context || $("body"); + var toast = BI.createWidget({ + type: "bi.toast", + level: level, + text: message + }); + BI.createWidget({ + type: "bi.absolute", + element: context, + items: [{ + el: toast, + left: "50%", + top: 0 + }] + }); + if (toast.element.outerWidth() > context.outerWidth()) { + toast.setWidth(context.width()); + } + toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2}); + toast.invisible(); + toast.element.slideDown(500, function () { + BI.delay(function () { + toast.element.slideUp(500, function () { + toast.destroy(); + }) + }, 5000) + }) + }, + _show: function (hasCancel, title, message, callback) { + $mask = $('
    ').css({ + position: 'absolute', + 'zIndex': BI.zIndex_tip - 2, + top: 0, + left: 0, + right: 0, + bottom: 0, + opacity: 0.5 + }).appendTo('body'); + $pop = $('
    ').css({ + position: 'absolute', + 'zIndex': BI.zIndex_tip - 1, + top: 0, + left: 0, + right: 0, + bottom: 0 + }).appendTo('body'); + var close = function () { + messageShow.destroy(); + $mask.remove(); + }; + var controlItems = []; + if (hasCancel === true) { + controlItems.push({ + el: { + type: 'bi.button', + text: BI.i18nText("BI-Basic_Cancel"), + height: 30, + level: 'ignore', + handler: function () { + close(); + if (BI.isFunction(callback)) { + callback.apply(null, [false]); + } + } + } + }); + } + controlItems.push({ + el: { + type: 'bi.button', + text: BI.i18nText("BI-Basic_OK"), + height: 30, + handler: function () { + close(); + if (BI.isFunction(callback)) { + callback.apply(null, [true]); + } + } + } + }); + var conf = { + element: $pop, + type: 'bi.center_adapt', + items: [ + { + type: 'bi.border', + cls: 'bi-message-content', + items: { + 'north': { + el: { + type: 'bi.border', + cls: 'bi-message-title', + items: { + center: { + el: { + type: 'bi.label', + text: title || BI.i18nText("BI-Basic_Prompt"), + textAlign: 'left', + hgap: 20, + height: 50 + } + }, + east: { + el: { + type: 'bi.icon_button', + cls: 'bi-message-close close-font', +// height: 50, + handler: function () { + close(); + } + }, + width: 60 + } + } + }, + height: 50 + }, + 'center': { + el: { + type: "bi.text", + cls: "bi-message-text", + tgap: 60, + hgap: 20, + lineHeight: 30, + whiteSpace: "normal", + text: message + } + }, + 'south': { + el: { + type: "bi.absolute", + items: [{ + el: { + type: 'bi.right_vertical_adapt', + hgap: 5, + items: controlItems + }, + top: 0, + left: 20, + right: 20, + bottom: 0 + }] + + }, + height: 60 + } + }, + width: 400, + height: 300 + } + ] + }; + + messageShow = BI.createWidget(conf); + } + }; + }() +});/** + * Grid + * + * Created by GUY on 2016/1/11. + * @class BI.Grid + * @extends BI.Widget + */ +BI.Grid = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.Grid.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-grid", + width: 400, + height: 300, + overflowX: true, + overflowY: true, + overscanColumnCount: 0, + overscanRowCount: 0, + rowHeightGetter: BI.emptyFn, + columnWidthGetter: BI.emptyFn, + estimatedColumnSize: 100, + estimatedRowSize: 30, + scrollLeft: 0, + scrollTop: 0, + items: [] + }); + }, + + _init: function () { + BI.Grid.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.renderedCells = []; + this.renderedKeys = []; + this._scrollLock = false; + this._debounceRelease = BI.debounce(function () { + self._scrollLock = false; + }, 150); + this.container = BI.createWidget({ + type: "bi.absolute" + }); + this.element.scroll(function () { + if (self._scrollLock === true) { + return; + } + o.scrollLeft = self.element.scrollLeft(); + o.scrollTop = self.element.scrollTop(); + self._calculateChildrenToRender(); + self.fireEvent(BI.Grid.EVENT_SCROLL, { + scrollLeft: o.scrollLeft, + scrollTop: o.scrollTop + }); + }); + BI.createWidget({ + type: "bi.vertical", + element: this, + scrollable: o.overflowX === true && o.overflowY === true, + scrolly: o.overflowX === false && o.overflowY === true, + scrollx: o.overflowX === true && o.overflowY === false, + items: [this.container] + }); + if (o.items.length > 0) { + this._populate(); + } + if (o.scrollLeft !== 0 || o.scrollTop !== 0) { + BI.nextTick(function () { + self.element.scrollTop(o.scrollTop); + self.element.scrollLeft(o.scrollLeft); + }); + } + }, + + _getOverscanIndices: function (cellCount, overscanCellsCount, startIndex, stopIndex) { + return { + overscanStartIndex: Math.max(0, startIndex - overscanCellsCount), + overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount) + } + }, + + _calculateChildrenToRender: function () { + var self = this, o = this.options; + + var width = o.width, height = o.height, scrollLeft = BI.clamp(o.scrollLeft, 0, this._getMaxScrollLeft()), scrollTop = BI.clamp(o.scrollTop, 0, this._getMaxScrollTop()), + overscanColumnCount = o.overscanColumnCount, overscanRowCount = o.overscanRowCount; + + if (height > 0 && width > 0) { + var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange(width, scrollLeft); + var visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange(height, scrollTop); + + var horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment(width, scrollLeft); + var verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment(height, scrollTop); + + this._renderedColumnStartIndex = visibleColumnIndices.start; + this._renderedColumnStopIndex = visibleColumnIndices.stop; + this._renderedRowStartIndex = visibleRowIndices.start; + this._renderedRowStopIndex = visibleRowIndices.stop; + + var overscanColumnIndices = this._getOverscanIndices(this.columnCount, overscanColumnCount, this._renderedColumnStartIndex, this._renderedColumnStopIndex) + + var overscanRowIndices = this._getOverscanIndices(this.rowCount, overscanRowCount, this._renderedRowStartIndex, this._renderedRowStopIndex); + + var columnStartIndex = overscanColumnIndices.overscanStartIndex; + var columnStopIndex = overscanColumnIndices.overscanStopIndex; + var rowStartIndex = overscanRowIndices.overscanStartIndex; + var rowStopIndex = overscanRowIndices.overscanStopIndex; + + var renderedCells = [], renderedKeys = []; + + for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { + var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); + + for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) { + var key = [rowIndex, columnIndex]; + var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex); + + var index = BI.deepIndexOf(this.renderedKeys, key); + if (index > -1) { + if (columnDatum.size !== this.renderedCells[index]._width) { + this.renderedCells[index]._width = columnDatum.size; + this.renderedCells[index].el.setWidth(columnDatum.size); + } + if (rowDatum.size !== this.renderedCells[index]._height) { + this.renderedCells[index]._height = rowDatum.size; + this.renderedCells[index].el.setHeight(rowDatum.size); + } + if (this.renderedCells[index].left !== columnDatum.offset + horizontalOffsetAdjustment) { + this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) + "px"); + } + if (this.renderedCells[index].top !== rowDatum.offset + verticalOffsetAdjustment) { + this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) + "px"); + } + renderedCells.push(this.renderedCells[index]); + } else { + var child = BI.createWidget(BI.extend({ + type: "bi.label", + width: columnDatum.size, + height: rowDatum.size + }, o.items[rowIndex][columnIndex], { + cls: (o.items[rowIndex][columnIndex].cls || "") + " grid-cell" + (rowIndex === 0 ? " first-row" : "") + (columnIndex === 0 ? " first-col" : ""), + _rowIndex: rowIndex, + _columnIndex: columnIndex, + _left: columnDatum.offset + horizontalOffsetAdjustment, + _top: rowDatum.offset + verticalOffsetAdjustment + })); + renderedCells.push({ + el: child, + left: columnDatum.offset + horizontalOffsetAdjustment, + top: rowDatum.offset + verticalOffsetAdjustment, + _width: columnDatum.size, + _height: rowDatum.size + }); + } + renderedKeys.push(key); + } + } + //已存在的, 需要添加的和需要删除的 + var existSet = {}, addSet = {}, deleteArray = []; + BI.each(renderedKeys, function (i, key) { + if (BI.deepContains(self.renderedKeys, key)) { + existSet[i] = key; + } else { + addSet[i] = key; + } + }); + BI.each(this.renderedKeys, function (i, key) { + if (BI.deepContains(existSet, key)) { + return; + } + if (BI.deepContains(addSet, key)) { + return; + } + deleteArray.push(i); + }); + BI.each(deleteArray, function (i, index) { + self.renderedCells[index].el.destroy(); + }); + var addedItems = []; + BI.each(addSet, function (index) { + addedItems.push(renderedCells[index]) + }); + BI.createWidget({ + type: "bi.absolute", + element: this.container, + items: addedItems + }); + this.renderedCells = renderedCells; + this.renderedKeys = renderedKeys; + } + }, + + _getMaxScrollLeft: function () { + return Math.max(0, this._columnSizeAndPositionManager.getTotalSize() - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0)); + }, + + _getMaxScrollTop: function () { + return Math.max(0, this._rowSizeAndPositionManager.getTotalSize() - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0)); + }, + + _populate: function () { + var self = this, o = this.options; + if (o.items.length > 0) { + this.columnCount = o.items[0].length; + this.rowCount = o.items.length; + this.container.setWidth(this.columnCount * o.estimatedColumnSize); + this.container.setHeight(this.rowCount * o.estimatedRowSize); + + this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); + this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); + + this._calculateChildrenToRender(); + this.element.scrollTop(o.scrollTop); + this.element.scrollLeft(o.scrollLeft); + } + }, + + setScrollLeft: function (scrollLeft) { + if (this.options.scrollLeft === scrollLeft) { + return; + } + this._scrollLock = true; + this.options.scrollLeft = BI.clamp(scrollLeft || 0, 0, this._getMaxScrollLeft()); + this._debounceRelease(); + this._calculateChildrenToRender(); + this.element.scrollLeft(this.options.scrollLeft); + }, + + setScrollTop: function (scrollTop) { + if (this.options.scrollTop === scrollTop) { + return; + } + this._scrollLock = true; + this.options.scrollTop = BI.clamp(scrollTop || 0, 0, this._getMaxScrollTop()); + this._debounceRelease(); + this._calculateChildrenToRender(); + this.element.scrollTop(this.options.scrollTop); + }, + + setOverflowX: function (b) { + var self = this; + if (this.options.overflowX !== !!b) { + this.options.overflowX = !!b; + BI.nextTick(function () { + self.element.css({overflowX: !!b ? "auto" : "hidden"}); + }); + } + }, + + setOverflowY: function (b) { + var self = this; + if (this.options.overflowY !== !!b) { + this.options.overflowY = !!b; + BI.nextTick(function () { + self.element.css({overflowY: !!b ? "auto" : "hidden"}); + }); + } + }, + + getScrollLeft: function () { + return this.options.scrollLeft; + }, + + getScrollTop: function () { + return this.options.scrollTop; + }, + + getMaxScrollLeft: function () { + return this._getMaxScrollLeft(); + }, + + getMaxScrollTop: function () { + return this._getMaxScrollTop(); + }, + + setEstimatedColumnSize: function (width) { + this.options.estimatedColumnSize = width; + }, + + setEstimatedRowSize: function (height) { + this.options.estimatedRowSize = height; + }, + + restore: function () { + BI.each(this.renderedCells, function (i, cell) { + cell.el.destroy(); + }); + this.renderedCells = []; + this.renderedKeys = []; + this._scrollLock = false; + }, + + populate: function (items) { + if (items && items !== this.options.items) { + this.options.items = items; + this.restore(); + } + this._populate(); + } +}); +BI.Grid.EVENT_SCROLL = "EVENT_SCROLL"; +$.shortcut('bi.grid_view', BI.Grid);/** + * floatBox弹出层, + * @class BI.FloatBox + * @extends BI.Widget + */ +BI.FloatBox = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-float-box", + width: 600, + height: 500 + }) + }, + _init: function () { + BI.FloatBox.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.showAction = new BI.ShowAction({ + tar: this + }); + this._center = BI.createWidget(); + this._north = BI.createWidget(); + this.element.draggable({ + cursor: BICst.cursorUrl, + handle: ".bi-message-title", + drag: function (e, ui) { + var W = $("body").width(), H = $("body").height(); + if (ui.position.left + o.width > W) { + ui.position.left = W - o.width; + } + if (ui.position.top + o.height > H) { + ui.position.top = H - o.height; + } + if (ui.position.left < 0) { + ui.position.left = 0; + } + if (ui.position.top < 0) { + ui.position.top = 0; + } + } + }); + this._south = BI.createWidget(); + BI.createWidget({ + type: 'bi.border', + element: this, + items: { + 'north': { + el: { + type: 'bi.border', + cls: 'bi-message-title', + items: { + center: { + el: { + type: "bi.absolute", + items: [{ + el: this._north, + left: 10, + top: 0, + right: 0, + bottom: 0 + }] + } + }, + east: { + el: { + type: 'bi.icon_button', + cls: 'bi-message-close close-font', + height: 50, + handler: function () { + self.currentSectionProvider.close(); + } + }, + width: 60 + } + } + }, + height: 50 + }, + 'center': { + el: { + type: "bi.absolute", + items: [{ + el: this._center, + left: 10, + top: 10, + right: 10, + bottom: 10 + }] + } + }, + 'south': { + el: { + type: "bi.absolute", + items: [{ + el: this._south, + left: 10, + top: 0, + right: 10, + bottom: 0 + }] + }, + height: 60 + } + } + }) + }, + + populate: function (sectionProvider) { + var self = this; + this.currentSectionProvider = sectionProvider; + sectionProvider.rebuildNorth(this._north); + sectionProvider.rebuildCenter(this._center); + sectionProvider.rebuildSouth(this._south); + if (sectionProvider instanceof BI.Widget) { + sectionProvider.on(BI.PopoverSection.EVENT_CLOSE, function () { + self.close(); + }) + } + }, + + show: function () { + this.showAction.actionPerformed(); + }, + + hide: function () { + this.showAction.actionBack(); + }, + + open: function () { + this.show(); + this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_OPEN); + }, + + close: function () { + this.hide(); + this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED); + }, + + setZindex: function (zindex) { + this.element.css({"z-index": zindex}); + } +}); + +$.shortcut("bi.float_box", BI.FloatBox); + +BI.FloatBox.EVENT_FLOAT_BOX_CLOSED = "EVENT_FLOAT_BOX_CLOSED"; +BI.FloatBox.EVENT_FLOAT_BOX_OPEN = "EVENT_FLOAT_BOX_CLOSED"; +/** + * 下拉框弹出层, zIndex在1000w + * @class BI.PopupView + * @extends BI.Widget + */ +BI.PopupView = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-list-view", + maxWidth: 'auto', + minWidth: 100, + //maxHeight: 200, + minHeight: 25, + lgap: 0, + rgap: 0, + tgap: 0, + bgap: 0, + vgap: 0, + hgap: 0, + direction: BI.Direction.Top, //工具栏的方向 + stopEvent: false,//是否停止mousedown、mouseup事件 + stopPropagation: false, //是否停止mousedown、mouseup向上冒泡 + logic: { + dynamic: true + }, + + tool: false, //自定义工具栏 + tabs: [], //导航栏 + buttons: [], //toolbar栏 + + el: { + type: "bi.button_group", + items: [], + chooseType: 0, + behaviors: {}, + layouts: [{ + type: "bi.vertical" + }] + } + }) + }, + + _init: function () { + BI.PopupView.superclass._init.apply(this, arguments); + var self = this, o = this.options; + var fn = function (e) { + e.stopPropagation(); + }, stop = function (e) { + e.stopEvent(); + return false; + }; + this.element.css({ + "z-index": BI.zIndex_popup, + "min-width": o.minWidth + "px", + "max-width": o.maxWidth + "px" + }).bind({"click": fn}); + + //FIXME IE8下 jquery.mousewheeel.js 第一次执行65行$elem["offsetParent"]()的时候报错:未指明的错误 但是第二次或者调试的时候展开一下$elem内容均能避免上述问题 + try { + this.element.bind("mousewheel", fn); + } catch (e) { + this.element.bind("mousewheel", fn); + } + + o.stopPropagation && this.element.bind({"mousedown": fn, "mouseup": fn, "mouseover": fn}); + o.stopEvent && this.element.bind({"mousedown": stop, "mouseup": stop, "mouseover": stop}); + this.tool = this._createTool(); + this.tab = this._createTab(); + this.view = this._createView(); + this.toolbar = this._createToolBar(); + + this.button_group.on(BI.Controller.EVENT_CHANGE, function (type) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + self.fireEvent(BI.PopupView.EVENT_CHANGE); + } + }); + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { + scrolly: false, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + vgap: o.vgap, + hgap: o.hgap, + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, + BI.extend({ + cls: "list-view-outer" + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tool, this.tab, this.view, this.toolbar) + }))) + ) + })))); + }, + + _createView: function () { + var o = this.options; + this.button_group = BI.createWidget(o.el, {type: "bi.button_group"}); + this.button_group.element.css({"min-height": o.minHeight + "px"}); + return this.button_group; + }, + + _createTool: function () { + var o = this.options; + if (false === o.tool) { + return; + } + return BI.createWidget(o.tool) + }, + + _createTab: function () { + var o = this.options; + if (o.tabs.length === 0) { + return; + } + return BI.createWidget({ + type: "bi.center", + cls: "list-view-tab", + height: 25, + items: o.tabs + }) + }, + + _createToolBar: function () { + var o = this.options; + if (o.buttons.length === 0) { + return; + } + + return BI.createWidget({ + type: "bi.center", + cls: "list-view-toolbar", + height: 30, + items: BI.createItems(o.buttons, { + once: false, + shadow: true, + isShadowShowingOnSelected: true + }) + }) + }, + + getView: function () { + return this.button_group; + }, + + populate: function (items) { + this.button_group.populate.apply(this.button_group, arguments); + }, + + resetWidth: function (w) { + this.options.width = w; + this.element.width(w); + }, + + resetHeight: function (h) { + var tbHeight = this.toolbar ? (this.toolbar.attr("height") || 30) : 0, + tabHeight = this.tab ? (this.tab.attr("height") || 25) : 0, + toolHeight = ((this.tool && this.tool.attr("height")) || 25) * ((this.tool && this.tool.isVisible()) ? 1 : 0); + this.view.resetHeight ? this.view.resetHeight(h - tbHeight - tabHeight - toolHeight - 2) : + this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"}) + }, + + setEnable: function (arg) { + BI.PopupView.superclass.setEnable.apply(this, arguments); + this.view && this.view.setEnable(arg); + }, + + setValue: function (selectedValues) { + this.tab && this.tab.setValue(selectedValues); + this.button_group.setValue(selectedValues); + }, + + getValue: function () { + return this.button_group.getValue(); + } +}); +BI.PopupView.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.popup_view", BI.PopupView);/** + * guy + * @class BI.ScrollView + * @extends BI.Widget + */ +BI.ScrollView = BI.inherit(BI.Widget, { + + _const: { + dropDownHeight: 15, + expandIcon: "column-next-page-h-font", + collapseIcon: "column-pre-page-h-font" + }, + + _defaultConfig: function() { + return BI.extend(BI.ScrollView.superclass._defaultConfig.apply(this, arguments), { + baseCls:"bi-scroll-view", + scrollHeight: 50, + maxHeight: 300 + }) + }, + + _init : function() { + BI.ScrollView.superclass._init.apply(this, arguments); + + this.scrollUp = false; + this.scroll = BI.createWidget({ + type: "bi.vertical", + cls: "scroll-container", + scrolly: true + }) + BI.createWidget({ + type: "bi.vertical", + element: this, + scrolly: false, + items: [this.scroll] + }) + + this.dropdown = BI.createWidget({ + type: "bi.icon_button", + height: this._const.dropDownHeight, + cls: "scroll-drop-down-icon " + this._const.expandIcon, + handler: BI.bind(this._dropDownOrUp, this) + }) + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.dropdown, + left: 0, + right: 0, + bottom: -1 * this._const.dropDownHeight + }] + }) + this.populate(this.options.items); + }, + + _dropDownOrUp: function(){ + if(!this.scrollUp){ + var height = this.element.height(); + height += this.options.scrollHeight; + height = Math.min(height, this.scroll.element[0].scrollHeight, this.options.maxHeight); + this.element.height(height); + this._checkDropDownState(); + } else { + var height = this.element.height(); + height -= this.options.scrollHeight; + height = Math.max(height, this.options.height); + this.element.height(height); + this._checkDropDownState(); + } + }, + + _checkDropDownState: function(){ + var height = this.element.height(); + if(!this._checkScroll() || height >= this.options.maxHeight){ + this.scrollUp = true; + this.dropdown.element.removeClass(this._const.expandIcon).addClass(this._const.collapseIcon); + } else if(height <= this.options.height){ + this.scrollUp = false; + this.dropdown.element.addClass(this._const.expandIcon); + } else { + this.dropdown.element.addClass(this.scrollUp ? this._const.collapseIcon : this._const.expandIcon); + } + }, + + _checkScroll: function(){ + this.scroll.element.height(this.element.height()); + return this.scroll.element[0].scrollHeight > this.scroll.element[0].clientHeight; + }, + + _checkDropDown: function(){ + if(this._checkScroll()){ + this.dropdown.visible(); + //this.scrollUp = false; + this._checkDropDownState(); + } else { + this.dropdown.invisible(); + } + }, + + populate: function(){ + this.scroll.populate.apply(this.scroll, arguments); + this.resize(); + }, + + resize: function(){ + this.element.height(this.options.height); + BI.nextTick(BI.bind(this._checkDropDown, this)); + }, + + addItem: function(){ + this.scroll.addItem.apply(this.scroll, arguments); + BI.nextTick(BI.bind(this._checkDropDown, this)); + } +}); + +$.shortcut("bi.scroll_view", BI.ScrollView);/** + * 搜索面板 + * + * Created by GUY on 2015/9/28. + * @class BI.SearcherView + * @extends BI.Pane + */ + +BI.SearcherView = BI.inherit(BI.Pane, { + _defaultConfig: function () { + var conf = BI.SearcherView.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-searcher-view", + tipText: BI.i18nText("BI-No_Select"), + chooseType: BI.Selection.Single, + + matcher: {//完全匹配的构造器 + type: "bi.button_group", + behaviors: { + redmark: function () { + return true; + } + }, + items: [], + layouts: [{ + type: "bi.vertical" + }] + }, + searcher: { + type: "bi.button_group", + behaviors: { + redmark: function () { + return true; + } + }, + items: [], + layouts: [{ + type: "bi.vertical" + }] + } + }) + }, + + _init: function () { + BI.SearcherView.superclass._init.apply(this, arguments); + var self = this, o = this.options; + + this.matcher = BI.createWidget(o.matcher, { + type: "bi.button_group", + chooseType: o.chooseType, + behaviors: { + redmark: function () { + return true; + } + }, + layouts: [{ + type: "bi.vertical" + }] + }); + this.matcher.on(BI.Controller.EVENT_CHANGE, function (type, val, ob) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + self.fireEvent(BI.SearcherView.EVENT_CHANGE, val, ob); + } + }); + this.spliter = BI.createWidget({ + type: "bi.vertical", + height: 1, + hgap: 10, + items: [{ + type: "bi.layout", + height: 1, + cls: "searcher-view-spliter" + }] + }); + this.searcher = BI.createWidget(o.searcher, { + type: "bi.button_group", + chooseType: o.chooseType, + behaviors: { + redmark: function () { + return true; + } + }, + layouts: [{ + type: "bi.vertical" + }] + }); + this.searcher.on(BI.Controller.EVENT_CHANGE, function (type, val, ob) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + self.fireEvent(BI.SearcherView.EVENT_CHANGE, val, ob); + } + }); + + BI.createWidget({ + type: "bi.vertical", + element: this, + items: [this.matcher, this.spliter, this.searcher] + }); + }, + + startSearch: function () { + + }, + + stopSearch: function () { + + }, + + setValue: function (v) { + this.matcher.setValue(v); + this.searcher.setValue(v); + }, + + getValue: function () { + return this.matcher.getValue().concat(this.searcher.getValue()); + }, + + populate: function (searchResult, matchResult, keyword) { + searchResult || (searchResult = []); + matchResult || (matchResult = []); + this.setTipVisible(searchResult.length + matchResult.length === 0); + this.spliter.setVisible(BI.isNotEmptyArray(matchResult) && BI.isNotEmptyArray(searchResult)); + this.matcher.populate(matchResult, keyword); + this.searcher.populate(searchResult, keyword); + }, + + empty: function () { + this.searcher.empty(); + this.matcher.empty(); + }, + + hasMatched: function () { + return this.matcher.getAllButtons().length > 0; + } +}); +BI.SearcherView.EVENT_CHANGE = "EVENT_CHANGE"; + +$.shortcut("bi.searcher_view", BI.SearcherView);/** + * 分页控件 + * + * Created by GUY on 2015/8/31. + * @class BI.Pager + * @extends BI.Widget + */ +BI.Pager = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.Pager.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-pager", + behaviors: {}, + layouts: [{ + type: "bi.horizontal", + hgap: 10, + vgap: 0 + }], + + dynamicShow: true, //是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态 + //dynamicShow为false时以下两个有用 + dynamicShowFirstLast: false,//是否动态显示首页、尾页 + dynamicShowPrevNext: false,//是否动态显示上一页、下一页 + pages: false, //总页数 + curr: function () { + return 1; + }, //初始化当前页 + groups: 0, //连续显示分页数 + jump: BI.emptyFn, //分页的回调函数 + + first: false, //是否显示首页 + last: false, //是否显示尾页 + prev: "上一页", + next: "下一页", + + firstPage: 1, + lastPage: function () { //在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法 + return 1; + }, + hasPrev: BI.emptyFn, //pages不可用时有效 + hasNext: BI.emptyFn //pages不可用时有效 + }) + }, + _init: function () { + BI.Pager.superclass._init.apply(this, arguments); + var self = this; + this.currPage = BI.result(this.options, "curr"); + //翻页太灵敏 + this._lock = false; + this._debouce = BI.debounce(function () { + self._lock = false; + }, 300); + this._populate(); + }, + + _populate: function () { + var self = this, o = this.options, view = [], dict = {}; + this.empty(); + var pages = BI.result(o, "pages"); + var curr = BI.result(this, "currPage"); + var groups = BI.result(o, "groups"); + var first = BI.result(o, "first"); + var last = BI.result(o, "last"); + var prev = BI.result(o, "prev"); + var next = BI.result(o, "next"); + + if (pages === false) { + groups = 0; + first = false; + last = false; + } else { + groups > pages && (groups = pages); + } + + //计算当前组 + dict.index = Math.ceil((curr + ((groups > 1 && groups !== pages) ? 1 : 0)) / (groups === 0 ? 1 : groups)); + + //当前页非首页,则输出上一页 + if (((!o.dynamicShow && !o.dynamicShowPrevNext) || curr > 1) && prev !== false) { + if (BI.isKey(prev)) { + view.push({ + text: prev, + value: "prev", + disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) + }) + } else { + view.push(BI.extend({ + disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) + }, prev)); + } + } + + //当前组非首组,则输出首页 + if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (dict.index > 1 && groups !== 0)) && first) { + view.push({ + text: first, + value: "first", + disabled: !(dict.index > 1 && groups !== 0) + }); + if (dict.index > 1 && groups !== 0) { + view.push({ + type: "bi.label", + cls: "page-ellipsis", + text: "\u2026" + }); + } + } + + //输出当前页组 + dict.poor = Math.floor((groups - 1) / 2); + dict.start = dict.index > 1 ? curr - dict.poor : 1; + dict.end = dict.index > 1 ? (function () { + var max = curr + (groups - dict.poor - 1); + return max > pages ? pages : max; + }()) : groups; + if (dict.end - dict.start < groups - 1) { //最后一组状态 + dict.start = dict.end - groups + 1; + } + var s = dict.start, e = dict.end; + if (first && last && (dict.index > 1 && groups !== 0) && (pages > groups && dict.end < pages && groups !== 0)) { + s++; + e--; + } + for (; s <= e; s++) { + if (s === curr) { + view.push({ + text: s, + value: s, + selected: true + }) + } else { + view.push({ + text: s, + value: s + }) + } + } + + //总页数大于连续分页数,且当前组最大页小于总页,输出尾页 + if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) { + if (pages > groups && dict.end < pages && groups !== 0) { + view.push({ + type: "bi.label", + cls: "page-ellipsis", + text: "\u2026" + }); + } + view.push({ + text: last, + value: "last", + disabled: !(pages > groups && dict.end < pages && groups !== 0) + }) + } + + //当前页不为尾页时,输出下一页 + dict.flow = !prev && groups === 0; + if (((!o.dynamicShow && !o.dynamicShowPrevNext) && next) || (curr !== pages && next || dict.flow)) { + view.push((function () { + if (BI.isKey(next)) { + if (pages === false) { + return {text: next, value: "next", disabled: o.hasNext(curr) === false} + } + return (dict.flow && curr === pages) + ? + {text: next, value: "next", disabled: true} + : + {text: next, value: "next", disabled: !(curr !== pages && next || dict.flow)}; + } else { + return BI.extend({ + disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow) + }, next); + } + }())); + } + + this.button_group = BI.createWidget({ + type: "bi.button_group", + element: this, + items: BI.createItems(view, { + cls: "page-item", + height: 23, + hgap: 10 + }), + behaviors: o.behaviors, + layouts: o.layouts + }); + this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + if (self._lock === true) { + return; + } + self._lock = true; + self._debouce(); + if (type === BI.Events.CLICK) { + var v = self.button_group.getValue()[0]; + switch (v) { + case "first": + self.currPage = 1; break; - case bottomright: - colgroupTds = self.bottomRightColGroupTds; - bodyTds = self.bottomRightBodyTds; - bodyItems = self.bottomRightBodyItems; - sizes = columnRight; + case "last": + self.currPage = pages; + break; + case "prev": + self.currPage--; + break; + case "next": + self.currPage++; + break; + default: + self.currPage = v; + break; + } + o.jump.apply(self, [{ + pages: pages, + curr: self.currPage + }]); + self._populate(); + self.fireEvent(BI.Pager.EVENT_CHANGE, obj); + } + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + this.fireEvent(BI.Pager.EVENT_AFTER_POPULATE); + }, + + getCurrentPage: function () { + return this.currPage; + }, + + setAllPages: function (pages) { + this.options.pages = pages; + }, + + hasPrev: function (v) { + v || (v = 1); + var o = this.options; + var pages = this.options.pages; + return pages === false ? o.hasPrev(v) : v > 1; + }, + + hasNext: function (v) { + v || (v = 1); + var o = this.options; + var pages = this.options.pages; + return pages === false ? o.hasNext(v) : v < pages; + }, + + setValue: function (v) { + var o = this.options; + v = v | 0; + v = v < 1 ? 1 : v; + if (o.pages === false) { + var lastPage = BI.result(o, "lastPage"), firstPage = 1; + this.currPage = v > lastPage ? lastPage : ((firstPage = BI.result(o, "firstPage")), (v < firstPage ? firstPage : v)); + } else { + v = v > o.pages ? o.pages : v; + this.currPage = v; + } + this._populate(); + }, + + getValue: function () { + var val = this.button_group.getValue()[0]; + switch (val) { + case "prev": + return -1; + case "next": + return 1; + case "first": + return BI.MIN; + case "last": + return BI.MAX; + default : + return val; + } + }, + + attr: function (key, value) { + BI.Pager.superclass.attr.apply(this, arguments); + if (key === "curr") { + this.currPage = BI.result(this.options, "curr"); + } + }, + + populate: function () { + this._populate(); + } +}); +BI.Pager.EVENT_CHANGE = "EVENT_CHANGE"; +BI.Pager.EVENT_AFTER_POPULATE = "EVENT_AFTER_POPULATE"; +$.shortcut("bi.pager", BI.Pager);/** + * Created by Young's on 2016/8/17. + * 加载面板,一般只用于 requestAsync 中 + */ +BI.RequstLoading = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.RequstLoading.superclass._defaultConfig.apply(this, arguments), {}); + }, + + _init: function () { + BI.RequstLoading.superclass._init.apply(this, arguments); + var self = this, o = this.options; + var mask = BI.Maskers.create(BI.RequstLoading.MASK_ID); + this.callback = o.callback; + this.paneTab = BI.createWidget({ + type: "bi.tab", + cardCreator: BI.bind(this._cardCreator, this), + defaultShowIndex: BI.RequstLoading.ERROR, + width: 400, + height: 300 + }); + var tempIcon = BI.createWidget({ + type: "bi.icon_button", + cls: "data-link-test-fail-icon", + width: 0, + height: 0 + }); + BI.createWidget({ + type: "bi.absolute", + element: $('body'), + items: [{ + el: tempIcon, + bottom: 0 + }] + }); + + BI.createWidget({ + type: "bi.absolute", + element: mask, + cls: "bi-request-loading", + items: [{ + el: { + type: "bi.layout", + cls: "mask-pane" + }, + top: 0, + left: 0, + bottom: 0, + right: 0 + }, { + el: { + type: "bi.center_adapt", + items: [this.paneTab] + }, + top: 0, + left: 0, + right: 0, + bottom: 0 + }] + }); + }, + + _cardCreator: function (v) { + var self = this; + var cancel = BI.createWidget({ + type: "bi.button", + text: BI.i18nText("BI-Basic_Cancel"), + title: BI.i18nText("BI-Basic_Cancel"), + level: "ignore", + height: 28, + width: 90, + handler: function () { + BI.Maskers.hide(BI.RequstLoading.MASK_ID); + } + }); + var retry = BI.createWidget({ + type: "bi.button", + text: BI.i18nText("BI-Basic_Retry"), + title: BI.i18nText("BI-Basic_Retry"), + level: "common", + height: 28, + width: 90, + handler: function () { + self.paneTab.setSelect(BI.RequstLoading.LOADING); + self.callback(); + } + }); + switch (v) { + case BI.RequstLoading.LOADING: + return BI.createWidget({ + type: "bi.vertical", + items: [{ + type: "bi.center_adapt", + cls: "loading-bar-icon", + items: [{ + type: "bi.icon", + width: 208, + height: 15 + }] + }, { + type: "bi.label", + cls: "loading-comment", + text: BI.i18nText("BI-Basic_Loading"), + height: 30 + }], + width: 208, + height: 200, + vgap: 10 + }); + case BI.RequstLoading.LOADING_TIMEOUT: + return BI.createWidget({ + type: "bi.vertical", + items: [{ + type: "bi.center_adapt", + cls: "loading-bar-icon", + items: [{ + type: "bi.icon", + width: 208, + height: 15 + }] + }, { + type: "bi.label", + cls: "loading-comment", + text: BI.i18nText("BI-Basic_Loading"), + height: 30 + }, { + type: "bi.label", + text: BI.i18nText("BI-Request_Time_Out_Toast_Tip"), + cls: "load-timeout-warning" + }, { + type: "bi.left_right_vertical_adapt", + items: { + left: [cancel], + right: [retry] + }, + height: 30, + llgap: 100, + rrgap: 100 + }], + vgap: 10 + }); + case BI.RequstLoading.ERROR: + return BI.createWidget({ + type: "bi.vertical", + items: [{ + type: "bi.center_adapt", + cls: "data-link-test-fail-icon", + items: [{ + type: "bi.icon", + width: 126, + height: 126 + }] + }, { + type: "bi.label", + text: BI.i18nText("BI-Connection_Lost"), + cls: "load-fail-comment" + }, { + type: "bi.left_right_vertical_adapt", + items: { + left: [cancel], + right: [retry] + }, + height: 30, + llgap: 100, + rrgap: 100 + }], + vgap: 20 + }); + } + }, + + showLoading: function () { + BI.Maskers.show(BI.RequstLoading.MASK_ID); + this.paneTab.setSelect(BI.RequstLoading.LOADING); + }, + + showError: function () { + BI.Maskers.show(BI.RequstLoading.MASK_ID); + this.paneTab.setSelect(BI.RequstLoading.ERROR); + }, + + setCallback: function (callback) { + this.callback = callback; + } +}); +BI.extend(BI.RequstLoading, { + MASK_ID: "___request__loading___", + LOADING: 1, + LOADING_TIMEOUT: 2, + ERROR: 3 +}); +$.shortcut("bi.request_loading", BI.RequstLoading);/** + * 超链接 + * + * Created by GUY on 2015/9/9. + * @class BI.A + * @extends BI.Text + * @abstract + */ +BI.A = BI.inherit(BI.Text, { + _defaultConfig: function () { + var conf = BI.A.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-a display-block", + href: "", + target: "_blank", + el: null, + element: "" + }) + }, + _init: function () { + var o = this.options; + BI.A.superclass._init.apply(this, arguments); + this.element.attr({href: o.href, target: o.target}); + if (o.el) { + BI.createWidget(o.el, { + element: this + }); + } + } +}); + +$.shortcut("bi.a", BI.A);/** + * guy + * 加载条 + * @type {*|void|Object} + */ +BI.LoadingBar = BI.inherit(BI.Single, { + consts: { + loadedText: BI.i18nText("BI-Load_More"), + endText: BI.i18nText("BI-No_More_Data") + }, + _defaultConfig: function() { + var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments); + return BI.extend( conf, { + baseCls : (conf.baseCls ||"")+' bi-loading-bar', + height: 30, + handler: BI.emptyFn + }) + }, + _init : function() { + BI.LoadingBar.superclass._init.apply(this, arguments); + var self = this; + this.loaded = BI.createWidget({ + type: "bi.text_button", + cls: "loading-text", + text: this.consts.loadedText, + width: 120, + handler: this.options.handler + }) + this.loaded.on(BI.Controller.EVENT_CHANGE, function(type){ + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }) + + this.loading = BI.createWidget({ + type: "bi.layout", + height:this.options.height, + cls: "loading-background cursor-default" + }) + var loaded = BI.createWidget({ + type: "bi.center_adapt", + items: [this.loaded] + }) + var loading = BI.createWidget({ + type: "bi.center_adapt", + items: [this.loading] + }) + this.cardLayout = BI.createWidget({ + type: "bi.card", + element: this, + items: [{ + el: loaded, + cardName: "loaded" + }, { + el: loading, + cardName: "loading" + }] + }) + this.invisible(); + }, + + _reset: function(){ + this.visible(); + this.loaded.setText(this.consts.loadedText); + this.loaded.enable(); + }, + + setLoaded: function(){ + this._reset(); + this.cardLayout.showCardByName("loaded"); + }, + + setEnd: function(){ + this.setLoaded(); + this.loaded.setText(this.consts.endText); + this.loaded.disable(); + }, + + setLoading: function(){ + this._reset(); + this.cardLayout.showCardByName("loading"); + } +}); + +$.shortcut("bi.loading_bar", BI.LoadingBar);/** + * @class BI.IconButton + * @extends BI.BasicButton + * 图标的button + */ +BI.IconButton = BI.inherit(BI.BasicButton, { + _defaultConfig: function () { + var conf = BI.IconButton.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-icon-button horizon-center", + iconWidth: null, + iconHeight: null + }) + }, + + _init: function () { + BI.IconButton.superclass._init.apply(this, arguments); + var o = this.options; + this.element.css({ + textAlign: 'center' + }); + this.icon = BI.createWidget({ + type: 'bi.icon', + width: o.iconWidth, + height: o.iconHeight + }); + if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) { + this.element.css("lineHeight", o.height + "px"); + BI.createWidget({ + type: "bi.default", + element: this, + items: [this.icon] + }) + } else { + BI.createWidget({ + element: this, + type: 'bi.center_adapt', + items: [this.icon] + }); + } + }, + + doClick: function () { + BI.IconButton.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.IconButton.EVENT_CHANGE, this); + } + } +}); +BI.IconButton.EVENT_CHANGE = "IconButton.EVENT_CHANGE"; +$.shortcut("bi.icon_button", BI.IconButton);/** + * 图片的button + * + * Created by GUY on 2016/1/27. + * @class BI.ImageButton + * @extends BI.BasicButton + */ +BI.ImageButton = BI.inherit(BI.BasicButton, { + _defaultConfig: function () { + var conf = BI.ImageButton.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-image-button", + src: "", + iconWidth: "100%", + iconHeight: "100%" + }) + }, + + _init: function () { + BI.ImageButton.superclass._init.apply(this, arguments); + var o = this.options; + this.image = BI.createWidget({ + type: "bi.img", + width: o.iconWidth, + height: o.iconHeight, + src: o.src + }); + if (BI.isNumber(o.iconWidth) || BI.isNumber(o.iconHeight)) { + BI.createWidget({ + type: "bi.center_adapt", + element: this, + items: [this.image] + }) + } else { + BI.createWidget({ + type: "bi.adaptive", + element: this, + items: [this.image], + scrollable: false + }) + } + }, + + setWidth: function (w) { + BI.ImageButton.superclass.setWidth.apply(this, arguments); + this.options.width = w; + }, + + setHeight: function (h) { + BI.ImageButton.superclass.setHeight.apply(this, arguments); + this.options.height = h; + }, + + setImageWidth: function (w) { + this.image.setWidth(w); + }, + + setImageHeight: function (h) { + this.image.setHeight(h); + }, + + getImageWidth: function () { + return this.image.element.width(); + }, + + getImageHeight: function () { + return this.image.element.height(); + }, + + setSrc: function (src) { + this.options.src = src; + this.image.setSrc(src); + }, + + getSrc: function () { + return this.image.getSrc(); + }, + + doClick: function () { + BI.ImageButton.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.ImageButton.EVENT_CHANGE, this); + } + } +}); +BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE"; +$.shortcut("bi.image_button", BI.ImageButton);(function ($) { + + /** + * 文字类型的按钮 + * @class BI.Button + * @extends BI.BasicButton + * + * @cfg {JSON} options 配置属性 + * @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型,用不同颜色强调不同的场景 + */ + BI.Button = BI.inherit(BI.BasicButton, { + _const: { + minWidth: 90 + }, + + _defaultConfig: function () { + var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + ' bi-button', + shadow: true, + isShadowShowingOnSelected: true, + readonly: true, + iconClass: "", + level: 'common', + textAlign: "center", + whiteSpace: "nowrap", + forceCenter: false, + textWidth: null, + textHeight: null, + hgap: 10, + vgap: 0, + tgap: 0, + bgap: 0, + lgap: 0, + rgap: 0 + }) + }, + + _init: function () { + BI.Button.superclass._init.apply(this, arguments); + var o = this.options, self = this; + if (BI.isNumber(o.height)) { + this.element.css({height: o.height - 2, lineHeight: (o.height - 2) + 'px'}); + } + if (BI.isKey(o.iconClass)) { + this.icon = BI.createWidget({ + type: "bi.icon", + width: 18 + }); + this.text = BI.createWidget({ + type: "bi.label", + text: o.text, + value: o.value + }); + BI.createWidget({ + type: "bi.horizontal_auto", + cls: "button-" + o.level + " " + o.iconClass, + element: this, + hgap: o.hgap, + vgap: o.vgap, + tgap: o.tgap, + bgap: o.bgap, + lgap: o.lgap, + rgap: o.rgap, + items: [{ + type: "bi.horizontal", + items: [this.icon, this.text] + }] + }) + } else { + this.text = BI.createWidget({ + type: "bi.label", + cls: "button-" + o.level, + textAlign: o.textAlign, + whiteSpace: o.whiteSpace, + forceCenter: o.forceCenter, + textWidth: o.textWidth, + textHeight: o.textHeight, + hgap: o.hgap, + vgap: o.vgap, + tgap: o.tgap, + bgap: o.bgap, + lgap: o.lgap, + rgap: o.rgap, + element: this, + text: o.text, + value: o.value + }); + } + this.element.css({"min-width": this._const.minWidth - 2 + "px"}); + }, + + doClick: function () { + BI.Button.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.Button.EVENT_CHANGE, this); + } + }, + + setText: function (text) { + BI.Button.superclass.setText.apply(this, arguments); + this.text.setText(text); + }, + + setValue: function (text) { + BI.Button.superclass.setValue.apply(this, arguments); + if (!this.isReadOnly()) { + this.text.setValue(text); + } + }, + + setEnable: function (b) { + BI.Button.superclass.setEnable.apply(this, arguments); + this.text.setEnable(b); + this.icon && this.icon.setEnable(b); + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + destroy: function () { + BI.Button.superclass.destroy.apply(this, arguments); + } + }); + $.shortcut('bi.button', BI.Button); + BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; +})(jQuery);/** + * guy + * 可以点击的一行文字 + * @class BI.TextButton + * @extends BI.BasicButton + * 文字button + */ +BI.TextButton = BI.inherit(BI.BasicButton, { + _defaultConfig: function () { + var conf = BI.TextButton.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-button", + textAlign: "center", + whiteSpace: "nowrap", + forceCenter: false, + textWidth: null, + textHeight: null, + hgap: 0, + lgap: 0, + rgap: 0, + text: "", + py: "" + }) + }, + + _init: function () { + BI.TextButton.superclass._init.apply(this, arguments); + var o = this.options; + this.text = BI.createWidget({ + type: "bi.label", + element: this, + textAlign: o.textAlign, + whiteSpace: o.whiteSpace, + textWidth: o.textWidth, + textHeight: o.textHeight, + forceCenter: o.forceCenter, + width: o.width, + height: o.height, + hgap: o.hgap, + lgap: o.lgap, + rgap: o.rgap, + text: o.text, + value: o.value, + py: o.py + }); + }, + + doClick: function () { + BI.TextButton.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.TextButton.EVENT_CHANGE, this.getValue(), this); + } + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setText: function (text) { + BI.TextButton.superclass.setText.apply(this, arguments); + text = BI.isArray(text) ? text.join(",") : text; + this.text.setText(text); + }, + + setStyle: function (style) { + this.text.setStyle(style); + }, + + setValue: function (text) { + BI.TextButton.superclass.setValue.apply(this, arguments); + if (!this.isReadOnly()) { + text = BI.isArray(text) ? text.join(",") : text; + this.text.setValue(text); + } + } +}); +BI.TextButton.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.text_button", BI.TextButton);/** + * 带有一个占位 + * + * Created by GUY on 2015/9/11. + * @class BI.BlankIconIconTextItem + * @extends BI.BasicButton + */ +BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item", + logic: { + dynamic: false + }, + iconCls1: "close-ha-font", + iconCls2: "close-ha-font", + blankWidth: 0, + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.BlankIconIconTextItem.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + var blank = BI.createWidget({ + type: "bi.layout", + width: o.blankWidth + }) + this.text = BI.createWidget({ + type: "bi.label", + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }); + this.icon1 = BI.createWidget({ + type: "bi.icon_button", + cls: o.iconCls1, + forceNotSelected: true, + width: c.commonWidth + }); + this.icon2 = BI.createWidget({ + type: "bi.icon_button", + cls: o.iconCls2, + forceNotSelected: true, + width: c.commonWidth + }); + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon1, this.icon2, this.text) + })))); + }, + + doClick: function () { + BI.BlankIconIconTextItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE, this.getValue(), this); + } + }, + + setSelected: function (b) { + BI.BlankIconIconTextItem.superclass.setSelected.apply(this, arguments); + this.icon1.setSelected(b); + this.icon2.setSelected(b); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + } +}); +BI.BlankIconIconTextItem.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.blank_icon_icon_text_item", BI.BlankIconIconTextItem);/** + * guy + * 一个占位符和两个icon和一行数 组成的一行listitem + * + * Created by GUY on 2015/9/15. + * @class BI.BlankIconTextIconItem + * @extends BI.BasicButton + */ +BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-blank-icon-text-icon-item", + logic: { + dynamic: false + }, + iconCls1: "close-ha-font", + iconCls2: "close-ha-font", + blankWidth: 0, + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.BlankIconTextIconItem.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }) + + var icon1 = BI.createWidget({ + type: "bi.center_adapt", + cls: o.iconCls1, + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }) + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.center_adapt", + cls: o.iconCls2, + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }, + top: 0, + bottom: 0, + right: 0 + }] + }) + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", { + type: "bi.layout", + width: o.blankWidth + }, icon1, this.text, { + type: "bi.layout", + width: c.commonWidth + }) + })))); + }, + + doClick: function () { + BI.BlankIconTextIconItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE, this.getValue(), this); + } + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + } +}); +BI.BlankIconTextIconItem.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.blank_icon_text_icon_item", BI.BlankIconTextIconItem);/** + * 带有一个占位 + * + * Created by GUY on 2015/9/11. + * @class BI.BlankIconTextItem + * @extends BI.BasicButton + */ +BI.BlankIconTextItem = BI.inherit(BI.BasicButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.BlankIconTextItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item", + logic: { + dynamic: false + }, + cls: "close-ha-font", + blankWidth: 0, + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.BlankIconTextItem.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + var blank = BI.createWidget({ + type: "bi.layout", + width: o.blankWidth + }) + this.text = BI.createWidget({ + type: "bi.label", + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }) + this.icon = BI.createWidget({ + type: "bi.center_adapt", + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }); + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon, this.text) + })))); + }, + + doClick: function () { + BI.BlankIconTextItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.BlankIconTextItem.EVENT_CHANGE, this.getValue(), this); + } + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + } +}); +BI.BlankIconTextItem.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.blank_icon_text_item", BI.BlankIconTextItem);/** + * guy + * 两个icon和一行数 组成的一行listitem + * + * Created by GUY on 2015/9/9. + * @class BI.IconTextIconItem + * @extends BI.BasicButton + */ +BI.IconTextIconItem = BI.inherit(BI.BasicButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.IconTextIconItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-icon-text-icon-item", + logic: { + dynamic: false + }, + iconCls1: "close-ha-font", + iconCls2: "close-ha-font", + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.IconTextIconItem.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }) + + var icon1 = BI.createWidget({ + type: "bi.center_adapt", + cls: o.iconCls1, + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }) + var blank = BI.createWidget({ + type: "bi.layout", + width: c.commonWidth + }) + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.center_adapt", + cls: o.iconCls2, + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }, + top: 0, + bottom: 0, + right: 0 + }] + }) + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank) + })))); + }, + + doClick: function () { + BI.IconTextIconItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.IconTextIconItem.EVENT_CHANGE, this.getValue(), this); + } + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + } +}); +BI.IconTextIconItem.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.icon_text_icon_item", BI.IconTextIconItem);/** + * guy + * + * Created by GUY on 2015/9/9. + * @class BI.IconTextItem + * @extends BI.BasicButton + */ +BI.IconTextItem = BI.inherit(BI.BasicButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.IconTextItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-icon-text-item", + direction: BI.Direction.Left, + logic: { + dynamic: false + }, + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.IconTextItem.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }); + this.icon = BI.createWidget({ + type: "bi.center_adapt", + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }); + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.icon, this.text) + })))); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + }, + + doClick: function () { + BI.IconTextItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.IconTextItem.EVENT_CHANGE, this.getValue(), this); + } + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + } +}); +BI.IconTextItem.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.icon_text_item", BI.IconTextItem);/** + * + * 图标的button + * + * Created by GUY on 2015/9/9. + * @class BI.TextIconItem + * @extends BI.BasicButton + */ +BI.TextIconItem = BI.inherit(BI.BasicButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.TextIconItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-icon-item", + logic: { + dynamic: false + }, + cls: "close-ha-font", + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.TextIconItem.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }); + this.icon = BI.createWidget({ + type: "bi.center_adapt", + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }); + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon) + })))); + }, + + doClick: function () { + BI.TextIconItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.TextIconItem.EVENT_CHANGE, this.getValue(), this); + } + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + } +}); +BI.TextIconItem.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.text_icon_item", BI.TextIconItem);/** + * guy + * 一个button和一行数 组成的一行listitem + * + * Created by GUY on 2015/9/9. + * @class BI.TextItem + * @extends BI.BasicButton + */ +BI.TextItem = BI.inherit(BI.BasicButton, { + + _defaultConfig: function () { + var conf = BI.TextItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-item", + textAlign: "left", + whiteSpace: "nowrap", + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.TextItem.superclass._init.apply(this, arguments); + var o = this.options; + this.text = BI.createWidget({ + type: "bi.label", + element: this, + textAlign: o.textAlign, + whiteSpace: o.whiteSpace, + textHeight: o.whiteSpace == "nowrap" ? o.height : o.textHeight, + height: o.height, + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + py: o.py + }); + }, + + doClick: function () { + BI.TextItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.TextItem.EVENT_CHANGE, this.getValue(), this); + } + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + } +}); +BI.TextItem.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.text_item", BI.TextItem);/** + * guy + * Created by GUY on 2015/9/9. + * @class BI.IconTextIconNode + * @extends BI.NodeButton + */ +BI.IconTextIconNode = BI.inherit(BI.NodeButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node", + logic: { + dynamic: false + }, + iconCls1: "close-ha-font", + iconCls2: "close-ha-font", + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.IconTextIconNode.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }) + + var icon1 = BI.createWidget({ + type: "bi.center_adapt", + cls: o.iconCls1, + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }) + var blank = BI.createWidget({ + type: "bi.layout", + width: c.commonWidth + }) + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.center_adapt", + cls: o.iconCls2, + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }, + top: 0, + bottom: 0, + right: 0 + }] + }) + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank) + })))); + }, + + doClick: function () { + BI.IconTextIconNode.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.IconTextIconNode.EVENT_CHANGE, this.getValue(), this); + } + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + } +}); +BI.IconTextIconNode.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.icon_text_icon_node", BI.IconTextIconNode);/** + * guy + * Created by GUY on 2015/9/9. + * @class BI.IconTextNode + * @extends BI.NodeButton + */ +BI.IconTextNode = BI.inherit(BI.NodeButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-icon-text-node", + logic: { + dynamic: false + }, + cls: "close-ha-font", + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.IconTextNode.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }) + this.icon = BI.createWidget({ + type: "bi.center_adapt", + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }) + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon, this.text) + })))); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + }, + + doClick: function () { + BI.IconTextNode.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.IconTextNode.EVENT_CHANGE, this.getValue(), this); + } + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + } +}); +BI.IconTextNode.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.icon_text_node", BI.IconTextNode);/** + * Created by GUY on 2015/9/9. + * @class BI.TextIconNode + * @extends BI.NodeButton + */ +BI.TextIconNode = BI.inherit(BI.NodeButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-icon-node", + logic: { + dynamic: false + }, + cls: "close-ha-font", + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.TextIconNode.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }) + this.icon = BI.createWidget({ + type: "bi.center_adapt", + width: c.commonWidth, + items: [{ + el: { + type: "bi.icon", + width: o.iconWidth, + height: o.iconHeight + } + }] + }); + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon) + })))); + }, + + doClick: function () { + BI.TextIconNode.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.TextIconNode.EVENT_CHANGE, this.getValue(), this); + } + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + } +}); +BI.TextIconNode.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.text_icon_node", BI.TextIconNode);/** + * guy + * + * Created by GUY on 2015/9/9. + * @class BI.TextNode + * @extends BI.NodeButton + */ +BI.TextNode = BI.inherit(BI.NodeButton, { + + _defaultConfig: function () { + var conf = BI.TextNode.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-node", + textAlign: "left", + whiteSpace: "nowrap", + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.TextNode.superclass._init.apply(this, arguments); + var o = this.options; + this.text = BI.createWidget({ + type: "bi.label", + element: this, + textAlign: o.textAlign, + whiteSpace: o.whiteSpace, + textHeight: o.whiteSpace == "nowrap" ? o.height : o.textHeight, + height: o.height, + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + py: o.py + }); + }, + + doClick: function () { + BI.TextNode.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.TextNode.EVENT_CHANGE, this.getValue(), this); + } + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + } +}); +BI.TextNode.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.text_node", BI.TextNode);/** + * + * Created by GUY on 2016/1/15. + * @class BI.CodeEditor + * @extends BI.Single + */ +BI.CodeEditor = BI.inherit(BI.Single, { + _defaultConfig: function () { + return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), { + baseCls: 'bi-code-editor', + value: '', + watermark: "" + }); + }, + _init: function () { + BI.CodeEditor.superclass._init.apply(this, arguments); + var o = this.options, self = this; + this.editor = CodeMirror(this.element[0], { + textWrapping: true, + lineWrapping: true, + lineNumbers: false + }); + this.editor.on("change", function (cm, change) { + BI.nextTick(function () { + self.fireEvent(BI.CodeEditor.EVENT_CHANGE) + }); + }); + + this.editor.on("focus", function () { + watermark.setVisible(false); + self.fireEvent(BI.CodeEditor.EVENT_FOCUS); + }); + + this.editor.on("blur", function () { + watermark.setVisible(BI.isEmptyString(self.getValue())); + self.fireEvent(BI.CodeEditor.EVENT_BLUR); + }); + + // this.editor.on("blur", function () { + // self.editor.execCommand("goLineEnd"); + // }); + + //水印 + var watermark = BI.createWidget({ + type: "bi.label", + text: o.watermark, + cls: "bi-water-mark", + whiteSpace: "nowrap", + textAlign: "left" + }); + watermark.element.bind( + "mousedown", function (e) { + self.insertString(""); + self.editor.focus(); + e.stopEvent(); + } + ); + watermark.element.bind("click", function (e) { + self.editor.focus(); + e.stopEvent(); + }); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: watermark, + top: 0, + left: 5 + }] + }); + + if (BI.isKey(o.value)) { + BI.nextTick(function () { + self.setValue(o.value); + }); + } + }, + + setEnable: function (b) { + BI.CodeEditor.superclass.setEnable.apply(this, arguments); + this.editor.setOption("readOnly", b === true ? false : "nocursor") + }, + + insertParam: function(param){ + var from = this.editor.getCursor(); + this.editor.replaceSelection(param); + var to = this.editor.getCursor(); + this.editor.markText(from, to, {className: 'param', atomic: true}); + this.editor.replaceSelection(" "); + this.editor.focus(); + }, + + insertString: function(str){ + this.editor.replaceSelection(str); + this.editor.focus(); + }, + + getValue: function () { + return this.editor.getValue("\n", function (line) { + var rawText = line.text, value = line.text, num = 0; + value.text = rawText; + _.forEach(line.markedSpans, function (i, ms) { + switch (i.marker.className) { + case "param": + var fieldNameLength = i.to - i.from; + value = value.substr(0, i.from + num) + "$\{" + value.substr(i.from + num, fieldNameLength) + "\}" + value.substr(i.to + num, value.length); + num += 3; break; } - BI.each(colgroupTds, function (i, colgroup) { - var width = colgroup.attr("width") | 0; - if (width !== sizes[i]) { - var w = self._calculateWidth(sizes[i]); - colgroup.attr("width", w).css("width", w); - BI.each(bodyTds, function (j, items) { - if (items[i]) { - if (items[i].__mergeCols.length > 1) { - var wid = 0; - BI.each(sizes, function (t, s) { - if (items[i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += items[i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].attr("width", wid).css("width", wid); - } - } else { - items[i].attr("width", "").css("width", ""); - } - } else { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } - } - }); - BI.each(bodyItems, function (j, items) { - if (items[i]) { - if (bodyTds[j][i].__mergeCols.length > 1) { - var wid = 0; - BI.each(sizes, function (t, s) { - if (bodyTds[j][i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += bodyTds[j][i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].element.attr("width", wid).css("width", wid); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } else { - if (BI.isNumeric(w)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", w - 1).css("width", w - 1); - } else { - items[i].element.attr("width", w).css("width", w); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } - } - }); - } - }) - }; - run(topleft); - run(topright); - run(bottomleft); - run(bottomright); + }); + return value; + }); + }, + + _analyzeContent: function (v) { + var regx = /\$[\{][^\}]*[\}]|(\s+)|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)|\n/g; + return v.match(regx); + }, + + setValue: function (v) { + var self = this, result; + this.refresh(); + self.editor.setValue(""); + result = this._analyzeContent(v || ""); + BI.each(result, function (i, item) { + var fieldRegx = /\$[\{][^\}]*[\}]/; + var str = item.match(fieldRegx); + if (BI.isNotEmptyArray(str)) { + self.insertParam(str[0].substring(2, item.length - 1)); + } else { + self.insertString(item); + } + }) + }, + + refresh: function(){ + var self = this; + BI.nextTick(function () { + self.editor.refresh(); + }); + } +}); +BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR"; +BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS"; +$.shortcut("bi.code_editor", BI.CodeEditor);/** + * Created by GUY on 2015/4/15. + * @class BI.Editor + * @extends BI.Single + */ +BI.Editor = BI.inherit(BI.Single, { + _defaultConfig: function () { + var conf = BI.Editor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: "bi-editor", + hgap: 4, + vgap: 2, + lgap: 0, + rgap: 0, + tgap: 0, + bgap: 0, + tipType: "warning", + inputType: "text", + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn, + mouseOut: false, + allowBlank: false, + watermark: "", + errorText: "" + }) + }, + + _init: function () { + BI.Editor.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.editor = this.addWidget(BI.createWidget({ + type: "bi.input", + element: "", + watermark: o.watermark, + validationChecker: o.validationChecker, + quitChecker: o.quitChecker, + mouseOut: o.mouseOut, + allowBlank: o.allowBlank + })); + this.editor.element.css({ + "width": "100%", + "height": "100%", + "border": "none", + "outline": "none", + "padding": "0", + "margin": "0" + }); + if (BI.isKey(this.options.watermark)) { + this.watermark = BI.createWidget({ + type: "bi.label", + cls: "bi-water-mark", + text: this.options.watermark, + height: this.options.height, + forceCenter: true, + height: o.height - 2 * (o.vgap + o.tgap), + whiteSpace: "nowrap", + textAlign: "left" + }); + this.watermark.element.bind({ + mousedown: function (e) { + if (self.isEnabled()) { + self.editor.isEditing() || self.editor.focus(); + } else { + self.editor.isEditing() && self.editor.blur(); + } + e.stopEvent(); + } + }); + this.watermark.element.bind("click", function (e) { + if (self.isEnabled()) { + self.editor.isEditing() || self.editor.focus(); + } else { + self.editor.isEditing() && self.editor.blur(); + } + e.stopEvent(); + }); + this.watermark.element.css({ + position: "absolute", + left: "3px", + right: "3px", + top: "0px", + bottom: "0px" + }); + } + var items = [{ + el: { + type: "bi.default", + items: this.watermark ? [this.editor, this.watermark] : [this.editor] + }, + left: o.hgap + o.lgap, + right: o.hgap + o.rgap, + top: o.vgap + o.tgap, + bottom: o.vgap + o.bgap + }]; + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: items + }); + this.editor.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + this.editor.on(BI.Input.EVENT_FOCUS, function () { + self._checkError(); + self.element.addClass("bi-editor-focus"); + self.fireEvent(BI.Editor.EVENT_FOCUS, arguments); + }); + this.editor.on(BI.Input.EVENT_BLUR, function () { + self.setErrorVisible(false); + self.element.removeClass("bi-editor-focus"); + self.fireEvent(BI.Editor.EVENT_BLUR, arguments); + }); + this.editor.on(BI.Input.EVENT_CLICK, function () { + self.fireEvent(BI.Editor.EVENT_CLICK, arguments); + }); + this.editor.on(BI.Input.EVENT_CHANGE, function () { + self.fireEvent(BI.Editor.EVENT_CHANGE, arguments); + }); + this.editor.on(BI.Input.EVENT_KEY_DOWN, function (v) { + self.fireEvent(BI.Editor.EVENT_KEY_DOWN, arguments); + }); + this.editor.on(BI.Input.EVENT_QUICK_DOWN, function (v) { + self.watermark && self.watermark.invisible(); + }); + + this.editor.on(BI.Input.EVENT_VALID, function () { + self._checkWaterMark(); + self.setErrorVisible(false); + self.fireEvent(BI.Editor.EVENT_VALID, arguments); + }); + this.editor.on(BI.Input.EVENT_ERROR, function () { + self._checkWaterMark(); + self.fireEvent(BI.Editor.EVENT_ERROR, arguments); + self.setErrorVisible(self.isEditing()); + }); + this.editor.on(BI.Input.EVENT_RESTRICT, function () { + self._checkWaterMark(); + var tip = self.setErrorVisible(true); + tip && tip.element.fadeOut(100, function () { + tip.element.fadeIn(100); + }); + self.fireEvent(BI.Editor.EVENT_RESTRICT, arguments); + }); + this.editor.on(BI.Input.EVENT_EMPTY, function () { + self._checkWaterMark(); + self.fireEvent(BI.Editor.EVENT_EMPTY, arguments); + }); + this.editor.on(BI.Input.EVENT_ENTER, function () { + self.fireEvent(BI.Editor.EVENT_ENTER, arguments); + }); + this.editor.on(BI.Input.EVENT_SPACE, function () { + self.fireEvent(BI.Editor.EVENT_SPACE, arguments); + }); + this.editor.on(BI.Input.EVENT_BACKSPACE, function () { + self.fireEvent(BI.Editor.EVENT_BACKSPACE, arguments); + }); + this.editor.on(BI.Input.EVENT_REMOVE, function () { + self.fireEvent(BI.Editor.EVENT_REMOVE, arguments); + }); + this.editor.on(BI.Input.EVENT_START, function () { + self.fireEvent(BI.Editor.EVENT_START, arguments); + }); + this.editor.on(BI.Input.EVENT_PAUSE, function () { + self.fireEvent(BI.Editor.EVENT_PAUSE, arguments); + }); + this.editor.on(BI.Input.EVENT_STOP, function () { + self.fireEvent(BI.Editor.EVENT_STOP, arguments); + }); + this.editor.on(BI.Input.EVENT_CONFIRM, function () { + self.fireEvent(BI.Editor.EVENT_CONFIRM, arguments); + }); + this.element.click(function (e) { + e.stopPropagation(); + return false; + }); + if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) { + this.setValue(this.options.value); + } else { + this._checkWaterMark(); + } + }, + + _checkToolTip: function () { + var o = this.options; + var errorText = o.errorText; + if (BI.isFunction(errorText)) { + errorText = errorText(this.editor.getValue()); + } + if (BI.isKey(errorText)) { + if (!this.isEnabled() || this.isValid() || (BI.Bubbles.has(this.getName()) && BI.Bubbles.get(this.getName()).isVisible())) { + this.setTitle(""); + } else { + this.setTitle(errorText); + } + } + }, + + _checkError: function () { + this.setErrorVisible(this.isEnabled() && !this.isValid()); + this._checkToolTip(); + }, + + _checkWaterMark: function () { + var o = this.options; + if (!this.disabledWarterMark && this.editor.getValue() === "" && BI.isKey(o.watermark)) { + this.watermark && this.watermark.visible(); + } else { + this.watermark && this.watermark.invisible(); + } + }, + + setErrorText: function (text) { + this.options.errorText = text; + }, + + getErrorText: function () { + return this.options.errorText; + }, + + setErrorVisible: function (b) { + var o = this.options; + var errorText = o.errorText; + if (BI.isFunction(errorText)) { + errorText = errorText(this.editor.getValue()); + } + if (!this.disabledError && BI.isKey(errorText)) { + BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this); + this._checkToolTip(); + return BI.Bubbles.get(this.getName()); + } + }, + + disableError: function () { + this.disabledError = true; + this._checkError(); + }, + + enableError: function () { + this.disabledError = false; + this._checkError(); + }, + + disableWarterMark: function () { + this.disabledWarterMark = true; + this._checkWaterMark(); + }, + + enableWarterMark: function () { + this.disabledWarterMark = false; + this._checkWaterMark(); + }, + + focus: function () { + this.element.addClass("text-editor-focus"); + this.editor.focus(); + }, + + blur: function () { + this.element.removeClass("text-editor-focus"); + this.editor.blur(); + }, + + selectAll: function () { + this.editor.selectAll(); + }, + + onKeyDown: function (k) { + this.editor.onKeyDown(k); + }, + + setValue: function (v) { + BI.Editor.superclass.setValue.apply(this, arguments); + this.editor.setValue(v); + this._checkError(); + this._checkWaterMark(); + }, + + getLastValidValue: function () { + return this.editor.getLastValidValue(); + }, + + resetLastValidValue: function () { + this.editor.resetLastValidValue(); + }, + + getValue: function () { + if (!this.isValid()) { + return BI.trim(this.editor.getLastValidValue()); + } + return BI.trim(this.editor.getValue()); + }, + + setValid: function (b) { + BI.Editor.superclass.setValid.apply(this, arguments); + this.editor.setValid(b); + }, + + isEditing: function () { + return this.editor.isEditing(); + }, + + isValid: function () { + return this.editor.isValid(); + }, + + setEnable: function (b) { + BI.Editor.superclass.setEnable.apply(this, arguments); + this.editor && this.editor.setEnable(b); + this.watermark && this.watermark.setEnable(b); + } +}); +BI.Editor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.Editor.EVENT_FOCUS = "EVENT_FOCUS"; +BI.Editor.EVENT_BLUR = "EVENT_BLUR"; +BI.Editor.EVENT_CLICK = "EVENT_CLICK"; +BI.Editor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; +BI.Editor.EVENT_SPACE = "EVENT_SPACE"; +BI.Editor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; + +BI.Editor.EVENT_START = "EVENT_START"; +BI.Editor.EVENT_PAUSE = "EVENT_PAUSE"; +BI.Editor.EVENT_STOP = "EVENT_STOP"; +BI.Editor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.Editor.EVENT_VALID = "EVENT_VALID"; +BI.Editor.EVENT_ERROR = "EVENT_ERROR"; +BI.Editor.EVENT_ENTER = "EVENT_ENTER"; +BI.Editor.EVENT_RESTRICT = "EVENT_RESTRICT"; +BI.Editor.EVENT_REMOVE = "EVENT_REMOVE"; +BI.Editor.EVENT_EMPTY = "EVENT_EMPTY"; + +$.shortcut("bi.editor", BI.Editor);/** + * 多文件 + * + * Created by GUY on 2016/4/13. + * @class BI.MultifileEditor + * @extends BI.Single + * @abstract + */ +BI.MultifileEditor = BI.inherit(BI.Single, { + _defaultConfig: function () { + var conf = BI.MultifileEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-multifile-editor", + multiple: false, + maxSize: 1024 * 1024, + accept: "", + url: "" + }) + }, + + _init: function () { + var self = this, o = this.options; + BI.MultifileEditor.superclass._init.apply(this, arguments); + this.file = BI.createWidget({ + type: "bi.file", + cls: "multifile-editor", + width: "100%", + height: "100%", + name: o.name, + url: o.url, + multiple: o.multiple, + accept: o.accept, + maxSize: o.maxSize + }); + this.file.on(BI.File.EVENT_CHANGE, function () { + self.fireEvent(BI.MultifileEditor.EVENT_CHANGE, arguments); + }); + this.file.on(BI.File.EVENT_UPLOADSTART, function () { + self.fireEvent(BI.MultifileEditor.EVENT_UPLOADSTART, arguments); + }); + this.file.on(BI.File.EVENT_ERROR, function () { + self.fireEvent(BI.MultifileEditor.EVENT_ERROR, arguments); + }); + this.file.on(BI.File.EVENT_PROGRESS, function () { + self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS, arguments); + }); + this.file.on(BI.File.EVENT_UPLOADED, function () { + self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED, arguments); + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.adaptive", + scrollable: false, + items: [this.file] + }, + top: 0, + right: 0, + left: 0, + bottom: 0 + }] + }); + }, + + select: function () { + this.file.select(); + }, + + getValue: function () { + return this.file.getValue(); + }, + + upload: function () { + this.file.upload(); + }, + + reset: function () { + this.file.reset(); + }, + + setEnable: function (enable) { + BI.MultiFile.superclass.setEnable.apply(this, arguments); + this.file.setEnable(enable); + } +}); +BI.MultifileEditor.EVENT_CHANGE = "MultifileEditor.EVENT_CHANGE"; +BI.MultifileEditor.EVENT_UPLOADSTART = "MultifileEditor.EVENT_UPLOADSTART"; +BI.MultifileEditor.EVENT_ERROR = "MultifileEditor.EVENT_ERROR"; +BI.MultifileEditor.EVENT_PROGRESS = "MultifileEditor.EVENT_PROGRESS"; +BI.MultifileEditor.EVENT_UPLOADED = "MultifileEditor.EVENT_UPLOADED"; +$.shortcut("bi.multifile_editor", BI.MultifileEditor);/** + * + * Created by GUY on 2016/1/18. + * @class BI.TextAreaEditor + * @extends BI.Single + */ +BI.TextAreaEditor = BI.inherit(BI.Single, { + _defaultConfig: function () { + return $.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(), { + baseCls: 'bi-textarea-editor', + value: '' + }); + }, + _init: function () { + BI.TextAreaEditor.superclass._init.apply(this, arguments); + var o = this.options, self = this; + this.content = BI.createWidget({ + type: "bi.layout", + tagName: "textarea", + width: "100%", + height: "100%", + cls: "textarea-editor-content display-block" + }); + this.content.element.css({"resize": "none"}); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.adaptive", + items: [this.content] + }, + left: 0, + right: 3, + top: 0, + bottom: 5 + }] + }); + + this.content.element.on("input propertychange", function (e) { + self._checkWaterMark(); + self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE); + }); + + this.content.element.focus(function () { + if (self.isValid()) { + self._focus(); + self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS); + } + $(document).bind("mousedown." + self.getName(), function (e) { + if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) { + $(document).unbind("mousedown." + self.getName()); + self.content.element.blur(); + } + }); + }); + this.content.element.blur(function () { + if (self.isValid()) { + self._blur(); + self.fireEvent(BI.TextAreaEditor.EVENT_BLUR); + } + $(document).unbind("mousedown." + self.getName()); + }); + if (BI.isKey(o.value)) { + self.setValue(o.value); + } + if (BI.isNotNull(o.style)) { + self.setValue(o.style); + } + this._checkWaterMark(); + }, + + _checkWaterMark: function () { + var self = this, o = this.options; + var val = this.getValue(); + if (BI.isNotEmptyString(val)) { + this.watermark && this.watermark.destroy(); + this.watermark = null; + } else { + if (BI.isNotEmptyString(o.watermark)) { + if (!this.watermark) { + this.watermark = BI.createWidget({ + type: "bi.text_button", + cls: "bi-water-mark", + textAlign: "left", + height: 30, + text: o.watermark, + invalid: o.invalid, + disabled: o.disabled + }); + this.watermark.on(BI.TextButton.EVENT_CHANGE, function () { + self.focus(); + }); + BI.createWidget({ + type: 'bi.absolute', + element: this, + items: [{ + el: this.watermark, + left: 0, + top: 0, + right: 0 + }] + }) + } else { + this.watermark.setText(o.watermark); + this.watermark.setValid(!o.invalid); + this.watermark.setEnable(!o.disabled); + } + } + } + }, + + _focus: function () { + this.content.element.addClass("textarea-editor-focus"); + this._checkWaterMark(); + }, + + _blur: function () { + this.content.element.removeClass("textarea-editor-focus"); + this._checkWaterMark(); + }, + + focus: function () { + this._focus(); + this.content.element.focus(); + }, + + blur: function () { + this._blur(); + this.content.element.blur(); + }, + + getValue: function () { + return this.content.element.val(); + }, + + setValue: function (value) { + this.content.element.val(value); + }, + + setStyle: function (style) { + this.style = style; + this.element.css(style); + this.content.element.css(style) + }, + + getStyle: function () { + return this.style; + }, + + setValid: function (b) { + BI.TextAreaEditor.superclass.setValid.apply(this, arguments); + this.content.setValid(b); + this.watermark && this.watermark.setValid(b); + }, + + setEnable: function (b) { + BI.TextAreaEditor.superclass.setEnable.apply(this, arguments); + this.content.setEnable(b); + this.watermark && this.watermark.setEnable(b); + } +}); +BI.TextAreaEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.TextAreaEditor.EVENT_BLUR = "EVENT_BLUR"; +BI.TextAreaEditor.EVENT_FOCUS = "EVENT_FOCUS"; +$.shortcut("bi.textarea_editor", BI.TextAreaEditor);/** + * guy 图标 + * @class BI.Icon + * @extends BI.Single + */ +BI.Icon = BI.inherit(BI.Single, { + _defaultConfig: function () { + var conf = BI.Icon.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + tagName: "i", + baseCls: (conf.baseCls || "") + " x-icon b-font horizon-center display-block" + }) + }, + _init: function () { + BI.Icon.superclass._init.apply(this, arguments); + } +}); +$.shortcut("bi.icon", BI.Icon);/** + * @class BI.Iframe + * @extends BI.Single + * @abstract + * Created by GameJian on 2016/3/2. + */ +BI.Iframe = BI.inherit(BI.Single, { + _defaultConfig: function () { + var conf = BI.Iframe.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-iframe", + src: "", + width: "100%", + height: "100%" + }) + }, + + _init: function () { + var o = this.options; + this.options.element = $("')); + } catch (e) { + var form = document.createElement('form'), + iframe = handler.iframe || (handler.iframe = document.createElement("iframe")); + form.setAttribute("enctype", "multipart/form-data"); + iframe.setAttribute("name", iframe.id = target); + iframe.setAttribute("src", url); + } + iframe.style.position = "absolute"; + iframe.style.left = iframe.style.top = "-10000px"; + iframe.onload = onload; + iframe.onerror = function (event) { + if (isFunction(handler.onerror)) { + handler.onerror(rpe, event || window.event); + } + }; + iframe.onreadystatechange = function () { + if (/loaded|complete/i.test(iframe.readyState)) { + onload(); + + //wei : todo,将附件信息放到handler.attach + } + else if (isFunction(handler.onloadprogress)) { + if (rpe.loaded < rpe.total) { + ++rpe.loaded; + } + handler.onloadprogress(rpe, { + readyState: { + loading: 2, + interactive: 3, + loaded: 4, + complete: 4 + }[iframe.readyState] || 1 + }); + } + }; + form.setAttribute("action", handler.url); + form.setAttribute("target", iframe.id); + form.setAttribute("method", "post"); + form.appendChild(handler.file); + form.style.display = "none"; + if (isFunction(handler.onloadstart)) { + handler.onloadstart(rpe, {}); + } + with (document.body || document.documentElement) { + appendChild(iframe); + appendChild(form); + form.submit(); + } + ; + return handler; + }; + } + xhr = null; + return sendFile; + })(Object.prototype.toString); + + var sendFiles = function (handler, maxSize, width, height) { + + var length = handler.files.length, + i = 0, + onload = handler.onload, + onloadstart = handler.onloadstart; + handler.current = 0; + handler.total = 0; + handler.sent = 0; + while (handler.current < length) { + handler.total += (handler.files[handler.current].fileSize || handler.files[handler.current].size); + handler.current++; + } + handler.current = 0; + if (length && handler.files[0].fileSize !== -1) { + handler.file = handler.files[handler.current]; + + sendFile(handler, maxSize, width, height).onload = function (rpe, xhr) { + handler.onloadstart = null; + handler.sent += (handler.files[handler.current].fileSize || handler.files[handler.current].size); + if (++handler.current < length) { + handler.file = handler.files[handler.current]; + sendFile(handler, maxSize, width, height).onload = arguments.callee; + } else if (onload) { + handler.onloadstart = onloadstart; + handler.onload = onload; + handler.onload(rpe, xhr); + } + }; + } else if (length) { + handler.total = length * 100; + handler.file = handler.files[handler.current]; + sendFile(handler, maxSize, width, height).onload = function (rpe, xhr) { + var callee = arguments.callee; + handler.onloadstart = null; + handler.sent += 100; + if (++handler.current < length) { + if (/\b(chrome|safari)\b/i.test(navigator.userAgent)) { + handler.iframe.parentNode.removeChild(handler.iframe); + handler.iframe = null; + } + setTimeout(function () { + handler.file = handler.files[handler.current]; + sendFile(handler, maxSize, width, height).onload = callee; + }, 15); + } else if (onload) { + setTimeout(function () { + handler.iframe.parentNode.removeChild(handler.iframe); + handler.iframe = null; + handler.onloadstart = onloadstart; + handler.onload = onload; + handler.onload(rpe, xhr); + }, 15); + } + }; + } + return handler; + }; + + BI.File = BI.inherit(BI.Single, { + _defaultConfig: function () { + var conf = BI.File.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-file display-block", + element: "", + name: "", + url: "", + multiple: true, + accept: "", /**'*.jpg; *.zip'**/ + maxSize: 1024 * 1024 + }) + }, + + _init: function () { + var self = this, o = this.options; + BI.File.superclass._init.apply(this, arguments); + if (o.multiple === true) { + this.element.attr("multiple", "multiple"); + } + this.element.attr("name", o.name || this.getName()); + + BI.nextTick(function () { + // create the noswfupload.wrap Object + // wrap.maxSize 文件大小限制 + // wrap.maxlength 文件个数限制 + var _wrap = self.wrap = self._wrap(self.element[0], o.maxSize); + // fileType could contain whatever text but filter checks *.{extension} + // if present + + // handlers + + _wrap.onloadstart = function (rpe, xhr) { + //BI.Msg.toast("loadstart"); + self.fireEvent(BI.File.EVENT_UPLOADSTART); + }; + + _wrap.onprogress = function (rpe, xhr) { + //BI.Msg.toast("onprogress"); + // percent for each bar + + // fileSize is -1 only if browser does not support file info access + // this if splits recent browsers from others + if (this.file.fileSize !== -1) { + // simulation property indicates when the progress event is fake + if (rpe.simulation) { + + } else { + + } + } else { + // if fileSIze is -1 browser is using an iframe because it does + // not support + // files sent via Ajax (XMLHttpRequest) + // We can still show some information + } + self.fireEvent(BI.File.EVENT_PROGRESS, { + file: this.file, + total: rpe.total, + loaded: rpe.loaded, + simulation: rpe.simulation + }); + }; + + // generated if there is something wrong during upload + _wrap.onerror = function () { + // just inform the user something was wrong + self.fireEvent(BI.File.EVENT_ERROR); + }; + + // generated when every file has been sent (one or more, it does not + // matter) + _wrap.onload = function (rpe, xhr) { + var self_ = this; + // just show everything is fine ... + // ... and after a second reset the component + setTimeout(function () { + self_.clean(); // remove files from list + self_.hide(); // hide progress bars and enable input file + + //BI.Msg.toast("onload"); + self.fireEvent(BI.File.EVENT_UPLOADED); + // enable again the submit button/element + }, 1000); + }; + _wrap.url = o.url ? o.url : FR.servletURL + + '?op=fr_attach&cmd=ah_upload'; + _wrap.fileType = o.accept; //文件类型限制 + _wrap.attach_array = []; + _wrap.attach_names = []; + _wrap.attachNum = 0; + }); + }, + + _events: function (wrap) { + var self = this; + event.add(wrap.dom.input, "change", function () { + event.del(wrap.dom.input, "change", arguments.callee); + for (var input = wrap.dom.input.cloneNode(true), i = 0, files = F(wrap.dom.input); i < files.length; i++) { + var item = files.item(i); + var tempFile = item.value || item.name; + var value = item.fileName || (item.fileName = tempFile.split("\\").pop()), + ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown", + size = item.fileSize || item.size; + if (wrap.fileType && -1 === wrap.fileType.indexOf("*." + ext)) { + //文件类型不支持 + BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error")); + self.fireEvent(BI.File.EVENT_ERROR, { + errorType: 0, + file: item + }); + } else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) { + //文件大小不支持 + BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error")); + self.fireEvent(BI.File.EVENT_ERROR, { + errorType: 1, + file: item + }); + } else { + wrap.files.unshift(item); + //BI.Msg.toast(value); + self.fireEvent(BI.File.EVENT_CHANGE, { + file: item + }); + } + } + input.value = ""; + wrap.dom.input.parentNode.replaceChild(input, wrap.dom.input); + wrap.dom.input = input; + event.add(wrap.dom.input, "change", arguments.callee); + }); + return wrap; + }, + + _wrap: function () { + var self = this, o = this.options; + // be sure input accept multiple files + var input = this.element[0]; + if (o.multiple === true) { + this.element.attr("multiple", "multiple"); + } + input.value = ""; + + // wrap Object + return this._events({ + + // DOM namespace + dom: { + input: input, // input file + disabled: false // internal use, checks input file state + }, + name: input.name, // name to send for each file ($_FILES[{name}] in the server) + // maxSize is the maximum amount of bytes for each file + maxSize: o.maxSize ? o.maxSize >> 0 : -1, + files: [], // file list + + // remove every file from the noswfupload component + clean: function () { + this.files = []; + }, + + // upload one file a time (which make progress possible rather than all files in one shot) + // the handler is an object injected into the wrap one, could be the wrap itself or + // something like {onload:function(){alert("OK")},onerror:function(){alert("Error")}, etc ...} + upload: function (handler) { + if (handler) { + for (var key in handler) { + this[key] = handler[key]; + } + } + sendFiles(this, this.maxSize); + return this; + }, + + // hide progress bar (total + current) and enable files selection + hide: function () { + if (this.dom.disabled) { + this.dom.disabled = false; + this.dom.input.removeAttribute("disabled"); + } + }, + + // show progress bar and disable file selection (used during upload) + // total and current are pixels used to style bars + // totalProp and currentProp are properties to change, "height" by default + show: function (total, current, totalProp, currentProp) { + if (!this.dom.disabled) { + this.dom.disabled = true; + this.dom.input.setAttribute("disabled", "disabled"); + } + } + }); + }, + + select: function () { + $(this.wrap.dom.input).click(); + }, + + upload: function (handler) { + this.wrap.upload(handler); + }, + + getValue: function () { + return this.wrap.attach_array; + }, + + reset: function () { + this.wrap.attach_array = []; + this.wrap.attach_names = []; + this.wrap.attachNum = 0; + }, + + setEnable: function (enable) { + BI.MultiFile.superclass.setEnable.apply(this, arguments); + if (enable === true) { + this.element.attr("disabled", "disabled"); + } else { + this.element.removeAttr("disabled"); + } + } + }); + BI.File.EVENT_CHANGE = "BI.File.EVENT_CHANGE"; + BI.File.EVENT_UPLOADSTART = "EVENT_UPLOADSTART"; + BI.File.EVENT_ERROR = "EVENT_ERROR"; + BI.File.EVENT_PROGRESS = "EVENT_PROGRESS"; + BI.File.EVENT_UPLOADED = "EVENT_UPLOADED"; + $.shortcut("bi.file", BI.File); +})();/** + * guy + * @class BI.Input 一个button和一行数 组成的一行listitem + * @extends BI.Single + * @type {*|void|Object} + */ +BI.Input = BI.inherit(BI.Single, { + _defaultConfig: function () { + var conf = BI.Input.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-input display-block", + element: "", + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn,//按确定键能否退出编辑 + mouseOut: false, + allowBlank: false + }) + }, + + _init: function () { + BI.Input.superclass._init.apply(this, arguments); + var self = this; + var ctrlKey = false; + var inputEventValid = false; + var _keydown = BI.debounce(function (keyCode) { + self.onKeyDown(keyCode, ctrlKey); + self._keydown_ = false; + }, 300); + var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, true); + this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, true); + this.element + .keydown(function (e) { + inputEventValid = false; + ctrlKey = e.ctrlKey; + self.fireEvent(BI.Input.EVENT_QUICK_DOWN); + }) + .keyup(function (e) { + if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { + self._keydown_ = true; + _keydown(e.keyCode); + } + }) + .on("input propertychange", function (e) { + inputEventValid = true; + self._keydown_ = true; + _keydown(e.keyCode); + }) + .click(function (e) { + e.stopPropagation(); + _clk(); + }) + .mousedown(function (e) { + self.element.val(self.element.val()); + }) + .focusout(function (e) { + self._blurDebounce(); + }); + }, + + _focus: function () { + this.element.addClass("bi-input-focus"); + this._checkValidationOnValueChange(); + this._isEditing = true; + if (this.getValue() == "") { + this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); + this.fireEvent(BI.Input.EVENT_EMPTY); + } + this.fireEvent(BI.Input.EVENT_FOCUS); + }, + + _blur: function () { + var self = this; + if (self._keydown_ === true) { + BI.delay(blur, 300); + } else { + blur(); + } + function blur() { + if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) { + self.element.val(self._lastValidValue ? self._lastValidValue : ""); + self._checkValidationOnValueChange(); + self._defaultState(); + } + self.element.removeClass("bi-input-focus"); + self._isEditing = false; + self._start = false; + if (self.isValid()) { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CONFIRM, self.getValue(), self); + self.fireEvent(BI.Input.EVENT_CONFIRM); + } + self.fireEvent(BI.Input.EVENT_BLUR); + } + }, + + _click: function () { + if (this._isEditing !== true) { + this._focus(); + this.selectAll(); + this.fireEvent(BI.Input.EVENT_CLICK); + } + }, + + onClick: function () { + this._click(); + }, + + onKeyDown: function (keyCode, ctrlKey) { + if (!this.isValid() || BI.trim(this._lastValidValue) !== BI.trim(this.getValue())) { + this._checkValidationOnValueChange(); + } + if (this.isValid() && BI.trim(this.getValue()) !== "") { + if (BI.trim(this.getValue()) !== this._lastValue && (!this._start || this._lastValue == null || this._lastValue === "") + || (this._pause === true && !/(\s|\u00A0)$/.test(this.getValue()))) { + this._start = true; + this._pause = false; + this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STARTEDIT, this.getValue(), this); + this.fireEvent(BI.Input.EVENT_START); + } + } + if (ctrlKey === true && keyCode === 86) {//ctrlKey+V + this._valueChange(); + } else { + if (keyCode == BI.KeyCode.ENTER) { + if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) { + this.blur(); + this.fireEvent(BI.Input.EVENT_ENTER); + } else { + this.fireEvent(BI.Input.EVENT_RESTRICT); + } + } + if (keyCode == BI.KeyCode.SPACE) { + this.fireEvent(BI.Input.EVENT_SPACE); + } + if (keyCode == BI.KeyCode.BACKSPACE && this._lastValue == "") { + this.fireEvent(BI.Input.EVENT_REMOVE); + } + if (keyCode == BI.KeyCode.BACKSPACE || keyCode == BI.KeyCode.DELETE) { + this.fireEvent(BI.Input.EVENT_BACKSPACE); + } + } + this.fireEvent(BI.Input.EVENT_KEY_DOWN); + + if (BI.isEndWithBlank(this.getValue())) { + this._pause = true; + this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.PAUSE, "", this); + this.fireEvent(BI.Input.EVENT_PAUSE); + this._defaultState(); + } else if ((keyCode === BI.KeyCode.BACKSPACE || keyCode === BI.KeyCode.DELETE) && + BI.trim(this.getValue()) === "" && (this._lastValue !== null && BI.trim(this._lastValue) !== "")) { + this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT, this.getValue(), this); + this.fireEvent(BI.Input.EVENT_STOP); + this._valueChange(); + } else { + this._valueChange(); + } + }, + + //初始状态 + _defaultState: function () { + if (this.getValue() == "") { + this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); + this.fireEvent(BI.Input.EVENT_EMPTY); + } + this._lastValue = this.getValue(); + this._lastSubmitValue = null; + }, + + _valueChange: function () { + if (this.isValid() && BI.trim(this.getValue()) !== this._lastSubmitValue) { + this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CHANGE, this.getValue(), this); + this.fireEvent(BI.Input.EVENT_CHANGE); + this._lastSubmitValue = BI.trim(this.getValue()); + } + if (this.getValue() == "") { + this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); + this.fireEvent(BI.Input.EVENT_EMPTY); + } + this._lastValue = this.getValue(); + }, + + _checkValidationOnValueChange: function () { + var o = this.options; + var v = this.getValue(); + this.setValid( + (o.allowBlank === true && BI.trim(v) == "") || + (BI.isNotEmptyString(BI.trim(v)) + && (v === this._lastValidValue || + o.validationChecker.apply(this, [BI.trim(v)]) !== false)) + ); + }, + + focus: function () { + if (!this.element.is(":visible")) { + throw new Error("input输入框在不可见下不能focus"); + } + if (!this._isEditing === true) { + this.element.focus(); + this._focus(); + this.selectAll(); + } + }, + + blur: function () { + if (!this.element.is(":visible")) { + throw new Error("input输入框在不可见下不能blur"); + } + if (this._isEditing === true) { + this.element.blur(); + this._blurDebounce(); + } + }, + + selectAll: function () { + if (!this.element.is(":visible")) { + throw new Error("input输入框在不可见下不能select"); + } + this.element.select(); + this._isEditing = true; + }, + + setValue: function (textValue) { + this.element.val(textValue); + BI.nextTick(BI.bind(function () { + this._checkValidationOnValueChange(); + this._defaultState(); + if (this.isValid()) { + this._lastSubmitValue = this.getValue(); + } + }, this)); + }, + + getValue: function () { + return this.element.val() || ""; + }, + + isEditing: function () { + return this._isEditing; + }, + + getLastValidValue: function () { + return this._lastValidValue; + }, + + setValid: function () { + BI.Input.superclass.setValid.apply(this, arguments); + if (this.isValid()) { + this._lastValidValue = this.getValue(); + this.element.removeClass("bi-input-error"); + this.fireEvent(BI.Input.EVENT_VALID, BI.trim(this.getValue()), this); + } else { + if (this._lastValidValue === this.getValue()) { + this._lastValidValue = null; + } + this.element.addClass("bi-input-error"); + this.fireEvent(BI.Input.EVENT_ERROR, BI.trim(this.getValue()), this); + } + }, + + setEnable: function (b) { + BI.Input.superclass.setEnable.apply(this, [b]); + this.element[0].disabled = !b; + } +}); +BI.Input.EVENT_CHANGE = "EVENT_CHANGE"; + +BI.Input.EVENT_FOCUS = "EVENT_FOCUS"; +BI.Input.EVENT_CLICK = "EVENT_CLICK"; +BI.Input.EVENT_BLUR = "EVENT_BLUR"; +BI.Input.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; +BI.Input.EVENT_QUICK_DOWN = "EVENT_QUICK_DOWN"; +BI.Input.EVENT_SPACE = "EVENT_SPACE"; +BI.Input.EVENT_BACKSPACE = "EVENT_BACKSPACE"; + +BI.Input.EVENT_START = "EVENT_START"; +BI.Input.EVENT_PAUSE = "EVENT_PAUSE"; +BI.Input.EVENT_STOP = "EVENT_STOP"; +BI.Input.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.Input.EVENT_REMOVE = "EVENT_REMOVE"; +BI.Input.EVENT_EMPTY = "EVENT_EMPTY"; +BI.Input.EVENT_VALID = "EVENT_VALID"; +BI.Input.EVENT_ERROR = "EVENT_ERROR"; +BI.Input.EVENT_ENTER = "EVENT_ENTER"; +BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; +$.shortcut("bi.input", BI.Input);/** + * guy + * @extends BI.Single + * @type {*|void|Object} + */ +BI.Radio = BI.inherit(BI.IconButton, { + _defaultConfig: function() { + var conf = BI.Radio.superclass._defaultConfig.apply(this,arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-radio radio-icon", + selected: false, + handler: BI.emptyFn, + width: 16, + height: 16, + iconWidth: 16, + iconHeight: 16 + }) + }, + + _init : function() { + BI.Radio.superclass._init.apply(this, arguments); + }, + + doClick: function(){ + BI.Radio.superclass.doClick.apply(this, arguments); + if(this.isValid()){ + this.fireEvent(BI.Radio.EVENT_CHANGE); + } + } +}); +BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; + +$.shortcut("bi.radio", BI.Radio);/** + * Created by GUY on 2015/6/26. + */ + +BI.Label = BI.inherit(BI.Single, { + _defaultConfig: function () { + var conf = BI.Label.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-label", + textAlign: "center", + whiteSpace: "nowrap", //normal or nowrap + forceCenter: false, //是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效 + textWidth: null, + textHeight: null, + hgap: 0, + vgap: 0, + lgap: 0, + rgap: 0, + tgap: 0, + bgap: 0, + text: "", + py: "", + keyword: "" + }) + }, + + _createJson: function () { + var o = this.options; + return { + type: "bi.text", + textAlign: o.textAlign, + whiteSpace: o.whiteSpace, + lineHeight: o.textHeight, + text: o.text, + value: o.value, + py: o.py, + keyword: o.keyword + }; + }, + + _init: function () { + BI.Label.superclass._init.apply(this, arguments); + + if (this.options.textAlign === "center") { + this._createCenterEl(); + } else { + this._createNotCenterEl(); + } + }, + + _createCenterEl: function () { + var o = this.options; + var json = this._createJson(); + if (BI.isNumber(o.width) && o.width > 0) { + if (BI.isNumber(o.textWidth) && o.textWidth > 0) { + if (BI.isNumber(o.height) && o.height > 0) { + var gap = (o.width - o.textWidth) / 2; + BI.createWidget({ + type: "bi.adaptive", + height: o.height, + scrollable: o.whiteSpace === "normal", + element: this, + items: [ + { + el: (this.text = BI.createWidget(json)), + left: gap + o.hgap + o.lgap, + right: gap + o.hgap + o.rgap, + top: o.vgap + o.tgap, + bottom: o.vgap + o.bgap + } + ] + }); + this.element.css({"line-height": o.height + "px"}); + return; + } + json.width = o.textWidth; + BI.createWidget({ + type: "bi.center_adapt", + scrollable: o.whiteSpace === "normal", + element: this, + items: [ + { + el: (this.text = BI.createWidget(json)) + } + ] + }); + return; + } + if (o.whiteSpace == "normal") { + this.text = BI.createWidget(json); + BI.createWidget({ + type: "bi.center_adapt", + scrollable: o.whiteSpace === "normal", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + element: this, + items: [this.text] + }); + return; + } + if (BI.isNumber(o.height) && o.height > 0) { + this.element.css({ + "line-height": o.height + "px" + }); + BI.createWidget({ + type: "bi.absolute", + scrollable: o.whiteSpace === "normal", + element: this, + items: [{ + el: (this.text = BI.createWidget(json)), + left: o.hgap + o.lgap, + right: o.hgap + o.rgap, + top: o.vgap + o.tgap, + bottom: o.vgap + o.bgap + }] + }); + return; + } + json.width = o.width - 2 * o.hgap; + BI.createWidget({ + type: "bi.center_adapt", + scrollable: o.whiteSpace === "normal", + element: this, + items: [{ + el: (this.text = BI.createWidget(json)) + }] + }); + return; + } + if (BI.isNumber(o.textWidth) && o.textWidth > 0) { + json.width = o.textWidth; + BI.createWidget({ + type: "bi.center_adapt", + scrollable: o.whiteSpace === "normal", + element: this, + items: [ + { + el: (this.text = BI.createWidget(json)) + } + ] + }); + return; + } + if (o.whiteSpace == "normal") { + this.text = BI.createWidget(json); + this.text = BI.createWidget({ + type: "bi.center_adapt", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + scrollable: o.whiteSpace === "normal", + element: this, + items: [this.text] + }); + return; + } + if (BI.isNumber(o.height) && o.height > 0) { + if (BI.isNumber(o.textHeight) && o.textHeight > 0) { + this.element.css({ + "line-height": o.height + "px" + }); + BI.createWidget({ + type: "bi.adaptive", + height: o.height, + scrollable: o.whiteSpace === "normal", + element: this, + items: [{ + el: (this.text = BI.createWidget(json)), + left: o.hgap + o.lgap, + right: o.hgap + o.rgap, + top: o.vgap + o.tgap, + bottom: o.vgap + o.bgap + }] + }); + return; + } + BI.extend(json, { + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap + }); + this.element.css({ + "line-height": o.height + "px" + }); + this.text = BI.createWidget(BI.extend(json, { + element: this + })); + BI.createWidget({ + type: "bi.layout", + element: this.text, + scrollable: o.whiteSpace === "normal" + }); + return; + } + BI.extend(json, { + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap + }); + if (o.forceCenter) { + this.text = BI.createWidget(json); + BI.createWidget({ + type: "bi.center_adapt", + element: this, + items: [this.text] + }); + return; + } + this.text = BI.createWidget(BI.extend(json, { + element: this + })); + BI.createWidget({ + type: "bi.layout", + element: this.text, + scrollable: o.whiteSpace === "normal" + }) + }, + + _createNotCenterEl: function () { + var o = this.options; + var json = this._createJson(); + if (BI.isNumber(o.width) && o.width > 0) { + if (BI.isNumber(o.textWidth) && o.textWidth > 0) { + if (BI.isNumber(o.height) && o.height > 0) { + BI.createWidget({ + type: "bi.adaptive", + height: o.height, + scrollable: o.whiteSpace === "normal", + element: this, + items: [ + { + el: (this.text = BI.createWidget(json)), + left: o.hgap + o.lgap, + right: o.hgap + o.rgap, + top: o.vgap + o.tgap, + bottom: o.vgap + o.bgap + } + ] + }); + this.element.css({"line-height": o.height + "px"}); + return; + } + json.width = o.textWidth; + BI.createWidget({ + type: "bi.vertical_adapt", + scrollable: o.whiteSpace === "normal", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + element: this, + items: [ + { + el: (this.text = BI.createWidget(json)) + } + ] + }); + return; + } + if (o.whiteSpace == "normal") { + this.text = BI.createWidget(json); + BI.createWidget({ + type: "bi.vertical_adapt", + scrollable: o.whiteSpace === "normal", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + element: this, + items: [this.text] + }); + return; + } + if (BI.isNumber(o.height) && o.height > 0) { + this.element.css({ + "line-height": o.height + "px" + }); + BI.createWidget({ + type: "bi.absolute", + scrollable: o.whiteSpace === "normal", + element: this, + items: [{ + el: (this.text = BI.createWidget(json)), + left: o.hgap + o.lgap, + right: o.hgap + o.rgap, + top: o.vgap + o.tgap, + bottom: o.vgap + o.bgap + }] + }); + return; + } + json.width = o.width - 2 * o.hgap - o.lgap - o.rgap; + BI.createWidget({ + type: "bi.vertical_adapt", + scrollable: o.whiteSpace === "normal", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + element: this, + items: [{ + el: (this.text = BI.createWidget(json)) + }] + }); + return; + } + if (BI.isNumber(o.textWidth) && o.textWidth > 0) { + json.width = o.textWidth; + BI.createWidget({ + type: "bi.vertical_adapt", + scrollable: o.whiteSpace === "normal", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + element: this, + items: [ + { + el: (this.text = BI.createWidget(json)) + } + ] + }); + return; + } + if (o.whiteSpace == "normal") { + this.text = BI.createWidget(json) + this.text = BI.createWidget({ + type: "bi.vertical_adapt", + scrollable: o.whiteSpace === "normal", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + element: this, + items: [this.text] + }); + return; + } + if (BI.isNumber(o.height) && o.height > 0) { + if (BI.isNumber(o.textHeight) && o.textHeight > 0) { + this.element.css({ + "line-height": o.height + "px" + }); + BI.createWidget({ + type: "bi.adaptive", + height: o.height, + scrollable: o.whiteSpace === "normal", + element: this, + items: [{ + el: (this.text = BI.createWidget(json)), + left: o.hgap + o.lgap, + right: o.hgap + o.rgap, + top: o.vgap + o.tgap, + bottom: o.vgap + o.bgap + }] + }); + return; + } + BI.extend(json, { + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap + }); + this.element.css({ + "line-height": o.height + "px" + }); + this.text = BI.createWidget(BI.extend(json, { + element: this + })); + BI.createWidget({ + type: "bi.layout", + element: this.text, + scrollable: o.whiteSpace === "normal" + }); + return; + } + BI.extend(json, { + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap + }); + if (o.forceCenter) { + this.text = BI.createWidget(json); + BI.createWidget({ + type: "bi.vertical_adapt", + element: this, + items: [this.text] + }); + return; + } + this.text = BI.createWidget(BI.extend(json, { + element: this + })); + BI.createWidget({ + type: "bi.layout", + element: this.text, + scrollable: o.whiteSpace === "normal" + }) + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setText: function (v) { + this.options.text = v; + this.text.setText(v); + }, + + getText: function () { + return this.options.text; + }, + + setStyle: function (css) { + this.text.setStyle(css) + }, + + setValue: function (v) { + BI.Label.superclass.setValue.apply(this, arguments); + if (!this.isReadOnly()) { + this.text.setValue(v); + } + }, + + populate: function () { + BI.Label.superclass.populate.apply(this, arguments); + } +}); + +$.shortcut("bi.label", BI.Label);/** + * guy a元素 + * @class BI.Link + * @extends BI.Text + */ +BI.Link = BI.inherit(BI.Label, { + _defaultConfig: function() { + var conf = BI.Link.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-link", + href: "", + target: "_blank" + }) + }, + + _createJson: function(){ + var o = this.options; + return { + type:"bi.a", + textAlign: o.textAlign, + whiteSpace: o.whiteSpace, + lineHeight: o.textHeight, + text: o.text, + keyword: o.keyword, + value: o.value, + py: o.py, + href: o.href, + target: o.target + }; + }, + + _init : function() { + BI.Link.superclass._init.apply(this, arguments); + } +}); + +$.shortcut("bi.link", BI.Link);/** + * guy + * tip提示 + * zIndex在10亿级别 + * @class BI.Tip + * @extends BI.Single + * @abstract + */ +BI.Tip = BI.inherit(BI.Single, { + _defaultConfig: function() { + var conf = BI.Link.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-tip", + zIndex: BI.zIndex_tip + }) + }, + + _init : function() { + BI.Tip.superclass._init.apply(this, arguments); + this.element.css({"zIndex": this.options.zIndex}); + } +});/** + * 下拉 + * @class BI.Trigger + * @extends BI.Single + * @abstract + */ +BI.Trigger = BI.inherit(BI.Single, { + _defaultConfig: function() { + var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-trigger cursor-pointer", + height: 30 + }) + }, + + _init : function() { + BI.Trigger.superclass._init.apply(this, arguments); + }, + + setKey: function(){ + + }, + + getKey: function(){ + + } +});/** + * svg绘图 + * + * Created by GUY on 2015/12/3. + * @class BI.Svg + * @extends BI.Widget + */ +BI.Svg = BI.inherit(BI.Widget, { + + _defaultConfig: function () { + return BI.extend(BI.Svg.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-svg" + }) + }, + + _init: function () { + BI.Svg.superclass._init.apply(this, arguments); + this.paper = Raphael(this.element[0]); + + $(this.paper.canvas).width("100%").height("100%").css({"left": "0", "top": "0"}).appendTo(this.element); + + this.top = this.paper.top; + this.bottom = this.paper.bottom; + this.customAttributes = this.paper.customAttributes; + this.ca = this.paper.ca; + this.raphael = this.paper.raphael; + }, + + add: function () { + return this.paper.add.apply(this.paper, arguments); + }, + + path: function () { + return this.paper.path.apply(this.paper, arguments); + }, + + image: function () { + return this.paper.image.apply(this.paper, arguments); + }, + + rect: function () { + return this.paper.rect.apply(this.paper, arguments); + }, + + circle: function () { + return this.paper.circle.apply(this.paper, arguments); + }, + + ellipse: function () { + return this.paper.ellipse.apply(this.paper, arguments); + }, + + text: function () { + return this.paper.text.apply(this.paper, arguments); + }, + + print: function () { + return this.paper.print.apply(this.paper, arguments); + }, + + + setStart: function () { + return this.paper.setStart.apply(this.paper, arguments); + }, + + setFinish: function () { + return this.paper.setFinish.apply(this.paper, arguments); + }, + + setSize: function () { + return this.paper.setSize.apply(this.paper, arguments); + }, + + setViewBox: function () { + return this.paper.setViewBox.apply(this.paper, arguments); + }, + + + getById: function () { + return this.paper.getById.apply(this.paper, arguments); + }, + + getElementByPoint: function () { + return this.paper.getElementByPoint.apply(this.paper, arguments); + }, + + getElementsByPoint: function () { + return this.paper.getElementsByPoint.apply(this.paper, arguments); + }, + + getFont: function () { + return this.paper.getFont.apply(this.paper, arguments); + }, + + + set: function () { + return this.paper.set.apply(this.paper, arguments); + }, + remove: function () { + return this.paper.remove.apply(this.paper, arguments); + }, + clear: function () { + return this.paper.clear.apply(this.paper, arguments); + } +}); +$.shortcut("bi.svg", BI.Svg);/** + * + * 表格 + * + * Created by GUY on 2015/9/22. + * @class BI.TableCell + * @extends BI.Single + */ +BI.TableCell = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.TableCell.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-table-cell", + textAlign: "left", + text: "" + }) + }, + + _init: function () { + BI.TableCell.superclass._init.apply(this, arguments); + BI.createWidget({ + type: "bi.label", + element: this, + whiteSpace: "nowrap", + textAlign: this.options.textAlign, + height: this.options.height, + text: this.options.text, + value: this.options.value, + lgap: 5 + }) + } +}); + +$.shortcut("bi.table_cell", BI.TableCell);/** + * + * 表格单元格 + * + * Created by GUY on 2016/1/12. + * @class BI.CollectionTableCell + * @extends BI.Widget + */ +BI.CollectionTableCell = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.CollectionTableCell.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-collection-table-cell", + width: 0, + height: 0, + _left: 0, + _top: 0, + cell: {} + }) + }, + + _init: function () { + BI.CollectionTableCell.superclass._init.apply(this, arguments); + var o = this.options; + this.cell = BI.createWidget(BI.extend({ + type: "bi.label" + }, o.cell, { + cls: (o.cell.cls || "") + "collection-table-cell-wrapper", + width: o.width - (o._left === 0 ? 1 : 0) - 1, + height: o.height - (o._top === 0 ? 1 : 0) - 1 + })); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.cell, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }); + }, + + setWidth: function (width) { + BI.CollectionTableCell.superclass.setWidth.apply(this, arguments); + var o = this.options; + this.cell.setWidth(o.width - (o._left === 0 ? 1 : 0) - 1); + }, + + setHeight: function (height) { + BI.CollectionTableCell.superclass.setHeight.apply(this, arguments); + var o = this.options; + this.cell.setHeight(o.height - (o._top === 0 ? 1 : 0) - 1); + } +}); + +$.shortcut("bi.collection_table_cell", BI.CollectionTableCell);/** + * CollectionTable + * + * Created by GUY on 2016/1/12. + * @class BI.CollectionTable + * @extends BI.Widget + */ +BI.CollectionTable = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.CollectionTable.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-collection-table", + headerRowSize: 25, + rowSize: 25, + columnSize: [], + isNeedFreeze: false, + freezeCols: [], + isNeedMerge: false, + mergeCols: [], + mergeRule: BI.emptyFn, + header: [], + items: [], + regionColumnSize: [] + }); + }, + + _init: function () { + BI.CollectionTable.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this._width = 0; + this._height = 0; + this._scrollBarSize = BI.DOM.getScrollWidth(); + this.topLeftCollection = BI.createWidget({ + type: "bi.collection_view", + cellSizeAndPositionGetter: function (index) { + return self.topLeftItems[index]; + } + }); + this.topLeftCollection.on(BI.Collection.EVENT_SCROLL, function (scroll) { + self.bottomLeftCollection.setScrollLeft(scroll.scrollLeft); + self._populateScrollbar(); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.topRightCollection = BI.createWidget({ + type: "bi.collection_view", + cellSizeAndPositionGetter: function (index) { + return self.topRightItems[index]; + } + }); + this.topRightCollection.on(BI.Collection.EVENT_SCROLL, function (scroll) { + self.bottomRightCollection.setScrollLeft(scroll.scrollLeft); + self._populateScrollbar(); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.bottomLeftCollection = BI.createWidget({ + type: "bi.collection_view", + cellSizeAndPositionGetter: function (index) { + return self.bottomLeftItems[index]; + } + }); + this.bottomLeftCollection.on(BI.Collection.EVENT_SCROLL, function (scroll) { + self.bottomRightCollection.setScrollTop(scroll.scrollTop); + self.topLeftCollection.setScrollLeft(scroll.scrollLeft); + self._populateScrollbar(); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.bottomRightCollection = BI.createWidget({ + type: "bi.collection_view", + cellSizeAndPositionGetter: function (index) { + return self.bottomRightItems[index]; + } + }); + this.bottomRightCollection.on(BI.Collection.EVENT_SCROLL, function (scroll) { + self.bottomLeftCollection.setScrollTop(scroll.scrollTop); + self.topRightCollection.setScrollLeft(scroll.scrollLeft); + self._populateScrollbar(); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.topLeft = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.topLeftCollection] + }); + this.topRight = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.topRightCollection] + }); + this.bottomLeft = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.bottomLeftCollection] + }); + this.bottomRight = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.bottomRightCollection] + }); + this.contextLayout = BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.topLeft, + top: 0, + left: 0 + }, { + el: this.topRight, + top: 0 + }, { + el: this.bottomLeft, + left: 0 + }, { + el: this.bottomRight + }] + }); + + this.topScrollbar = BI.createWidget({ + type: "bi.grid_table_scrollbar", + width: BI.GridTableScrollbar.SIZE + }); + this.topScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function (scrollTop) { + self.bottomLeftCollection.setScrollTop(scrollTop); + self.bottomRightCollection.setScrollTop(scrollTop); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.leftScrollbar = BI.createWidget({ + type: "bi.grid_table_horizontal_scrollbar", + height: BI.GridTableScrollbar.SIZE + }); + this.leftScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function (scrollLeft) { + self.topLeftCollection.setScrollLeft(scrollLeft); + self.bottomLeftCollection.setScrollLeft(scrollLeft); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.rightScrollbar = BI.createWidget({ + type: "bi.grid_table_horizontal_scrollbar", + height: BI.GridTableScrollbar.SIZE + }); + this.rightScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function (scrollLeft) { + self.topRightCollection.setScrollLeft(scrollLeft); + self.bottomRightCollection.setScrollLeft(scrollLeft); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.scrollBarLayout = BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.topScrollbar, + right: 0, + top: 0 + }, { + el: this.leftScrollbar, + left: 0 + }, { + el: this.rightScrollbar, + }] + }); + this._width = o.width - BI.GridTableScrollbar.SIZE; + this._height = o.height - BI.GridTableScrollbar.SIZE; + if (o.items.length > 0 || o.header.length < 0) { + this._digest(); + this._populate(); + } + }, + + _getFreezeColLength: function () { + return this.options.isNeedFreeze ? this.options.freezeCols.length : 0; + }, + + _populateScrollbar: function () { + var o = this.options; + var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; + var freezeColLength = this._getFreezeColLength(); + BI.each(o.columnSize, function (i, size) { + if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { + totalLeftColumnSize += size; + } else { + totalRightColumnSize += size; + } + totalColumnSize += size; + if (i === 0) { + summaryColumnSizeArray[i] = size; + } else { + summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; + } + }); + this.topScrollbar.setContentSize(o.items.length * o.rowSize); + this.topScrollbar.setSize(this._height - o.header.length * o.headerRowSize); + this.topScrollbar.setPosition(this.bottomRightCollection.getScrollTop()); + this.topScrollbar.populate(); + + this.leftScrollbar.setContentSize(totalLeftColumnSize); + this.leftScrollbar.setSize(regionSize); + this.leftScrollbar.setPosition(this.bottomLeftCollection.getScrollLeft()); + this.leftScrollbar.populate(); + + this.rightScrollbar.setContentSize(totalRightColumnSize); + this.rightScrollbar.setSize(this._width - regionSize); + this.rightScrollbar.setPosition(this.bottomRightCollection.getScrollLeft()); + this.rightScrollbar.populate(); + + var items = this.scrollBarLayout.attr("items"); + items[0].top = o.header.length * o.headerRowSize; + items[1].top = this._height; + items[2].top = this._height; + items[2].left = regionSize; + this.scrollBarLayout.attr("items", items); + this.scrollBarLayout.resize(); + }, + + _populateTable: function () { + var self = this, o = this.options; + var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; + var freezeColLength = this._getFreezeColLength(); + BI.each(o.columnSize, function (i, size) { + if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { + totalLeftColumnSize += size; + } else { + totalRightColumnSize += size; + } + totalColumnSize += size; + if (i === 0) { + summaryColumnSizeArray[i] = size; + } else { + summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; + } + }); + + var tlw = regionSize; + var tlh = regionSize >= summaryColumnSizeArray[freezeColLength - 1] ? (o.header.length * o.headerRowSize) : (o.header.length * o.headerRowSize + this._scrollBarSize); + var trw = this._width - regionSize; + var trh = (this._width - regionSize >= totalColumnSize - (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (o.header.length * o.headerRowSize) : (o.header.length * o.headerRowSize + this._scrollBarSize); + var blw = (this._height - o.header.length * o.headerRowSize >= totalRowSize) ? regionSize : (regionSize + this._scrollBarSize); + var blh = (regionSize >= (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (this._height - o.header.length * o.headerRowSize) : (this._height - o.header.length * o.headerRowSize + this._scrollBarSize); + var brw = (this._height - o.header.length * o.headerRowSize >= totalRowSize) ? (this._width - regionSize) : (this._width - regionSize + this._scrollBarSize); + var brh = (this._width - regionSize >= totalColumnSize - (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (this._height - o.header.length * o.headerRowSize) : (this._height - o.header.length * o.headerRowSize + this._scrollBarSize); + + var otlw = regionSize; + var otlh = o.header.length * o.headerRowSize; + var otrw = this._width - regionSize; + var otrh = o.header.length * o.headerRowSize; + var oblw = regionSize; + var oblh = this._height - o.header.length * o.headerRowSize; + var obrw = this._width - regionSize; + var obrh = this._height - o.header.length * o.headerRowSize; + + var digest = function (w, h, tw, th, el) { + if (w >= tw && h >= th) { + el.element.css({ + overflow: "hidden", + overflowX: "hidden", + overflowY: "hidden" + }) + } else if (w >= tw) { + el.element.css({ + overflow: "hidden", + overflowX: "hidden", + overflowY: "auto" + }) + } else if (h >= th) { + el.element.css({ + overflow: "hidden", + overflowX: "auto", + overflowY: "hidden" + }) + } else { + el.element.css({ + overflow: "auto", + overflowX: "auto", + overflowY: "auto" + }) + } + }; + + this.topLeft.setWidth(otlw); + this.topLeft.setHeight(otlh); + this.topRight.setWidth(otrw); + this.topRight.setHeight(otrh); + this.bottomLeft.setWidth(oblw); + this.bottomLeft.setHeight(oblh); + this.bottomRight.setWidth(obrw); + this.bottomRight.setHeight(obrh); + + this.topLeftCollection.setWidth(tlw); + this.topLeftCollection.setHeight(tlh); + this.topRightCollection.setWidth(trw); + this.topRightCollection.setHeight(trh); + this.bottomLeftCollection.setWidth(blw); + this.bottomLeftCollection.setHeight(blh); + this.bottomRightCollection.setWidth(brw); + this.bottomRightCollection.setHeight(brh); + + digest(tlw, tlh, totalLeftColumnSize, o.header.length * o.headerRowSize, this.topLeftCollection); + digest(trw, trh, totalRightColumnSize, o.header.length * o.headerRowSize, this.topRightCollection); + digest(blw, blh, totalLeftColumnSize, o.items.length * o.rowSize, this.bottomLeftCollection); + digest(brw, brh, totalRightColumnSize, o.items.length * o.rowSize, this.bottomRightCollection); + + var items = this.contextLayout.attr("items"); + items[1].left = regionSize; + items[2].top = o.header.length * o.headerRowSize; + items[3].left = regionSize; + items[3].top = o.header.length * o.headerRowSize; + this.contextLayout.attr("items", items); + this.contextLayout.resize(); + + var leftHeader = [], rightHeader = [], leftItems = [], rightItems = []; + var run = function (positions, items, rendered) { + BI.each(positions, function (i, item) { + var cell = { + type: "bi.collection_table_cell", + cell: items[item.row][item.col] + }; + rendered.push(cell); + }); + }; + run(this.topLeftItems, o.header, leftHeader); + run(this.topRightItems, o.header, rightHeader); + run(this.bottomLeftItems, o.items, leftItems); + run(this.bottomRightItems, o.items, rightItems); + + this.topLeftCollection.populate(leftHeader); + this.topRightCollection.populate(rightHeader); + this.bottomLeftCollection.populate(leftItems); + this.bottomRightCollection.populate(rightItems); + }, + + _digest: function () { + var o = this.options; + var freezeColLength = this._getFreezeColLength(); + this.topLeftItems = this._serialize(o.header, 0, freezeColLength, o.headerRowSize, o.columnSize, o.mergeCols); + this.topRightItems = this._serialize(o.header, freezeColLength, o.columnSize.length, o.headerRowSize, o.columnSize, true); + this.bottomLeftItems = this._serialize(o.items, 0, freezeColLength, o.rowSize, o.columnSize, o.mergeCols); + this.bottomRightItems = this._serialize(o.items, freezeColLength, o.columnSize.length, o.rowSize, o.columnSize, o.mergeCols); + }, + + _serialize: function (items, startCol, endCol, rowHeight, columnSize, mergeCols) { + var self = this, o = this.options; + var result = [], cache = {}, preCol = {}, preRow = {}, map = {}; + var summaryColumnSize = []; + for (var i = startCol; i < endCol; i++) { + if (i === startCol) { + summaryColumnSize[i] = columnSize[i]; + } else { + summaryColumnSize[i] = summaryColumnSize[i - 1] + columnSize[i]; + } + } + var mergeRow = function (i, j) { + preCol[j]._height += rowHeight; + preCol[j].__mergeRows.push(i); + }; + + var mergeCol = function (i, j) { + preRow[i]._width += columnSize[j]; + preRow[i].__mergeCols.push(j); + }; + + var createOneEl = function (r, c) { + var width = columnSize[c]; + var height = rowHeight; + map[r][c]._row = r; + map[r][c]._col = c; + map[r][c]._width = width; + map[r][c]._height = height; + preCol[c] = map[r][c]; + preCol[c].__mergeRows = [r]; + preRow[r] = map[r][c]; + preRow[r].__mergeCols = [c]; + + result.push({ + x: summaryColumnSize[c] - columnSize[c], + y: +r * rowHeight, + item: map[r][c] + }); + }; + + BI.each(items, function (i, cols) { + for (var j = startCol; j < endCol; j++) { + if (!cache[i]) { + cache[i] = {}; + } + if (!map[i]) { + map[i] = {}; + } + cache[i][j] = cols[j]; + map[i][j] = {}; + if (mergeCols === true || mergeCols.indexOf(j) > -1) { + if (i === 0 && j === startCol) { + createOneEl(0, startCol); + } else if (j === startCol && i > 0) { + var isNeedMergeRow = o.mergeRule(cache[i][j], cache[i - 1][j]); + if (isNeedMergeRow === true) { + mergeRow(i, j); + preRow[i] = preCol[j]; + } else { + createOneEl(i, j); + } + } else if (i === 0 && j > startCol) { + var isNeedMergeCol = o.mergeRule(cache[i][j], cache[i][j - 1]); + if (isNeedMergeCol === true) { + mergeCol(i, j); + preCol[j] = preRow[i]; + } else { + createOneEl(i, j); + } + } else { + var isNeedMergeRow = o.mergeRule(cache[i][j], cache[i - 1][j]); + var isNeedMergeCol = o.mergeRule(cache[i][j], cache[i][j - 1]); + if (isNeedMergeCol && isNeedMergeRow) { + continue; + //mergeRow(i, j);//优先合并列 + } + if (isNeedMergeCol) { + mergeCol(i, j); + } + if (isNeedMergeRow) { + mergeRow(i, j); + } + if (!isNeedMergeCol && !isNeedMergeRow) { + createOneEl(i, j); + } + } + } else { + createOneEl(i, j); + } + } + }); + return BI.map(result, function (i, item) { + return { + x: item.x, + y: item.y, + row: item.item._row, + col: item.item._col, + width: item.item._width, + height: item.item._height + } + }); + }, + + _populate: function () { + if (this._width <= 0 || this._height <= 0) { + return; + } + if (this._isNeedDigest === true) { + this._digest(); + } + this._populateTable(); + this._populateScrollbar(); + }, + + getRegionSize: function () { + var o = this.options; + var regionSize = o.regionColumnSize[0] || 0; + if (o.isNeedFreeze === false || o.freezeCols.length === 0) { + return 0; + } + if (!regionSize) { + BI.each(o.freezeCols, function (i, col) { + regionSize += o.columnSize[col]; + }); + } + return regionSize; + }, + + setVerticalScroll: function (scrollTop) { + this.bottomLeftCollection.setScrollTop(scrollTop); + this.bottomRightCollection.setScrollTop(scrollTop); + }, + + setLeftHorizontalScroll: function (scrollLeft) { + this.topLeftCollection.setScrollLeft(scrollLeft); + this.bottomLeftCollection.setScrollLeft(scrollLeft); + }, + + setRightHorizontalScroll: function (scrollLeft) { + this.topRightCollection.setScrollLeft(scrollLeft); + this.bottomRightCollection.setScrollLeft(scrollLeft); + }, + + getVerticalScroll: function () { + return this.bottomRightCollection.getScrollTop(); + }, + + getLeftHorizontalScroll: function () { + return this.bottomLeftCollection.getScrollLeft(); + }, + + getRightHorizontalScroll: function () { + return this.bottomRightCollection.getScrollLeft(); + }, + + setWidth: function (width) { + BI.CollectionTable.superclass.setWidth.apply(this, arguments); + this._width = this.options.width - BI.GridTableScrollbar.SIZE; + }, + + setHeight: function (height) { + BI.CollectionTable.superclass.setHeight.apply(this, arguments); + this._height = this.options.height - BI.GridTableScrollbar.SIZE; + }, + + setColumnSize: function (columnSize) { + this._isNeedDigest = true; + this.options.columnSize = columnSize; + }, + + setRegionColumnSize: function (regionColumnSize) { + this._isNeedDigest = true; + this.options.regionColumnSize = regionColumnSize; + }, + + getColumnSize: function () { + return this.options.columnSize; + }, + + getRegionColumnSize: function () { + return this.options.regionColumnSize; + }, + + populate: function (items, header) { + if (items && items !== this.options.items) { + this._isNeedDigest = true; + this.options.items = items; + this._restore(); + } + if (header && header !== this.options.header) { + this._isNeedDigest = true; + this.options.header = header; + this._restore(); + } + this._populate(); + }, + + _restore: function () { + this.topLeftCollection.restore(); + this.topRightCollection.restore(); + this.bottomLeftCollection.restore(); + this.bottomRightCollection.restore(); + }, + + restore: function () { + this._restore(); + } +}); +$.shortcut('bi.collection_table', BI.CollectionTable);/** + * QuickCollectionTable + * + * Created by GUY on 2016/1/12. + * @class BI.QuickCollectionTable + * @extends BI.CollectionTable + */ +BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, { + _defaultConfig: function () { + return BI.extend(BI.QuickCollectionTable.superclass._defaultConfig.apply(this, arguments), { + extraCls: "bi-quick-collection-table" + }); + }, + + _init: function () { + BI.QuickCollectionTable.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.topLeftCollection.setOverflowX(false); + this.topLeftCollection.setOverflowY(false); + this.topRightCollection.setOverflowX(false); + this.topRightCollection.setOverflowY(false); + this.bottomLeftCollection.setOverflowX(false); + this.bottomLeftCollection.setOverflowY(false); + this.bottomRightCollection.setOverflowX(false); + this.bottomRightCollection.setOverflowY(false); + this._leftWheelHandler = new BI.WheelHandler( + BI.bind(this._onWheelY, this), + BI.bind(this._shouldHandleX, this), + BI.bind(this._shouldHandleY, this) + ); + this._rightWheelHandler = new BI.WheelHandler( + BI.bind(this._onWheelY, this), + BI.bind(this._shouldHandleX, this), + BI.bind(this._shouldHandleY, this) + ); + this.bottomLeftCollection.element.mousewheel(function (e) { + self._leftWheelHandler.onWheel(e.originalEvent); + }); + this.bottomRightCollection.element.mousewheel(function (e) { + self._rightWheelHandler.onWheel(e.originalEvent); + }); + }, + + _shouldHandleX: function (delta) { + return false; + }, + + _shouldHandleY: function (delta) { + if (delta > 0) { + return this.bottomRightCollection.getScrollTop() < this.bottomRightCollection.getMaxScrollTop(); + } else { + return this.bottomRightCollection.getScrollTop() > 0; + } + }, + + _onWheelY: function (deltaX, deltaY) { + var self = this; + var scrollTop = this.bottomRightCollection.getScrollTop(); + scrollTop += deltaY; + this.bottomLeftCollection.setScrollTop(scrollTop); + this.bottomRightCollection.setScrollTop(scrollTop); + self._populateScrollbar(); + this.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }, + + _populateTable: function () { + var self = this, o = this.options; + var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; + var freezeColLength = this._getFreezeColLength(); + BI.each(o.columnSize, function (i, size) { + if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { + totalLeftColumnSize += size; + } else { + totalRightColumnSize += size; + } + totalColumnSize += size; + if (i === 0) { + summaryColumnSizeArray[i] = size; + } else { + summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; + } + }); + + var otlw = regionSize; + var otlh = o.header.length * o.headerRowSize; + var otrw = this._width - regionSize; + var otrh = o.header.length * o.headerRowSize; + var oblw = regionSize; + var oblh = this._height - o.header.length * o.headerRowSize; + var obrw = this._width - regionSize; + var obrh = this._height - o.header.length * o.headerRowSize; + + this.topLeft.setWidth(otlw); + this.topLeft.setHeight(otlh); + this.topRight.setWidth(otrw); + this.topRight.setHeight(otrh); + this.bottomLeft.setWidth(oblw); + this.bottomLeft.setHeight(oblh); + this.bottomRight.setWidth(obrw); + this.bottomRight.setHeight(obrh); + + this.topLeftCollection.setWidth(otlw); + this.topLeftCollection.setHeight(otlh); + this.topRightCollection.setWidth(otrw); + this.topRightCollection.setHeight(otrh); + this.bottomLeftCollection.setWidth(oblw); + this.bottomLeftCollection.setHeight(oblh); + this.bottomRightCollection.setWidth(obrw); + this.bottomRightCollection.setHeight(obrh); + + var items = this.contextLayout.attr("items"); + items[1].left = regionSize; + items[2].top = o.header.length * o.headerRowSize; + items[3].left = regionSize; + items[3].top = o.header.length * o.headerRowSize; + this.contextLayout.attr("items", items); + this.contextLayout.resize(); + + var leftHeader = [], rightHeader = [], leftItems = [], rightItems = []; + var run = function (positions, items, rendered) { + BI.each(positions, function (i, item) { + var cell = { + type: "bi.collection_table_cell", + cell: items[item.row][item.col] + }; + rendered.push(cell); + }); + }; + run(this.topLeftItems, o.header, leftHeader); + run(this.topRightItems, o.header, rightHeader); + run(this.bottomLeftItems, o.items, leftItems); + run(this.bottomRightItems, o.items, rightItems); + + this.topLeftCollection.populate(leftHeader); + this.topRightCollection.populate(rightHeader); + this.bottomLeftCollection.populate(leftItems); + this.bottomRightCollection.populate(rightItems); + } +}); +$.shortcut('bi.quick_collection_table', BI.QuickCollectionTable);/** + * + * 表格单元格 + * + * Created by GUY on 2016/1/12. + * @class BI.GridTableCell + * @extends BI.Widget + */ +BI.GridTableCell = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.GridTableCell.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-grid-table-cell", + width: 0, + height: 0, + _rowIndex: 0, + _columnIndex: 0, + _left: 0, + _top: 0, + cell: {} + }) + }, + + _init: function () { + BI.GridTableCell.superclass._init.apply(this, arguments); + var o = this.options; + this.cell = BI.createWidget(BI.extend({ + type: "bi.label" + }, o.cell, { + cls: (o.cell.cls || "") + "grid-table-cell-wrapper", + width: o.width - (o._columnIndex === 0 ? 1 : 0) - 1, + height: o.height - (o._rowIndex === 0 ? 1 : 0) - 1 + })); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.cell, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }); + }, + + setWidth: function (width) { + BI.GridTableCell.superclass.setWidth.apply(this, arguments); + var o = this.options; + this.cell.setWidth(o.width - (o._columnIndex === 0 ? 1 : 0) - 1); + }, + + setHeight: function (height) { + BI.GridTableCell.superclass.setHeight.apply(this, arguments); + var o = this.options; + this.cell.setHeight(o.height - (o._rowIndex === 0 ? 1 : 0) - 1); + } +}); + +$.shortcut("bi.grid_table_cell", BI.GridTableCell);/** + * GridTable + * + * Created by GUY on 2016/1/12. + * @class BI.GridTable + * @extends BI.Widget + */ +BI.GridTable = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.GridTable.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-grid-table", + headerRowSize: 25, + rowSize: 25, + columnSize: [], + isNeedFreeze: false, + freezeCols: [], + header: [], + items: [], + regionColumnSize: [] + }); + }, + + _init: function () { + BI.GridTable.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this._width = 0; + this._height = 0; + this._scrollBarSize = BI.DOM.getScrollWidth(); + var rowHeightGetter = function () { + return o.rowSize; + }; + var columnLeftWidthGetter = function (index) { + return o.columnSize[index]; + }; + var columnRightWidthGetter = function (index) { + return o.columnSize[index + self._getFreezeColLength()]; + }; + this.topLeftGrid = BI.createWidget({ + type: "bi.grid_view", + rowHeightGetter: rowHeightGetter, + columnWidthGetter: columnLeftWidthGetter, + }); + this.topLeftGrid.on(BI.Grid.EVENT_SCROLL, function (scroll) { + self.bottomLeftGrid.setScrollLeft(scroll.scrollLeft); + self._populateScrollbar(); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.topRightGrid = BI.createWidget({ + type: "bi.grid_view", + rowHeightGetter: rowHeightGetter, + columnWidthGetter: columnRightWidthGetter, + }); + this.topRightGrid.on(BI.Grid.EVENT_SCROLL, function (scroll) { + self.bottomRightGrid.setScrollLeft(scroll.scrollLeft); + self._populateScrollbar(); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.bottomLeftGrid = BI.createWidget({ + type: "bi.grid_view", + rowHeightGetter: rowHeightGetter, + columnWidthGetter: columnLeftWidthGetter, + }); + this.bottomLeftGrid.on(BI.Grid.EVENT_SCROLL, function (scroll) { + self.bottomRightGrid.setScrollTop(scroll.scrollTop); + self.topLeftGrid.setScrollLeft(scroll.scrollLeft); + self._populateScrollbar(); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.bottomRightGrid = BI.createWidget({ + type: "bi.grid_view", + rowHeightGetter: rowHeightGetter, + columnWidthGetter: columnRightWidthGetter, + }); + this.bottomRightGrid.on(BI.Grid.EVENT_SCROLL, function (scroll) { + self.bottomLeftGrid.setScrollTop(scroll.scrollTop); + self.topRightGrid.setScrollLeft(scroll.scrollLeft); + self._populateScrollbar(); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.topLeft = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.topLeftGrid] + }); + this.topRight = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.topRightGrid] + }); + this.bottomLeft = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.bottomLeftGrid] + }); + this.bottomRight = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.bottomRightGrid] + }); + this.contextLayout = BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.topLeft, + top: 0, + left: 0 + }, { + el: this.topRight, + top: 0 + }, { + el: this.bottomLeft, + left: 0 + }, { + el: this.bottomRight + }] + }); + + this.topScrollbar = BI.createWidget({ + type: "bi.grid_table_scrollbar", + width: BI.GridTableScrollbar.SIZE + }); + this.topScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function (scrollTop) { + self.bottomLeftGrid.setScrollTop(scrollTop); + self.bottomRightGrid.setScrollTop(scrollTop); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.leftScrollbar = BI.createWidget({ + type: "bi.grid_table_horizontal_scrollbar", + height: BI.GridTableScrollbar.SIZE + }); + this.leftScrollbar.on(BI.GridTableHorizontalScrollbar.EVENT_SCROLL, function (scrollLeft) { + self.topLeftGrid.setScrollLeft(scrollLeft); + self.bottomLeftGrid.setScrollLeft(scrollLeft); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.rightScrollbar = BI.createWidget({ + type: "bi.grid_table_horizontal_scrollbar", + height: BI.GridTableScrollbar.SIZE + }); + this.rightScrollbar.on(BI.GridTableHorizontalScrollbar.EVENT_SCROLL, function (scrollLeft) { + self.topRightGrid.setScrollLeft(scrollLeft); + self.bottomRightGrid.setScrollLeft(scrollLeft); + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }); + this.scrollBarLayout = BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.topScrollbar, + right: 0, + top: 0 + }, { + el: this.leftScrollbar, + left: 0 + }, { + el: this.rightScrollbar, + }] + }); + this._width = o.width - BI.GridTableScrollbar.SIZE; + this._height = o.height - BI.GridTableScrollbar.SIZE; + this.header = this._getHeader(); + this.items = this._getItems(); + if (o.items.length > 0) { + this._populate(); + } + }, + + _getFreezeColLength: function () { + return this.options.isNeedFreeze ? this.options.freezeCols.length : 0; + }, + + _populateScrollbar: function () { + var o = this.options; + var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; + var freezeColLength = this._getFreezeColLength(); + BI.each(o.columnSize, function (i, size) { + if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { + totalLeftColumnSize += size; + } else { + totalRightColumnSize += size; + } + totalColumnSize += size; + if (i === 0) { + summaryColumnSizeArray[i] = size; + } else { + summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; + } + }); + this.topScrollbar.setContentSize(o.items.length * o.rowSize); + this.topScrollbar.setSize(this._height - o.header.length * o.headerRowSize); + this.topScrollbar.setPosition(Math.min(this.bottomLeftGrid.getScrollTop(), this.bottomRightGrid.getScrollTop())); + this.topScrollbar.populate(); + + this.leftScrollbar.setContentSize(totalLeftColumnSize); + this.leftScrollbar.setSize(regionSize); + this.leftScrollbar.setPosition(this.bottomLeftGrid.getScrollLeft()); + this.leftScrollbar.populate(); + + this.rightScrollbar.setContentSize(totalRightColumnSize); + this.rightScrollbar.setSize(this._width - regionSize); + this.rightScrollbar.setPosition(this.bottomRightGrid.getScrollLeft()); + this.rightScrollbar.populate(); + + var items = this.scrollBarLayout.attr("items"); + items[0].top = o.header.length * o.headerRowSize; + items[1].top = this._height; + items[2].top = this._height; + items[2].left = regionSize; + this.scrollBarLayout.attr("items", items); + this.scrollBarLayout.resize(); + }, + + _getHeader: function () { + var o = this.options; + var freezeColLength = this._getFreezeColLength(); + var leftHeader = [], rightHeader = []; + BI.each(o.header, function (i, cols) { + leftHeader[i] = []; + rightHeader[i] = []; + BI.each(cols, function (j, col) { + var cell = { + type: "bi.grid_table_cell", + cell: col + }; + if (j < freezeColLength) { + leftHeader[i].push(cell); + } else { + rightHeader[i].push(cell); + } + }); + }); + return [leftHeader, rightHeader]; + }, + + _getItems: function () { + var o = this.options; + var freezeColLength = this._getFreezeColLength(); + var leftItems = [], rightItems = []; + BI.each(o.items, function (i, cols) { + leftItems[i] = []; + rightItems[i] = []; + BI.each(cols, function (j, col) { + var cell = { + type: "bi.grid_table_cell", + cell: col + }; + if (j < freezeColLength) { + leftItems[i].push(cell); + } else { + rightItems[i].push(cell); + } + }); + }); + return [leftItems, rightItems]; + }, + + _populateTable: function () { + var self = this, o = this.options; + var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; + var freezeColLength = this._getFreezeColLength(); + BI.each(o.columnSize, function (i, size) { + if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { + totalLeftColumnSize += size; + } else { + totalRightColumnSize += size; + } + totalColumnSize += size; + if (i === 0) { + summaryColumnSizeArray[i] = size; + } else { + summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; + } + }); + + var tlw = regionSize; + var tlh = regionSize >= summaryColumnSizeArray[freezeColLength - 1] ? (o.header.length * o.headerRowSize) : (o.header.length * o.headerRowSize + this._scrollBarSize); + var trw = this._width - regionSize; + var trh = (this._width - regionSize >= totalColumnSize - (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (o.header.length * o.headerRowSize) : (o.header.length * o.headerRowSize + this._scrollBarSize); + var blw = (this._height - o.header.length * o.headerRowSize >= totalRowSize) ? regionSize : (regionSize + this._scrollBarSize); + var blh = (regionSize >= (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (this._height - o.header.length * o.headerRowSize) : (this._height - o.header.length * o.headerRowSize + this._scrollBarSize); + var brw = (this._height - o.header.length * o.headerRowSize >= totalRowSize) ? (this._width - regionSize) : (this._width - regionSize + this._scrollBarSize); + var brh = (this._width - regionSize >= totalColumnSize - (summaryColumnSizeArray[freezeColLength - 1] || 0)) ? (this._height - o.header.length * o.headerRowSize) : (this._height - o.header.length * o.headerRowSize + this._scrollBarSize); + + var otlw = regionSize; + var otlh = o.header.length * o.headerRowSize; + var otrw = this._width - regionSize; + var otrh = o.header.length * o.headerRowSize; + var oblw = regionSize; + var oblh = this._height - o.header.length * o.headerRowSize; + var obrw = this._width - regionSize; + var obrh = this._height - o.header.length * o.headerRowSize; + + var digest = function (w, h, tw, th, el) { + if (w >= tw && h >= th) { + el.element.css({ + overflow: "hidden", + overflowX: "hidden", + overflowY: "hidden" + }) + } else if (w >= tw) { + el.element.css({ + overflow: "hidden", + overflowX: "hidden", + overflowY: "auto" + }) + } else if (h >= th) { + el.element.css({ + overflow: "hidden", + overflowX: "auto", + overflowY: "hidden" + }) + } else { + el.element.css({ + overflow: "auto", + overflowX: "auto", + overflowY: "auto" + }) + } + }; + + this.topLeft.setWidth(otlw); + this.topLeft.setHeight(otlh); + this.topRight.setWidth(otrw); + this.topRight.setHeight(otrh); + this.bottomLeft.setWidth(oblw); + this.bottomLeft.setHeight(oblh); + this.bottomRight.setWidth(obrw); + this.bottomRight.setHeight(obrh); + + this.topLeftGrid.setWidth(tlw); + this.topLeftGrid.setHeight(tlh); + this.topRightGrid.setWidth(trw); + this.topRightGrid.setHeight(trh); + this.bottomLeftGrid.setWidth(blw); + this.bottomLeftGrid.setHeight(blh); + this.bottomRightGrid.setWidth(brw); + this.bottomRightGrid.setHeight(brh); + + digest(tlw, tlh, totalLeftColumnSize, o.header.length * o.headerRowSize, this.topLeftGrid); + digest(trw, trh, totalRightColumnSize, o.header.length * o.headerRowSize, this.topRightGrid); + digest(blw, blh, totalLeftColumnSize, o.items.length * o.rowSize, this.bottomLeftGrid); + digest(brw, brh, totalRightColumnSize, o.items.length * o.rowSize, this.bottomRightGrid); + + this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); + this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); + this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); + this.topRightGrid.setEstimatedRowSize(o.headerRowSize); + this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); + this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); + this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); + this.bottomRightGrid.setEstimatedRowSize(o.rowSize); + + var items = this.contextLayout.attr("items"); + items[1].left = regionSize; + items[2].top = o.header.length * o.headerRowSize; + items[3].left = regionSize; + items[3].top = o.header.length * o.headerRowSize; + this.contextLayout.attr("items", items); + this.contextLayout.resize(); + + this.topLeftGrid.populate(this.header[0]); + this.topRightGrid.populate(this.header[1]); + this.bottomLeftGrid.populate(this.items[0]); + this.bottomRightGrid.populate(this.items[1]); + }, + + _populate: function () { + if (this._width <= 0 || this._height <= 0) { + return; + } + this._populateTable(); + this._populateScrollbar(); + }, + + getRegionSize: function () { + var o = this.options; + var regionSize = o.regionColumnSize[0] || 0; + if (o.isNeedFreeze === false || o.freezeCols.length === 0) { + return 0; + } + if (!regionSize) { + BI.each(o.freezeCols, function (i, col) { + regionSize += o.columnSize[col]; + }); + } + return regionSize; + }, + + setVerticalScroll: function (scrollTop) { + this.bottomLeftGrid.setScrollTop(scrollTop); + this.bottomRightGrid.setScrollTop(scrollTop); + }, + + setLeftHorizontalScroll: function (scrollLeft) { + this.topLeftGrid.setScrollLeft(scrollLeft); + this.bottomLeftGrid.setScrollLeft(scrollLeft); + }, + + setRightHorizontalScroll: function (scrollLeft) { + this.topRightGrid.setScrollLeft(scrollLeft); + this.bottomRightGrid.setScrollLeft(scrollLeft); + }, + + getVerticalScroll: function () { + return this.bottomRightGrid.getScrollTop(); + }, + + getLeftHorizontalScroll: function () { + return this.bottomLeftGrid.getScrollLeft(); + }, + + getRightHorizontalScroll: function () { + return this.bottomRightGrid.getScrollLeft(); + }, + + setWidth: function (width) { + BI.GridTable.superclass.setWidth.apply(this, arguments); + this._width = this.options.width - BI.GridTableScrollbar.SIZE; + }, + + setHeight: function (height) { + BI.GridTable.superclass.setHeight.apply(this, arguments); + this._height = this.options.height - BI.GridTableScrollbar.SIZE; + }, + + setColumnSize: function (columnSize) { + this.options.columnSize = columnSize; + }, + + setRegionColumnSize: function (regionColumnSize) { + this.options.regionColumnSize = regionColumnSize; + }, + + getColumnSize: function () { + return this.options.columnSize; + }, + + getRegionColumnSize: function () { + return this.options.regionColumnSize; + }, + + populate: function (items, header) { + if (items && this.options.items !== items) { + this.options.items = items; + this.items = this._getItems(); + this._restore(); + } + if (header && this.options.header !== header) { + this.options.header = header; + this.header = this._getHeader(); + this._restore(); + } + this._populate(); + }, + + _restore: function () { + this.topLeftGrid.restore(); + this.topRightGrid.restore(); + this.bottomLeftGrid.restore(); + this.bottomRightGrid.restore(); + }, + + restore: function () { + this._restore(); + } +}); +$.shortcut('bi.grid_table', BI.GridTable);/** + * QuickGridTable + * + * Created by GUY on 2016/1/12. + * @class BI.QuickGridTable + * @extends BI.GridTable + */ +BI.QuickGridTable = BI.inherit(BI.GridTable, { + _defaultConfig: function () { + return BI.extend(BI.QuickGridTable.superclass._defaultConfig.apply(this, arguments), { + extraCls: "bi-quick-grid-table" + }); + }, + + _init: function () { + BI.QuickGridTable.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.topLeftGrid.setOverflowX(false); + this.topLeftGrid.setOverflowY(false); + this.topRightGrid.setOverflowX(false); + this.topRightGrid.setOverflowY(false); + this.bottomLeftGrid.setOverflowX(false); + this.bottomLeftGrid.setOverflowY(false); + this.bottomRightGrid.setOverflowX(false); + this.bottomRightGrid.setOverflowY(false); + this._leftWheelHandler = new BI.WheelHandler( + BI.bind(this._onWheelY, this), + BI.bind(this._shouldHandleX, this), + BI.bind(this._shouldHandleY, this) + ); + this._rightWheelHandler = new BI.WheelHandler( + BI.bind(this._onWheelY, this), + BI.bind(this._shouldHandleX, this), + BI.bind(this._shouldHandleY, this) + ); + this.bottomLeftGrid.element.mousewheel(function (e) { + self._leftWheelHandler.onWheel(e.originalEvent); + }); + this.bottomRightGrid.element.mousewheel(function (e) { + self._rightWheelHandler.onWheel(e.originalEvent); + }); + }, + + _shouldHandleX: function (delta) { + return false; + }, + + _shouldHandleY: function (delta) { + if (delta > 0) { + return this.bottomRightGrid.getScrollTop() < this.bottomRightGrid.getMaxScrollTop(); + } else { + return this.bottomRightGrid.getScrollTop() > 0; + } + }, + + _onWheelY: function (deltaX, deltaY) { + var self = this; + var scrollTop = this.bottomRightGrid.getScrollTop(); + scrollTop += deltaY; + this.bottomLeftGrid.setScrollTop(scrollTop); + this.bottomRightGrid.setScrollTop(scrollTop); + self._populateScrollbar(); + this.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + }, + + _populateTable: function () { + var self = this, o = this.options; + var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize; + var freezeColLength = this._getFreezeColLength(); + BI.each(o.columnSize, function (i, size) { + if (o.isNeedFreeze === true && o.freezeCols.contains(i)) { + totalLeftColumnSize += size; + } else { + totalRightColumnSize += size; + } + totalColumnSize += size; + if (i === 0) { + summaryColumnSizeArray[i] = size; + } else { + summaryColumnSizeArray[i] = summaryColumnSizeArray[i - 1] + size; + } + }); + + var otlw = regionSize; + var otlh = o.header.length * o.headerRowSize; + var otrw = this._width - regionSize; + var otrh = o.header.length * o.headerRowSize; + var oblw = regionSize; + var oblh = this._height - o.header.length * o.headerRowSize; + var obrw = this._width - regionSize; + var obrh = this._height - o.header.length * o.headerRowSize; + + this.topLeft.setWidth(otlw); + this.topLeft.setHeight(otlh); + this.topRight.setWidth(otrw); + this.topRight.setHeight(otrh); + this.bottomLeft.setWidth(oblw); + this.bottomLeft.setHeight(oblh); + this.bottomRight.setWidth(obrw); + this.bottomRight.setHeight(obrh); + + this.topLeftGrid.setWidth(otlw); + this.topLeftGrid.setHeight(otlh); + this.topRightGrid.setWidth(otrw); + this.topRightGrid.setHeight(otrh); + this.bottomLeftGrid.setWidth(oblw); + this.bottomLeftGrid.setHeight(oblh); + this.bottomRightGrid.setWidth(obrw); + this.bottomRightGrid.setHeight(obrh); + + this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); + this.topLeftGrid.setEstimatedRowSize(o.headerRowSize); + this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); + this.topRightGrid.setEstimatedRowSize(o.headerRowSize); + this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0); + this.bottomLeftGrid.setEstimatedRowSize(o.rowSize); + this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength)); + this.bottomRightGrid.setEstimatedRowSize(o.rowSize); + + var items = this.contextLayout.attr("items"); + items[1].left = regionSize; + items[2].top = o.header.length * o.headerRowSize; + items[3].left = regionSize; + items[3].top = o.header.length * o.headerRowSize; + this.contextLayout.attr("items", items); + this.contextLayout.resize(); + + var leftHeader = [], rightHeader = [], leftItems = [], rightItems = []; + BI.each(o.header, function (i, cols) { + leftHeader[i] = []; + rightHeader[i] = []; + BI.each(cols, function (j, col) { + var cell = { + type: "bi.grid_table_cell", + cell: col + }; + if (j < freezeColLength) { + leftHeader[i].push(cell); + } else { + rightHeader[i].push(cell); + } + }); + }); + BI.each(o.items, function (i, cols) { + leftItems[i] = []; + rightItems[i] = []; + BI.each(cols, function (j, col) { + var cell = { + type: "bi.grid_table_cell", + cell: col + }; + if (j < freezeColLength) { + leftItems[i].push(cell); + } else { + rightItems[i].push(cell); + } + }); + }); + this.topLeftGrid.populate(leftHeader); + this.topRightGrid.populate(rightHeader); + this.bottomLeftGrid.populate(leftItems); + this.bottomRightGrid.populate(rightItems); + } +}); +$.shortcut('bi.quick_grid_table', BI.QuickGridTable);/** + * + * 表格滚动条 + * + * Created by GUY on 2016/1/12. + * @class BI.GridTableScrollbar + * @extends BI.Widget + */ +BI.GridTableScrollbar = BI.inherit(BI.Widget, { + _const: { + FACE_MARGIN: 4, + FACE_MARGIN_2: 4 * 2, + FACE_SIZE_MIN: 30, + KEYBOARD_SCROLL_AMOUNT: 40 + }, + _defaultConfig: function () { + return BI.extend(BI.GridTableScrollbar.superclass._defaultConfig.apply(this, arguments), { + baseCls: "scrollbar-layout-main public-scrollbar-main", + attributes: { + tabIndex: 0 + }, + contentSize: 0, + defaultPosition: 0, + isOpaque: false, + orientation: "vertical", + position: 0, + size: 0 + }) + }, + + _init: function () { + BI.GridTableScrollbar.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.focused = false; + this.isDragging = false; + this.face = BI.createWidget({ + type: "bi.layout", + cls: "scrollbar-layout-face public-scrollbar-face " + + (this._isHorizontal() ? "scrollbar-layout-face-horizontal" : "scrollbar-layout-face-vertical") + }); + this.contextLayout = BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.face, + left: 0, + top: 0 + }] + }); + var onWheel = o.orientation === 'horizontal' ? this._onWheelX : this._onWheelY; + this._wheelHandler = new BI.WheelHandler( + BI.bind(onWheel, this), + BI.bind(this._shouldHandleX, this), + BI.bind(this._shouldHandleY, this) + ); + this._mouseMoveTracker = new BI.MouseMoveTracker( + BI.bind(this._onMouseMove, this), + BI.bind(this._onMouseMoveEnd, this), + document + ); + this.element.on("mousedown", BI.bind(this._onMouseDown, this)); + this.element.on("mousewheel", function (e) { + self._wheelHandler.onWheel(e.originalEvent); + }); + this.element.on("keydown", BI.bind(this._onKeyDown, this)); + this.element.on("focus", function () { + self.focused = true; + self._populate(); + }); + this.element.on("blur", function () { + self.focused = false; + self._populate(); + }); + if (this._isHorizontal()) { + this.element.addClass("scrollbar-layout-main-horizontal"); + } else { + this.element.addClass("scrollbar-layout-main-vertical"); + } + this._populate(); + }, + + _isHorizontal: function () { + return this.options.orientation === 'horizontal' + }, + + _getScale: function () { + var o = this.options; + var scale = o.size / o.contentSize; + var faceSize = o.size * scale; + + if (faceSize < this._const.FACE_SIZE_MIN) { + scale = (o.size - this._const.FACE_SIZE_MIN) / (o.contentSize - o.size); + } + return scale; + }, + + _getFaceSize: function () { + var o = this.options; + var scale = o.size / o.contentSize; + var faceSize = o.size * scale; + + if (faceSize < this._const.FACE_SIZE_MIN) { + faceSize = this._const.FACE_SIZE_MIN; + } + return faceSize; + }, + + _shouldHandleX: function (delta) { + return this.options.orientation === 'horizontal' ? + this._shouldHandleChange(delta) : + false; + }, + + _shouldHandleY: function (delta) { + return this.options.orientation !== 'horizontal' ? + this._shouldHandleChange(delta) : + false; + }, + + _shouldHandleChange: function (delta) { + return this.options.position + delta !== this.options.position; + }, + + _onWheelY: function (deltaX, deltaY) { + this._onWheel(deltaY); + }, + + _onWheelX: function (deltaX, deltaY) { + this._onWheel(deltaX); + }, + + _onWheel: function (delta) { + var maxPosition = this.options.contentSize - this.options.size; + this.options.position += delta; + if (this.options.position < 0) { + this.options.position = 0; + } else if (this.options.position > maxPosition) { + this.options.position = maxPosition; + } + this._populate(); + this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL, this.options.position); + }, + + _onMouseDown: function (e) { + if (e.target !== this.face.element[0]) { + var position = this._isHorizontal() ? e.offsetX : e.offsetY; + position /= this._getScale(); + this.options.position = BI.clamp(position - (this._getFaceSize() * 0.5 / this._getScale()), 0, this.options.contentSize - this.options.size); + this._populate(); + this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL, this.options.position); + } else { + this._mouseMoveTracker.captureMouseMoves(e); + } + this.element[0].focus(); + }, + + _onMouseMove: function (deltaX, deltaY) { + var delta = this._isHorizontal() ? deltaX : deltaY; + delta /= this._getScale(); + this.options.position = BI.clamp(this.options.position + delta, 0, this.options.contentSize - this.options.size); + this.isDragging = this._mouseMoveTracker.isDragging(); + this._populate(); + this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL, this.options.position); + }, + + _onMouseMoveEnd: function (event) { + this._mouseMoveTracker.releaseMouseMoves(); + if (this.isDragging === true) { + this.isDragging = false; + this._populate(); + } + }, + + _onKeyDown: function (event) { + var Keys = { + BACKSPACE: 8, + TAB: 9, + RETURN: 13, + ALT: 18, + ESC: 27, + SPACE: 32, + PAGE_UP: 33, + PAGE_DOWN: 34, + END: 35, + HOME: 36, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46, + COMMA: 188, + PERIOD: 190, + A: 65, + Z: 90, + ZERO: 48, + NUMPAD_0: 96, + NUMPAD_9: 105 + }; + var keyCode = event.keyCode; + + if (keyCode === Keys.TAB) { + return; + } + + var distance = 40; + var direction = 0; + + if (this._isHorizontal()) { + switch (keyCode) { + case Keys.HOME: + direction = -1; + distance = this.options.contentSize; + break; + + case Keys.LEFT: + direction = -1; + break; + + case Keys.RIGHT: + direction = 1; + break; + + default: + return; + } + } + + if (!this._isHorizontal()) { + switch (keyCode) { + case Keys.SPACE: + if (event.shiftKey) { + direction = -1; + } else { + direction = 1; + } + break; + + case Keys.HOME: + direction = -1; + distance = this.options.contentSize; + break; + + case Keys.UP: + direction = -1; + break; + + case Keys.DOWN: + direction = 1; + break; + + case Keys.PAGE_UP: + direction = -1; + distance = this.options.size; + break; + + case Keys.PAGE_DOWN: + direction = 1; + distance = this.options.size; + break; + + default: + return; + } + } + + this.options.position = BI.clamp(this.options.position + (distance * direction), 0, this.options.contentSize - this.options.size); + event.preventDefault(); + this._populate(); + this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL, this.options.position); + }, + + _populate: function () { + var self = this, o = this.options; + if (o.size < 1 || o.contentSize <= o.size) { + this.setVisible(false); + return; + } + this.setVisible(true); + + var size = o.size; + var isHorizontal = this._isHorizontal(); + var isActive = this.focused || this.isDragging; + + var faceSize = this._getFaceSize(); + var isOpaque = o.isOpaque; + this.element[isOpaque === true ? "addClass" : "removeClass"]("public-scrollbar-main-opaque"); + this.element[isActive === true ? "addClass" : "removeClass"]("public-scrollbar-main-active"); + + this.face.element[isActive === true ? "addClass" : "removeClass"]("public-scrollbar-face-active"); + + var position = o.position * this._getScale() + this._const.FACE_MARGIN; + + var items = this.contextLayout.attr("items"); + if (isHorizontal) { + this.setWidth(size); + this.face.setWidth(faceSize - this._const.FACE_MARGIN_2); + items[0].left = position; + items[0].top = 0; + } else { + this.setHeight(size); + this.face.setHeight(faceSize - this._const.FACE_MARGIN_2); + items[0].left = 0; + items[0].top = position; + } + this.contextLayout.attr("items", items); + this.contextLayout.resize(); + }, + + setContentSize: function (contentSize) { + this.options.contentSize = contentSize; + }, + + setPosition: function (position) { + this.options.position = position; + }, + + setSize: function (size) { + this.options.size = size; + }, + + populate: function () { + this._populate(); + } +}); +BI.GridTableScrollbar.SIZE = 10; +BI.GridTableScrollbar.EVENT_SCROLL = "EVENT_SCROLL"; +$.shortcut("bi.grid_table_scrollbar", BI.GridTableScrollbar); + + +BI.GridTableHorizontalScrollbar = BI.inherit(BI.Widget, { + _const: { + FACE_MARGIN: 4, + FACE_MARGIN_2: 4 * 2, + FACE_SIZE_MIN: 30, + KEYBOARD_SCROLL_AMOUNT: 40 + }, + _defaultConfig: function () { + return BI.extend(BI.GridTableHorizontalScrollbar.superclass._defaultConfig.apply(this, arguments), { + attributes: { + tabIndex: 0 + }, + contentSize: 0, + position: 0, + size: 0 + }) + }, + + _init: function () { + BI.GridTableHorizontalScrollbar.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.scrollbar = BI.createWidget({ + type: "bi.grid_table_scrollbar", + orientation: "horizontal", + isOpaque: true, + position: o.position, + contentSize: o.contentSize, + size: o.size + }); + this.scrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL, function () { + self.fireEvent(BI.GridTableHorizontalScrollbar.EVENT_SCROLL, arguments); + }); + BI.createWidget({ + type: "bi.absolute", + cls: "horizontal-scrollbar", + element: this, + width: o.size, + height: BI.GridTableScrollbar.SIZE, + items: [{ + el: { + type: "bi.absolute", + scrollable: false, + height: BI.GridTableScrollbar.SIZE, + items: [{ + el: this.scrollbar, + left: 0, + top: 0 + }] + }, + top: 0, + left: 0, + right: 0 + }] + }); + }, + + setContentSize: function (contentSize) { + this.options.contentSize = contentSize; + this.scrollbar.setContentSize(contentSize); + }, + + setPosition: function (position) { + this.options.position = position; + this.scrollbar.setPosition(position); + }, + + setSize: function (size) { + this.setWidth(size); + this.options.size = size; + this.scrollbar.setSize(size); + }, + + populate: function () { + this.scrollbar.populate(); + } +}); +BI.GridTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL"; +$.shortcut("bi.grid_table_horizontal_scrollbar", BI.GridTableHorizontalScrollbar);/** + * + * 表格 + * + * Created by GUY on 2015/9/22. + * @class BI.TableHeaderCell + * @extends BI.Single + */ +BI.TableHeaderCell = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.TableHeaderCell.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-table-header-cell", + text: "" + }) + }, + + _init: function () { + BI.TableHeaderCell.superclass._init.apply(this, arguments); + BI.createWidget({ + type: "bi.label", + element: this, + textAlign: "center", + height: this.options.height, + text: this.options.text, + value: this.options.value + }) + } +}); + +$.shortcut("bi.table_header_cell", BI.TableHeaderCell);/** + * + * 表格 + * + * 能处理静态宽度以及动态宽度的表, 百分比宽度的表请使用PreviewTable + * + * Created by GUY on 2015/9/22. + * @class BI.Table + * @extends BI.Widget + */ +BI.Table = BI.inherit(BI.Widget, { + + _defaultConfig: function () { + return BI.extend(BI.Table.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-table", + logic: { //冻结的页面布局逻辑 + dynamic: false + }, + + isNeedResize: false,//是否需要调整列宽 + isResizeAdapt: true,//是否需要在调整列宽或区域宽度的时候它们自适应变化 + + isNeedFreeze: false,//是否需要冻结单元格 + freezeCols: [], //冻结的列号,从0开始,isNeedFreeze为true时生效 + + isNeedMerge: false,//是否需要合并单元格 + mergeCols: [], //合并的单元格列号 + mergeRule: function (row1, row2) { //合并规则, 默认相等时合并 + return BI.isEqual(row1, row2); + }, + + columnSize: [], + headerRowSize: 25, + footerRowSize: 25, + rowSize: 25, + + regionColumnSize: false, + + header: [], + footer: false, + items: [] //二维数组 + }) + }, + + _calculateWidth: function (width) { + if (!width || width === "0") { + return ""; + } + width = BI.parseFloat(width); + if (width < 0) { + width = 0; + } + return width > 1.01 ? width : (width * 100 + "%"); + }, + + _calculateHeight: function (height) { + return height ? height : ""; + }, + + _isRightFreeze: function () { + return BI.isNotEmptyArray(this.options.freezeCols) && BI.first(this.options.freezeCols) !== 0; + }, + + _createTopLeft: function () { + var o = this.options, isRight = this._isRightFreeze(); + this.topLeftColGroupTds = {}; + this.topLeftBodyTds = {}; + this.topLeftBodyItems = {}; + var table = this._table(); + var colgroup = this._createColGroup(this.columnLeft, this.topLeftColGroupTds); + var body = this.topLeftBody = this._body(); + body.element.append(this._createHeaderCells(this.topLeftItems, this.columnLeft, this.mergeLeft, this.topLeftBodyTds, this.topLeftBodyItems)); + BI.createWidget({ + type: "bi.adaptive", + element: table, + items: [colgroup, body] + }); + if (isRight) { + var w = 0; + BI.each(o.columnSize, function (i, col) { + if (!o.freezeCols.contains(i)) { + w += col; + } + }); + if (BI.isNumeric(w) && w > 1) { + w = BI.parseFloat(w) + o.columnSize.length - o.freezeCols.length; + } + } + return (this.topLeftContainer = BI.createWidget({ + type: "bi.adaptive", + width: this._calculateWidth(w), + items: [table] + })); + }, - var lw = 0, rw = 0; - this.columnLeft = []; - this.columnRight = []; - BI.each(o.columnSize, function (i, size) { - if (o.freezeCols.contains(i)) { - lw += size; - self[isRight ? "columnRight" : "columnLeft"].push(size); - } else { - rw += size; - self[isRight ? "columnLeft" : "columnRight"].push(size); + _createTopRight: function () { + var o = this.options, isRight = this._isRightFreeze(); + this.topRightColGroupTds = {}; + this.topRightBodyTds = {}; + this.topRightBodyItems = {}; + var table = this._table(); + var colgroup = this._createColGroup(this.columnRight, this.topRightColGroupTds); + var body = this.topRightBody = this._body(); + body.element.append(this._createHeaderCells(this.topRightItems, this.columnRight, this.mergeRight, this.topRightBodyTds, this.topRightBodyItems, this.columnLeft.length)); + BI.createWidget({ + type: "bi.adaptive", + element: table, + items: [colgroup, body] + }); + if (!isRight) { + var w = 0; + BI.each(o.columnSize, function (i, col) { + if (!o.freezeCols.contains(i)) { + w += col; + } + }); + if (BI.isNumeric(w)) { + w = BI.parseFloat(w) + o.columnSize.length - o.freezeCols.length; + } + } + return (this.topRightContainer = BI.createWidget({ + type: "bi.adaptive", + width: w || undefined, + items: [table] + })); + }, + + _createBottomLeft: function () { + var o = this.options, isRight = this._isRightFreeze(); + this.bottomLeftColGroupTds = {}; + this.bottomLeftBodyTds = {}; + this.bottomLeftBodyItems = {}; + var table = this._table(); + var colgroup = this._createColGroup(this.columnLeft, this.bottomLeftColGroupTds); + var body = this._createBottomLeftBody(); + BI.createWidget({ + type: "bi.adaptive", + element: table, + items: [colgroup, body] + }); + if (isRight) { + var w = 0; + BI.each(o.columnSize, function (i, col) { + if (!o.freezeCols.contains(i)) { + w += col; } }); - lw = this._calculateWidth(lw); - rw = this._calculateWidth(rw); - - if (BI.isNumeric(lw)) { - lw = BI.parseFloat(lw) + o.freezeCols.length; - } - if (BI.isNumeric(rw)) { - rw = BI.parseFloat(rw) + o.columnSize.length - o.freezeCols.length; - } - this.topLeftContainer.element.width(isRight ? rw : lw); - this.bottomLeftContainer.element.width(isRight ? rw : lw); - this.topRightContainer.element.width(isRight ? lw : rw); - this.bottomRightContainer.element.width(isRight ? lw : rw); - this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft; - this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft; - if (o.isNeedResize && o.isResizeAdapt) { - var leftWidth = BI.sum(o.freezeCols, function (i, col) { - return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col]; - }); - this.partitions.attr("columnSize", isRight ? ['fill', leftWidth] : [leftWidth, 'fill']); - this.partitions.resize(); + if (BI.isNumeric(w) && w > 1) { + w = BI.parseFloat(w) + o.columnSize.length - o.freezeCols.length; } - } else { - BI.each(this.colgroupTds, function (i, colgroup) { - var width = colgroup.attr("width") | 0; - if (width !== o.columnSize[i]) { - var w = self._calculateWidth(o.columnSize[i]); - colgroup.attr("width", w).css("width", w); - BI.each(self.bodyTds, function (j, items) { - if (items[i]) { - if (items[i].__mergeCols.length > 1) { - var wid = 0; - BI.each(o.columnSize, function (t, s) { - if (items[i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += items[i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } else { - items[i].attr("width", "").css("width", ""); - } - } else { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } - } - }); - BI.each(self.headerTds, function (j, items) { - if (items[i]) { - if (items[i].__mergeCols.length > 1) { - var wid = 0; - BI.each(o.columnSize, function (t, s) { - if (items[i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += items[i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } else { - items[i].attr("width", "").css("width", ""); - } - } else { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } - } - }); - BI.each(self.footerTds, function (j, items) { - if (items[i]) { - if (items[i].__mergeCols.length > 1) { - var wid = 0; - BI.each(o.columnSize, function (t, s) { - if (items[i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += items[i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } else { - items[i].attr("width", "").css("width", ""); - } - } else { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } - } - }); - BI.each(self.bodyItems, function (j, items) { - if (items[i]) { - if (self.bodyTds[j][i].__mergeCols.length > 1) { - var wid = 0; - BI.each(o.columnSize, function (t, s) { - if (self.bodyTds[j][i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += self.bodyTds[j][i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].element.attr("width", wid).css("width", wid); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } else { - if (BI.isNumeric(w)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", w - 1).css("width", w - 1); - } else { - items[i].element.attr("width", w).css("width", w); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } - } - }); - BI.each(self.headerItems, function (j, items) { - if (items[i]) { - if (self.headerTds[j][i].__mergeCols.length > 1) { - var wid = 0; - BI.each(o.columnSize, function (t, s) { - if (self.headerTds[j][i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += self.headerTds[j][i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].element.attr("width", wid).css("width", wid); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } else { - if (BI.isNumeric(w)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", w - 1).css("width", w - 1); - } else { - items[i].element.attr("width", w).css("width", w); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } - } - }); - BI.each(self.footerItems, function (j, items) { - if (items[i]) { - if (self.footerTds[j][i].__mergeCols.length > 1) { - var wid = 0; - BI.each(o.columnSize, function (t, s) { - if (self.footerTds[j][i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += self.footerTds[j][i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].element.attr("width", wid).css("width", wid); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } else { - if (BI.isNumeric(w)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", w - 1).css("width", w - 1); - } else { - items[i].element.attr("width", w).css("width", w); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } - } - }); + } + return (this.bottomLeftContainer = BI.createWidget({ + type: "bi.adaptive", + width: this._calculateWidth(w), + items: [table] + })); + }, + + _createBottomLeftBody: function () { + var body = this.bottomLeftBody = this._body(); + body.element.append(this._createCells(this.bottomLeftItems, this.columnLeft, this.mergeLeft, this.bottomLeftBodyTds, this.bottomLeftBodyItems)); + return body; + }, + + _createBottomRight: function () { + var o = this.options, isRight = this._isRightFreeze(); + this.bottomRightColGroupTds = {}; + this.bottomRightBodyTds = {}; + this.bottomRightBodyItems = {}; + var table = this._table(); + var colgroup = this._createColGroup(this.columnRight, this.bottomRightColGroupTds); + var body = this._createBottomRightBody(); + BI.createWidget({ + type: "bi.adaptive", + element: table, + items: [colgroup, body] + }); + if (!isRight) { + var w = 0; + BI.each(o.columnSize, function (i, col) { + if (!o.freezeCols.contains(i)) { + w += col; } }); - var w = this._calculateWidth(BI.sum(o.columnSize)); - if (w > 1.05) { - w += o.columnSize.length; + if (BI.isNumeric(w) && w > 1) { + w = BI.parseFloat(w) + o.columnSize.length - o.freezeCols.length; } - this.tableContainer.element.width(w); } + return (this.bottomRightContainer = BI.createWidget({ + type: "bi.adaptive", + width: this._calculateWidth(w), + items: [table] + })); }, - getColumnSize: function () { - return this.options.columnSize; + _createBottomRightBody: function () { + var body = this.bottomRightBody = this._body(); + body.element.append(this._createCells(this.bottomRightItems, this.columnRight, this.mergeRight, this.bottomRightBodyTds, this.bottomRightBodyItems, this.columnLeft.length)); + return body; }, - getCalculateColumnSize: function () { + _createFreezeTable: function () { var self = this, o = this.options; - var columnSize = []; - if (o.isNeedFreeze === true) { - if (BI.size(this.bottomLeftBodyTds) > 0 || BI.size(this.bottomRightBodyTds) > 0) { - if (!BI.any(this.bottomLeftBodyTds, function (i, tds) { - if (!BI.any(tds, function (i, item) { - if (item.__mergeCols.length > 1) { - return true; - } - })) { - BI.each(tds, function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(tds) - 1) { - width++; - } - columnSize.push(width); - }); - return true; - } - })) { - BI.each(this.bottomLeftBodyTds[0], function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(self.bottomLeftBodyTds[0]) - 1) { - width++; - } - columnSize.push(width); - }); + var isRight = this._isRightFreeze(); + var split = this._split(o.header); + this.topLeftItems = split.left; + this.topRightItems = split.right; + split = this._split(o.items); + this.bottomLeftItems = split.left; + this.bottomRightItems = split.right; + + this.columnLeft = []; + this.columnRight = []; + BI.each(o.columnSize, function (i, size) { + if (o.freezeCols.contains(i)) { + self[isRight ? "columnRight" : "columnLeft"].push(size); + } else { + self[isRight ? "columnLeft" : "columnRight"].push(size); + } + }); + this.mergeLeft = []; + this.mergeRight = []; + BI.each(o.mergeCols, function (i, col) { + if (o.freezeCols.contains(col)) { + self[isRight ? "mergeRight" : "mergeLeft"].push(col); + } else { + self[isRight ? "mergeLeft" : "mergeRight"].push(col); + } + }); + + var topLeft = this._createTopLeft(); + var topRight = this._createTopRight(); + var bottomLeft = this._createBottomLeft(); + var bottomRight = this._createBottomRight(); + + this.scrollTopLeft = BI.createWidget({ + type: "bi.adaptive", + cls: "scroll-top-left", + width: "100%", + height: "100%", + scrollable: false, + items: [topLeft] + }); + this.scrollTopRight = BI.createWidget({ + type: "bi.adaptive", + cls: "scroll-top-right", + width: "100%", + height: "100%", + scrollable: false, + items: [topRight] + }); + this.scrollBottomLeft = BI.createWidget({ + type: "bi.adaptive", + cls: "scroll-bottom-left", + width: "100%", + height: "100%", + scrollable: isRight || null, + scrollx: !isRight, + items: [bottomLeft] + }); + this.scrollBottomRight = BI.createWidget({ + type: "bi.adaptive", + cls: "scroll-bottom-right", + width: "100%", + height: "100%", + scrollable: !isRight || null, + scrollx: isRight, + items: [bottomRight] + }); + this.topLeft = BI.createWidget({ + type: "bi.adaptive", + cls: "top-left", + scrollable: false, + items: [this.scrollTopLeft] + }); + this.topRight = BI.createWidget({ + type: "bi.adaptive", + cls: "top-right", + scrollable: false, + items: [this.scrollTopRight] + }); + this.bottomLeft = BI.createWidget({ + type: "bi.adaptive", + cls: "bottom-left", + // scrollable: false, + items: [this.scrollBottomLeft] + }); + this.bottomRight = BI.createWidget({ + type: "bi.adaptive", + cls: "bottom-right", + scrollable: false, + items: [this.scrollBottomRight] + }); + + var headerHeight = o.header.length * ((o.headerRowSize || o.rowSize) + 1) + 1; + var leftWidth = BI.sum(o.freezeCols, function (i, col) { + return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col]; + }); + + if (o.isNeedResize) { + var resizer; + var createResizer = function (size, position) { + var rowSize = self.getCalculateRegionRowSize(); + resizer = BI.createWidget({ + type: "bi.layout", + cls: "bi-resizer", + width: size.width, + height: rowSize[0] + rowSize[1] + }); + BI.createWidget({ + type: "bi.absolute", + element: "body", + items: [{ + el: resizer, + left: position.left, + top: position.top - rowSize[0] + }] + }); + }; + var resizeResizer = function (size, position) { + var rowSize = self.getCalculateRegionRowSize(); + var columnSize = self.getCalculateRegionColumnSize(); + var height = rowSize[0] + rowSize[1]; + var sumSize = columnSize[0] + columnSize[1]; + if (size.width > sumSize / 5 * 4) { + size.width = sumSize / 5 * 4; } - if (!BI.any(this.bottomRightBodyTds, function (i, tds) { - if (!BI.any(tds, function (i, item) { - if (item.__mergeCols.length > 1) { - return true; - } - })) { - BI.each(tds, function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(tds) - 1) { - width++; - } - columnSize.push(width); - }); - return true; - } - })) { - BI.each(this.bottomRightBodyTds[0], function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(self.bottomRightBodyTds[0]) - 1) { - width++; - } - columnSize.push(width); - }); + if (size.width < 10) { + size.width = 10; } - return columnSize; - } - if (!BI.any(this.topLeftBodyTds, function (i, tds) { - if (!BI.any(tds, function (i, item) { - if (item.__mergeCols.length > 1) { - return true; - } - })) { - BI.each(tds, function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(tds) - 1) { - width++; - } - columnSize.push(width); - }); - return true; - } - })) { - BI.each(this.topLeftBodyTds[BI.size(this.topLeftBodyTds) - 1], function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(self.topLeftBodyTds[BI.size(self.topLeftBodyTds) - 1]) - 1) { - width++; - } - columnSize.push(width); + resizer.element.css({ + "left": position.left + "px", + "width": size.width + "px", + "height": height + "px" }); - } - if (!BI.any(this.topRightBodyTds, function (i, tds) { - if (!BI.any(tds, function (i, item) { - if (item.__mergeCols.length > 1) { - return true; + }; + var stopResizer = function () { + resizer && resizer.destroy(); + resizer = null; + }; + var handle; + if (o.freezeCols.length > 0 && o.freezeCols.length < o.columnSize.length) { + if (isRight) { + var options = { + handles: "w", + minWidth: 15, + helper: "clone", + start: function (event, ui) { + createResizer(ui.size, ui.position); + self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE); + }, + resize: function (e, ui) { + resizeResizer(ui.size, ui.position); + self.fireEvent(BI.Table.EVENT_TABLE_REGION_RESIZE); + e.stopPropagation(); + //return false; + }, + stop: function (e, ui) { + stopResizer(); + if (o.isResizeAdapt) { + var increment = ui.size.width - (BI.sum(self.columnRight) + self.columnRight.length); + o.columnSize[self.columnLeft.length] += increment; + } else { + self.setRegionColumnSize(["fill", ui.size.width]); } - })) { - BI.each(tds, function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(tds) - 1) { - width++; + self._resize(); + ui.element.css("left", ""); + self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE); + } + }; + self.bottomRight.element.resizable(options); + handle = $(".ui-resizable-handle", this.bottomRight.element).css("top", -1 * headerHeight); + } else { + var options = { + handles: "e", + minWidth: 15, + helper: "clone", + start: function (event, ui) { + createResizer(ui.size, ui.position); + self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE); + }, + resize: function (e, ui) { + resizeResizer(ui.size, ui.position); + self.fireEvent(BI.Table.EVENT_TABLE_REGION_RESIZE); + e.stopPropagation(); + //return false; + }, + stop: function (e, ui) { + stopResizer(); + if (o.isResizeAdapt) { + var increment = ui.size.width - (BI.sum(self.columnLeft) + self.columnLeft.length); + o.columnSize[self.columnLeft.length - 1] += increment; + } else { + self.setRegionColumnSize([ui.size.width, "fill"]); } - columnSize.push(width); - }); - return true; - } - })) { - BI.each(this.topRightBodyTds[BI.size(this.topRightBodyTds) - 1], function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(self.topRightBodyTds[BI.size(self.topRightBodyTds) - 1]) - 1) { - width++; - } - columnSize.push(width); - }); - } - } else { - BI.each(this.headerTds[BI.size(this.headerTds) - 1], function (i, item) { - var width = item.width() / item.__mergeCols.length; - if (i == BI.size(self.headerTds[BI.size(self.headerTds) - 1]) - 1) { - width++; + self._resize(); + self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE); + } + }; + self.bottomLeft.element.resizable(options); + handle = $(".ui-resizable-handle", this.bottomLeft.element).css("top", -1 * headerHeight); } - columnSize.push(width); - }); + } } - return columnSize; - }, - - setHeaderColumnSize: function (columnSize) { - var self = this, o = this.options; - var isRight = this._isRightFreeze(); - if (o.isNeedFreeze) { - var columnLeft = []; - var columnRight = []; - BI.each(columnSize, function (i, size) { - if (o.freezeCols.contains(i)) { - isRight ? columnRight.push(size) : columnLeft.push(size); + this._resize = function () { + if (self.scrollBottomLeft.element.is(":visible")) { + self.scrollBottomLeft.element.css({"overflow-x": "auto"}); + self.scrollBottomRight.element.css({"overflow-x": "auto"}); + self.setColumnSize(o.columnSize); + if (isRight) { + self.scrollBottomLeft.element.css({"overflow-y": "auto"}); } else { - isRight ? columnLeft.push(size) : columnRight.push(size); + self.scrollBottomRight.element.css({"overflow-y": "auto"}); } - }); - var topleft = 0, topright = 1; - var run = function (direction) { - var colgroupTds, bodyTds, bodyItems, sizes; - switch (direction) { - case topleft: - colgroupTds = self.topLeftColGroupTds; - bodyTds = self.topLeftBodyTds; - bodyItems = self.topLeftBodyItems; - sizes = columnLeft; - break; - case topright: - colgroupTds = self.topRightColGroupTds; - bodyTds = self.topRightBodyTds; - bodyItems = self.topRightBodyItems; - sizes = columnRight; - break; + if (self.scrollBottomLeft.element.hasHorizonScroll() || self.scrollBottomRight.element.hasHorizonScroll()) { + self.scrollBottomLeft.element.css("overflow-x", "scroll"); + self.scrollBottomRight.element.css("overflow-x", "scroll"); } - BI.each(colgroupTds, function (i, colgroup) { - var width = colgroup.attr("width") | 0; - if (width !== sizes[i]) { - var w = self._calculateWidth(sizes[i]); - colgroup.attr("width", w).css("width", w); - BI.each(bodyTds, function (j, items) { - if (items[i]) { - if (items[i].__mergeCols.length > 1) { - var wid = 0; - BI.each(sizes, function (t, s) { - if (items[i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += items[i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].attr("width", wid).css("width", wid); - } - } else { - items[i].attr("width", "").css("width", ""); - } - } else { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } - } - }); - BI.each(bodyItems, function (j, items) { - if (items[i]) { - if (bodyTds[j][i].__mergeCols.length > 1) { - var wid = 0; - BI.each(sizes, function (t, s) { - if (bodyTds[j][i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += bodyTds[j][i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].element.attr("width", wid).css("width", wid); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } else { - if (BI.isNumeric(w)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", w - 1).css("width", w - 1); - } else { - items[i].element.attr("width", w).css("width", w); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } - } - }); - } - }) - }; - run(topleft); - run(topright); - - var lw = 0, rw = 0; - BI.each(columnSize, function (i, size) { - if (o.freezeCols.contains(i)) { - lw += size; + if (self.scrollBottomRight.element.hasVerticalScroll()) { + self.scrollTopRight.element.css("overflow-y", "scroll"); } else { - rw += size; + self.scrollTopRight.element.css("overflow-y", "hidden"); } - }); - lw = this._calculateWidth(lw); - rw = this._calculateWidth(rw); + if (self.scrollBottomLeft.element.hasVerticalScroll()) { + self.scrollTopLeft.element.css("overflow-y", "scroll"); + } else { + self.scrollTopLeft.element.css("overflow-y", "hidden"); + } + self.scrollTopLeft.element[0].scrollLeft = self.scrollBottomLeft.element[0].scrollLeft; + self.scrollTopRight.element[0].scrollLeft = self.scrollBottomRight.element[0].scrollLeft; + self.scrollBottomLeft.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop; + //调整拖拽handle的高度 + if (o.isNeedResize) { + handle && handle.css("height", self.bottomLeft.element.height() + headerHeight); + } + } + }; + + var regionColumnSize = o.regionColumnSize; + if (o.freezeCols.length === 0) { + regionColumnSize = isRight ? ['fill', 0] : [0, 'fill']; + } else if (o.freezeCols.length >= o.columnSize.length) { + regionColumnSize = isRight ? [0, 'fill'] : ['fill', 0]; + } + this.partitions = BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("table", BI.extend({}, o.logic, { + rows: 2, + columns: 2, + columnSize: regionColumnSize || (isRight ? ['fill', leftWidth] : [leftWidth, 'fill']), + rowSize: [headerHeight, 'fill'], + items: [[{ + el: this.topLeft + }, { + el: this.topRight + }], [{ + el: this.bottomLeft + }, { + el: this.bottomRight + }]] + })))); - if (BI.isNumeric(lw)) { - lw = BI.parseFloat(lw) + o.freezeCols.length; - } - if (BI.isNumeric(rw)) { - rw = BI.parseFloat(rw) + columnSize.length - o.freezeCols.length; + //var scrollElement = isRight ? scrollBottomLeft.element : scrollBottomRight.element; + //var scrollTopElement = isRight ? scrollTopLeft.element : scrollTopRight.element; + //var otherElement = isRight ? scrollBottomRight.element : scrollBottomLeft.element; + + this._initFreezeScroll(); + BI.nextTick(function () { + if (self.element.is(":visible")) { + self._resize(); + self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); } - this.topLeftContainer.element.width(isRight ? rw : lw); - this.topRightContainer.element.width(isRight ? lw : rw); - this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft; - this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft; - if (o.isNeedResize && o.isResizeAdapt) { - var leftWidth = BI.sum(o.freezeCols, function (i, col) { - return columnSize[col] > 1 ? columnSize[col] + 1 : columnSize[col]; - }); - this.partitions.attr("columnSize", isRight ? ['fill', leftWidth] : [leftWidth, 'fill']); - this.partitions.resize(); + }); + BI.Resizers.add(this.getName(), function (e) { + if (BI.isWindow(e.target) && self.element.is(":visible")) { + self._resize(); + self.fireEvent(BI.Table.EVENT_TABLE_RESIZE); } - } else { - BI.each(this.colgroupTds, function (i, colgroup) { - var width = colgroup.attr("width") | 0; - if (width !== columnSize[i]) { - var w = self._calculateWidth(columnSize[i]); - colgroup.attr("width", w).css("width", w); - BI.each(self.headerTds, function (j, items) { - if (items[i]) { - if (items[i].__mergeCols.length > 1) { - var wid = 0; - BI.each(columnSize, function (t, s) { - if (items[i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += items[i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].element.attr("width", wid).css("width", wid); - } - } else { - items[i].attr("width", "").css("width", ""); - } - } else { - if (i == BI.size(items) - 1) { - items[i].attr("width", w - 1).css("width", w - 1); - } else { - items[i].attr("width", w).css("width", w); - } - } - } - }); - BI.each(self.headerItems, function (j, items) { - if (items[i]) { - if (self.headerTds[j][i].__mergeCols.length > 1) { - var wid = 0; - BI.each(columnSize, function (t, s) { - if (self.headerTds[j][i].__mergeCols.contains(t)) { - wid += s; - } - }); - wid = self._calculateWidth(wid); - if (wid > 1) { - wid += self.headerTds[j][i].__mergeCols.length - 1; - } - if (BI.isNumeric(wid)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", wid - 1).css("width", wid - 1); - } else { - items[i].element.attr("width", wid).css("width", wid); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } else { - if (BI.isNumeric(w)) { - if (i == BI.size(items) - 1) { - items[i].element.attr("width", w - 1).css("width", w - 1); - } else { - items[i].element.attr("width", w).css("width", w); - } - } else { - items[i].element.attr("width", "").css("width", ""); - } - } + }); + }, + + _initFreezeScroll: function () { + var self = this, o = this.options; + scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element); + scroll(this.scrollBottomLeft.element, this.scrollTopLeft.element, this.scrollBottomRight.element); + + function scroll(scrollElement, scrollTopElement, otherElement) { + var scrolling, scrollingX; + var fn = function (event, delta, deltaX, deltaY) { + var inf = self._getScrollOffsetAndDur(event); + if (deltaY < 0 || deltaY > 0) { + if (scrolling) { + scrollElement[0].scrollTop = scrolling; + } + scrolling = scrollElement[0].scrollTop - delta * inf.offset; + var stopPropagation = false; + var st = scrollElement[0].scrollTop; + scrollElement[0].scrollTop = scrolling; + if (scrollElement[0].scrollTop !== st) { + stopPropagation = true; + } + scrollElement[0].scrollTop = st; + self._animateScrollTo(scrollElement, scrollElement[0].scrollTop, scrolling, inf.dur, "linear", { + onStart: function () { + }, + onUpdate: function (top) { + otherElement[0].scrollTop = top; + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top); + }, + onComplete: function () { + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling); + scrolling = null; } }); + + + //otherElement[0].scrollTop = scrollTop; + //scrollElement[0].scrollTop = scrollTop; + //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop); + if (stopPropagation === true) { + event.stopPropagation(); + return false; + } + return; + } + //if (deltaX < 0 || deltaX > 0) { + // if (scrollingX) { + // scrollElement[0].scrollLeft = scrollingX; + // } + // scrollingX = scrollElement[0].scrollLeft + delta * inf.offset; + // var stopPropagation = false; + // var sl = scrollElement[0].scrollLeft; + // scrollElement[0].scrollLeft = scrollingX; + // if (scrollElement[0].scrollLeft !== sl) { + // stopPropagation = true; + // } + // scrollElement[0].scrollLeft = sl; + // self._animateScrollTo(scrollElement, scrollElement[0].scrollLeft, scrollingX, inf.dur, "linear", { + // direction: "left", + // onStart: function () { + // }, + // onUpdate: function (left) { + // scrollTopElement[0].scrollLeft = left; + // self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, left); + // }, + // onComplete: function () { + // self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, scrollingX); + // scrollingX = null; + // } + // }); + // + // + // //otherElement[0].scrollTop = scrollTop; + // //scrollElement[0].scrollTop = scrollTop; + // //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop); + // if (stopPropagation === true) { + // event.stopPropagation(); + // return false; + // } + //} + }; + scrollElement.mousewheel(fn); + var scrollTop = 0, scrollLeft = 0; + scrollElement.scroll(function (e) { + var change = false; + if (scrollElement.scrollTop() != scrollTop) { + var old = otherElement.scrollTop(); + otherElement.scrollTop(scrollElement.scrollTop()); + scrollTop = scrollElement.scrollTop(); + if (Math.abs(old - otherElement[0].scrollTop) > 0.1) { + e.stopPropagation(); + change = true; + } + } + if (scrollElement.scrollLeft() != scrollLeft) { + var old = scrollTopElement.scrollLeft(); + scrollTopElement.scrollLeft(scrollElement.scrollLeft()); + scrollLeft = scrollElement.scrollLeft(); + if (Math.abs(old - scrollTopElement[0].scrollLeft) > 0.1) { + e.stopPropagation(); + change = true; + } + } + // self.fireEvent(BI.Table.EVENT_TABLE_SCROLL); + if (change === true) { + e.stopPropagation(); + //return false; } }); - var cW = this._calculateWidth(BI.sum(columnSize)); - if (cW > 1.05) { - cW = cW + columnSize.length; - } - this.tableContainer.element.width(cW); } }, - setRegionColumnSize: function (columnSize) { - var self = this, o = this.options; - o.regionColumnSize = columnSize; - if (o.freezeCols.length === 0) { - if (o.isNeedFreeze) { - this.partitions.attr("columnSize", this._isRightFreeze() ? ['fill', 0] : [0, 'fill']); - this.partitions.resize(); - } else { - this.tableContainer.element.width(columnSize[0]); + _animateScrollTo: function (el, from, to, duration, easing, op) { + var self = this; + var onStart = op.onStart, onComplete = op.onComplete, onUpdate = op.onUpdate; + var startTime = BI.getTime(), _delay, progress = 0, _request; + _cancelTween(); + _startTween(); + var diff = to - from; + el._stop = 0; + function _step() { + if (el._stop) { + return; } - } else if (o.freezeCols.length > 0 && o.freezeCols.length < o.columnSize.length) { - if (o.isNeedFreeze) { - this.partitions.attr("columnSize", columnSize); - this.partitions.resize(); - } else { - this.tableContainer.element.width(columnSize[0]); + if (!progress) { + onStart.call(); } - } else { - if (o.isNeedFreeze) { - this.partitions.attr("columnSize", this._isRightFreeze() ? [0, 'fill'] : ['fill', 0]); - this.partitions.resize(); + progress = BI.getTime() - startTime; + _tween(); + if (progress >= el.time) { + el.time = (progress > el.time) ? progress + _delay - (progress - el.time) : progress + _delay - 1; + if (el.time < progress + 1) { + el.time = progress + 1; + } + } + if (el.time < duration) { + el._id = _request(_step); } else { - this.tableContainer.element.width(columnSize[0]); + el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to); + onComplete.call(); } } - }, - - getRegionColumnSize: function () { - return this.options.regionColumnSize; - }, - - getCalculateRegionColumnSize: function () { - var o = this.options; - if (o.isNeedFreeze) { - return [this.scrollBottomLeft.element.width(), this.scrollBottomRight.element.width()]; - } - return [this.scrollBottomRight.element.width()]; - }, - getCalculateRegionRowSize: function () { - var o = this.options; - if (o.isNeedFreeze) { - return [this.scrollTopRight.element.height(), this.scrollBottomRight.element.height()]; + function _tween() { + var top = to; + if (duration > 0) { + el.currVal = _ease(el.time, from, diff, duration, easing); + el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](top = Math.round(el.currVal)); + } else { + el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to); + } + onUpdate(top); } - return [this.scrollBottomRight.element.height()]; - }, - getClientRegionColumnSize: function () { - var o = this.options; - if (o.isNeedFreeze) { - return [this.scrollBottomLeft.element[0].clientWidth, this.scrollBottomRight.element[0].clientWidth]; + function _startTween() { + _delay = 1000 / 60; + el.time = progress + _delay; + _request = (!requestAnimationFrame()) ? function (f) { + _tween(); + return setTimeout(f, 0.01); + } : requestAnimationFrame(); + el._id = _request(_step); } - return [this.scrollBottomRight.element[0].clientWidth]; - }, - getClientRegionRowSize: function () { - var o = this.options; - if (o.isNeedFreeze) { - return [this.scrollBottomLeft.element[0].clientHeight, this.scrollBottomRight.element[0].clientHeight]; + function requestAnimationFrame() { + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.msRequestAnimationFrame || + window.oRequestAnimationFrame; } - return [this.scrollBottomRight.element[0].clientHeight]; - }, - getScrollRegionColumnSize: function () { - var o = this.options; - if (o.isNeedFreeze) { - return [this.scrollBottomLeft.element[0].scrollWidth, this.scrollBottomRight.element[0].scrollWidth]; + function cancelAnimationFrame() { + return window.cancelAnimationFrame || + window.webkitCancelAnimationFrame || + window.mozCancelAnimationFrame || + window.msCancelAnimationFrame || + window.oCancelAnimationFrame || + window.cancelRequestAnimationFrame || + window.webkitCancelRequestAnimationFrame || + window.mozCancelRequestAnimationFrame || + window.msCancelRequestAnimationFrame || + window.oCancelRequestAnimationFrame } - return [this.scrollBottomRight.element[0].scrollWidth]; - }, - getScrollRegionRowSize: function () { - var o = this.options; - if (o.isNeedFreeze) { - if (o.freezeCols.length < o.columnSize.length) { - return [this.scrollTopRight.element[0].scrollHeight, this.scrollBottomRight.element[0].scrollHeight]; + function _cancelTween() { + if (el._id == null) { + return; + } + if (!cancelAnimationFrame()) { + clearTimeout(el._id); } else { - return [this.scrollTopLeft.element[0].scrollHeight, this.scrollBottomLeft.element[0].scrollHeight]; + cancelAnimationFrame()(el._id); } + el._id = null; } - return [this.scrollBottomRight.element[0].scrollHeight]; - }, - hasVerticalScroll: function () { - var o = this.options; - if (o.isNeedFreeze) { - return this.scrollBottomRight.element.hasVerticalScroll() || this.scrollBottomLeft.element.hasVerticalScroll(); + function _ease(t, b, c, d, type) { + switch (type) { + case "linear": + return c * t / d + b; + break; + case "mcsLinearOut": + t /= d; + t--; + return c * Math.sqrt(1 - t * t) + b; + break; + case "easeInOutSmooth": + t /= d / 2; + if (t < 1) { + return c / 2 * t * t + b; + } + t--; + return -c / 2 * (t * (t - 2) - 1) + b; + break; + case "easeInOutStrong": + t /= d / 2; + if (t < 1) { + return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + } + t--; + return c / 2 * ( -Math.pow(2, -10 * t) + 2 ) + b; + break; + case "easeInOut": + case "mcsEaseInOut": + t /= d / 2; + if (t < 1) { + return c / 2 * t * t * t + b; + } + t -= 2; + return c / 2 * (t * t * t + 2) + b; + break; + case "easeOutSmooth": + t /= d; + t--; + return -c * (t * t * t * t - 1) + b; + break; + case "easeOutStrong": + return c * ( -Math.pow(2, -10 * t / d) + 1 ) + b; + break; + case "easeOut": + case "mcsEaseOut": + default: + var ts = (t /= d) * t, tc = ts * t; + return b + c * (0.499999999999997 * tc * ts + -2.5 * ts * ts + 5.5 * tc + -6.5 * ts + 4 * t); + } } - return this.scrollBottomRight.element.hasVerticalScroll(); }, - setVerticalScroll: function (scrollTop) { - var o = this.options; - if (o.isNeedFreeze) { - if (this.scrollBottomRight.element[0].scrollTop !== scrollTop) { - this.scrollBottomRight.element[0].scrollTop = scrollTop; - } - if (this.scrollBottomLeft.element[0].scrollTop !== scrollTop) { - this.scrollBottomLeft.element[0].scrollTop = scrollTop; - } - } else { - if (this.scrollBottomRight.element[0].scrollTop !== scrollTop) { - this.scrollBottomRight.element[0].scrollTop = scrollTop; - } + _getScrollOffsetAndDur: function (event) { + var offset = 40, dur = 200; + if (event.originalEvent.wheelDelta) { + offset = Math.abs(event.originalEvent.wheelDelta); + } + if (event.deltaFactor < 2) { + offset = 3; + dur = 17; } + return { + offset: offset, + dur: dur + }; }, - setLeftHorizontalScroll: function (scrollLeft) { - var o = this.options; - if (o.isNeedFreeze) { - if (this.scrollBottomLeft.element[0].scrollLeft !== scrollLeft) { - this.scrollBottomLeft.element[0].scrollLeft = scrollLeft; - } - if (this.scrollTopLeft.element[0].scrollLeft !== scrollLeft) { - this.scrollTopLeft.element[0].scrollLeft = scrollLeft; - } - } else { - if (this.scrollBottomRight.element[0].scrollLeft !== scrollLeft) { - this.scrollBottomRight.element[0].scrollLeft = scrollLeft; - } - } + resize: function () { + this._resize(); }, - setRightHorizontalScroll: function (scrollLeft) { - var o = this.options; - if (o.isNeedFreeze) { - if (this.scrollBottomRight.element[0].scrollLeft !== scrollLeft) { - this.scrollBottomRight.element[0].scrollLeft = scrollLeft; - } - if (this.scrollTopRight.element[0].scrollLeft !== scrollLeft) { - this.scrollTopRight.element[0].scrollLeft = scrollLeft; - } - } else { - if (this.scrollBottomRight.element[0].scrollLeft !== scrollLeft) { - this.scrollBottomRight.element[0].scrollLeft = scrollLeft; + _createCells: function (items, columnSize, mergeCols, TDs, Ws, start, rowSize) { + var self = this, o = this.options, preCol = {}, preRow = {}, preRW = {}, preCW = {}, map = {}; + columnSize = columnSize || o.columnSize; + mergeCols = mergeCols || o.mergeCols; + TDs = TDs || {}; + Ws = Ws || {}; + start = start || 0; + rowSize || (rowSize = o.rowSize); + var frag = document.createDocumentFragment(); + BI.each(items, function (i, rows) { + var tr = $("").addClass((i & 1) === 0 ? "odd" : "even"); + BI.each(rows, function (j, row) { + if (!map[i]) { + map[i] = {}; + } + if (!TDs[i]) { + TDs[i] = {}; + } + if (!Ws[i]) { + Ws[i] = {}; + } + map[i][j] = row; + + if (o.isNeedMerge && mergeCols.contains(j)) { + if (i === 0 && j === 0) { + createOneEl(0, 0); + } else if (j === 0 && i > 0) { + var isNeedMergeRow = o.mergeRule(map[i][j], map[i - 1][j]); + if (isNeedMergeRow === true) { + mergeRow(i, j); + preRow[i] = preCol[j]; + preRW[i] = preCW[j]; + } else { + createOneEl(i, j); + } + } else if (i === 0 && j > 0) { + var isNeedMergeCol = o.mergeRule(map[i][j], map[i][j - 1]); + if (isNeedMergeCol === true) { + mergeCol(i, j); + preCol[j] = preRow[j - 1]; + preCW[j] = preRW[j - 1]; + } else { + createOneEl(i, j); + } + } else { + var isNeedMergeRow = o.mergeRule(map[i][j], map[i - 1][j]); + var isNeedMergeCol = o.mergeRule(map[i][j], map[i][j - 1]); + if (isNeedMergeCol && isNeedMergeRow) { + return; + } + if (isNeedMergeCol) { + mergeCol(i, j); + } + if (isNeedMergeRow) { + mergeRow(i, j); + } + if (!isNeedMergeCol && !isNeedMergeRow) { + createOneEl(i, j); + } + } + } else { + createOneEl(i, j); + } + }); + function mergeRow(i, j) { + var height = (preCol[j].attr("height") | 0) + rowSize + 1; + preCol[j].attr("height", height).css("height", height); + //preCW[j].element.css("height", height); + var rowspan = ((preCol[j].attr("rowspan") || 1) | 0) + 1; + preCol[j].attr("rowspan", rowspan); + preCol[j].__mergeRows.pushDistinct(i); + TDs[i][j] = preCol[j]; + Ws[i][j] = preCW[j]; } - } - }, - - getVerticalScroll: function () { - var o = this.options; - if (o.isNeedFreeze) { - return this.scrollBottomRight.element[0].scrollTop || this.scrollBottomLeft.element[0].scrollTop; - } - return this.scrollBottomRight.element[0].scrollTop; - }, - - getLeftHorizontalScroll: function () { - var o = this.options; - if (o.isNeedFreeze) { - return this.scrollBottomLeft.element[0].scrollLeft; - } - return this.scrollBottomRight.element[0].scrollLeft; - }, - - getRightHorizontalScroll: function () { - var o = this.options; - if (o.isNeedFreeze) { - return this.scrollBottomRight.element[0].scrollLeft; - } - return this.scrollBottomRight.element[0].scrollLeft; - }, - getColumns: function () { - var o = this.options; - if (o.isNeedFreeze) { - return { - topLeft: this.topLeftBodyItems, - topRight: this.topRightBodyItems, - bottomLeft: this.bottomLeftBodyItems, - bottomRight: this.bottomRightBodyItems - } - } else { - return { - header: this.headerItems, - body: this.bodyItems, - footer: this.footerItems + function mergeCol(i, j) { + if (columnSize[j]) { + var width = preRow[i].attr("width") | 0; + if (width > 1.05 && columnSize[j]) { + width = width + columnSize[j] + 1; + if (j === columnSize.length - 1) { + width--; + } + } else { + width = width + columnSize[j] + } + width = self._calculateWidth(width); + preRow[i].attr("width", width).css("width", width); + preRW[i].element.width(width); + } + var colspan = ((preRow[i].attr("colspan") || 1) | 0) + 1; + preRow[i].attr("colspan", colspan); + preRow[i].__mergeCols.pushDistinct(j); + TDs[i][j] = preRow[i]; + Ws[i][j] = preRW[i]; } - } - }, - populate: function (items, header) { - this.options.items = items || []; - if (header) { - this.options.header = header; - } - this.empty(); - if (this.options.isNeedFreeze) { - this._createFreezeTable(); - } else { - this._createNormalTable(); - } - }, + function createOneEl(r, c) { + var width = self._calculateWidth(columnSize[c]); + if (width > 1.05 && c === columnSize.length - 1) { + width--; + } + var height = self._calculateHeight(rowSize); + var td = $("").attr("height", height) + .attr("width", width).css({"width": width, "height": height, "position": "relative"}) + .addClass((c & 1) === 0 ? "odd-col" : "even-col") + .addClass(r === 0 ? "first-row" : "") + .addClass(c === 0 ? "first-col" : "") + .addClass(c === rows.length - 1 ? "last-col" : ""); + var w = BI.createWidget(map[r][c], { + type: "bi.table_cell", + textAlign: "left", + width: BI.isNumeric(width) ? width : "", + height: BI.isNumeric(height) ? height : "", + _row: r, + _col: c + start + }); + w.element.css("position", "relative"); + td.append(w.element); + tr.append(td); + preCol[c] = td; + preCol[c].__mergeRows = [r]; + preCW[c] = w; + preRow[r] = td; + preRow[r].__mergeCols = [c]; + preRW[r] = w; + TDs[r][c] = td; + Ws[r][c] = w; + } - empty: function () { - BI.Resizers.remove(this.getName()); - BI.Table.superclass.empty.apply(this, arguments); + frag.appendChild(tr[0]); + }); + return frag; }, - destroy: function () { - BI.Table.superclass.destroy.apply(this, arguments); - } -}) -; -BI.Table.EVENT_TABLE_AFTER_INIT = "EVENT_TABLE_AFTER_INIT"; -BI.Table.EVENT_TABLE_RESIZE = "EVENT_TABLE_RESIZE"; -BI.Table.EVENT_TABLE_SCROLL = "EVENT_TABLE_SCROLL"; -BI.Table.EVENT_TABLE_BEFORE_COLUMN_RESIZE = "EVENT_TABLE_BEFORE_COLUMN_RESIZE"; -BI.Table.EVENT_TABLE_COLUMN_RESIZE = "EVENT_TABLE_COLUMN_RESIZE"; -BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE = "EVENT_TABLE_AFTER_COLUMN_RESIZE"; - -BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE = "EVENT_TABLE_BEFORE_REGION_RESIZE"; -BI.Table.EVENT_TABLE_REGION_RESIZE = "EVENT_TABLE_REGION_RESIZE"; -BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE = "EVENT_TABLE_AFTER_REGION_RESIZE"; -$.shortcut("bi.table_view", BI.Table); -/** - * - * 表格单元格 - * - * Created by GUY on 2016/1/12. - * @class BI.ResizableTableCell - * @extends BI.Widget - */ -BI.ResizableTableCell = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.ResizableTableCell.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-resizable-table-cell", - cell: {}, - start: BI.emptyFn, - resize: BI.emptyFn, - stop: BI.emptyFn - }) + _createColGroupCells: function (columnSize, store) { + var self = this, o = this.options; + columnSize = columnSize || o.columnSize; + store = store || {}; + var frag = document.createDocumentFragment(); + BI.each(columnSize, function (i, size) { + var width = self._calculateWidth(size); + var col = $("").attr("width", width).css("width", width); + store[i] = col; + frag.appendChild(col[0]); + }); + return frag; }, - _init: function () { - BI.ResizableTableCell.superclass._init.apply(this, arguments); + _createHeaderCells: function (items, columnSize, mergeCols, TDs, Ws, start) { var self = this, o = this.options; - this.cell = BI.createWidget(BI.extend({type: "bi.label"}, o.cell, {width: o.width, height: o.height})); + start || (start = 0); + var frag = this._createCells(items, columnSize, BI.range(o.columnSize.length), TDs, Ws, start, o.headerRowSize || o.rowSize); - var startDrag = false; - var size = 0, offset = 0, defaultSize = o.width; - var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX, deltaY) { - if (mouseMoveTracker.isDragging()) { - startDrag = true; - offset += deltaX; - size = BI.clamp(defaultSize + offset, 15, Number.MAX_VALUE); - self.handler.element.addClass("dragging"); - o.resize(size); - } - }, function () { - if (startDrag === true) { - size = BI.clamp(size, 15, Number.MAX_VALUE); - o.stop(size); - size = 0; - offset = 0; - defaultSize = o.width; - self.handler.element.removeClass("dragging"); - startDrag = false; - } - mouseMoveTracker.releaseMouseMoves(); - }, document); - this.handler = BI.createWidget({ - type: "bi.absolute", - cls: "resizable-table-cell-resizer-container", - width: 6, - items: [{ - el: { - type: "bi.layout", - cls: "resizable-table-cell-resizer-knob", - width: 4 - }, - right: 0, - top: 0, - bottom: 0 - }] - }); - this.handler.element.on("mousedown", function (event) { - defaultSize = o.width; - mouseMoveTracker.captureMouseMoves(event); - }); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.cell, - left: 0, - right: 0, - top: 0, - bottom: 0 - }, { - el: this.handler, - right: 0, - top: 0, - bottom: 0 - }] - }) + if (o.isNeedResize === true) { + var tds = TDs[BI.size(TDs) - 1]; + BI.each(tds, function (j, td) { + j = j | 0; + var resizer; + var getHeight = function (size, position) { + var rowSize = self.getCalculateRegionRowSize(); + if (o.isNeedFreeze === true) { + var tableHeight = self.bottomRightContainer.element.outerHeight(); + return size.height + Math.min(rowSize[1], tableHeight); + } else { + var tableHeight = self.tableContainer.element.outerHeight(); + var offset = self.tableContainer.element.offset(); + var offsetTop = position.top - offset.top; + var height = tableHeight - offsetTop; + height = Math.min(height, rowSize[0] - offsetTop); + return height; + } + }; + if (j < BI.size(tds) - 1) { + td.resizable({ + handles: "e", + minWidth: 15, + helper: "clone", + start: function (event, ui) { + var height = getHeight(ui.size, ui.position); + resizer = BI.createWidget({ + type: "bi.layout", + cls: "bi-resizer", + width: ui.size.width, + height: height + }); + + BI.createWidget({ + type: "bi.absolute", + element: "body", + items: [{ + el: resizer, + left: ui.position.left, + top: ui.position.top + }] + }); + self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_COLUMN_RESIZE); + }, + resize: function (e, ui) { + var height = getHeight(ui.size, ui.position); + resizer.element.css({"width": ui.size.width + "px", "height": height + "px"}); + //o.columnSize[start + j] = ui.size.width; + //self.setColumnSize(o.columnSize); + self.fireEvent(BI.Table.EVENT_TABLE_COLUMN_RESIZE); + e.stopPropagation(); + //return false; + }, + stop: function (e, ui) { + resizer.destroy(); + resizer = null; + o.columnSize[start + j] = ui.size.width - 1; + self.setColumnSize(o.columnSize); + self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE); + } + }) + } + }) + } + return frag; }, - setWidth: function (width) { - BI.ResizableTableCell.superclass.setWidth.apply(this, arguments); + _createFooterCells: function (items, columnSize, TDs, Ws) { var o = this.options; - this.cell.setWidth(o.width); + var frag = this._createCells(items, columnSize, [], TDs, Ws, 0); + return frag; }, - setHeight: function (height) { - BI.ResizableTableCell.superclass.setHeight.apply(this, arguments); - var o = this.options; - this.cell.setHeight(o.height); - } -}); -$.shortcut("bi.resizable_table_cell", BI.ResizableTableCell);/** - * - * 可调整列宽的grid表格 - * - * Created by GUY on 2016/1/12. - * @class BI.ResizableTable - * @extends BI.Widget - */ -BI.ResizableTable = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.ResizableTable.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-resizable-table", - el: { - type: "bi.grid_table" - }, - isNeedFreeze: false, - isNeedResize: true, - isResizeAdapt: false, - headerRowSize: 25, - rowSize: 25, - isNeedMerge: true,//是否需要合并单元格 - mergeCols: [], - mergeRule: BI.emptyFn, - columnSize: [], - freezeCols: [], - header: [], - items: [], - regionColumnSize: [] - }) + _createColGroup: function (columnSize, store, widgets) { + var self = this, o = this.options; + this.colgroup = this._colgroup(); + this.colgroup.element.append(this._createColGroupCells(columnSize, store, widgets)); + return this.colgroup; }, - _init: function () { - BI.ResizableTable.superclass._init.apply(this, arguments); + _createHeader: function () { var self = this, o = this.options; - this.resizer = BI.createWidget({ - type: "bi.layout", - cls: "resizable-table-resizer", - invisible: true, - width: 2 - }); - this.regionResizerHandler = this._createResizerHandler(); - this.table = BI.createWidget(o.el, { - type: "bi.grid_table", - element: this, - width: o.width, - height: o.height, - headerRowSize: o.headerRowSize, - rowSize: o.rowSize, - columnSize: o.columnSize, + if (o.header === false) { + return; + } + this.header = this._header(); + this.header.element.append(this._createHeaderCells(o.header, null, null, this.headerTds, this.headerItems)); + return this.header; + }, - isNeedFreeze: o.isNeedFreeze, - freezeCols: o.freezeCols, - isNeedMerge: o.isNeedMerge, - mergeCols: o.mergeCols, - mergeRule: BI.bind(this._mergeRule, this), + _createFooter: function (columnSize, store, widgets) { + var self = this, o = this.options; + if (o.footer === false) { + return; + } + this.footer = this._footer(); + this.footer.element.append(this._createFooterCells(o.footer, null, this.footerTds, this.footerItems)); + return this.footer; + }, - header: this._formatHeader(o.header), - items: o.items, - regionColumnSize: o.regionColumnSize + _createBody: function () { + var self = this, o = this.options; + this.body = this._body(); + this.body.element.append(this._createCells(o.items, null, null, this.bodyTds, this.bodyItems)); + return this.body; + }, + + _createNormalTable: function () { + var self = this, o = this.options, table = this._table(); + this.colgroupTds = {}; + this.headerTds = {}; + this.footerTds = {}; + this.bodyTds = {}; + + this.headerItems = {}; + this.footerItems = {}; + this.bodyItems = {}; + var colgroup = this._createColGroup(null, this.colgroupTds); + var header = this._createHeader(); + var footer = this._createFooter(); + var body = this._createBody(); + + BI.createWidget({ + type: "bi.adaptive", + element: table, + items: [colgroup, header, footer, body] }); - this.table.on(BI.Table.EVENT_TABLE_SCROLL, function () { - self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); + + var w = BI.sum(this.options.columnSize) || undefined; + w = this._calculateWidth(w); + if (BI.isNumeric(w) && w > 1) { + w += o.columnSize.length; + } + this.tableContainer = BI.createWidget({ + type: "bi.adaptive", + width: this._calculateWidth(w), + items: [table] + }); + + this.scrollBottomRight = BI.createWidget({ + type: "bi.adaptive", + width: "100%", + height: "100%", + cls: "scroll-bottom-right", + scrollable: true, + items: [this.tableContainer] }); + BI.createWidget({ - type: "bi.absolute", + type: "bi.adaptive", + cls: "bottom-right", element: this, - items: [{ - el: this.regionResizerHandler, - left: 0, - top: 0, - bottom: 0 - }, { - el: this.resizer, - left: 0, - top: 0 - }] + scrollable: false, + items: [this.scrollBottomRight] + }); + + this._resize = function () { + if (self.element.is(":visible")) { + self.setColumnSize(o.columnSize); + } + }; + + this._initNormalScroll(); + BI.Resizers.add(this.getName(), function (e) { + if (self.element.is(":visible") && BI.isWindow(e.target)) { + self._resize(); + self.fireEvent(BI.Table.EVENT_TABLE_RESIZE); + } + }); + BI.nextTick(function () { + if (self.element.is(":visible")) { + self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); + } + }); + }, + + _initNormalScroll: function () { + var self = this; + var scrolling, scrollX; + this.scrollBottomRight.element.mousewheel(function (event, delta, deltaX, deltaY) { + var inf = self._getScrollOffsetAndDur(event); + if (deltaY < 0 || deltaY > 0) { + var ele = self.scrollBottomRight.element; + if (scrolling) { + ele[0].scrollTop = scrolling; + } + + scrolling = ele[0].scrollTop - delta * inf.offset; + var stopPropagation = false; + var st = ele[0].scrollTop; + ele[0].scrollTop = scrolling; + if (ele[0].scrollTop !== st) { + stopPropagation = true; + } + ele[0].scrollTop = st; + self._animateScrollTo(ele, ele[0].scrollTop, scrolling, inf.dur, "linear", { + onStart: function () { + }, + onUpdate: function (top) { + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top); + }, + onComplete: function () { + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling); + scrolling = null; + } + }); + //var scrollTop = self.scrollBottomRight.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop - delta * offset; + //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop); + if (stopPropagation === true) { + event.stopPropagation(); + return false; + } + } + }); + var scrollTop = 0, scrollLeft = 0; + this.scrollBottomRight.element.scroll(function (e) { + var change = false; + var scrollElement = self.scrollBottomRight.element; + if (scrollElement.scrollTop() != scrollTop) { + if (Math.abs(scrollElement.scrollTop() - scrollTop) > 0.1) { + e.stopPropagation(); + change = true; + } + scrollTop = scrollElement.scrollTop(); + } + if (scrollElement.scrollLeft() != scrollLeft) { + if (Math.abs(scrollElement.scrollLeft() - scrollLeft) > 0.1) { + e.stopPropagation(); + change = true; + } + scrollLeft = scrollElement.scrollLeft(); + } + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL); + if (change === true) { + e.stopPropagation(); + //return false; + } + return false; }); - this._populate(); }, - _mergeRule: function (row1, row2) { - var o = this.options; - if (row1.type === "bi.resizable_table_cell") { - row1 = row1.cell; - } - if (row2.type === "bi.resizable_table_cell") { - row2 = row2.cell; + _split: function (items) { + var o = this.options, left = [], right = [], isRight = this._isRightFreeze(); + BI.each(items, function (i, rows) { + left.push([]); + right.push([]); + BI.each(rows, function (j, cell) { + if (o.freezeCols.contains(j)) { + (isRight ? right : left)[i].push(cell); + } else { + (isRight ? left : right)[i].push(cell); + } + }) + }); + return { + left: left, + right: right } - return o.mergeRule(row1, row2); }, - _createResizerHandler: function () { - var self = this, o = this.options; - var regionResizerHandler = BI.createWidget({ - type: "bi.absolute", - cls: "resizable-table-region-resizer", - invisible: true, - width: 6, - items: [{ - el: { - type: "bi.layout", - width: 2, - cls: "resizable-table-region-resizer-knob" - }, - left: 2, - top: 0, - bottom: 0 - }] + _table: function () { + return BI.createWidget({ + type: "bi.layout", + tagName: "table", + cls: "table", + attribute: {"cellspacing": 0, "cellpadding": 0} }); - var size = 0, offset = 0, defaultSize = 0, start = false; - var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX, deltaY) { - if (mouseMoveTracker.isDragging()) { - start = true; - offset += deltaX; - size = BI.clamp(defaultSize + offset, 15, o.width - 15); + }, - self.regionResizerHandler.element.addClass("dragging"); - self._setRegionResizerHandlerPosition(size - 3, 0); - } + _header: function () { + return BI.createWidget({ + type: "bi.layout", + cls: "header", + tagName: "thead" + }); + }, - }, function () { - if (start === true) { - o.regionColumnSize[0] = BI.clamp(size, 15, o.width - 15); - self.table.setRegionColumnSize(o.regionColumnSize); - if (o.isResizeAdapt === true) { - var freezeColumnSize = self._getFreezeColumnSize(); - o.columnSize[self._getFreezeColLength() - 1] += o.regionColumnSize[0] - freezeColumnSize; - self.table.setColumnSize(o.columnSize); - } - self.table.populate(); - self._populate(); - self.regionResizerHandler.element.removeClass("dragging"); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE); - start = false; - } - mouseMoveTracker.releaseMouseMoves(); - }, document); - regionResizerHandler.element.on("mousedown", function (event) { - defaultSize = size = self._getRegionSize(); - offset = 0; - self._setResizerPosition(0, 0); - mouseMoveTracker.captureMouseMoves(event); + _footer: function () { + return BI.createWidget({ + type: "bi.layout", + cls: "footer", + tagName: "tfoot" }); - return regionResizerHandler; }, - _setResizerPosition: function (left, top) { - this.resizer.element.css({ - left: left + "px", - top: top + "px" + _body: function () { + return BI.createWidget({ + type: "bi.layout", + tagName: "tbody", + cls: "body" }); }, - _setRegionResizerHandlerPosition: function (left, top) { - this.regionResizerHandler.element.css({ - left: left + "px", - top: top + "px" + _colgroup: function () { + return BI.createWidget({ + type: "bi.layout", + tagName: "colgroup" }); }, - _getRegionSize: function () { - var o = this.options; - var regionSize = o.regionColumnSize[0] || 0; - if (o.isNeedFreeze === false || o.freezeCols.length === 0) { - return 0; - } - if (!regionSize) { - BI.each(o.freezeCols, function (i, col) { - regionSize += o.columnSize[col]; + _init: function () { + BI.Table.superclass._init.apply(this, arguments); + + this.populate(this.options.items); + }, + + setColumnSize: function (columnSize) { + var self = this, o = this.options; + var isRight = this._isRightFreeze(); + o.columnSize = columnSize || []; + if (o.isNeedFreeze) { + var columnLeft = []; + var columnRight = []; + BI.each(o.columnSize, function (i, size) { + if (o.freezeCols.contains(i)) { + isRight ? columnRight.push(size) : columnLeft.push(size); + } else { + isRight ? columnLeft.push(size) : columnRight.push(size); + } + }); + var topleft = 0, topright = 1, bottomleft = 2, bottomright = 3; + var run = function (direction) { + var colgroupTds, bodyTds, bodyItems, sizes; + switch (direction) { + case topleft: + colgroupTds = self.topLeftColGroupTds; + bodyTds = self.topLeftBodyTds; + bodyItems = self.topLeftBodyItems; + sizes = columnLeft; + break; + case topright: + colgroupTds = self.topRightColGroupTds; + bodyTds = self.topRightBodyTds; + bodyItems = self.topRightBodyItems; + sizes = columnRight; + break; + case bottomleft: + colgroupTds = self.bottomLeftColGroupTds; + bodyTds = self.bottomLeftBodyTds; + bodyItems = self.bottomLeftBodyItems; + sizes = columnLeft; + break; + case bottomright: + colgroupTds = self.bottomRightColGroupTds; + bodyTds = self.bottomRightBodyTds; + bodyItems = self.bottomRightBodyItems; + sizes = columnRight; + break; + } + BI.each(colgroupTds, function (i, colgroup) { + var width = colgroup.attr("width") | 0; + if (width !== sizes[i]) { + var w = self._calculateWidth(sizes[i]); + colgroup.attr("width", w).css("width", w); + BI.each(bodyTds, function (j, items) { + if (items[i]) { + if (items[i].__mergeCols.length > 1) { + var wid = 0; + BI.each(sizes, function (t, s) { + if (items[i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += items[i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].attr("width", wid).css("width", wid); + } + } else { + items[i].attr("width", "").css("width", ""); + } + } else { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } + } + }); + BI.each(bodyItems, function (j, items) { + if (items[i]) { + if (bodyTds[j][i].__mergeCols.length > 1) { + var wid = 0; + BI.each(sizes, function (t, s) { + if (bodyTds[j][i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += bodyTds[j][i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].element.attr("width", wid).css("width", wid); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } else { + if (BI.isNumeric(w)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", w - 1).css("width", w - 1); + } else { + items[i].element.attr("width", w).css("width", w); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } + } + }); + } + }) + }; + run(topleft); + run(topright); + run(bottomleft); + run(bottomright); + + var lw = 0, rw = 0; + this.columnLeft = []; + this.columnRight = []; + BI.each(o.columnSize, function (i, size) { + if (o.freezeCols.contains(i)) { + lw += size; + self[isRight ? "columnRight" : "columnLeft"].push(size); + } else { + rw += size; + self[isRight ? "columnLeft" : "columnRight"].push(size); + } }); - } - return regionSize; - }, - - _getRegionRowSize: function () { - var o = this.options; - return [o.header.length * o.headerRowSize, - Math.min(o.height - o.header.length * o.headerRowSize, o.items.length * o.rowSize)]; - }, - - _getFreezeColLength: function () { - return this.options.freezeCols.length; - }, + lw = this._calculateWidth(lw); + rw = this._calculateWidth(rw); - _getFreezeColumnSize: function () { - var columnSize = this.options.columnSize; - var sum = 0; - for (var i = 0, len = this._getFreezeColLength(); i < len; i++) { - sum += columnSize[i]; + if (BI.isNumeric(lw)) { + lw = BI.parseFloat(lw) + o.freezeCols.length; + } + if (BI.isNumeric(rw)) { + rw = BI.parseFloat(rw) + o.columnSize.length - o.freezeCols.length; + } + this.topLeftContainer.element.width(isRight ? rw : lw); + this.bottomLeftContainer.element.width(isRight ? rw : lw); + this.topRightContainer.element.width(isRight ? lw : rw); + this.bottomRightContainer.element.width(isRight ? lw : rw); + this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft; + this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft; + if (o.isNeedResize && o.isResizeAdapt) { + var leftWidth = BI.sum(o.freezeCols, function (i, col) { + return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col]; + }); + this.partitions.attr("columnSize", isRight ? ['fill', leftWidth] : [leftWidth, 'fill']); + this.partitions.resize(); + } + } else { + BI.each(this.colgroupTds, function (i, colgroup) { + var width = colgroup.attr("width") | 0; + if (width !== o.columnSize[i]) { + var w = self._calculateWidth(o.columnSize[i]); + colgroup.attr("width", w).css("width", w); + BI.each(self.bodyTds, function (j, items) { + if (items[i]) { + if (items[i].__mergeCols.length > 1) { + var wid = 0; + BI.each(o.columnSize, function (t, s) { + if (items[i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += items[i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } else { + items[i].attr("width", "").css("width", ""); + } + } else { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } + } + }); + BI.each(self.headerTds, function (j, items) { + if (items[i]) { + if (items[i].__mergeCols.length > 1) { + var wid = 0; + BI.each(o.columnSize, function (t, s) { + if (items[i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += items[i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } else { + items[i].attr("width", "").css("width", ""); + } + } else { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } + } + }); + BI.each(self.footerTds, function (j, items) { + if (items[i]) { + if (items[i].__mergeCols.length > 1) { + var wid = 0; + BI.each(o.columnSize, function (t, s) { + if (items[i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += items[i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } else { + items[i].attr("width", "").css("width", ""); + } + } else { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } + } + }); + BI.each(self.bodyItems, function (j, items) { + if (items[i]) { + if (self.bodyTds[j][i].__mergeCols.length > 1) { + var wid = 0; + BI.each(o.columnSize, function (t, s) { + if (self.bodyTds[j][i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += self.bodyTds[j][i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].element.attr("width", wid).css("width", wid); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } else { + if (BI.isNumeric(w)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", w - 1).css("width", w - 1); + } else { + items[i].element.attr("width", w).css("width", w); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } + } + }); + BI.each(self.headerItems, function (j, items) { + if (items[i]) { + if (self.headerTds[j][i].__mergeCols.length > 1) { + var wid = 0; + BI.each(o.columnSize, function (t, s) { + if (self.headerTds[j][i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += self.headerTds[j][i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].element.attr("width", wid).css("width", wid); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } else { + if (BI.isNumeric(w)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", w - 1).css("width", w - 1); + } else { + items[i].element.attr("width", w).css("width", w); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } + } + }); + BI.each(self.footerItems, function (j, items) { + if (items[i]) { + if (self.footerTds[j][i].__mergeCols.length > 1) { + var wid = 0; + BI.each(o.columnSize, function (t, s) { + if (self.footerTds[j][i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += self.footerTds[j][i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].element.attr("width", wid).css("width", wid); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } else { + if (BI.isNumeric(w)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", w - 1).css("width", w - 1); + } else { + items[i].element.attr("width", w).css("width", w); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } + } + }); + } + }); + var w = this._calculateWidth(BI.sum(o.columnSize)); + if (w > 1.05) { + w += o.columnSize.length; + } + this.tableContainer.element.width(w); } - return sum; }, - _getResizerLeft: function (j) { - var left = 0; - var columnSize = this.options.columnSize; - var freezeColLength = this._getFreezeColLength(); - for (var i = (j >= freezeColLength ? freezeColLength : 0); i < j; i++) { - left += columnSize[i] || 0; - } - if (j >= freezeColLength) { - left += this.table.getRegionSize(); - left -= this.table.getRightHorizontalScroll(); - } else { - left -= this.table.getLeftHorizontalScroll(); - } - return left; + getColumnSize: function () { + return this.options.columnSize; }, - _formatHeader: function (header) { + getCalculateColumnSize: function () { var self = this, o = this.options; - var result = []; - var resize = function (j, size) { - self.resizer.setVisible(true); - var height = o.headerRowSize + self._getRegionRowSize()[1]; - self.resizer.setHeight(height); - - self._setResizerPosition(self._getResizerLeft(j) + size, (o.header.length - 1) * o.headerRowSize); - }; - var stop = function (j, size) { - self.resizer.setVisible(false); - o.columnSize[j] = size; - self.table.setColumnSize(o.columnSize); - self.table.populate(); - self._populate(); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE); - }; - BI.each(header, function (i, cols) { - if (i === header.length - 1) { - result[i] = []; - BI.each(cols, function (j, col) { - if (j === self._getFreezeColLength() - 1 || j === cols.length - 1) { - result[i][j] = col; - } else { - result[i][j] = { - type: "bi.resizable_table_cell", - cell: col, - resize: BI.bind(resize, null, j), - stop: BI.bind(stop, null, j) - }; - if (o.isNeedMerge) { - var r = i; - while (r > 0 && self._mergeRule(result[r][j], result[r - 1][j])) { - result[r - 1][j] = { - type: "bi.resizable_table_cell", - cell: result[r - 1][j], - resize: BI.bind(resize, null, j), - stop: BI.bind(stop, null, j) - }; - r--; - } + var columnSize = []; + if (o.isNeedFreeze === true) { + if (BI.size(this.bottomLeftBodyTds) > 0 || BI.size(this.bottomRightBodyTds) > 0) { + if (!BI.any(this.bottomLeftBodyTds, function (i, tds) { + if (!BI.any(tds, function (i, item) { + if (item.__mergeCols.length > 1) { + return true; + } + })) { + BI.each(tds, function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(tds) - 1) { + width++; + } + columnSize.push(width); + }); + return true; + } + })) { + BI.each(this.bottomLeftBodyTds[0], function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(self.bottomLeftBodyTds[0]) - 1) { + width++; + } + columnSize.push(width); + }); + } + if (!BI.any(this.bottomRightBodyTds, function (i, tds) { + if (!BI.any(tds, function (i, item) { + if (item.__mergeCols.length > 1) { + return true; + } + })) { + BI.each(tds, function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(tds) - 1) { + width++; + } + columnSize.push(width); + }); + return true; + } + })) { + BI.each(this.bottomRightBodyTds[0], function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(self.bottomRightBodyTds[0]) - 1) { + width++; } + columnSize.push(width); + }); + } + return columnSize; + } + if (!BI.any(this.topLeftBodyTds, function (i, tds) { + if (!BI.any(tds, function (i, item) { + if (item.__mergeCols.length > 1) { + return true; + } + })) { + BI.each(tds, function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(tds) - 1) { + width++; + } + columnSize.push(width); + }); + return true; + } + })) { + BI.each(this.topLeftBodyTds[BI.size(this.topLeftBodyTds) - 1], function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(self.topLeftBodyTds[BI.size(self.topLeftBodyTds) - 1]) - 1) { + width++; } + columnSize.push(width); }); - } else { - result.push(cols); } - }); - return result; - }, - - _populate: function () { - var o = this.options; - var regionSize = this._getRegionSize(); - if (regionSize > 0) { - this.regionResizerHandler.setVisible(true); - this._setRegionResizerHandlerPosition(regionSize - 3, 0); - } else { - this.regionResizerHandler.setVisible(false); - } - }, - - setWidth: function (width) { - BI.ResizableTable.superclass.setWidth.apply(this, arguments); - this.table.setWidth(width) - }, - - setHeight: function (height) { - BI.ResizableTable.superclass.setHeight.apply(this, arguments); - this.table.setHeight(height); - }, - - setVerticalScroll: function (scrollTop) { - this.table.setVerticalScroll(scrollTop); - }, - - setLeftHorizontalScroll: function (scrollLeft) { - this.table.setLeftHorizontalScroll(scrollLeft); - }, - - setRightHorizontalScroll: function (scrollLeft) { - this.table.setRightHorizontalScroll(scrollLeft); - }, - - setColumnSize: function (columnSize) { - this.options.columnSize = columnSize; - this.table.setColumnSize(columnSize); - }, - - getColumnSize: function () { - return this.table.getColumnSize(); - }, - - setRegionColumnSize: function (columnSize) { - this.options.regionColumnSize = columnSize; - this.table.setRegionColumnSize(columnSize); - }, - - getRegionColumnSize: function () { - return this.table.getRegionColumnSize(); - }, - - getVerticalScroll: function () { - return this.table.getVerticalScroll(); - }, - - getLeftHorizontalScroll: function () { - return this.table.getLeftHorizontalScroll(); - }, - - getRightHorizontalScroll: function () { - return this.table.getRightHorizontalScroll(); - }, - - attr: function () { - BI.ResizableTable.superclass.attr.apply(this, arguments); - this.table.attr.apply(this.table, arguments); - }, - - restore: function () { - this.table.restore(); - }, - - populate: function (items, header) { - if (items) { - this.options.items = items; - } - if (header) { - this.options.header = header; - if (this.options.isNeedResize) { - header = this._formatHeader(header); + if (!BI.any(this.topRightBodyTds, function (i, tds) { + if (!BI.any(tds, function (i, item) { + if (item.__mergeCols.length > 1) { + return true; + } + })) { + BI.each(tds, function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(tds) - 1) { + width++; + } + columnSize.push(width); + }); + return true; + } + })) { + BI.each(this.topRightBodyTds[BI.size(this.topRightBodyTds) - 1], function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(self.topRightBodyTds[BI.size(self.topRightBodyTds) - 1]) - 1) { + width++; + } + columnSize.push(width); + }); } + } else { + BI.each(this.headerTds[BI.size(this.headerTds) - 1], function (i, item) { + var width = item.width() / item.__mergeCols.length; + if (i == BI.size(self.headerTds[BI.size(self.headerTds) - 1]) - 1) { + width++; + } + columnSize.push(width); + }); } - this.table.populate(items, header); - this._populate(); - } -}); - -$.shortcut("bi.resizable_table", BI.ResizableTable);/** - * guy - * 异步树 - * @class BI.TreeView - * @extends BI.Pane - */ -BI.TreeView = BI.inherit(BI.Pane, { - _defaultConfig: function () { - return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-tree", - paras: {}, - itemsCreator: BI.emptyFn - }) + return columnSize; }, - _init: function () { - BI.TreeView.superclass._init.apply(this, arguments); - this._stop = false; - this.container = BI.createWidget(); + setHeaderColumnSize: function (columnSize) { + var self = this, o = this.options; + var isRight = this._isRightFreeze(); + if (o.isNeedFreeze) { + var columnLeft = []; + var columnRight = []; + BI.each(columnSize, function (i, size) { + if (o.freezeCols.contains(i)) { + isRight ? columnRight.push(size) : columnLeft.push(size); + } else { + isRight ? columnLeft.push(size) : columnRight.push(size); + } + }); + var topleft = 0, topright = 1; + var run = function (direction) { + var colgroupTds, bodyTds, bodyItems, sizes; + switch (direction) { + case topleft: + colgroupTds = self.topLeftColGroupTds; + bodyTds = self.topLeftBodyTds; + bodyItems = self.topLeftBodyItems; + sizes = columnLeft; + break; + case topright: + colgroupTds = self.topRightColGroupTds; + bodyTds = self.topRightBodyTds; + bodyItems = self.topRightBodyItems; + sizes = columnRight; + break; + } + BI.each(colgroupTds, function (i, colgroup) { + var width = colgroup.attr("width") | 0; + if (width !== sizes[i]) { + var w = self._calculateWidth(sizes[i]); + colgroup.attr("width", w).css("width", w); + BI.each(bodyTds, function (j, items) { + if (items[i]) { + if (items[i].__mergeCols.length > 1) { + var wid = 0; + BI.each(sizes, function (t, s) { + if (items[i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += items[i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].attr("width", wid).css("width", wid); + } + } else { + items[i].attr("width", "").css("width", ""); + } + } else { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } + } + }); + BI.each(bodyItems, function (j, items) { + if (items[i]) { + if (bodyTds[j][i].__mergeCols.length > 1) { + var wid = 0; + BI.each(sizes, function (t, s) { + if (bodyTds[j][i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += bodyTds[j][i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].element.attr("width", wid).css("width", wid); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } else { + if (BI.isNumeric(w)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", w - 1).css("width", w - 1); + } else { + items[i].element.attr("width", w).css("width", w); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } + } + }); + } + }) + }; + run(topleft); + run(topright); - this._createTree(); - this.tip = BI.createWidget({ - type: "bi.loading_bar", - invisible: true, - handler: BI.bind(this._loadMore, this) - }); - BI.createWidget({ - type: "bi.vertical", - scrollable: true, - scrolly: false, - element: this, - items: [this.container, this.tip] - }); + var lw = 0, rw = 0; + BI.each(columnSize, function (i, size) { + if (o.freezeCols.contains(i)) { + lw += size; + } else { + rw += size; + } + }); + lw = this._calculateWidth(lw); + rw = this._calculateWidth(rw); + if (BI.isNumeric(lw)) { + lw = BI.parseFloat(lw) + o.freezeCols.length; + } + if (BI.isNumeric(rw)) { + rw = BI.parseFloat(rw) + columnSize.length - o.freezeCols.length; + } + this.topLeftContainer.element.width(isRight ? rw : lw); + this.topRightContainer.element.width(isRight ? lw : rw); + this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft; + this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft; + if (o.isNeedResize && o.isResizeAdapt) { + var leftWidth = BI.sum(o.freezeCols, function (i, col) { + return columnSize[col] > 1 ? columnSize[col] + 1 : columnSize[col]; + }); + this.partitions.attr("columnSize", isRight ? ['fill', leftWidth] : [leftWidth, 'fill']); + this.partitions.resize(); + } + } else { + BI.each(this.colgroupTds, function (i, colgroup) { + var width = colgroup.attr("width") | 0; + if (width !== columnSize[i]) { + var w = self._calculateWidth(columnSize[i]); + colgroup.attr("width", w).css("width", w); + BI.each(self.headerTds, function (j, items) { + if (items[i]) { + if (items[i].__mergeCols.length > 1) { + var wid = 0; + BI.each(columnSize, function (t, s) { + if (items[i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += items[i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].element.attr("width", wid).css("width", wid); + } + } else { + items[i].attr("width", "").css("width", ""); + } + } else { + if (i == BI.size(items) - 1) { + items[i].attr("width", w - 1).css("width", w - 1); + } else { + items[i].attr("width", w).css("width", w); + } + } + } + }); + BI.each(self.headerItems, function (j, items) { + if (items[i]) { + if (self.headerTds[j][i].__mergeCols.length > 1) { + var wid = 0; + BI.each(columnSize, function (t, s) { + if (self.headerTds[j][i].__mergeCols.contains(t)) { + wid += s; + } + }); + wid = self._calculateWidth(wid); + if (wid > 1) { + wid += self.headerTds[j][i].__mergeCols.length - 1; + } + if (BI.isNumeric(wid)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", wid - 1).css("width", wid - 1); + } else { + items[i].element.attr("width", wid).css("width", wid); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } else { + if (BI.isNumeric(w)) { + if (i == BI.size(items) - 1) { + items[i].element.attr("width", w - 1).css("width", w - 1); + } else { + items[i].element.attr("width", w).css("width", w); + } + } else { + items[i].element.attr("width", "").css("width", ""); + } + } + } + }); + } + }); + var cW = this._calculateWidth(BI.sum(columnSize)); + if (cW > 1.05) { + cW = cW + columnSize.length; + } + this.tableContainer.element.width(cW); + } }, - _createTree: function () { - this.id = "bi-tree" + BI.UUID(); - if (this.nodes) { - this.nodes.destroy(); - } - if (this.tree) { - this.tree.destroy(); + setRegionColumnSize: function (columnSize) { + var self = this, o = this.options; + o.regionColumnSize = columnSize; + if (o.freezeCols.length === 0) { + if (o.isNeedFreeze) { + this.partitions.attr("columnSize", this._isRightFreeze() ? ['fill', 0] : [0, 'fill']); + this.partitions.resize(); + } else { + this.tableContainer.element.width(columnSize[0]); + } + } else if (o.freezeCols.length > 0 && o.freezeCols.length < o.columnSize.length) { + if (o.isNeedFreeze) { + this.partitions.attr("columnSize", columnSize); + this.partitions.resize(); + } else { + this.tableContainer.element.width(columnSize[0]); + } + } else { + if (o.isNeedFreeze) { + this.partitions.attr("columnSize", this._isRightFreeze() ? [0, 'fill'] : ['fill', 0]); + this.partitions.resize(); + } else { + this.tableContainer.element.width(columnSize[0]); + } } - this.tree = BI.createWidget({ - type: "bi.layout", - element: "
      " - }); - BI.createWidget({ - type: "bi.default", - element: this.container, - items: [this.tree] - }); }, - //选择节点触发方法 - _selectTreeNode: function (treeId, treeNode) { - this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, treeNode, this); - this.fireEvent(BI.TreeView.EVENT_CHANGE, treeNode, this); + getRegionColumnSize: function () { + return this.options.regionColumnSize; }, - //配置属性 - _configSetting: function () { - var paras = this.options.paras; - var self = this; - var setting = { - async: { - enable: true, - url: getUrl, - autoParam: ["id", "name"], - otherParam: BI.cjkEncodeDO(paras) - }, - check: { - enable: true - }, - data: { - key: { - title: "title", - name: "text" - }, - simpleData: { - enable: true - } - }, - view: { - showIcon: false, - expandSpeed: "", - nameIsHTML: true, - dblClickExpand: false - }, - callback: { - beforeExpand: beforeExpand, - onAsyncSuccess: onAsyncSuccess, - onAsyncError: onAsyncError, - beforeCheck: beforeCheck, - onCheck: onCheck, - onExpand: onExpand, - onCollapse: onCollapse, - onClick: onClick - } - }; - var className = "dark", perTime = 100; - - function onClick(event, treeId, treeNode) { - self.nodes.checkNode(treeNode, !treeNode.checked, true, true); + getCalculateRegionColumnSize: function () { + var o = this.options; + if (o.isNeedFreeze) { + return [this.scrollBottomLeft.element.width(), this.scrollBottomRight.element.width()]; } + return [this.scrollBottomRight.element.width()]; + }, - function getUrl(treeId, treeNode) { - var parentNode = self._getParentValues(treeNode); - treeNode.times = treeNode.times || 1; - var param = "id=" + treeNode.id - + "×=" + (treeNode.times++) - + "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) - + "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + getCalculateRegionRowSize: function () { + var o = this.options; + if (o.isNeedFreeze) { + return [this.scrollTopRight.element.height(), this.scrollBottomRight.element.height()]; + } + return [this.scrollBottomRight.element.height()]; + }, - return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; + getClientRegionColumnSize: function () { + var o = this.options; + if (o.isNeedFreeze) { + return [this.scrollBottomLeft.element[0].clientWidth, this.scrollBottomRight.element[0].clientWidth]; } + return [this.scrollBottomRight.element[0].clientWidth]; + }, - function beforeExpand(treeId, treeNode) { - if (!treeNode.isAjaxing) { - if (!treeNode.children) { - treeNode.times = 1; - ajaxGetNodes(treeNode, "refresh"); - } - return true; - } else { - BI.Msg.toast("Please Wait。", "warning"); - return false; - } + getClientRegionRowSize: function () { + var o = this.options; + if (o.isNeedFreeze) { + return [this.scrollBottomLeft.element[0].clientHeight, this.scrollBottomRight.element[0].clientHeight]; } + return [this.scrollBottomRight.element[0].clientHeight]; + }, - function onAsyncSuccess(event, treeId, treeNode, msg) { - treeNode.halfCheck = false; - if (!msg || msg.length === 0 || /^[\s,\S]*<\/html>$/gi.test(msg) || self._stop) { - return; - } - var zTree = self.nodes; - var totalCount = treeNode.count || 0; + getScrollRegionColumnSize: function () { + var o = this.options; + if (o.isNeedFreeze) { + return [this.scrollBottomLeft.element[0].scrollWidth, this.scrollBottomRight.element[0].scrollWidth]; + } + return [this.scrollBottomRight.element[0].scrollWidth]; + }, - //尝试去获取下一组节点,若获取值为空数组,表示获取完成 - // TODO by GUY - if (treeNode.children.length > totalCount) { - treeNode.count = treeNode.children.length; - BI.delay(function () { - ajaxGetNodes(treeNode); - }, perTime); + getScrollRegionRowSize: function () { + var o = this.options; + if (o.isNeedFreeze) { + if (o.freezeCols.length < o.columnSize.length) { + return [this.scrollTopRight.element[0].scrollHeight, this.scrollBottomRight.element[0].scrollHeight]; } else { - //treeNode.icon = ""; - zTree.updateNode(treeNode); - zTree.selectNode(treeNode.children[0]); - //className = (className === "dark" ? "":"dark"); + return [this.scrollTopLeft.element[0].scrollHeight, this.scrollBottomLeft.element[0].scrollHeight]; } } + return [this.scrollBottomRight.element[0].scrollHeight]; + }, - function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) { - var zTree = self.nodes; - BI.Msg.toast("Error!", "warning"); - //treeNode.icon = ""; - //zTree.updateNode(treeNode); + hasVerticalScroll: function () { + var o = this.options; + if (o.isNeedFreeze) { + return this.scrollBottomRight.element.hasVerticalScroll() || this.scrollBottomLeft.element.hasVerticalScroll(); } + return this.scrollBottomRight.element.hasVerticalScroll(); + }, - function ajaxGetNodes(treeNode, reloadType) { - var zTree = self.nodes; - if (reloadType == "refresh") { - //treeNode.icon = FR.servletURL +"?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif"; - zTree.updateNode(treeNode); + setVerticalScroll: function (scrollTop) { + var o = this.options; + if (o.isNeedFreeze) { + if (this.scrollBottomRight.element[0].scrollTop !== scrollTop) { + this.scrollBottomRight.element[0].scrollTop = scrollTop; } - zTree.reAsyncChildNodes(treeNode, reloadType, true); - } - - function beforeCheck(treeId, treeNode) { - treeNode.halfCheck = false; - if (treeNode.checked === true) { - //将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy - //所有的半选状态都需要取消halfCheck=true的情况 - function track(children) { - BI.each(children, function (i, ch) { - if (ch.halfCheck === true) { - ch.halfCheck = false; - track(ch.children); - } - }) - } - - track(treeNode.children); - var treeObj = self.nodes; - var nodes = treeObj.getSelectedNodes(); - $.each(nodes, function (index, node) { - node.halfCheck = false; - }) + if (this.scrollBottomLeft.element[0].scrollTop !== scrollTop) { + this.scrollBottomLeft.element[0].scrollTop = scrollTop; + } + } else { + if (this.scrollBottomRight.element[0].scrollTop !== scrollTop) { + this.scrollBottomRight.element[0].scrollTop = scrollTop; } } + }, - function onCheck(event, treeId, treeNode) { - self._selectTreeNode(treeId, treeNode); + setLeftHorizontalScroll: function (scrollLeft) { + var o = this.options; + if (o.isNeedFreeze) { + if (this.scrollBottomLeft.element[0].scrollLeft !== scrollLeft) { + this.scrollBottomLeft.element[0].scrollLeft = scrollLeft; + } + if (this.scrollTopLeft.element[0].scrollLeft !== scrollLeft) { + this.scrollTopLeft.element[0].scrollLeft = scrollLeft; + } + } else { + if (this.scrollBottomRight.element[0].scrollLeft !== scrollLeft) { + this.scrollBottomRight.element[0].scrollLeft = scrollLeft; + } } + }, - function onExpand(event, treeId, treeNode) { - treeNode.halfCheck = false; + setRightHorizontalScroll: function (scrollLeft) { + var o = this.options; + if (o.isNeedFreeze) { + if (this.scrollBottomRight.element[0].scrollLeft !== scrollLeft) { + this.scrollBottomRight.element[0].scrollLeft = scrollLeft; + } + if (this.scrollTopRight.element[0].scrollLeft !== scrollLeft) { + this.scrollTopRight.element[0].scrollLeft = scrollLeft; + } + } else { + if (this.scrollBottomRight.element[0].scrollLeft !== scrollLeft) { + this.scrollBottomRight.element[0].scrollLeft = scrollLeft; + } } + }, - function onCollapse(event, treeId, treeNode) { + getVerticalScroll: function () { + var o = this.options; + if (o.isNeedFreeze) { + return this.scrollBottomRight.element[0].scrollTop || this.scrollBottomLeft.element[0].scrollTop; } - - return setting; + return this.scrollBottomRight.element[0].scrollTop; }, - _getParentValues: function (treeNode) { - if (!treeNode.getParentNode()) { - return []; + getLeftHorizontalScroll: function () { + var o = this.options; + if (o.isNeedFreeze) { + return this.scrollBottomLeft.element[0].scrollLeft; } - var parentNode = treeNode.getParentNode(); - var result = this._getParentValues(parentNode); - result = result.concat([this._getNodeValue(parentNode)]); - return result; + return this.scrollBottomRight.element[0].scrollLeft; }, - _getNodeValue: function (node) { - //去除标红 - return node.value || node.text.replace(/<[^>]+>/g, ""); + getRightHorizontalScroll: function () { + var o = this.options; + if (o.isNeedFreeze) { + return this.scrollBottomRight.element[0].scrollLeft; + } + return this.scrollBottomRight.element[0].scrollLeft; }, - //获取半选框值 - _getHalfSelectedValues: function (map, node) { - var self = this; - var checkState = node.getCheckStatus(); - //将未选的去掉 - if (checkState.checked === false && checkState.half === false) { - return; + getColumns: function () { + var o = this.options; + if (o.isNeedFreeze) { + return { + topLeft: this.topLeftBodyItems, + topRight: this.topRightBodyItems, + bottomLeft: this.bottomLeftBodyItems, + bottomRight: this.bottomRightBodyItems + } + } else { + return { + header: this.headerItems, + body: this.bodyItems, + footer: this.footerItems + } } - //如果节点已展开,并且是半选 - if (BI.isNotEmptyArray(node.children) && checkState.half === true) { - var children = node.children; - BI.each(children, function (i, ch) { - self._getHalfSelectedValues(map, ch); - }); - return; + }, + + populate: function (items, header) { + this.options.items = items || []; + if (header) { + this.options.header = header; } - var parent = node.parentValues || self._getParentValues(node); - var path = parent.concat(this._getNodeValue(node)); - if (BI.isNotEmptyArray(node.children) || checkState.half === false) { - this._buildTree(map, path); - return; + this.empty(); + if (this.options.isNeedFreeze) { + this._createFreezeTable(); + } else { + this._createNormalTable(); } - var storeValues = BI.deepClone(this.options.paras.selected_values); - var treeNode = this._getTree(storeValues, path); - this._addTreeNode(map, parent, this._getNodeValue(node), treeNode); }, - _getTree: function (map, values) { - var cur = map; - BI.any(values, function (i, value) { - if (cur[value] == null) { - return true; - } - cur = cur[value]; - }); - return cur; + empty: function () { + BI.Resizers.remove(this.getName()); + BI.Table.superclass.empty.apply(this, arguments); }, - _addTreeNode: function (map, values, key, value) { - var cur = map; - BI.each(values, function (i, value) { - if (cur[value] == null) { - cur[value] = {}; - } - cur = cur[value]; - }); - cur[key] = value; + destroy: function () { + BI.Table.superclass.destroy.apply(this, arguments); + } +}) +; +BI.Table.EVENT_TABLE_AFTER_INIT = "EVENT_TABLE_AFTER_INIT"; +BI.Table.EVENT_TABLE_RESIZE = "EVENT_TABLE_RESIZE"; +BI.Table.EVENT_TABLE_SCROLL = "EVENT_TABLE_SCROLL"; +BI.Table.EVENT_TABLE_BEFORE_COLUMN_RESIZE = "EVENT_TABLE_BEFORE_COLUMN_RESIZE"; +BI.Table.EVENT_TABLE_COLUMN_RESIZE = "EVENT_TABLE_COLUMN_RESIZE"; +BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE = "EVENT_TABLE_AFTER_COLUMN_RESIZE"; + +BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE = "EVENT_TABLE_BEFORE_REGION_RESIZE"; +BI.Table.EVENT_TABLE_REGION_RESIZE = "EVENT_TABLE_REGION_RESIZE"; +BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE = "EVENT_TABLE_AFTER_REGION_RESIZE"; +$.shortcut("bi.table_view", BI.Table); +/** + * + * 表格单元格 + * + * Created by GUY on 2016/1/12. + * @class BI.ResizableTableCell + * @extends BI.Widget + */ +BI.ResizableTableCell = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.ResizableTableCell.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-resizable-table-cell", + cell: {}, + start: BI.emptyFn, + resize: BI.emptyFn, + stop: BI.emptyFn + }) }, - //构造树节点 - _buildTree: function (map, values) { - var cur = map; - BI.each(values, function (i, value) { - if (cur[value] == null) { - cur[value] = {}; + _init: function () { + BI.ResizableTableCell.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.cell = BI.createWidget(BI.extend({type: "bi.label"}, o.cell, {width: o.width, height: o.height})); + + var startDrag = false; + var size = 0, offset = 0, defaultSize = o.width; + var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX, deltaY) { + if (mouseMoveTracker.isDragging()) { + startDrag = true; + offset += deltaX; + size = BI.clamp(defaultSize + offset, 15, Number.MAX_VALUE); + self.handler.element.addClass("dragging"); + o.resize(size); } - cur = cur[value]; + }, function () { + if (startDrag === true) { + size = BI.clamp(size, 15, Number.MAX_VALUE); + o.stop(size); + size = 0; + offset = 0; + defaultSize = o.width; + self.handler.element.removeClass("dragging"); + startDrag = false; + } + mouseMoveTracker.releaseMouseMoves(); + }, document); + this.handler = BI.createWidget({ + type: "bi.absolute", + cls: "resizable-table-cell-resizer-container", + width: 6, + items: [{ + el: { + type: "bi.layout", + cls: "resizable-table-cell-resizer-knob", + width: 4 + }, + right: 0, + top: 0, + bottom: 0 + }] + }); + this.handler.element.on("mousedown", function (event) { + defaultSize = o.width; + mouseMoveTracker.captureMouseMoves(event); + }); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.cell, + left: 0, + right: 0, + top: 0, + bottom: 0 + }, { + el: this.handler, + right: 0, + top: 0, + bottom: 0 + }] }) }, - //获取选中的值 - _getSelectedValues: function () { - var self = this; - var hashMap = {}; - var rootNoots = this.nodes.getNodes(); - track(rootNoots); - function track(nodes) { - BI.each(nodes, function (i, node) { - var checkState = node.getCheckStatus(); - if (checkState.checked === true || checkState.half === true) { - if (checkState.half === true) { - self._getHalfSelectedValues(hashMap, node); - } else { - var parentValues = node.parentValues || self._getParentValues(node); - var values = parentValues.concat([self._getNodeValue(node)]); - self._buildTree(hashMap, values); - } - } - }) - } - - return hashMap; + setWidth: function (width) { + BI.ResizableTableCell.superclass.setWidth.apply(this, arguments); + var o = this.options; + this.cell.setWidth(o.width); }, - //处理节点 - _dealWidthNodes: function (nodes) { - var self = this, o = this.options; - //处理标红 - if (BI.isKey(o.paras.keyword)) { - var keyword = o.paras.keyword; - var ns = BI.Tree.transformToArrayFormat(nodes); - BI.each(ns, function (i, n) { - n.text = $("
      ").__textKeywordMarked__(n.text, keyword, n.py).html(); - }); - } - return nodes; + setHeight: function (height) { + BI.ResizableTableCell.superclass.setHeight.apply(this, arguments); + var o = this.options; + this.cell.setHeight(o.height); + } +}); +$.shortcut("bi.resizable_table_cell", BI.ResizableTableCell);/** + * + * 可调整列宽的grid表格 + * + * Created by GUY on 2016/1/12. + * @class BI.ResizableTable + * @extends BI.Widget + */ +BI.ResizableTable = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.ResizableTable.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-resizable-table", + el: { + type: "bi.grid_table" + }, + isNeedFreeze: false, + isNeedResize: true, + isResizeAdapt: false, + headerRowSize: 25, + rowSize: 25, + isNeedMerge: true,//是否需要合并单元格 + mergeCols: [], + mergeRule: BI.emptyFn, + columnSize: [], + freezeCols: [], + header: [], + items: [], + regionColumnSize: [] + }) }, - _loadMore: function () { + _init: function () { + BI.ResizableTable.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.tip.setLoading(); - var op = BI.extend({}, o.paras, { - times: ++this.times + this.resizer = BI.createWidget({ + type: "bi.layout", + cls: "resizable-table-resizer", + invisible: true, + width: 2 }); - o.itemsCreator(op, function (res) { - if (self._stop === true) { - return; - } - var hasNext = !!res.hasNext, nodes = res.items || []; + this.regionResizerHandler = this._createResizerHandler(); + this.table = BI.createWidget(o.el, { + type: "bi.grid_table", + element: this, + width: o.width, + height: o.height, + headerRowSize: o.headerRowSize, + rowSize: o.rowSize, + columnSize: o.columnSize, - if (!hasNext) { - self.tip.setEnd(); - } else { - self.tip.setLoaded(); - } - if (nodes.length > 0) { - self.nodes.addNodes(null, self._dealWidthNodes(nodes)); - } - }); - }, + isNeedFreeze: o.isNeedFreeze, + freezeCols: o.freezeCols, + isNeedMerge: o.isNeedMerge, + mergeCols: o.mergeCols, + mergeRule: BI.bind(this._mergeRule, this), - //生成树内部方法 - _initTree: function (setting) { - var self = this, o = this.options; - self.fireEvent(BI.Events.INIT); - this.times = 1; - var tree = this.tree; - tree.empty(); - this.loading(); - this.tip.setVisible(false); - var callback = function (nodes) { - if (self._stop === true) { - return; - } - self.nodes = $.fn.zTree.init(tree.element, setting, nodes); - }; - var op = BI.extend({}, o.paras, { - times: 1, - type: BICst.TREE.TREE_REQ_TYPE.INIT_DATA + header: this._formatHeader(o.header), + items: o.items, + regionColumnSize: o.regionColumnSize }); - - o.itemsCreator(op, function (res) { - if (self._stop === true) { - return; - } - var hasNext = !!res.hasNext, nodes = res.items || []; - if (nodes.length > 0) { - callback(self._dealWidthNodes(nodes)); - } - self.setTipVisible(nodes.length <= 0); - self.loaded(); - if (!hasNext) { - self.tip.invisible(); - } else { - self.tip.setLoaded(); - } - op.times === 1 && self.fireEvent(BI.Events.AFTERINIT); + this.table.on(BI.Table.EVENT_TABLE_SCROLL, function () { + self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, arguments); }); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.regionResizerHandler, + left: 0, + top: 0, + bottom: 0 + }, { + el: this.resizer, + left: 0, + top: 0 + }] + }); + this._populate(); }, - //构造树结构, - initTree: function (nodes, setting) { - var setting = setting || { - async: { - enable: false - }, - check: { - enable: false - }, - data: { - key: { - title: "title", - name: "text" - }, - simpleData: { - enable: true - } - }, - view: { - showIcon: false, - expandSpeed: "" - }, - callback: {} - }; - this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes); - }, - - start: function () { - this._stop = false; - }, - - stop: function () { - this._stop = true; + _mergeRule: function (row1, row2) { + var o = this.options; + if (row1.type === "bi.resizable_table_cell") { + row1 = row1.cell; + } + if (row2.type === "bi.resizable_table_cell") { + row2 = row2.cell; + } + return o.mergeRule(row1, row2); }, - //生成树方法 - stroke: function (config) { - delete this.options.keyword; - BI.extend(this.options.paras, config); - var setting = this._configSetting(); - this._createTree(); - this.start(); - this._initTree(setting); - }, + _createResizerHandler: function () { + var self = this, o = this.options; + var regionResizerHandler = BI.createWidget({ + type: "bi.absolute", + cls: "resizable-table-region-resizer", + invisible: true, + width: 6, + items: [{ + el: { + type: "bi.layout", + width: 2, + cls: "resizable-table-region-resizer-knob" + }, + left: 2, + top: 0, + bottom: 0 + }] + }); + var size = 0, offset = 0, defaultSize = 0, start = false; + var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX, deltaY) { + if (mouseMoveTracker.isDragging()) { + start = true; + offset += deltaX; + size = BI.clamp(defaultSize + offset, 15, o.width - 15); - populate: function () { - this.stroke.apply(this, arguments); - }, + self.regionResizerHandler.element.addClass("dragging"); + self._setRegionResizerHandlerPosition(size - 3, 0); + } - hasChecked: function () { - var treeObj = this.nodes; - return treeObj.getCheckedNodes(true).length > 0; + }, function () { + if (start === true) { + o.regionColumnSize[0] = BI.clamp(size, 15, o.width - 15); + self.table.setRegionColumnSize(o.regionColumnSize); + if (o.isResizeAdapt === true) { + var freezeColumnSize = self._getFreezeColumnSize(); + o.columnSize[self._getFreezeColLength() - 1] += o.regionColumnSize[0] - freezeColumnSize; + self.table.setColumnSize(o.columnSize); + } + self.table.populate(); + self._populate(); + self.regionResizerHandler.element.removeClass("dragging"); + self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE); + start = false; + } + mouseMoveTracker.releaseMouseMoves(); + }, document); + regionResizerHandler.element.on("mousedown", function (event) { + defaultSize = size = self._getRegionSize(); + offset = 0; + self._setResizerPosition(0, 0); + mouseMoveTracker.captureMouseMoves(event); + }); + return regionResizerHandler; }, - checkAll: function (checked) { - this.nodes && this.nodes.checkAllNodes(checked); + _setResizerPosition: function (left, top) { + this.resizer.element.css({ + left: left + "px", + top: top + "px" + }); }, - expandAll: function (flag) { - this.nodes && this.nodes.expandAll(flag); + _setRegionResizerHandlerPosition: function (left, top) { + this.regionResizerHandler.element.css({ + left: left + "px", + top: top + "px" + }); }, - setValue: function (value, param) { - this.options.paras.selected_values = value || {}; - this.selected_values = BI.deepClone(value) || {}; - this.checkAll(false); - this.updateValue(value, param); - this.refresh(); + _getRegionSize: function () { + var o = this.options; + var regionSize = o.regionColumnSize[0] || 0; + if (o.isNeedFreeze === false || o.freezeCols.length === 0) { + return 0; + } + if (!regionSize) { + BI.each(o.freezeCols, function (i, col) { + regionSize += o.columnSize[col]; + }); + } + return regionSize; }, - updateValue: function (values, param) { - if (!this.nodes) { - return; - } - param || (param = "value"); - var treeObj = this.nodes; - BI.each(values, function (v, op) { - var nodes = treeObj.getNodesByParam(param, v, null); - BI.each(nodes, function (j, node) { - BI.extend(node, {checked: true}, op); - treeObj.updateNode(node); - }) - }); + _getRegionRowSize: function () { + var o = this.options; + return [o.header.length * o.headerRowSize, + Math.min(o.height - o.header.length * o.headerRowSize, o.items.length * o.rowSize)]; }, - refresh: function () { - this.nodes && this.nodes.refresh(); + _getFreezeColLength: function () { + return this.options.freezeCols.length; }, - getValue: function () { - if (!this.nodes) { - return null; + _getFreezeColumnSize: function () { + var columnSize = this.options.columnSize; + var sum = 0; + for (var i = 0, len = this._getFreezeColLength(); i < len; i++) { + sum += columnSize[i]; } - return this._getSelectedValues(); + return sum; }, - empty: function () { - BI.isNotNull(this.nodes) && this.nodes.destroy(); + _getResizerLeft: function (j) { + var left = 0; + var columnSize = this.options.columnSize; + var freezeColLength = this._getFreezeColLength(); + for (var i = (j >= freezeColLength ? freezeColLength : 0); i < j; i++) { + left += columnSize[i] || 0; + } + if (j >= freezeColLength) { + left += this.table.getRegionSize(); + left -= this.table.getRightHorizontalScroll(); + } else { + left -= this.table.getLeftHorizontalScroll(); + } + return left; }, - destroy: function () { - this.stop(); - this.nodes && this.nodes.destroy(); - BI.TreeView.superclass.destroy.apply(this, arguments); - } -}); -BI.extend(BI.TreeView, { - REQ_TYPE_INIT_DATA: 1, - REQ_TYPE_ADJUST_DATA: 2, - REQ_TYPE_CALCULATE_SELECT_DATA: 3, - REQ_TYPE_SELECTED_DATA: 4 -}); - -BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE"; -BI.TreeView.EVENT_INIT = BI.Events.INIT; -BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT; - -$.shortcut("bi.tree", BI.TreeView);/** - * guy - * 同步树 - * @class BI.SyncTree - * @extends BI.TreeView - */ -BI.SyncTree = BI.inherit(BI.TreeView, { - _defaultConfig: function () { - return BI.extend(BI.SyncTree.superclass._defaultConfig.apply(this, arguments), {}) - }, - _init: function () { - BI.SyncTree.superclass._init.apply(this, arguments); - }, + _formatHeader: function (header) { + var self = this, o = this.options; + var result = []; + var resize = function (j, size) { + self.resizer.setVisible(true); + var height = o.headerRowSize + self._getRegionRowSize()[1]; + self.resizer.setHeight(height); - //配置属性 - _configSetting: function () { - var paras = this.options.paras; - var self = this; - var setting = { - async: { - enable: false, - otherParam: BI.cjkEncodeDO(paras) - }, - check: { - enable: true - }, - data: { - key: { - title: "title", - name: "text" - }, - simpleData: { - enable: true - } - }, - view: { - showIcon: false, - expandSpeed: "", - nameIsHTML: true, - dblClickExpand: false - }, - callback: { - beforeCheck: beforeCheck, - onCheck: onCheck, - beforeExpand: beforeExpand, - onExpand: onExpand, - onCollapse: onCollapse, - onClick: onClick - } + self._setResizerPosition(self._getResizerLeft(j) + size, (o.header.length - 1) * o.headerRowSize); }; - - function onClick(event, treeId, treeNode) { - var zTree = $.fn.zTree.getZTreeObj(treeId); - zTree.checkNode(treeNode, !treeNode.checked, true, true); - } - - function beforeCheck(treeId, treeNode) { - treeNode.halfCheck = false; - if (treeNode.checked === true) { - //将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy - //所有的半选状态都需要取消halfCheck=true的情况 - function track(children) { - BI.each(children, function (i, ch) { - if (ch.halfCheck === true) { - ch.halfCheck = false; - track(ch.children); + var stop = function (j, size) { + self.resizer.setVisible(false); + o.columnSize[j] = size; + self.table.setColumnSize(o.columnSize); + self.table.populate(); + self._populate(); + self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE); + }; + BI.each(header, function (i, cols) { + if (i === header.length - 1) { + result[i] = []; + BI.each(cols, function (j, col) { + if (j === self._getFreezeColLength() - 1 || j === cols.length - 1) { + result[i][j] = col; + } else { + result[i][j] = { + type: "bi.resizable_table_cell", + cell: col, + resize: BI.bind(resize, null, j), + stop: BI.bind(stop, null, j) + }; + if (o.isNeedMerge) { + var r = i; + while (r > 0 && self._mergeRule(result[r][j], result[r - 1][j])) { + result[r - 1][j] = { + type: "bi.resizable_table_cell", + cell: result[r - 1][j], + resize: BI.bind(resize, null, j), + stop: BI.bind(stop, null, j) + }; + r--; + } } - }) - } - - track(treeNode.children); - - var treeObj = $.fn.zTree.getZTreeObj(treeId); - var nodes = treeObj.getSelectedNodes(); - BI.each(nodes, function (index, node) { - node.halfCheck = false; - }) + } + }); + } else { + result.push(cols); } - } + }); + return result; + }, - function beforeExpand(treeId, treeNode) { - self._expandNode(treeId, treeNode); + _populate: function () { + var o = this.options; + var regionSize = this._getRegionSize(); + if (regionSize > 0) { + this.regionResizerHandler.setVisible(true); + this._setRegionResizerHandlerPosition(regionSize - 3, 0); + } else { + this.regionResizerHandler.setVisible(false); } + }, - function onCheck(event, treeId, treeNode) { - self._selectTreeNode(treeId, treeNode); - } + setWidth: function (width) { + BI.ResizableTable.superclass.setWidth.apply(this, arguments); + this.table.setWidth(width) + }, - function onExpand(event, treeId, treeNode) { - treeNode.halfCheck = false; - } + setHeight: function (height) { + BI.ResizableTable.superclass.setHeight.apply(this, arguments); + this.table.setHeight(height); + }, - function onCollapse(event, treeId, treeNode) { - treeNode.halfCheck = false; - } + setVerticalScroll: function (scrollTop) { + this.table.setVerticalScroll(scrollTop); + }, - return setting; + setLeftHorizontalScroll: function (scrollLeft) { + this.table.setLeftHorizontalScroll(scrollLeft); }, - _selectTreeNode: function (treeId, treeNode) { - var self = this, o = this.options; - var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); - var name = this._getNodeValue(treeNode) -// var values = parent_values.concat([name]); - if (treeNode.checked === true) { - } else { - var tNode = treeNode; - var pNode = this._getTree(this.selected_values, parent_values); - if (BI.isNotNull(pNode[name])) { - delete pNode[name]; - } - while (tNode != null && BI.isEmpty(pNode)) { - parent_values = parent_values.slice(0, parent_values.length - 1); - tNode = tNode.getParentNode(); - if (tNode != null) { - pNode = this._getTree(this.selected_values, parent_values); - name = this._getNodeValue(tNode); - delete pNode[name]; - } - } - } - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); + setRightHorizontalScroll: function (scrollLeft) { + this.table.setRightHorizontalScroll(scrollLeft); }, - //展开节点 - _expandNode: function (treeId, treeNode) { - var self = this, o = this.options; - var parentValues = treeNode.parentValues || self._getParentValues(treeNode); - var op = BI.extend({}, o.paras, { - "id": treeNode.id, - "times": 1, - "parent_values": parentValues.concat(this._getNodeValue(treeNode)), - "check_state": treeNode.getCheckStatus() - }); - var complete = function (d) { - var nodes = d.items || []; - if (nodes.length > 0) { - callback(self._dealWidthNodes(nodes), !!d.hasNext); - } - }; - var times = 1; + setColumnSize: function (columnSize) { + this.options.columnSize = columnSize; + this.table.setColumnSize(columnSize); + }, - function callback(nodes, hasNext) { - self.nodes.addNodes(treeNode, nodes); + getColumnSize: function () { + return this.table.getColumnSize(); + }, + + setRegionColumnSize: function (columnSize) { + this.options.regionColumnSize = columnSize; + this.table.setRegionColumnSize(columnSize); + }, - if (hasNext === true) { - BI.delay(function () { - times++; - op.times = times; - o.itemsCreator(op, complete); - }, 100); - } - } + getRegionColumnSize: function () { + return this.table.getRegionColumnSize(); + }, - if (!treeNode.children) { - o.itemsCreator(op, complete) - } + getVerticalScroll: function () { + return this.table.getVerticalScroll(); }, - _joinTree: function (map, values, isLast) { - var cur = map; - BI.each(values, function (i, value) { - if (i > 0 && BI.isPlainObject(cur) && BI.isEmpty(cur)) { - return; - } - if (isLast === true && i === values.length - 1) { - cur[value] = {}; - return; - } - if (cur[value] == null) { - cur[value] = {}; - } - cur = cur[value]; - }) + getLeftHorizontalScroll: function () { + return this.table.getLeftHorizontalScroll(); }, - _join: function (valueA, valueB) { - var self = this; - var hashMap = valueA || {}; - track([], valueB); - function track(parent, node) { - BI.each(node, function (n, item) { - var next = parent.concat([n]); - self._joinTree(hashMap, next, BI.isPlainObject(item) && BI.isEmpty(item)); - track(next, item); - }) - } + getRightHorizontalScroll: function () { + return this.table.getRightHorizontalScroll(); + }, - return hashMap; + attr: function () { + BI.ResizableTable.superclass.attr.apply(this, arguments); + this.table.attr.apply(this.table, arguments); }, - hasChecked: function () { - return !BI.isEmpty(this.selected_values) || BI.SyncTree.superclass.hasChecked.apply(this, arguments); + restore: function () { + this.table.restore(); }, - getValue: function () { - if (!this.nodes) { - return {}; - } - var checkedValues = this._getSelectedValues(); - if (BI.isEmpty(checkedValues)) { - return this.selected_values; + populate: function (items, header) { + if (items) { + this.options.items = items; } - if (BI.isEmpty(this.selected_values)) { - return checkedValues; + if (header) { + this.options.header = header; + if (this.options.isNeedResize) { + header = this._formatHeader(header); + } } - return this._join(checkedValues, this.selected_values); - }, - - //生成树方法 - stroke: function (config) { - delete this.options.keyword; - BI.extend(this.options.paras, config); - //取消选中时使用 - this.selected_values = BI.deepClone(this.options.paras.selected_values) || {}; - var setting = this._configSetting(); - this._initTree(setting); + this.table.populate(items, header); + this._populate(); } }); -$.shortcut("bi.sync_tree", BI.SyncTree);/** - * guy - * 局部树,两个请求树, 第一个请求构造树,第二个请求获取节点 - * @class BI.PartTree - * @extends BI.SyncTree +$.shortcut("bi.resizable_table", BI.ResizableTable);/** + * 组件请求数据超时提示 + * Created by Young's on 2017/2/4. */ -BI.PartTree = BI.inherit(BI.SyncTree, { +BI.TimeoutToast = BI.inherit(BI.Tip, { _defaultConfig: function () { - return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this, arguments), {}) + return BI.extend(BI.TimeoutToast.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-timeout-toast" + }); }, _init: function () { - BI.PartTree.superclass._init.apply(this, arguments); + BI.TimeoutToast.superclass._init.apply(this, arguments); + var self = this; + this.requests = []; + this.toast = BI.createWidget({ + type: "bi.vertical_adapt", + element: this, + items: [{ + type: "bi.label", + text: BI.i18nText("BI-Request_Time_Out_Toast_Tip") + }, { + type: "bi.text_button", + cls: "cancel-button", + width: 60, + height: 22, + text: BI.i18nText("BI-Basic_Cancel"), + title: BI.i18nText("BI-Basic_Cancel"), + handler: function () { + self.cancelAllRequests(); + } + }, { + type: "bi.text_button", + cls: "retry-button", + width: 60, + height: 22, + text: BI.i18nText("BI-Basic_Retry"), + title: BI.i18nText("BI-Basic_Retry"), + handler: function () { + self.toast.element.slideUp(500); + self._retryAll(); + } + }, { + type: "bi.icon_button", + cls: "close-font", + width: 20, + height: 20, + title: BI.i18nText("BI-Basic_Close"), + handler: function () { + self.toast.element.slideUp(500); + } + }], + width: 520, + height: 30, + hgap: 2 + }); + + BI.createWidget({ + type: "bi.absolute", + element: $("body"), + items: [{ + el: this.toast, + left: "50%", + top: 0 + }] + }); + this.toast.element.css({"margin-left": -1 * this.toast.element.outerWidth() / 2}); + this.toast.setVisible(false); }, - _loadMore: function () { - var self = this, o = this.options; - var op = BI.extend({}, o.paras, { - type: BI.TreeView.REQ_TYPE_INIT_DATA, - times: ++this.times + _retryAll: function () { + var self = this; + var clonedRequests = BI.deepClone(this.requests); + this.requests = []; + BI.each(clonedRequests, function (i, options) { + BI.isFunction(self.callback) && self.callback(options); }); - this.tip.setLoading(); - o.itemsCreator(op, function (d) { - var hasNext = !!d.hasNext, nodes = d.items || []; - o.paras.last_search_value = d.last_search_value; - if (self._stop === true) { - return; - } - if (!hasNext) { - self.tip.setEnd(); - } else { - self.tip.setLoaded(); - } - if (nodes.length > 0) { - self.nodes.addNodes(null, self._dealWidthNodes(nodes)); + }, + + cancelAllRequests: function () { + this.toast.element.slideUp(500); + BI.each(this.requests, function (i, reqArgs) { + if (BI.isNotNull(reqArgs) && BI.isFunction(reqArgs.complete)) { + reqArgs.complete(); } }); + this.requests = []; }, - _selectTreeNode: function (treeId, treeNode) { - var self = this, o = this.options; - var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); - var name = this._getNodeValue(treeNode) -// var values = parent_values.concat([name]); - if (treeNode.checked === true) { - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); - } else { - o.itemsCreator(BI.extend({}, o.paras, { - type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA, - selected_values: this.selected_values, - not_selected_value: name, - parent_values: parent_values - }), function (new_values) { - if (BI.isEqual(self.selected_values, new_values)) { - var tNode = treeNode; - var pNode = self._getTree(new_values, parent_values); - if (pNode[name]) { - delete pNode[name]; - } - while (tNode != null && BI.isEmpty(pNode)) { - parent_values = parent_values.slice(0, parent_values.length - 1); - tNode = tNode.getParentNode(); - if (tNode != null) { - pNode = self._getTree(new_values, parent_values); - name = self._getNodeValue(tNode); - delete pNode[name]; - } - } - } - self.selected_values = new_values; - BI.SyncTree.superclass._selectTreeNode.apply(self, arguments); - }); - } + setCallback: function (callback) { + this.callback = callback; }, - _getSelectedValues: function () { + addReq: function (options) { var self = this; - var hashMap = {}; - var rootNoots = this.nodes.getNodes(); - track(rootNoots); - function track(nodes) { - BI.each(nodes, function (i, node) { - var checkState = node.getCheckStatus(); - if (checkState.checked === false) { - return true; - } - var parentValues = node.parentValues || self._getParentValues(node); - //把文字中的html去掉,其实就是把文字颜色去掉 - var values = parentValues.concat([self._getNodeValue(node)]); - self._buildTree(hashMap, values); -// if(checkState.checked === true && checkState.half === false && nodes[i].flag === true){ -// continue; -// } - if (BI.isNotEmptyArray(node.children)) { - track(node.children); - return true; - } - if (checkState.half === true) { - self._getHalfSelectedValues(hashMap, node); + if (this.requests.length === 0) { + setTimeout(function () { + if (self.requests.contains(options)) { + self.toast.element.slideDown(500); } - }) + }, 5 * 60 * 1000); //5 min } - - return hashMap; + this.requests.push(options); }, - _initTree: function (setting, keyword) { - var self = this, o = this.options; - this.times = 1; - var tree = this.tree; - tree.empty(); - self.tip.setVisible(false); - this.loading(); - var op = BI.extend({}, o.paras, { - type: BI.TreeView.REQ_TYPE_INIT_DATA, - times: this.times - }); - var complete = function (d) { - if (self._stop === true || keyword != o.paras.keyword) { - return; - } - var hasNext = !!d.hasNext, nodes = d.items || []; - o.paras.last_search_value = d.last_search_value; - if (nodes.length > 0) { - callback(self._dealWidthNodes(nodes)); - } - self.setTipVisible(nodes.length <= 0); - self.loaded(); - if (!hasNext) { - self.tip.invisible(); - } else { - self.tip.setLoaded(); - } - self.fireEvent(BI.Events.AFTERINIT); - }; - - function callback(nodes) { - if (self._stop === true) { - return; - } - self.nodes = $.fn.zTree.init(tree.element, setting, nodes); + removeReq: function (options) { + BI.remove(this.requests, options); + if (this.requests.length === 0) { + this.toast.element.slideUp(500); } - - BI.delay(function () { - o.itemsCreator(op, complete); - }, 100); - }, - - getValue: function () { - var o = this.options; - var result = BI.PartTree.superclass.getValue.apply(this, arguments); - o.itemsCreator({ - type: BI.TreeView.REQ_TYPE_ADJUST_DATA, - selected_values: result - }, function (res) { - result = res; - }); - return result; }, - //生成树方法 - stroke: function (config) { - var o = this.options; - delete o.paras.keyword; - BI.extend(o.paras, config); - delete o.paras.last_search_value; - //取消选中时使用 - this.selected_values = BI.deepClone(o.paras.selected_values) || {}; - //delete this.options.paras.selected_values; - var setting = this._configSetting(); - this._initTree(setting, o.paras.keyword); + hasReq: function (options) { + return this.requests.contains(options); } }); - -$.shortcut("bi.part_tree", BI.PartTree);/** +$.shortcut("bi.timeout_toast", BI.TimeoutToast);/** * * 自定义树 * diff --git a/dist/core.js b/dist/core.js index b4e0b28440..61b8b721e7 100644 --- a/dist/core.js +++ b/dist/core.js @@ -13698,6 +13698,10 @@ if (!window.BI) { return (string + "").toLocaleLowerCase(); }, + isEndWithBlank: function (string) { + return /(\s|\u00A0)$/.test(string); + }, + isLiteral: function (exp) { var literalValueRE = /^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/ return literalValueRE.test(exp) @@ -19644,7 +19648,7 @@ BI.Cache = { * 控制器 * Controller层超类 * @class BI.Controller - * @extends FR.OB + * @extends BI.OB * @abstract */ BI.Controller = BI.inherit(BI.OB, { @@ -22009,6 +22013,52 @@ BI.ShowListener = BI.inherit(BI.OB, { } }); BI.ShowListener.EVENT_CHANGE = "ShowListener.EVENT_CHANGE";/** + * style加载管理器 + * + * Created by GUY on 2015/9/7. + * @class + */ +BI.StyleLoaderManager = BI.inherit(BI.OB, { + _defaultConfig: function () { + return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this, arguments), {}); + }, + + _init: function () { + BI.StyleLoaderManager.superclass._init.apply(this, arguments); + this.stylesManager = {}; + }, + + loadStyle: function (name, styleString) { + var d = document, styles = d.createElement('style'); + d.getElementsByTagName('head')[0].appendChild(styles); + styles.setAttribute('type', 'text/css'); + if (styles.styleSheet) { + styles.styleSheet.cssText = styleString; + } else { + styles.appendChild(document.createTextNode(styleString)); + } + this.stylesManager[name] = styles; + + return this; + }, + + get: function (name) { + return this.stylesManager[name]; + }, + + has: function (name) { + return this.stylesManager[name] != null; + }, + + removeStyle: function (name) { + if (!this.has(name)) { + return this; + } + this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]); + delete this.stylesManager[name]; + return this; + } +});/** * @class BI.Logic * @extends BI.OB */ @@ -23160,6 +23210,66 @@ Function.prototype.after = function (func) { func.apply(this, arguments); return ret; } +};/*! + * jLayout JQuery Plugin v0.11 + * + * Licensed under the revised BSD License. + * Copyright 2008, Bram Stein + * All rights reserved. + */ +if (jQuery) { + (function($){ + // richer:容器在其各个边缘留出的空间 + $.fn.insets = function () { + var p = this.padding(), + b = this.border(); + return { + 'top': p.top, + 'bottom': p.bottom + b.bottom + b.top, + 'left': p.left, + 'right': p.right + b.right + b.left + }; + }; + + // richer:获取 && 设置jQuery元素的边界 + $.fn.bounds = function (value) { + var tmp = {hasIgnoredBounds : true}; + + if (value) { + if (!isNaN(value.x)) { + tmp.left = value.x; + } + if (!isNaN(value.y)) { + tmp.top = value.y; + } + if (value.width != null) { + tmp.width = (value.width - (this.outerWidth(true) - this.width())); + tmp.width = (tmp.width >= 0) ? tmp.width : value.width; + // fix chrome + //tmp.width = (tmp.width >= 0) ? tmp.width : 0; + } + if (value.height != null) { + tmp.height = value.height - (this.outerHeight(true) - this.height()); + tmp.height = (tmp.height >= 0) ? tmp.height : value.height; + // fix chrome + //tmp.height = (tmp.height >= 0) ? tmp.height : value.0; + } + this.css(tmp); + return this; + } + else { + // richer:注意此方法只对可见元素有效 + tmp = this.position(); + return { + 'x': tmp.left, + 'y': tmp.top, + // richer:这里计算外部宽度和高度的时候,都不包括边框 + 'width': this.outerWidth(), + 'height': this.outerHeight() + }; + } + }; + })(jQuery); };if (!Number.prototype.toFixed || (0.00008).toFixed(3) !== '0.000' || (0.9).toFixed(0) === '0' || (1.255).toFixed(2) !== '1.25' || (1000000000000000128).toFixed(0) !== "1000000000000000128") { @@ -23644,51 +23754,6 @@ $.extend(String, { return args[i]; }); } -});/** - * guy - * 状态常量 - */ - -_.extend(BI, { - Status: { - SUCCESS: 1, - WRONG: 2, - START: 3, - END: 4, - WAITING: 5, - READY: 6, - RUNNING: 7, - OUTOFBOUNDS: 8, - NULL: -1 - }, - Direction: { - Top: "top", - Bottom: "bottom", - Left: "left", - Right: "right", - Custom: "custom" - }, - Axis: { - Vertical: "vertical", - Horizontal: "horizontal" - }, - Selection: { - Default: -999, - None: -1, - Single: 0, - Multi: 1, - All: 2 - }, - HorizontalAlign: { - Left: "left", - Right: "right", - Center: "center" - }, - VerticalAlign: { - Middle: "middle", - Top: "top", - Bottom: "bottom" - } });BI.EventListener = { listen: function listen(target, eventType, callback) { if (target.addEventListener) { @@ -23995,7 +24060,70 @@ _.extend(BI, { emptyStr: "", emptyFn: function () { }, - empty: null + empty: null, + KeyCode: { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + }, + Status: { + SUCCESS: 1, + WRONG: 2, + START: 3, + END: 4, + WAITING: 5, + READY: 6, + RUNNING: 7, + OUTOFBOUNDS: 8, + NULL: -1 + }, + Direction: { + Top: "top", + Bottom: "bottom", + Left: "left", + Right: "right", + Custom: "custom" + }, + Axis: { + Vertical: "vertical", + Horizontal: "horizontal" + }, + Selection: { + Default: -999, + None: -1, + Single: 0, + Multi: 1, + All: 2 + }, + HorizontalAlign: { + Left: "left", + Right: "right", + Center: "center" + }, + VerticalAlign: { + Middle: "middle", + Top: "top", + Bottom: "bottom" + } });/** * absolute实现的居中布局 * @class BI.AbsoluteCenterLayout @@ -25844,7 +25972,6 @@ BI.CardLayout = BI.inherit(BI.Layout, { .appendTo(this.element); widget.invisible(); this.addWidget(this._getCardName(cardName), widget); - widget._mount(); return widget; }, @@ -25862,7 +25989,10 @@ BI.CardLayout = BI.inherit(BI.Layout, { //动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了 !flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.element.hide(); } else { - (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, callback); + (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, function () { + el._mount(); + callback && callback(); + }); } }); }, diff --git a/dist/icon/check-box-disable.png b/dist/icon/check-box-disable.png new file mode 100644 index 0000000000000000000000000000000000000000..bb7f451b34e113d727ccef7ed3ab7ba357bab22c GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP*AeO zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkDP*I?#i(^Q|t)xHy|JyUGHcZT7 zn`2X3b$PyheNE@ZBZm%cx_Rfy75+1AoJ}UHSFR99eZAJY{DGLEVE~64uY@Uss%q0D o^&&3iDN|O?pLv3nfsu{DpjGkD){h;pfQB=8y85}Sb4q9e03zf-Y5)KL literal 0 HcmV?d00001 diff --git a/dist/icon/check-box-normal.png b/dist/icon/check-box-normal.png new file mode 100644 index 0000000000000000000000000000000000000000..2974ad7dbc523a7091e1d32ecfbb75c2f07964a9 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP*AeO zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkDP*Jd_i(^Q|t)xHy|JyUGHgq;R z9bihnv*&-o<@xsYwVjua9NH5Z8+ecZ3}Yo@%lbRJe$S6!2<5)!zERwbSHhG*RkL~0 q^Q*VNclez$Fniqa+^vCunPK8g-yrFEKj#6BXYh3Ob6Mw<&;$S$QbXwg literal 0 HcmV?d00001 diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index fa991aa87a..528913284e 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -58,20 +58,14 @@ BI.Collection = BI.inherit(BI.Widget, { this._calculateSizeAndPositionData(); this._populate(); } - }, - - mounted: function () { - var o = this.options; if (o.scrollLeft !== 0 || o.scrollTop !== 0) { - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); + BI.nextTick(function () { + self.element.scrollTop(o.scrollTop); + self.element.scrollLeft(o.scrollLeft); + }); } }, - destroyed: function () { - this._debounceRelease = null; - }, - _calculateSizeAndPositionData: function () { var o = this.options; var cellMetadata = []; diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 75fb6b7a27..6f0a84bb0e 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -4,14 +4,17 @@ */ BI.Combo = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.Combo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo", + var conf = BI.Combo.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-combo", trigger: "click", toggle: true, direction: "bottom", //top||bottom||left||right||top,left||top,right||bottom,left||bottom,right isDefaultInit: false, isNeedAdjustHeight: true,//是否需要高度调整 isNeedAdjustWidth: true, + stopEvent: false, + stopPropagation: false, adjustLength: 0,//调整的距离 adjustXOffset: 0, adjustYOffset: 0, @@ -88,6 +91,14 @@ BI.Combo = BI.inherit(BI.Widget, { _initPullDownAction: function () { var self = this, o = this.options; var evs = this.options.trigger.split(","); + var st = function (e) { + if (o.stopEvent) { + e.stopEvent(); + } + if (o.stopPropagation) { + e.stopPropagation(); + } + }; BI.each(evs, function (i, ev) { switch (ev) { case "hover": @@ -107,25 +118,27 @@ BI.Combo = BI.inherit(BI.Widget, { }); break; case "click": - if (ev) { - self.element.off(ev + "." + self.getName()).on(ev + "." + self.getName(), BI.debounce(function (e) { - if (self.combo.element.__isMouseInBounds__(e)) { - if (self.isEnabled() && self.combo.isEnabled()) { - o.toggle ? self._toggle() : self._popupView(); - if (self.isViewVisible()) { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); - self.fireEvent(BI.Combo.EVENT_EXPAND); - } else { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo); - self.fireEvent(BI.Combo.EVENT_COLLAPSE); - } + var debounce = BI.debounce(function (e) { + if (self.combo.element.__isMouseInBounds__(e)) { + if (self.isEnabled() && self.combo.isEnabled()) { + o.toggle ? self._toggle() : self._popupView(); + if (self.isViewVisible()) { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); + self.fireEvent(BI.Combo.EVENT_EXPAND); + } else { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo); + self.fireEvent(BI.Combo.EVENT_COLLAPSE); } } - }, BI.EVENT_RESPONSE_TIME, true)); - } + } + }, BI.EVENT_RESPONSE_TIME, true); + self.element.off(ev + "." + self.getName()).on(ev + "." + self.getName(), function(e){ + debounce(e); + st(e); + }); break; } - }) + }); }, _initCombo: function () { @@ -292,6 +305,7 @@ BI.Combo = BI.inherit(BI.Widget, { top: p.top }); } + this.position = p; this.popupView.setVisible(isVisible); }, @@ -315,7 +329,7 @@ BI.Combo = BI.inherit(BI.Widget, { BI.Combo.superclass.setEnable.apply(this, arguments); this.combo && this.combo.setEnable(arg); this.popupView && this.popupView.setEnable(arg); - !arg && this._hideView(); + !arg && this.isViewVisible() && this._hideView(); }, setValue: function (v) { @@ -347,6 +361,10 @@ BI.Combo = BI.inherit(BI.Widget, { return this.popupView; }, + getPopupPosition: function () { + return this.position; + }, + doBehavior: function () { this._assertPopupView(); this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments); @@ -356,14 +374,14 @@ BI.Combo = BI.inherit(BI.Widget, { this._toggle(); }, - destroyed: function () { + destroy: function () { $(document).unbind("mousedown." + this.getName()) .unbind("mousewheel." + this.getName()) .unbind("mouseenter." + this.getName()) .unbind("mousemove." + this.getName()) .unbind("mouseleave." + this.getName()); - this.popupView && this.popupView.destroy(); BI.Resizers.remove(this.getName()); + BI.Combo.superclass.destroy.apply(this, arguments); } }); BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; diff --git a/src/base/combination/expander.js b/src/base/combination/expander.js index 8e593cee1a..a71b09d660 100644 --- a/src/base/combination/expander.js +++ b/src/base/combination/expander.js @@ -35,8 +35,13 @@ BI.Expander = BI.inherit(BI.Widget, { self._hideView(); } if (self.isEnabled() && this.isEnabled()) { - if (type === BI.Events.EXPAND || type === BI.Events.COLLAPSE) { + if (type === BI.Events.EXPAND) { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + self.fireEvent(BI.Expander.EVENT_EXPAND); + } + if(type === BI.Events.COLLAPSE) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + self.fireEvent(BI.Expander.EVENT_COLLAPSE); } if (type === BI.Events.CLICK) { self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE, value, obj); @@ -254,8 +259,8 @@ BI.Expander = BI.inherit(BI.Widget, { return this.popupView && this.popupView.getNodeByValue(value); }, - destroyed: function () { - this.popupView && this.popupView.destroy(); + destroy: function () { + BI.Expander.superclass.destroy.apply(this, arguments); } }); BI.Expander.EVENT_EXPAND = "EVENT_EXPAND"; diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index c48b86304a..a1f36155ed 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -298,6 +298,10 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { } }); return node; + }, + + destroy: function () { + BI.ButtonGroup.superclass.destroy.apply(this, arguments); } }); BI.extend(BI.ButtonGroup, { @@ -309,4 +313,4 @@ BI.extend(BI.ButtonGroup, { }); BI.ButtonGroup.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.button_group", BI.ButtonGroup); +$.shortcut("bi.button_group", BI.ButtonGroup); \ No newline at end of file diff --git a/src/base/combination/loader.js b/src/base/combination/loader.js index 331c2ea9b2..434a90f2a8 100644 --- a/src/base/combination/loader.js +++ b/src/base/combination/loader.js @@ -252,6 +252,10 @@ BI.Loader = BI.inherit(BI.Widget, { BI.each([this.prev, this.next], function (i, ob) { ob && ob.setVisible(false); }); + }, + + destroy: function () { + BI.Loader.superclass.destroy.apply(this, arguments); } }); BI.Loader.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/base/combination/map.button.js b/src/base/combination/map.button.js new file mode 100644 index 0000000000..8184e70083 --- /dev/null +++ b/src/base/combination/map.button.js @@ -0,0 +1,115 @@ +/** + * value作为key值缓存button, 不支持顺序读写 + * 适合用于频繁增删的一组button + * Created by GUY on 2015/8/10. + * @class BI.ButtonMap + * @extends BI.ButtonTree + */ + +BI.ButtonMap = BI.inherit(BI.ButtonTree, { + _defaultConfig: function () { + return BI.extend(BI.ButtonMap.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-button-map" + }) + }, + + _init: function () { + BI.ButtonMap.superclass._init.apply(this, arguments); + }, + + _createBtns: function (items) { + var self = this, o = this.options; + var buttons = BI.createWidgets(BI.createItems(items, {type: "bi.text_button", once: o.chooseType === 0})); + var keys = BI.map(items, function (i, item) { + item = BI.stripEL(item); + if (!(item.id || item.value)) { + throw new Error("item必须包含id或value属性"); + } + return item.id || item.value; + }); + return BI.object(keys, buttons); + }, + + setValue: function (v) { + var self = this; + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (val, item) { + if (!BI.isFunction(item.setSelected)) { + item.setValue(v); + return; + } + if (v.contains(val)) { + item.setSelected && item.setSelected(true); + } else { + item.setSelected && item.setSelected(false); + } + }); + }, + + setNotSelectedValue: function (v) { + var self = this; + v = BI.isArray(v) ? v : [v]; + BI.each(this.buttons, function (val, item) { + if (!BI.isFunction(item.setSelected)) { + item.setNotSelectedValue(v); + return; + } + if (v.contains(val)) { + item.setSelected && item.setSelected(false); + } else { + item.setSelected && item.setSelected(true); + } + }); + }, + + populate: function (items) { + var self = this; + var args = [].slice.call(arguments); + var linkHashMap = new BI.LinkHashMap(); + var val = function (item) { + return item.id || item.value; + }; + if (!this.buttons) { + this.buttons = {}; + } + //所有已存在的和新添加的 + var willCreated = []; + BI.each(items, function (i, item) { + item = BI.stripEL(item); + if (self.buttons[val(item)]) { + var ob = self.buttons[val(item)]; + args[0] = item.items; + args[2] = item; + ob.populate && ob.populate.apply(ob, args); + } else { + willCreated.push(item); + } + }); + //创建新元素 + args[0] = willCreated; + var newBtns = this._btnsCreator.apply(this, args); + + //整理 + var array = []; + BI.each(items, function (i, item) { + item = BI.stripEL(item); + var button = self.buttons[val(item)] || newBtns[val(item)]; + linkHashMap.add(val(item), button); + array.push(button); + }); + this.buttons = linkHashMap.map; + + BI.DOM.hang(this.buttons); + this.empty(); + + var packages = this._packageItems(items, this._packageBtns(array)); + BI.createWidget(BI.extend({element: this}, this._packageLayout(packages))); + }, + + getIndexByValue: function (value) { + throw new Error("不能使用getIndexByValue方法"); + } +}); +BI.ButtonMap.EVENT_CHANGE = "EVENT_CHANGE"; + +$.shortcut("bi.button_map", BI.ButtonMap); \ No newline at end of file diff --git a/src/base/combination/navigation.js b/src/base/combination/navigation.js index 4e2f13b481..524821ce3d 100644 --- a/src/base/combination/navigation.js +++ b/src/base/combination/navigation.js @@ -127,6 +127,10 @@ BI.Navigation = BI.inherit(BI.Widget, { empty: function(){ this.layout.deleteAllCard(); this.cardMap = {}; + }, + + destroy: function(){ + BI.Navigation.superclass.destroy.apply(this, arguments); } }); BI.Navigation.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/base/combination/searcher.js b/src/base/combination/searcher.js index 1c441664c9..c4dae3418f 100644 --- a/src/base/combination/searcher.js +++ b/src/base/combination/searcher.js @@ -90,27 +90,26 @@ BI.Searcher = BI.inherit(BI.Widget, { type: "bi.searcher_view", chooseType: o.chooseType }); - BI.Maskers.create(this.getName(), o.adapter, { - offset: o.masker.offset, + BI.Maskers.create(this.getName(), o.adapter, BI.extend({ container: this, render: this.popupView - }); + }, o.masker)); this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); if (type === BI.Events.CLICK) { if (o.isAutoSync) { - var values = o.adapter.getValue(); + var values = o.adapter && o.adapter.getValue(); if (!obj.isSelected()) { - o.adapter.setValue(BI.deepWithout(values, obj.getValue())); + o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue())); } else { switch (o.chooseType) { case BI.ButtonGroup.CHOOSE_TYPE_SINGLE: - o.adapter.setValue([obj.getValue()]); + o.adapter && o.adapter.setValue([obj.getValue()]); break; case BI.ButtonGroup.CHOOSE_TYPE_MULTI: values.push(obj.getValue()); - o.adapter.setValue(values); + o.adapter && o.adapter.setValue(values); break; } } @@ -140,7 +139,9 @@ BI.Searcher = BI.inherit(BI.Widget, { _pauseSearch: function () { var o = this.options, name = this.getName(); this._stop = true; - BI.Maskers.hide(name); + BI.nextTick(function (name) { + BI.Maskers.hide(name); + }, this.getName()); if (BI.Maskers.has(name) && this._isSearching === true) { this.popupView && this.popupView.pauseSearch && this.popupView.pauseSearch(); this.fireEvent(BI.Searcher.EVENT_PAUSE); @@ -181,7 +182,7 @@ BI.Searcher = BI.inherit(BI.Widget, { o.onSearch({ times: 1, keyword: keyword, - selectedValues: o.adapter.getValue() + selectedValues: o.adapter && o.adapter.getValue() }, function (searchResult, matchResult) { if (!self._stop) { var args = [].slice.call(arguments); @@ -190,7 +191,7 @@ BI.Searcher = BI.inherit(BI.Widget, { } BI.Maskers.show(self.getName()); self.popupView.populate.apply(self.popupView, args); - o.isAutoSync && self.popupView.setValue(o.adapter.getValue()); + o.isAutoSync && self.popupView.setValue(o.adapter && o.adapter.getValue()); self.popupView.loaded && self.popupView.loaded(); self.fireEvent(BI.Searcher.EVENT_SEARCHING); } @@ -258,6 +259,10 @@ BI.Searcher = BI.inherit(BI.Widget, { return this.editor.getValue(); }, + getKeywords: function () { + return this.editor.getKeywords(); + }, + getValue: function () { var o = this.options; if (o.isAutoSync) { @@ -283,9 +288,9 @@ BI.Searcher = BI.inherit(BI.Widget, { this.popupView && this.popupView.empty(); }, - destroyed: function () { - this.popupView && this.popupView.destroy(); + destroy: function () { BI.Maskers.remove(this.getName()); + BI.Searcher.superclass.destroy.apply(this, arguments); } }); BI.Searcher.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/base/combination/switcher.js b/src/base/combination/switcher.js index 1a624481f1..d7468578f0 100644 --- a/src/base/combination/switcher.js +++ b/src/base/combination/switcher.js @@ -258,8 +258,8 @@ BI.Switcher = BI.inherit(BI.Widget, { this.popupView && this.popupView.empty(); }, - destroyed: function () { - this.popupView && this.popupView.destroy(); + destroy: function () { + BI.Switcher.superclass.destroy.apply(this, arguments); } }); BI.Switcher.EVENT_EXPAND = "EVENT_EXPAND"; diff --git a/src/base/combination/tab.js b/src/base/combination/tab.js index 74c8749388..f12d3a1505 100644 --- a/src/base/combination/tab.js +++ b/src/base/combination/tab.js @@ -114,9 +114,9 @@ BI.Tab = BI.inherit(BI.Widget, { this.cardMap = {}; }, - destroyed: function () { - this.layout.deleteAllCard(); + destroy: function () { this.cardMap = {}; + BI.Tab.superclass.destroy.apply(this, arguments); } }); BI.Tab.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/base/combination/tree.button.js b/src/base/combination/tree.button.js index 4b8bda42db..85afc684df 100644 --- a/src/base/combination/tree.button.js +++ b/src/base/combination/tree.button.js @@ -179,120 +179,4 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { }); BI.ButtonTree.EVENT_CHANGE = "EVENT_CHANGE"; -$.shortcut("bi.button_tree", BI.ButtonTree); - -/** - * value作为key值缓存button, 不支持顺序读写 - * 适合用于频繁增删的一组button - * Created by GUY on 2015/8/10. - * @class BI.ButtonMap - * @extends BI.ButtonTree - */ - -BI.ButtonMap = BI.inherit(BI.ButtonTree, { - _defaultConfig: function () { - return BI.extend(BI.ButtonMap.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-button-map" - }) - }, - - _init: function () { - BI.ButtonMap.superclass._init.apply(this, arguments); - }, - - _createBtns: function (items) { - var self = this, o = this.options; - var buttons = BI.createWidgets(BI.createItems(items, {type: "bi.text_button", once: o.chooseType === 0})); - var keys = BI.map(items, function (i, item) { - item = BI.stripEL(item); - if (!(item.id || item.value)) { - throw new Error("item必须包含id或value属性"); - } - return item.id || item.value; - }); - return BI.object(keys, buttons); - }, - - setValue: function (v) { - var self = this; - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (val, item) { - if (!BI.isFunction(item.setSelected)) { - item.setValue(v); - return; - } - if (v.contains(val)) { - item.setSelected && item.setSelected(true); - } else { - item.setSelected && item.setSelected(false); - } - }); - }, - - setNotSelectedValue: function (v) { - var self = this; - v = BI.isArray(v) ? v : [v]; - BI.each(this.buttons, function (val, item) { - if (!BI.isFunction(item.setSelected)) { - item.setNotSelectedValue(v); - return; - } - if (v.contains(val)) { - item.setSelected && item.setSelected(false); - } else { - item.setSelected && item.setSelected(true); - } - }); - }, - - populate: function (items) { - var self = this; - var args = [].slice.call(arguments); - var linkHashMap = new BI.LinkHashMap(); - var val = function (item) { - return item.id || item.value; - }; - if (!this.buttons) { - this.buttons = {}; - } - //所有已存在的和新添加的 - var willCreated = []; - BI.each(items, function (i, item) { - item = BI.stripEL(item); - if (self.buttons[val(item)]) { - var ob = self.buttons[val(item)]; - args[0] = item.items; - args[2] = item; - ob.populate && ob.populate.apply(ob, args); - } else { - willCreated.push(item); - } - }); - //创建新元素 - args[0] = willCreated; - var newBtns = this._btnsCreator.apply(this, args); - - //整理 - var array = []; - BI.each(items, function (i, item) { - item = BI.stripEL(item); - var button = self.buttons[val(item)] || newBtns[val(item)]; - linkHashMap.add(val(item), button); - array.push(button); - }); - this.buttons = linkHashMap.map; - - BI.DOM.hang(this.buttons); - this.empty(); - - var packages = this._packageItems(items, this._packageBtns(array)); - BI.createWidget(BI.extend({element: this}, this._packageLayout(packages))); - }, - - getIndexByValue: function (value) { - throw new Error("不能使用getIndexByValue方法"); - } -}); -BI.ButtonMap.EVENT_CHANGE = "EVENT_CHANGE"; - -$.shortcut("bi.button_map", BI.ButtonMap); \ No newline at end of file +$.shortcut("bi.button_tree", BI.ButtonTree); \ No newline at end of file diff --git a/src/base/farbtastic/farbtastic.js b/src/base/farbtastic/farbtastic.js index 0fb9cac6f4..a243d31ee3 100644 --- a/src/base/farbtastic/farbtastic.js +++ b/src/base/farbtastic/farbtastic.js @@ -18,6 +18,8 @@ BI.Farbtastic = BI.inherit(BI.Widget, { _init: function () { BI.Farbtastic.superclass._init.apply(this, arguments); var self = this; + FR.$defaultImport('/com/fr/bi/web/js/third/farbtastic.js', 'js'); + FR.$defaultImport('/com/fr/bi/web/css/base/third/farbtastic/farbtastic.css', 'css'); this.farbtastic = $.farbtastic(this.element, function (v) { self.fireEvent(BI.Farbtastic.EVENT_CHANGE, self.getValue(), self); diff --git a/src/base/formula/codemirror/addon/formula-hint.js b/src/base/formula/codemirror/addon/formula-hint.js new file mode 100644 index 0000000000..f35f859ff1 --- /dev/null +++ b/src/base/formula/codemirror/addon/formula-hint.js @@ -0,0 +1,88 @@ +(function (mod) { + mod(CodeMirror); +})(function (CodeMirror) { + var Pos = CodeMirror.Pos; + + function forEach(arr, f) { + for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); + } + + function arrayContains(arr, item) { + if (!Array.prototype.indexOf) { + var i = arr.length; + while (i--) { + if (arr[i] === item) { + return true; + } + } + return false; + } + return arr.indexOf(item) != -1; + } + + function scriptHint(editor, keywords, getToken, options) { + // Find the token at the cursor + var cur = editor.getCursor(), token = getToken(editor, cur); + if (/\b(?:string)\b/.test(token.type)) { + return; + } + token.state = CodeMirror.innerMode(editor.getMode(), token.state).state; + + if (!/^[\w$_]*$/.test(token.string)) { + token = { + start: cur.ch, end: cur.ch, string: "", state: token.state, + type: token.string == "." ? "property" : null + }; + } else if (token.end > cur.ch) { + token.end = cur.ch; + token.string = token.string.slice(0, cur.ch - token.start); + } + + var tprop = token; + // If it is a property, find out what it is a property of. + while (tprop.type == "property") { + tprop = getToken(editor, Pos(cur.line, tprop.start)); + if (tprop.string != ".") return; + tprop = getToken(editor, Pos(cur.line, tprop.start)); + if (!context) var context = []; + context.push(tprop); + } + return { + list: getCompletions(token, context, keywords, options), + from: Pos(cur.line, token.start), + to: Pos(cur.line, token.end) + }; + } + + function getFormulaKeywords() { + return FormulaCollections; + } + + function formulaHint(editor, options) { + return scriptHint(editor, getFormulaKeywords(), + function (e, cur) { + return e.getTokenAt(cur); + }, + options); + }; + CodeMirror.registerHelper("hint", "formula", formulaHint); + + function getCompletions(token, context, keywords, options) { + var found = [], start = token.string; + if (!start) { + return found; + } + function maybeAdd(str) { + if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) { + found.push(str); + } + } + + if (context && context.length) { + context.pop(); + } else { + forEach(keywords, maybeAdd); + } + return found; + } +}); \ No newline at end of file diff --git a/src/base/formula/codemirror/addon/formula-mode.js b/src/base/formula/codemirror/addon/formula-mode.js new file mode 100644 index 0000000000..b56509ee77 --- /dev/null +++ b/src/base/formula/codemirror/addon/formula-mode.js @@ -0,0 +1,80 @@ +(function (mod) { + mod(CodeMirror); +})(function (CodeMirror) { + "use strict"; + + CodeMirror.defineMode('formula', function () { + function wordObj(words) { + var o = {}; + for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; + return o; + } + + var atoms = wordObj(['false', 'true']); + var keywords = wordObj(FormulaCollections); + + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; + } + var ch = stream.next(); + + if (ch === '"' || ch === '\'') { + nextUntilUnescaped(stream, ch); + return "string"; + } + if (/[\[\],\(\)]/.test(ch)) { + return 'bracket'; + } + + // richie:暂时不需要解析操作符号 + //if (/[+\-*\/=<>!&|]/.test(ch)) { + // return 'operator'; + //} + //if (/\d|\d./.test(ch)) { + // stream.eatWhile(/\d|\./); + // if (stream.eol() || !/\w/.test(stream.peek())) { + // return 'number'; + // } + //} + + + + stream.eatWhile(/[\w-]/); + var word = stream.current(); + if (atoms.hasOwnProperty(word)) { + return "atom"; + } + if (keywords.hasOwnProperty(word)) { + return "keyword"; + } + return null; + } + + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next === end && !escaped) { + return false; + } + escaped = !escaped && next === "\\"; + } + return escaped; + } + + function tokenize(stream, state) { + return (state.tokens[0] || tokenBase)(stream, state); + } + + return { + startState: function () { + return {tokens: []}; + }, + token: function (stream, state) { + return tokenize(stream, state); + }, + fold: "brace" + }; + }); + CodeMirror.defineMIME("text/fx-formula", "formula"); +}); \ No newline at end of file diff --git a/src/base/formula/codemirror/addon/show-hint.js b/src/base/formula/codemirror/addon/show-hint.js new file mode 100644 index 0000000000..1fb9b7f41a --- /dev/null +++ b/src/base/formula/codemirror/addon/show-hint.js @@ -0,0 +1,432 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + mod(CodeMirror); +})(function (CodeMirror) { + "use strict"; + + var HINT_ELEMENT_CLASS = "CodeMirror-hint"; + var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active"; + + // This is the old interface, kept around for now to stay + // backwards-compatible. + CodeMirror.showHint = function (cm, getHints, options) { + if (!getHints) return cm.showHint(options); + if (options && options.async) getHints.async = true; + var newOpts = {hint: getHints}; + if (options) for (var prop in options) newOpts[prop] = options[prop]; + return cm.showHint(newOpts); + }; + + CodeMirror.defineExtension("showHint", function (options) { + // We want a single cursor position. + if (this.listSelections().length > 1 || this.somethingSelected()) return; + + if (this.state.completionActive) this.state.completionActive.close(); + var completion = this.state.completionActive = new Completion(this, options); + if (!completion.options.hint) return; + + CodeMirror.signal(this, "startCompletion", this); + completion.update(true); + }); + + function Completion(cm, options) { + this.cm = cm; + this.options = this.buildOptions(options); + this.widget = null; + this.debounce = 0; + this.tick = 0; + this.startPos = this.cm.getCursor(); + this.startLen = this.cm.getLine(this.startPos.line).length; + + var self = this; + cm.on("cursorActivity", this.activityFunc = function () { + self.cursorActivity(); + }); + } + + var requestAnimationFrame = window.requestAnimationFrame || function (fn) { + return setTimeout(fn, 1000 / 60); + }; + var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; + + Completion.prototype = { + close: function () { + if (!this.active()) return; + this.cm.state.completionActive = null; + this.tick = null; + this.cm.off("cursorActivity", this.activityFunc); + + if (this.widget && this.data) CodeMirror.signal(this.data, "close"); + if (this.widget) this.widget.close(); + CodeMirror.signal(this.cm, "endCompletion", this.cm); + }, + + active: function () { + return this.cm.state.completionActive == this; + }, + + pick: function (data, i) { + var completion = data.list[i]; + if (completion.hint) completion.hint(this.cm, data, completion); + else { + this.cm.replaceRange(getText(completion), completion.from || data.from, + completion.to || data.to, "complete"); + var to = this.cm.getCursor(); + this.cm.markText(completion.from || data.from, to, {className: "#function", atomic: true}); + this.cm.replaceSelection("() "); + to = this.cm.getCursor(); + to.ch = to.ch - 2; + this.cm.setCursor(to); + this.cm.focus(); + } + CodeMirror.signal(data, "pick", completion); + this.close(); + }, + + cursorActivity: function () { + if (this.debounce) { + cancelAnimationFrame(this.debounce); + this.debounce = 0; + } + + var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line); + if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || + pos.ch < this.startPos.ch || this.cm.somethingSelected() || + (pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { + this.close(); + } else { + var self = this; + this.debounce = requestAnimationFrame(function () { + self.update(); + }); + if (this.widget) this.widget.disable(); + } + }, + + update: function (first) { + if (this.tick == null) return; + if (this.data) CodeMirror.signal(this.data, "update"); + if (!this.options.hint.async) { + this.finishUpdate(this.options.hint(this.cm, this.options), first); + } else { + var myTick = ++this.tick, self = this; + this.options.hint(this.cm, function (data) { + if (self.tick == myTick) self.finishUpdate(data, first); + }, this.options); + } + }, + + finishUpdate: function (data, first) { + this.data = data; + + var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle); + if (this.widget) this.widget.close(); + if (data && data.list.length) { + if (picked && data.list.length == 1) { + this.pick(data, 0); + } else { + this.widget = new Widget(this, data); + CodeMirror.signal(data, "shown"); + } + } + }, + + buildOptions: function (options) { + var editor = this.cm.options.hintOptions; + var out = {}; + for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; + if (editor) for (var prop in editor) + if (editor[prop] !== undefined) out[prop] = editor[prop]; + if (options) for (var prop in options) + if (options[prop] !== undefined) out[prop] = options[prop]; + return out; + } + }; + + function getText(completion) { + if (typeof completion == "string") return completion; + else return completion.text; + } + + function buildKeyMap(completion, handle) { + var baseMap = { + Up: function () { + handle.moveFocus(-1); + }, + Down: function () { + handle.moveFocus(1); + }, + PageUp: function () { + handle.moveFocus(-handle.menuSize() + 1, true); + }, + PageDown: function () { + handle.moveFocus(handle.menuSize() - 1, true); + }, + Home: function () { + handle.setFocus(0); + }, + End: function () { + handle.setFocus(handle.length - 1); + }, + Enter: handle.pick, + Tab: handle.pick, + Esc: handle.close + }; + var custom = completion.options.customKeys; + var ourMap = custom ? {} : baseMap; + + function addBinding(key, val) { + var bound; + if (typeof val != "string") + bound = function (cm) { + return val(cm, handle); + }; + // This mechanism is deprecated + else if (baseMap.hasOwnProperty(val)) + bound = baseMap[val]; + else + bound = val; + ourMap[key] = bound; + } + + if (custom) + for (var key in custom) if (custom.hasOwnProperty(key)) + addBinding(key, custom[key]); + var extra = completion.options.extraKeys; + if (extra) + for (var key in extra) if (extra.hasOwnProperty(key)) + addBinding(key, extra[key]); + return ourMap; + } + + function getHintElement(hintsElement, el) { + while (el && el != hintsElement) { + if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; + el = el.parentNode; + } + } + + function Widget(completion, data) { + this.completion = completion; + this.data = data; + this.picked = false; + var widget = this, cm = completion.cm; + + var hints = this.hints = document.createElement("ul"); + hints.className = "CodeMirror-hints"; + this.selectedHint = data.selectedHint || 0; + + var completions = data.list; + for (var i = 0; i < completions.length; ++i) { + var elt = hints.appendChild(document.createElement("li")), cur = completions[i]; + var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); + if (cur.className != null) className = cur.className + " " + className; + elt.className = className; + if (cur.render) cur.render(elt, data, cur); + else elt.appendChild(document.createTextNode(cur.displayText || getText(cur))); + elt.hintId = i; + } + + var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); + var left = pos.left, top = pos.bottom, below = true; + hints.style.left = left + "px"; + hints.style.top = top + "px"; + // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. + var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); + var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); + (completion.options.container || document.body).appendChild(hints); + var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; + if (overlapY > 0) { + var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); + if (curTop - height > 0) { // Fits above cursor + hints.style.top = (top = pos.top - height) + "px"; + below = false; + } else if (height > winH) { + hints.style.height = (winH - 5) + "px"; + hints.style.top = (top = pos.bottom - box.top) + "px"; + var cursor = cm.getCursor(); + if (data.from.ch != cursor.ch) { + pos = cm.cursorCoords(cursor); + hints.style.left = (left = pos.left) + "px"; + box = hints.getBoundingClientRect(); + } + } + } + var overlapX = box.right - winW; + if (overlapX > 0) { + if (box.right - box.left > winW) { + hints.style.width = (winW - 5) + "px"; + overlapX -= (box.right - box.left) - winW; + } + hints.style.left = (left = pos.left - overlapX) + "px"; + } + + cm.addKeyMap(this.keyMap = buildKeyMap(completion, { + moveFocus: function (n, avoidWrap) { + widget.changeActive(widget.selectedHint + n, avoidWrap); + }, + setFocus: function (n) { + widget.changeActive(n); + }, + menuSize: function () { + return widget.screenAmount(); + }, + length: completions.length, + close: function () { + completion.close(); + }, + pick: function () { + widget.pick(); + }, + data: data + })); + + if (completion.options.closeOnUnfocus) { + var closingOnBlur; + cm.on("blur", this.onBlur = function () { + closingOnBlur = setTimeout(function () { + completion.close(); + }, 100); + }); + cm.on("focus", this.onFocus = function () { + clearTimeout(closingOnBlur); + }); + } + + var startScroll = cm.getScrollInfo(); + cm.on("scroll", this.onScroll = function () { + var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect(); + var newTop = top + startScroll.top - curScroll.top; + var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop); + if (!below) point += hints.offsetHeight; + if (point <= editor.top || point >= editor.bottom) return completion.close(); + hints.style.top = newTop + "px"; + hints.style.left = (left + startScroll.left - curScroll.left) + "px"; + }); + + CodeMirror.on(hints, "dblclick", function (e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) { + widget.changeActive(t.hintId); + widget.pick(); + } + }); + + CodeMirror.on(hints, "click", function (e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) { + widget.changeActive(t.hintId); + if (completion.options.completeOnSingleClick) widget.pick(); + } + }); + + CodeMirror.on(hints, "mousedown", function () { + setTimeout(function () { + cm.focus(); + }, 20); + }); + + CodeMirror.signal(data, "select", completions[0], hints.firstChild); + return true; + } + + Widget.prototype = { + close: function () { + if (this.completion.widget != this) return; + this.completion.widget = null; + this.hints.parentNode.removeChild(this.hints); + this.completion.cm.removeKeyMap(this.keyMap); + + var cm = this.completion.cm; + if (this.completion.options.closeOnUnfocus) { + cm.off("blur", this.onBlur); + cm.off("focus", this.onFocus); + } + cm.off("scroll", this.onScroll); + }, + + disable: function () { + this.completion.cm.removeKeyMap(this.keyMap); + var widget = this; + this.keyMap = { + Enter: function () { + widget.picked = true; + } + }; + this.completion.cm.addKeyMap(this.keyMap); + }, + + pick: function () { + this.completion.pick(this.data, this.selectedHint); + }, + + changeActive: function (i, avoidWrap) { + if (i >= this.data.list.length) + i = avoidWrap ? this.data.list.length - 1 : 0; + else if (i < 0) + i = avoidWrap ? 0 : this.data.list.length - 1; + if (this.selectedHint == i) return; + var node = this.hints.childNodes[this.selectedHint]; + node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); + node = this.hints.childNodes[this.selectedHint = i]; + node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; + if (node.offsetTop < this.hints.scrollTop) + this.hints.scrollTop = node.offsetTop - 3; + else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) + this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3; + CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); + }, + + screenAmount: function () { + return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; + } + }; + + CodeMirror.registerHelper("hint", "auto", function (cm, options) { + var helpers = cm.getHelpers(cm.getCursor(), "hint"), words; + if (helpers.length) { + for (var i = 0; i < helpers.length; i++) { + var cur = helpers[i](cm, options); + if (cur && cur.list.length) return cur; + } + } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { + if (words) return CodeMirror.hint.fromList(cm, {words: words}); + } else if (CodeMirror.hint.anyword) { + return CodeMirror.hint.anyword(cm, options); + } + }); + + CodeMirror.registerHelper("hint", "fromList", function (cm, options) { + var cur = cm.getCursor(), token = cm.getTokenAt(cur); + var found = []; + for (var i = 0; i < options.words.length; i++) { + var word = options.words[i]; + if (word.slice(0, token.string.length) == token.string) + found.push(word); + } + + if (found.length) return { + list: found, + from: CodeMirror.Pos(cur.line, token.start), + to: CodeMirror.Pos(cur.line, token.end) + }; + }); + + CodeMirror.commands.autocomplete = CodeMirror.showHint; + + var defaultOptions = { + hint: CodeMirror.hint.auto, + completeSingle: true, + alignWithWord: true, + closeCharacters: /[\s()\[\]{};:>,]/, + closeOnUnfocus: true, + completeOnSingleClick: true, + container: null, + customKeys: null, + extraKeys: null + }; + + CodeMirror.defineOption("hintOptions", null); +}); \ No newline at end of file diff --git a/src/base/formula/codemirror/codemirror.js b/src/base/formula/codemirror/codemirror.js new file mode 100644 index 0000000000..870197680d --- /dev/null +++ b/src/base/formula/codemirror/codemirror.js @@ -0,0 +1,8736 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// This is CodeMirror (http://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + +(function(mod) { + this.CodeMirror = mod(); +})(function() { + "use strict"; + + // BROWSER SNIFFING + + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + + var gecko = /gecko\/\d/i.test(navigator.userAgent); + var ie_upto10 = /MSIE \d/.test(navigator.userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); + var ie = ie_upto10 || ie_11up; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); + var webkit = /WebKit\//.test(navigator.userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); + var chrome = /Chrome\//.test(navigator.userAgent); + var presto = /Opera\//.test(navigator.userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); + var phantom = /PhantomJS/.test(navigator.userAgent); + + var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent); + var mac = ios || /Mac/.test(navigator.platform); + var windows = /win/i.test(navigator.platform); + + var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) presto_version = Number(presto_version[1]); + if (presto_version && presto_version >= 15) { presto = false; webkit = true; } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || (ie && ie_version >= 9); + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false, sawCollapsedSpans = false; + + // EDITOR CONSTRUCTOR + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. + + function CodeMirror(place, options) { + if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); + + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + setGuttersForLineNumbers(options); + + var doc = options.value; + if (typeof doc == "string") doc = new Doc(doc, options.mode); + this.doc = doc; + + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input); + display.wrapper.CodeMirror = this; + updateGutters(this); + themeChanged(this); + if (options.lineWrapping) + this.display.wrapper.className += " CodeMirror-wrap"; + if (options.autofocus && !mobile) display.input.focus(); + initScrollbars(this); + + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null, // Unfinished key sequence + specialChars: null + }; + + var cm = this; + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20); + + registerEventHandlers(this); + ensureGlobalHandlers(); + + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); + + if ((options.autofocus && !mobile) || cm.hasFocus()) + setTimeout(bind(onFocus, this), 20); + else + onBlur(this); + + for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) + optionHandlers[opt](this, options[opt], Init); + maybeUpdateLineNumberWidth(this); + if (options.finishInit) options.finishInit(this); + for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + display.lineDiv.style.textRendering = "auto"; + } + + // DISPLAY CONSTRUCTOR + + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = elt("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (!webkit && !(gecko && mobile)) d.scroller.draggable = true; + + if (place) { + if (place.appendChild) place.appendChild(d.wrapper); + else place(d.wrapper); + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; + + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; + + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + // True when shift is held down. + d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; + + d.activeTouch = null; + + input.init(d); + } + + // STATE UPDATES + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } + + function resetModeState(cm) { + cm.doc.iter(function(line) { + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + }); + cm.doc.frontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) regChange(cm); + } + + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function(){updateScrollbars(cm);}, 100); + } + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function(line) { + if (lineIsHidden(cm.doc, line)) return 0; + + var widgetsHeight = 0; + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; + } + + if (wrapping) + return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; + else + return widgetsHeight + th; + }; + } + + function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm); + doc.iter(function(line) { + var estHeight = est(line); + if (estHeight != line.height) updateLineHeight(line, estHeight); + }); + } + + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + + function guttersChanged(cm) { + updateGutters(cm); + regChange(cm); + setTimeout(function(){alignHorizontally(cm);}, 20); + } + + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function updateGutters(cm) { + var gutters = cm.display.gutters, specs = cm.options.gutters; + removeChildren(gutters); + for (var i = 0; i < specs.length; ++i) { + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = i ? "" : "none"; + updateGutterSpace(cm); + } + + function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth; + cm.display.sizer.style.marginLeft = width + "px"; + } + + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) return 0; + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found = merged.find(0, true); + len -= cur.text.length - found.from.ch; + cur = found.to.line; + len += cur.text.length - found.to.ch; + } + return len; + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function(line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // Make sure the gutters options contains the element + // "CodeMirror-linenumbers" when the lineNumbers option is true. + function setGuttersForLineNumbers(options) { + var found = indexOf(options.gutters, "CodeMirror-linenumbers"); + if (found == -1 && options.lineNumbers) { + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); + } else if (found > -1 && !options.lineNumbers) { + options.gutters = options.gutters.slice(0); + options.gutters.splice(found, 1); + } + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + }; + } + + function NativeScrollbars(place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + place(vert); place(horiz); + + on(vert, "scroll", function() { + if (vert.clientHeight) scroll(vert.scrollTop, "vertical"); + }); + on(horiz, "scroll", function() { + if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); + }); + + this.checkedOverlay = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; + } + + NativeScrollbars.prototype = copyObj({ + update: function(measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; + + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } + + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = + (measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } + + if (!this.checkedOverlay && measure.clientHeight > 0) { + if (sWidth == 0) this.overlayHack(); + this.checkedOverlay = true; + } + + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}; + }, + setScrollLeft: function(pos) { + if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos; + }, + setScrollTop: function(pos) { + if (this.vert.scrollTop != pos) this.vert.scrollTop = pos; + }, + overlayHack: function() { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.minHeight = this.vert.style.minWidth = w; + var self = this; + var barMouseDown = function(e) { + if (e_target(e) != self.vert && e_target(e) != self.horiz) + operation(self.cm, onMouseDown)(e); + }; + on(this.vert, "mousedown", barMouseDown); + on(this.horiz, "mousedown", barMouseDown); + }, + clear: function() { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + } + }, NativeScrollbars.prototype); + + function NullScrollbars() {} + + NullScrollbars.prototype = copyObj({ + update: function() { return {bottom: 0, right: 0}; }, + setScrollLeft: function() {}, + setScrollTop: function() {}, + clear: function() {} + }, NullScrollbars.prototype); + + CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; + + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) + rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + + cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function() { + if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0); + }); + node.setAttribute("cm-not-content", "true"); + }, function(pos, axis) { + if (axis == "horizontal") setScrollLeft(cm, pos); + else setScrollTop(cm, pos); + }, cm); + if (cm.display.scrollbars.addClass) + addClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + + function updateScrollbars(cm, measure) { + if (!measure) measure = measureForScrollbars(cm); + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + updateHeightsInViewport(cm); + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; + } + } + + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); + + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else d.scrollbarFiller.style.display = ""; + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else d.gutterFiller.style.display = ""; + } + + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return {from: from, to: Math.max(to, from + 1)}; + } + + // LINE NUMBERS + + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) if (!view[i].hidden) { + if (cm.options.fixedGutter && view[i].gutter) + view[i].gutter.style.left = left; + var align = view[i].alignable; + if (align) for (var j = 0; j < align.length; j++) + align[j].style.left = left; + } + if (cm.options.fixedGutter) + display.gutters.style.left = (comp + gutterW) + "px"; + } + + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) return false; + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm); + return true; + } + return false; + } + + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; + } + + // DISPLAY DRAWING + + function DisplayUpdate(cm, viewport, force) { + var display = cm.display; + + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + } + + DisplayUpdate.prototype.signal = function(emitter, type) { + if (hasHandler(emitter, type)) + this.events.push(arguments); + }; + DisplayUpdate.prototype.finish = function() { + for (var i = 0; i < this.events.length; i++) + signal.apply(null, this.events[i]); + }; + + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } + + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc; + + if (update.editorIsHidden) { + resetView(cm); + return false; + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + return false; + + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); + if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); + + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; + + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + return false; + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var focused = activeElt(); + if (toUpdate > 4) display.lineDiv.style.display = "none"; + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) display.lineDiv.style.display = ""; + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = 0; + + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } + + display.updateLineNumbers = null; + + return true; + } + + function postUpdateDisplay(cm, update) { + var viewport = update.viewport; + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + break; + } + if (!updateDisplayIfNeeded(cm, update)) break; + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + setDocumentHeight(cm, barMeasure); + updateScrollbars(cm, barMeasure); + } + + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; + } + } + + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + setDocumentHeight(cm, barMeasure); + updateScrollbars(cm, barMeasure); + update.finish(); + } + } + + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + var total = measure.docHeight + cm.display.barHeight; + cm.display.heightForcer.style.top = total + "px"; + cm.display.gutters.style.height = Math.max(total + scrollGap(cm), measure.clientHeight) + "px"; + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], height; + if (cur.hidden) continue; + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + } + var diff = cur.line.height - height; + if (height < 2) height = textHeight(display); + if (diff > .001 || diff < -.001) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) for (var j = 0; j < cur.rest.length; j++) + updateWidgetHeight(cur.rest[j]); + } + } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) + line.widgets[i].height = line.widgets[i].node.offsetHeight; + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; + width[cm.options.gutters[i]] = n.clientWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth}; + } + + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, cur = container.firstChild; + + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + node.style.display = "none"; + else + node.parentNode.removeChild(node); + return next; + } + + var view = display.view, lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) { + } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { // Already drawn + while (cur != lineView.node) cur = rm(cur); + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; + updateLineForChanges(cm, lineView, lineN, dims); + } + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) cur = rm(cur); + } + + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") updateLineText(cm, lineView); + else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); + else if (type == "class") updateLineClasses(lineView); + else if (type == "widget") updateLineWidgets(cm, lineView, dims); + } + lineView.changes = null; + } + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) + lineView.text.parentNode.replaceChild(lineView.node, lineView.text); + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) lineView.node.style.zIndex = 2; + } + return lineView.node; + } + + function updateLineBackground(lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) cls += " CodeMirror-linebackground"; + if (lineView.background) { + if (cls) lineView.background.className = cls; + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built; + } + return buildLineContent(cm, lineView); + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) lineView.node = built.pre; + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + + function updateLineClasses(lineView) { + updateLineBackground(lineView); + if (lineView.line.wrapClass) + ensureLineWrapped(lineView).className = lineView.line.wrapClass; + else if (lineView.node != lineView.text) + lineView.node.className = ""; + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + + "px; width: " + dims.gutterTotalWidth + "px"); + cm.display.input.setUneditable(gutterWrap); + wrap.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) + gutterWrap.className += " " + lineView.line.gutterClass; + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + + cm.display.lineNumInnerWidth + "px")); + if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; + if (found) + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + } + + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) lineView.alignable = null; + for (var node = lineView.node.firstChild, next; node; node = next) { + var next = node.nextSibling; + if (node.className == "CodeMirror-linewidget") + lineView.node.removeChild(node); + } + insertLineWidgets(cm, lineView, dims); + } + + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) lineView.bgClass = built.bgClass; + if (built.textClass) lineView.textClass = built.textClass; + + updateLineClasses(lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node; + } + + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); + } + + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) return; + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); + if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true"); + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) + wrap.insertBefore(node, lineView.gutter || lineView.text); + else + wrap.appendChild(node); + signalLater(widget, "redraw"); + } + } + + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; + } + } + + // POSITION OBJECT + + // A Pos instance represents a position within the text. + var Pos = CodeMirror.Pos = function(line, ch) { + if (!(this instanceof Pos)) return new Pos(line, ch); + this.line = line; this.ch = ch; + }; + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; + + function copyPos(x) {return Pos(x.line, x.ch);} + function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } + function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } + + // INPUT HANDLING + + function ensureFocus(cm) { + if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } + } + + function isReadOnly(cm) { + return cm.options.readOnly || cm.doc.cantEdit; + } + + // This will be set to an array of strings when copying, so that, + // when pasting, we know what kind of selections the copied text + // was made out of. + var lastCopied = null; + + function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) sel = doc.sel; + + var paste = cm.state.pasteIncoming || origin == "paste"; + var textLines = splitLines(inserted), multiPaste = null; + // When pasing N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.join("\n") == inserted) + multiPaste = sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines); + else if (textLines.length == sel.ranges.length) + multiPaste = map(textLines, function(l) { return [l]; }); + } + + // Normal behavior is to insert the new text into every selection + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + var from = range.from(), to = range.to(); + if (range.empty()) { + if (deleted && deleted > 0) // Handle deletion + from = Pos(from.line, from.ch - deleted); + else if (cm.state.overwrite && !paste) // Handle overwrite + to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); + } + var updateInput = cm.curOp.updateInput; + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + } + if (inserted && !paste) + triggerElectric(cm, inserted); + + ensureCursorVisible(cm); + cm.curOp.updateInput = updateInput; + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = false; + } + + function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("text/plain"); + if (pasted) { + e.preventDefault(); + runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); }); + return true; + } + } + + function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) return; + var sel = cm.doc.sel; + + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue; + var mode = cm.getModeAt(range.head); + var indented = false; + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range.head.line, "smart"); + break; + } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) + indented = indentLine(cm, range.head.line, "smart"); + } + if (indented) signalLater(cm, "electricInput", cm, range.head.line); + } + } + + function copyableRanges(cm) { + var text = [], ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return {text: text, ranges: ranges}; + } + + function disableBrowserMagic(field) { + field.setAttribute("autocorrect", "off"); + field.setAttribute("autocapitalize", "off"); + field.setAttribute("spellcheck", "false"); + } + + // TEXTAREA INPUT STYLE + + function TextareaInput(cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Tracks when input.reset has punted to just putting a short + // string into the textarea instead of the full selection. + this.inaccurateSelection = false; + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + this.composing = null; + }; + + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) te.style.width = "1000px"; + else te.setAttribute("wrap", "off"); + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) te.style.border = "1px solid black"; + disableBrowserMagic(te); + return div; + } + + TextareaInput.prototype = copyObj({ + init: function(display) { + var input = this, cm = this.cm; + + // Wraps and hides input textarea + var div = this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + var te = this.textarea = div.firstChild; + display.wrapper.insertBefore(div, display.wrapper.firstChild); + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) te.style.width = "0px"; + + on(te, "input", function() { + if (ie && ie_version >= 9 && input.hasSelection) input.hasSelection = null; + input.poll(); + }); + + on(te, "paste", function(e) { + if (handlePaste(e, cm)) return true; + + cm.state.pasteIncoming = true; + input.fastPoll(); + }); + + function prepareCopyCut(e) { + if (cm.somethingSelected()) { + lastCopied = cm.getSelections(); + if (input.inaccurateSelection) { + input.prevInput = ""; + input.inaccurateSelection = false; + te.value = lastCopied.join("\n"); + selectInput(te); + } + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + lastCopied = ranges.text; + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") cm.state.cutIncoming = true; + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); + + on(display.scroller, "paste", function(e) { + if (eventInWidget(display, e)) return; + cm.state.pasteIncoming = true; + input.focus(); + }); + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function(e) { + if (!eventInWidget(display, e)) e_preventDefault(e); + }); + + on(te, "compositionstart", function() { + var start = cm.getCursor("from"); + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) + }; + }); + on(te, "compositionend", function() { + if (input.composing) { + input.poll(); + input.composing.range.clear(); + input.composing = null; + } + }); + }, + + prepareSelection: function() { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc; + var result = prepareSelection(cm); + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); + } + + return result; + }, + + showSelection: function(drawn) { + var cm = this.cm, display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }, + + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + reset: function(typing) { + if (this.contextMenuPending) return; + var minimal, selected, cm = this.cm, doc = cm.doc; + if (cm.somethingSelected()) { + this.prevInput = ""; + var range = doc.sel.primary(); + minimal = hasCopyEvent && + (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); + var content = minimal ? "-" : selected || cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) selectInput(this.textarea); + if (ie && ie_version >= 9) this.hasSelection = content; + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) this.hasSelection = null; + } + this.inaccurateSelection = minimal; + }, + + getField: function() { return this.textarea; }, + + supportsTouch: function() { return false; }, + + focus: function() { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { this.textarea.focus(); } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }, + + blur: function() { this.textarea.blur(); }, + + resetPosition: function() { + this.wrapper.style.top = this.wrapper.style.left = 0; + }, + + receivedFocus: function() { this.slowPoll(); }, + + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + slowPoll: function() { + var input = this; + if (input.pollingFast) return; + input.polling.set(this.cm.options.pollInterval, function() { + input.poll(); + if (input.cm.state.focused) input.slowPoll(); + }); + }, + + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + fastPoll: function() { + var missed = false, input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) {missed = true; input.polling.set(60, p);} + else {input.pollingFast = false; input.slowPoll();} + } + input.polling.set(20, p); + }, + + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + poll: function() { + var cm = this.cm, input = this.textarea, prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || + (hasSelection(input) && !prevInput) || + isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq) + return false; + + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) return false; + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false; + } + + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) prevInput = "\u200b"; + if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo"); } + } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; + + var self = this; + runInOp(cm, function() { + applyTextInput(cm, text.slice(same), prevInput.length - same, + null, self.composing ? "*compose" : null); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = ""; + else self.prevInput = text; + + if (self.composing) { + self.composing.range.clear(); + self.composing.range = cm.markText(self.composing.start, cm.getCursor("to"), + {className: "CodeMirror-composing"}); + } + }); + return true; + }, + + ensurePolled: function() { + if (this.pollingFast && this.poll()) this.pollingFast = false; + }, + + onKeyPress: function() { + if (ie && ie_version >= 9) this.hasSelection = null; + this.fastPoll(); + }, + + onContextMenu: function(e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea; + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || presto) return; // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) + operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); + + var oldCSS = te.style.cssText; + input.wrapper.style.position = "absolute"; + te.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + + "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + + "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) window.scrollTo(null, oldScrollY); + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) te.value = input.prevInput = " "; + input.contextMenuPending = true; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; + } + } + function rehide() { + input.contextMenuPending = false; + input.wrapper.style.position = "relative"; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); + var i = 0, poll = function() { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && + te.selectionEnd > 0 && input.prevInput == "\u200b") + operation(cm, commands.selectAll)(cm); + else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); + else display.input.reset(); + }; + display.detectingSelectAll = setTimeout(poll, 200); + } + } + + if (ie && ie_version >= 9) prepareSelectAllHack(); + if (captureRightClick) { + e_stop(e); + var mouseup = function() { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + }, + + setUneditable: nothing, + + needsContentAttribute: false + }, TextareaInput.prototype); + + // CONTENTEDITABLE INPUT STYLE + + function ContentEditableInput(cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.gracePeriod = false; + } + + ContentEditableInput.prototype = copyObj({ + init: function(display) { + var input = this, cm = input.cm; + var div = input.div = display.lineDiv; + div.contentEditable = "true"; + disableBrowserMagic(div); + + on(div, "paste", function(e) { handlePaste(e, cm); }) + + on(div, "compositionstart", function(e) { + var data = e.data; + input.composing = {sel: cm.doc.sel, data: data, startData: data}; + if (!data) return; + var prim = cm.doc.sel.primary(); + var line = cm.getLine(prim.head.line); + var found = line.indexOf(data, Math.max(0, prim.head.ch - data.length)); + if (found > -1 && found <= prim.head.ch) + input.composing.sel = simpleSelection(Pos(prim.head.line, found), + Pos(prim.head.line, found + data.length)); + }); + on(div, "compositionupdate", function(e) { + input.composing.data = e.data; + }); + on(div, "compositionend", function(e) { + var ours = input.composing; + if (!ours) return; + if (e.data != ours.startData && !/\u200b/.test(e.data)) + ours.data = e.data; + // Need a small delay to prevent other code (input event, + // selection polling) from doing damage when fired right after + // compositionend. + setTimeout(function() { + if (!ours.handled) + input.applyComposition(ours); + if (input.composing == ours) + input.composing = null; + }, 50); + }); + + on(div, "touchstart", function() { + input.forceCompositionEnd(); + }); + + on(div, "input", function() { + if (input.composing) return; + if (!input.pollContent()) + runInOp(input.cm, function() {regChange(cm);}); + }); + + function onCopyCut(e) { + if (cm.somethingSelected()) { + lastCopied = cm.getSelections(); + if (e.type == "cut") cm.replaceSelection("", null, "cut"); + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + lastCopied = ranges.text; + if (e.type == "cut") { + cm.operation(function() { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } + } + // iOS exposes the clipboard API, but seems to discard content inserted into it + if (e.clipboardData && !ios) { + e.preventDefault(); + e.clipboardData.clearData(); + e.clipboardData.setData("text/plain", lastCopied.join("\n")); + } else { + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function() { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + }, 50); + } + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }, + + prepareSelection: function() { + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; + return result; + }, + + showSelection: function(info) { + if (!info || !this.cm.display.view.length) return; + if (info.focus) this.showPrimarySelection(); + this.showMultipleSelections(info); + }, + + showPrimarySelection: function() { + var sel = window.getSelection(), prim = this.cm.doc.sel.primary(); + var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), prim.from()) == 0 && + cmp(maxPos(curAnchor, curFocus), prim.to()) == 0) + return; + + var start = posToDOM(this.cm, prim.from()); + var end = posToDOM(this.cm, prim.to()); + if (!start && !end) return; + + var view = this.cm.display.view; + var old = sel.rangeCount && sel.getRangeAt(0); + if (!start) { + start = {node: view[0].measure.map[2], offset: 0}; + } else if (!end) { // FIXME dangerously hacky + var measure = view[view.length - 1].measure; + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; + } + + try { var rng = range(start.node, start.offset, end.offset, end.node); } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + sel.removeAllRanges(); + sel.addRange(rng); + if (old && sel.anchorNode == null) sel.addRange(old); + else if (gecko) this.startGracePeriod(); + } + this.rememberSelection(); + }, + + startGracePeriod: function() { + var input = this; + clearTimeout(this.gracePeriod); + this.gracePeriod = setTimeout(function() { + input.gracePeriod = false; + if (input.selectionChanged()) + input.cm.operation(function() { input.cm.curOp.selectionChanged = true; }); + }, 20); + }, + + showMultipleSelections: function(info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); + }, + + rememberSelection: function() { + var sel = window.getSelection(); + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; + }, + + selectionInEditor: function() { + var sel = window.getSelection(); + if (!sel.rangeCount) return false; + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node); + }, + + focus: function() { + if (this.cm.options.readOnly != "nocursor") this.div.focus(); + }, + blur: function() { this.div.blur(); }, + getField: function() { return this.div; }, + + supportsTouch: function() { return true; }, + + receivedFocus: function() { + var input = this; + if (this.selectionInEditor()) + this.pollSelection(); + else + runInOp(this.cm, function() { input.cm.curOp.selectionChanged = true; }); + + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); + }, + + selectionChanged: function() { + var sel = window.getSelection(); + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; + }, + + pollSelection: function() { + if (!this.composing && !this.gracePeriod && this.selectionChanged()) { + var sel = window.getSelection(), cm = this.cm; + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) runInOp(cm, function() { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) cm.curOp.selectionChanged = true; + }); + } + }, + + pollContent: function() { + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); + var from = sel.from(), to = sel.to(); + if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false; + + var fromIndex; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + var fromLine = lineNo(display.view[0].line); + var fromNode = display.view[0].node; + } else { + var fromLine = lineNo(display.view[fromIndex].line); + var fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + if (toIndex == display.view.length - 1) { + var toLine = display.viewTo - 1; + var toNode = display.lineDiv.lastChild; + } else { + var toLine = lineNo(display.view[toIndex + 1].line) - 1; + var toNode = display.view[toIndex + 1].node.previousSibling; + } + + var newText = splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } + else break; + } + + var cutFront = 0, cutEnd = 0; + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + ++cutFront; + var newBot = lst(newText), oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + ++cutEnd; + + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd); + newText[0] = newText[0].slice(cutFront); + + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true; + } + }, + + ensurePolled: function() { + this.forceCompositionEnd(); + }, + reset: function() { + this.forceCompositionEnd(); + }, + forceCompositionEnd: function() { + if (!this.composing || this.composing.handled) return; + this.applyComposition(this.composing); + this.composing.handled = true; + this.div.blur(); + this.div.focus(); + }, + applyComposition: function(composing) { + if (composing.data && composing.data != composing.startData) + operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel); + }, + + setUneditable: function(node) { + node.setAttribute("contenteditable", "false"); + }, + + onKeyPress: function(e) { + e.preventDefault(); + operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); + }, + + onContextMenu: nothing, + resetPosition: nothing, + + needsContentAttribute: true + }, ContentEditableInput.prototype); + + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) return null; + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); + + var order = getOrder(line), side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result; + } + + function badPos(pos, bad) { if (bad) pos.bad = true; return pos; } + + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); + node = null; offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) return null; + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) break; + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) + return locateNodeInLineView(lineView, node, offset); + } + } + + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false; + if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true); + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad); + } + } + + var textNode = node.nodeType == 3 ? node : null, topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) offset = textNode.nodeValue.length; + } + while (topNode.parentNode != wrapper) topNode = topNode.parentNode; + var measure = lineView.measure, maps = measure.maps; + + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map[j] + offset; + if (offset < 0 || curNode != textNode) ch = map[j + (offset ? 1 : 0)]; + return Pos(line, ch); + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) return badPos(found, bad); + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) + return badPos(Pos(found.line, found.ch - dist), bad); + else + dist += after.textContent.length; + } + for (var before = topNode.previousSibling, dist = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) + return badPos(Pos(found.line, found.ch + dist), bad); + else + dist += after.textContent.length; + } + } + + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false; + function recognizeMarker(id) { return function(marker) { return marker.id == id; }; } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText != null) { + if (cmText == "") cmText = node.textContent.replace(/\u200b/g, ""); + text += cmText; + return; + } + var markerID = node.getAttribute("cm-marker"), range; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range = found[0].find())) + text += getBetween(cm.doc, range.from, range.to).join("\n"); + return; + } + if (node.getAttribute("contenteditable") == "false") return; + for (var i = 0; i < node.childNodes.length; i++) + walk(node.childNodes[i]); + if (/^(pre|div|p)$/i.test(node.nodeName)) + closing = true; + } else if (node.nodeType == 3) { + var val = node.nodeValue; + if (!val) return; + if (closing) { + text += "\n"; + closing = false; + } + text += val; + } + } + for (;;) { + walk(from); + if (from == to) break; + from = from.nextSibling; + } + return text; + } + + CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; + + // SELECTION / CURSOR + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + function Selection(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + } + + Selection.prototype = { + primary: function() { return this.ranges[this.primIndex]; }, + equals: function(other) { + if (other == this) return true; + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; + for (var i = 0; i < this.ranges.length; i++) { + var here = this.ranges[i], there = other.ranges[i]; + if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; + } + return true; + }, + deepCopy: function() { + for (var out = [], i = 0; i < this.ranges.length; i++) + out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); + return new Selection(out, this.primIndex); + }, + somethingSelected: function() { + for (var i = 0; i < this.ranges.length; i++) + if (!this.ranges[i].empty()) return true; + return false; + }, + contains: function(pos, end) { + if (!end) end = pos; + for (var i = 0; i < this.ranges.length; i++) { + var range = this.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + return i; + } + return -1; + } + }; + + function Range(anchor, head) { + this.anchor = anchor; this.head = head; + } + + Range.prototype = { + from: function() { return minPos(this.anchor, this.head); }, + to: function() { return maxPos(this.anchor, this.head); }, + empty: function() { + return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + } + }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex]; + ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1]; + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) --primIndex; + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex); + } + + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0); + } + + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} + function clipPos(doc, pos) { + if (pos.line < doc.first) return Pos(doc.first, 0); + var last = doc.first + doc.size - 1; + if (pos.line > last) return Pos(last, getLine(doc, last).text.length); + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) return Pos(pos.line, linelen); + else if (ch < 0) return Pos(pos.line, 0); + else return pos; + } + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} + function clipPosArray(doc, array) { + for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); + return out; + } + + // SELECTION UPDATES + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(doc, range, head, other) { + if (doc.cm && doc.cm.display.shift || doc.extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; + } + } + return new Range(anchor, head); + } else { + return new Range(other || head, head); + } + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options) { + setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + for (var out = [], i = 0; i < doc.sel.ranges.length; i++) + out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); + } + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); + if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); + else return sel; + } + + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + sel = filterSelectionChange(doc, sel); + + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + + if (!(options && options.scroll === false) && doc.cm) + ensureCursorVisible(doc.cm); + } + + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) return; + + doc.sel = sel; + + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) out = sel.ranges.slice(0, i); + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel; + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, bias, mayClear) { + var flipped = false, curPos = pos; + var dir = bias || 1; + doc.cantEdit = false; + search: for (;;) { + var line = getLine(doc, curPos.line); + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) break; + else {--i; continue;} + } + } + if (!m.atomic) continue; + var newPos = m.find(dir < 0 ? -1 : 1); + if (cmp(newPos, curPos) == 0) { + newPos.ch += dir; + if (newPos.ch < 0) { + if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); + else newPos = null; + } else if (newPos.ch > line.text.length) { + if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); + else newPos = null; + } + if (!newPos) { + if (flipped) { + // Driven in a corner -- no valid cursor position found at all + // -- try again *with* clearing, if we didn't already + if (!mayClear) return skipAtomic(doc, pos, bias, true); + // Otherwise, turn off editing until further notice, and return the start of the doc + doc.cantEdit = true; + return Pos(doc.first, 0); + } + flipped = true; newPos = pos; dir = -dir; + } + } + curPos = newPos; + continue search; + } + } + } + return curPos; + } + } + + // SELECTION DRAWING + + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + + function prepareSelection(cm, primary) { + var doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (primary === false && i == doc.sel.primIndex) continue; + var range = doc.sel.ranges[i]; + var collapsed = range.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) + drawSelectionCursor(cm, range, curFragment); + if (!collapsed) + drawSelectionRange(cm, range, selFragment); + } + return result; + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, range, output) { + var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine); + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range, output) { + var display = cm.display, doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + + function add(left, top, width, bottom) { + if (top < 0) top = 0; + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + + "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + + "px; height: " + (bottom - top) + "px")); + } + + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias); + } + + iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { + var leftPos = coords(from, "left"), rightPos, left, right; + if (from == to) { + rightPos = leftPos; + left = right = leftPos.left; + } else { + rightPos = coords(to - 1, "right"); + if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; } + left = leftPos.left; + right = rightPos.right; + } + if (fromArg == null && from == 0) left = leftSide; + if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part + add(left, leftPos.top, null, leftPos.bottom); + left = leftSide; + if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); + } + if (toArg == null && to == lineLen) right = rightSide; + if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) + start = leftPos; + if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) + end = rightPos; + if (left < leftSide + 1) left = leftSide; + add(left, rightPos.top, right - left, rightPos.bottom); + }); + return {start: start, end: end}; + } + + var sFrom = range.from(), sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) + add(leftSide, leftEnd.bottom, null, rightStart.top); + } + + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) return; + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) + display.blinker = setInterval(function() { + display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + else if (cm.options.cursorBlinkRate < 0) + display.cursorDiv.style.visibility = "hidden"; + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) + cm.state.highlight.set(time, bind(highlightWorker, cm)); + } + + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.frontier < doc.first) doc.frontier = doc.first; + if (doc.frontier >= cm.display.viewTo) return; + var end = +new Date + cm.options.workTime; + var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); + var changedLines = []; + + doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { + if (doc.frontier >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles; + var highlighted = highlightLine(cm, line, state, true); + line.styles = highlighted.styles; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) line.styleClasses = newCls; + else if (oldCls) line.styleClasses = null; + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; + if (ischange) changedLines.push(doc.frontier); + line.stateAfter = copyState(doc.mode, state); + } else { + processLine(cm, line.text, state); + line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; + } + ++doc.frontier; + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true; + } + }); + if (changedLines.length) runInOp(cm, function() { + for (var i = 0; i < changedLines.length; i++) + regLineChange(cm, changedLines[i], "text"); + }); + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) return doc.first; + var line = getLine(doc, search - 1); + if (line.stateAfter && (!precise || search <= doc.frontier)) return search; + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } + + function getStateBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) return true; + var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; + if (!state) state = startState(doc.mode); + else state = copyState(doc.mode, state); + doc.iter(pos, n, function(line) { + processLine(cm, line.text, state); + var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; + line.stateAfter = save ? copyState(doc.mode, state) : null; + ++pos; + }); + if (precise) doc.frontier = pos; + return state; + } + + // POSITION MEASUREMENT + + function paddingTop(display) {return display.lineSpace.offsetTop;} + function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} + function paddingH(display) { + if (display.cachedPaddingH) return display.cachedPaddingH; + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; + return data; + } + + function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) + heights.push((cur.bottom + next.top) / 2 - rect.top); + } + } + heights.push(rect.bottom - rect.top); + } + } + + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + return {map: lineView.measure.map, cache: lineView.measure.cache}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineView.rest[i] == line) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineNo(lineView.rest[i]) > lineN) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; + } + + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view; + } + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); + } + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + return cm.display.view[findViewIndex(cm, lineN)]; + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + return ext; + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) + view = null; + else if (view && view.changes) + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + if (!view) + view = updateExternalMeasurement(cm, line); + + var info = mapFromLineView(view, line, lineN); + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + }; + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) ch = -1; + var key = ch + (bias || ""), found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) + prepared.rect = prepared.view.text.getBoundingClientRect(); + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) prepared.cache[key] = found; + } + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom}; + } + + var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; + + function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + var mStart = map[i], mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) collapse = "right"; + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + collapse = bias; + if (bias == "left" && start == 0) + while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } + if (bias == "right" && start == mEnd - mStart) + while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } + break; + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}; + } + + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, start = place.start, end = place.end, collapse = place.collapse; + + var rect; + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) --start; + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) ++end; + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { + rect = node.parentNode.getBoundingClientRect(); + } else if (ie && cm.options.lineWrapping) { + var rects = range(node, start, end).getClientRects(); + if (rects.length) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = nullRect; + } else { + rect = range(node, start, end).getBoundingClientRect() || nullRect; + } + if (rect.left || rect.right || start == 0) break; + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) collapse = bias = "right"; + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = node.getBoundingClientRect(); + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) + rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; + else + rect = nullRect; + } + + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + for (var i = 0; i < heights.length - 1; i++) + if (mid < heights[i]) break; + var top = i ? heights[i - 1] : 0, bot = heights[i]; + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot}; + if (!rect.left && !rect.right) result.bogus = true; + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } + + return result; + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + return rect; + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY}; + } + + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + lineView.measure.caches[i] = {}; + } + } + + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) + clearLineMeasurementCacheFor(cm.display.view[i]); + } + + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; + cm.display.lineNumChars = null; + } + + function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } + function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } + + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"/null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context) { + if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { + var size = widgetHeight(lineObj.widgets[i]); + rect.top += size; rect.bottom += size; + } + if (context == "line") return rect; + if (!context) context = "local"; + var yOff = heightAtLine(lineObj); + if (context == "local") yOff += paddingTop(cm.display); + else yOff -= cm.display.viewOffset; + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect; + } + + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"/null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") return coords; + var left = coords.left, top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; + } + + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) lineObj = getLine(cm.doc, pos.line); + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) m.left = m.right; else m.right = m.left; + return intoCoordSystem(cm, lineObj, m, context); + } + function getBidi(ch, partPos) { + var part = order[partPos], right = part.level % 2; + if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { + part = order[--partPos]; + ch = bidiRight(part) - (part.level % 2 ? 0 : 1); + right = true; + } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { + part = order[++partPos]; + ch = bidiLeft(part) - part.level % 2; + right = false; + } + if (right && ch == part.to && ch > part.from) return get(ch - 1); + return get(ch, right); + } + var order = getOrder(lineObj), ch = pos.ch; + if (!order) return get(ch); + var partPos = getBidiPartAt(order, ch); + var val = getBidi(ch, partPos); + if (bidiOther != null) val.other = getBidi(ch, bidiOther); + return val; + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0, pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return {left: left, right: left, top: top, bottom: top + lineObj.height}; + } + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, outside, xRel) { + var pos = Pos(line, ch); + pos.xRel = xRel; + if (outside) pos.outside = true; + return pos; + } + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) return PosWithInfo(doc.first, 0, true, -1); + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineN > last) + return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); + if (x < 0) x = 0; + + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var merged = collapsedSpanAtEnd(lineObj); + var mergedPos = merged && merged.find(0, true); + if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) + lineN = lineNo(lineObj = mergedPos.to.line); + else + return found; + } + } + + function coordsCharInner(cm, lineObj, lineNo, x, y) { + var innerOff = y - heightAtLine(lineObj); + var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + + function getX(ch) { + var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); + wrongLine = true; + if (innerOff > sp.bottom) return sp.left - adjust; + else if (innerOff < sp.top) return sp.left + adjust; + else wrongLine = false; + return sp.left; + } + + var bidi = getOrder(lineObj), dist = lineObj.text.length; + var from = lineLeft(lineObj), to = lineRight(lineObj); + var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; + + if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1); + // Do a binary search between these bounds. + for (;;) { + if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { + var ch = x < fromX || x - fromX <= toX - x ? from : to; + var xDiff = x - (ch == from ? fromX : toX); + while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; + var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside, + xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); + return pos; + } + var step = Math.ceil(dist / 2), middle = from + step; + if (bidi) { + middle = from; + for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); + } + var middleX = getX(middle); + if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;} + else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;} + } + } + + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) return display.cachedTextHeight; + if (measureText == null) { + measureText = elt("pre"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) display.cachedTextHeight = height; + removeChildren(display.measure); + return height || 1; + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) return display.cachedCharWidth; + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; + if (width > 2) display.cachedCharWidth = width; + return width || 10; + } + + // OPERATIONS + + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. + + var operationGroup = null; + + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: null, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + }; + if (operationGroup) { + operationGroup.ops.push(cm.curOp); + } else { + cm.curOp.ownsGroup = operationGroup = { + ops: [cm.curOp], + delayedCallbacks: [] + }; + } + } + + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0; + do { + for (; i < callbacks.length; i++) + callbacks[i](); + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) + while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm); + } + } while (i < callbacks.length); + } + + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp, group = op.ownsGroup; + if (!group) return; + + try { fireCallbacksForOps(group); } + finally { + operationGroup = null; + for (var i = 0; i < group.ops.length; i++) + group.ops[i].cm.curOp = null; + endOperations(group); + } + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R1(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W1(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R2(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W2(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_finish(ops[i]); + } + + function endOperation_R1(op) { + var cm = op.cm, display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) findMaxLine(cm); + + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + } + + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + + function endOperation_R2(op) { + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) updateHeightsInViewport(cm); + + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } + + if (op.updatedDisplay || op.selectionChanged) + op.preparedSelection = display.input.prepareSelection(); + } + + function endOperation_W2(op) { + var cm = op.cm; + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) + setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); + cm.display.maxLineChanged = false; + } + + if (op.preparedSelection) + cm.display.input.showSelection(op.preparedSelection); + if (op.updatedDisplay) + setDocumentHeight(cm, op.barMeasure); + if (op.updatedDisplay || op.startHeight != cm.doc.height) + updateScrollbars(cm, op.barMeasure); + + if (op.selectionChanged) restartBlink(cm); + + if (cm.state.focused && op.updateInput) + cm.display.input.reset(op.typing); + if (op.focus && op.focus == activeElt()) ensureFocus(op.cm); + } + + function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc; + + if (op.updatedDisplay) postUpdateDisplay(cm, op.update); + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + display.wheelStartX = display.wheelStartY = null; + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { + doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); + display.scrollbars.setScrollTop(doc.scrollTop); + display.scroller.scrollTop = doc.scrollTop; + } + if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { + doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - displayWidth(cm), op.scrollLeft)); + display.scrollbars.setScrollLeft(doc.scrollLeft); + display.scroller.scrollLeft = doc.scrollLeft; + alignHorizontally(cm); + } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; + if (hidden) for (var i = 0; i < hidden.length; ++i) + if (!hidden[i].lines.length) signal(hidden[i], "hide"); + if (unhidden) for (var i = 0; i < unhidden.length; ++i) + if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); + + if (display.wrapper.offsetHeight) + doc.scrollTop = cm.display.scroller.scrollTop; + + // Fire change events, and delayed event handlers + if (op.changeObjs) + signal(cm, "changes", cm, op.changeObjs); + if (op.update) + op.update.finish(); + } + + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) return f(); + startOperation(cm); + try { return f(); } + finally { endOperation(cm); } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function() { + if (cm.curOp) return f.apply(cm, arguments); + startOperation(cm); + try { return f.apply(cm, arguments); } + finally { endOperation(cm); } + }; + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function() { + if (this.curOp) return f.apply(this, arguments); + startOperation(this); + try { return f.apply(this, arguments); } + finally { endOperation(this); } + }; + } + function docMethodOp(f) { + return function() { + var cm = this.cm; + if (!cm || cm.curOp) return f.apply(this, arguments); + startOperation(cm); + try { return f.apply(this, arguments); } + finally { endOperation(cm); } + }; + } + + // VIEW TRACKING + + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array; + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) from = cm.doc.first; + if (to == null) to = cm.doc.first + cm.doc.size; + if (!lendiff) lendiff = 0; + + var display = cm.display; + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + display.updateLineNumbers = from; + + cm.curOp.viewChanged = true; + + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + resetView(cm); + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut = viewCuttingPoint(cm, from, from, -1); + if (cut) { + display.view = display.view.slice(0, cut.index); + display.viewTo = cut.lineN; + } else { + resetView(cm); + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) + ext.lineN += lendiff; + else if (from < ext.lineN + ext.size) + display.externalMeasured = null; + } + } + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + display.externalMeasured = null; + + if (line < display.viewFrom || line >= display.viewTo) return; + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) return; + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) arr.push(type); + } + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) return null; + n -= cm.display.viewFrom; + if (n < 0) return null; + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) return i; + } + } + + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + return {index: index, lineN: newN}; + for (var i = 0, n = cm.display.viewFrom; i < index; i++) + n += view[i].size; + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) return null; + diff = (n + view[index].size) - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) return null; + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return {index: index, lineN: newN}; + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) + display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); + else if (display.viewFrom < from) + display.view = display.view.slice(findViewIndex(cm, from)); + display.viewFrom = from; + if (display.viewTo < to) + display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); + else if (display.viewTo > to) + display.view = display.view.slice(0, findViewIndex(cm, to)); + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; + } + return dirty; + } + + // EVENT HANDLERS + + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + on(d.scroller, "dblclick", operation(cm, function(e) { + if (signalDOMEvent(cm, e)) return; + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); + else + on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); + + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0}; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date; + } + }; + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) return false; + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1; + } + function farAway(touch, other) { + if (other.left == null) return true; + var dx = other.left - touch.left, dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20; + } + on(d.scroller, "touchstart", function(e) { + if (!isMouseLikeTouchEvent(e)) { + clearTimeout(touchFinished); + var now = +new Date; + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null}; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; + } + } + }); + on(d.scroller, "touchmove", function() { + if (d.activeTouch) d.activeTouch.moved = true; + }); + on(d.scroller, "touchend", function(e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range; + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + range = new Range(pos, pos); + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + range = cm.findWordAt(pos); + else // Triple tap + range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function() { + if (d.scroller.clientHeight) { + setScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); + on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + + d.dragFunctions = { + simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);}, + start: function(e){onDragStart(cm, e);}, + drop: operation(cm, onDrop) + }; + + var inp = d.input.getField(); + on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", bind(onFocus, cm)); + on(inp, "blur", bind(onBlur, cm)); + } + + function dragDropChanged(cm, value, old) { + var wasOn = old && old != CodeMirror.Init; + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.simple); + toggle(cm.display.scroller, "dragover", funcs.simple); + toggle(cm.display.scroller, "drop", funcs.drop); + } + } + + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) + return; + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } + + // MOUSE EVENTS + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + return true; + } + } + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") return null; + + var x, y, space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top; } + catch (e) { return null; } + var coords = coordsChar(cm, x, y), line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords; + } + + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, display = cm.display; + if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return; + display.shift = e.shiftKey; + + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function(){display.scroller.draggable = true;}, 100); + } + return; + } + if (clickInGutter(cm, e)) return; + var start = posFromMouse(cm, e); + window.focus(); + + switch (e_button(e)) { + case 1: + if (start) + leftButtonDown(cm, e, start); + else if (e_target(e) == display.scroller) + e_preventDefault(e); + break; + case 2: + if (webkit) cm.state.lastMiddleDown = +new Date; + if (start) extendSelection(cm.doc, start); + setTimeout(function() {display.input.focus();}, 20); + e_preventDefault(e); + break; + case 3: + if (captureRightClick) onContextMenu(cm, e); + else delayBlurEvent(cm); + break; + } + } + + var lastClick, lastDoubleClick; + function leftButtonDown(cm, e, start) { + if (ie) setTimeout(bind(ensureFocus, cm), 0); + else cm.curOp.focus = activeElt(); + + var now = +new Date, type; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { + type = "triple"; + } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { + type = "double"; + lastDoubleClick = {time: now, pos: start}; + } else { + type = "single"; + lastClick = {time: now, pos: start}; + } + + var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; + if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && + type == "single" && (contained = sel.contains(start)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) && + (cmp(contained.to(), start) > 0 || start.xRel < 0)) + leftButtonStartDrag(cm, e, start, modifier); + else + leftButtonSelect(cm, e, start, type, modifier); + } + + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, e, start, modifier) { + var display = cm.display, startTime = +new Date; + var dragEnd = operation(cm, function(e2) { + if (webkit) display.scroller.draggable = false; + cm.state.draggingText = false; + off(document, "mouseup", dragEnd); + off(display.scroller, "drop", dragEnd); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); + if (!modifier && +new Date - 200 < startTime) + extendSelection(cm.doc, start); + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) + setTimeout(function() {document.body.focus(); display.input.focus();}, 20); + else + display.input.focus(); + } + }); + // Let the drag handler handle this. + if (webkit) display.scroller.draggable = true; + cm.state.draggingText = dragEnd; + // IE's approach to draggable + if (display.scroller.dragDrop) display.scroller.dragDrop(); + on(document, "mouseup", dragEnd); + on(display.scroller, "drop", dragEnd); + } + + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, e, start, type, addNew) { + var display = cm.display, doc = cm.doc; + e_preventDefault(e); + + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; + if (addNew && !e.shiftKey) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) + ourRange = ranges[ourIndex]; + else + ourRange = new Range(start, start); + } else { + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; + } + + if (e.altKey) { + type = "rect"; + if (!addNew) ourRange = new Range(start, start); + start = posFromMouse(cm, e, true, true); + ourIndex = -1; + } else if (type == "double") { + var word = cm.findWordAt(start); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, word.anchor, word.head); + else + ourRange = word; + } else if (type == "triple") { + var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, line.anchor, line.head); + else + ourRange = line; + } else { + ourRange = extendRange(doc, ourRange, start); + } + + if (!addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0)); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } + + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) return; + lastPos = pos; + + if (type == "rect") { + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); + if (left == right) + ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); + else if (text.length > leftPos) + ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); + } + if (!ranges.length) ranges.push(new Range(start, start)); + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var anchor = oldRange.anchor, head = pos; + if (type != "single") { + if (type == "double") + var range = cm.findWordAt(pos); + else + var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); + if (cmp(range.anchor, anchor) > 0) { + head = range.head; + anchor = minPos(oldRange.from(), range.anchor); + } else { + head = range.anchor; + anchor = maxPos(oldRange.to(), range.head); + } + } + var ranges = startSel.ranges.slice(0); + ranges[ourIndex] = new Range(clipPos(doc, anchor), head); + setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); + } + } + + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, type == "rect"); + if (!cur) return; + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) setTimeout(operation(cm, function() { + if (counter != curCount) return; + display.scroller.scrollTop += outside; + extend(e); + }), 50); + } + } + + function done(e) { + counter = Infinity; + e_preventDefault(e); + display.input.focus(); + off(document, "mousemove", move); + off(document, "mouseup", up); + doc.history.lastSelOrigin = null; + } + + var move = operation(cm, function(e) { + if (!e_button(e)) done(e); + else extend(e); + }); + var up = operation(cm, done); + on(document, "mousemove", move); + on(document, "mouseup", up); + } + + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent, signalfn) { + try { var mX = e.clientX, mY = e.clientY; } + catch(e) { return false; } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; + if (prevent) e_preventDefault(e); + + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); + + if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); + mY -= lineBox.top - display.viewOffset; + + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.options.gutters[i]; + signalfn(cm, type, cm, line, gutter, e); + return e_defaultPrevented(e); + } + } + } + + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true, signalLater); + } + + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; + + function onDrop(e) { + var cm = this; + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + return; + e_preventDefault(e); + if (ie) lastDrop = +new Date; + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || isReadOnly(cm)) return; + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var loadFile = function(file, i) { + var reader = new FileReader; + reader.onload = operation(cm, function() { + text[i] = reader.result; + if (++read == n) { + pos = clipPos(cm.doc, pos); + var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + } + }); + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) loadFile(files[i], i); + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function() {cm.display.input.focus();}, 20); + return; + } + try { + var text = e.dataTransfer.getData("Text"); + if (text) { + if (cm.state.draggingText && !(mac ? e.altKey : e.ctrlKey)) + var selected = cm.listSelections(); + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) for (var i = 0; i < selected.length; ++i) + replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); + cm.replaceSelection(text, "around", "paste"); + cm.display.input.focus(); + } + } + catch(e){} + } + } + + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; + + e.dataTransfer.setData("Text", cm.getSelection()); + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) img.parentNode.removeChild(img); + } + } + + // SCROLL EVENTS + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function setScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) return; + cm.doc.scrollTop = val; + if (!gecko) updateDisplaySimple(cm, {top: val}); + if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (gecko) updateDisplaySimple(cm); + startWorker(cm, 100); + } + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller) { + if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; + cm.display.scrollbars.setScrollLeft(val); + } + + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. + + var wheelSamples = 0, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) wheelPixelsPerUnit = -.53; + else if (gecko) wheelPixelsPerUnit = 15; + else if (chrome) wheelPixelsPerUnit = -.7; + else if (safari) wheelPixelsPerUnit = -1/3; + + var wheelEventDelta = function(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; + else if (dy == null) dy = e.wheelDelta; + return {x: dx, y: dy}; + }; + CodeMirror.wheelEventPixels = function(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta; + }; + + function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; + + var display = cm.display, scroll = display.scroller; + // Quit if there's nothing to scroll here + if (!(dx && scroll.scrollWidth > scroll.clientWidth || + dy && scroll.scrollHeight > scroll.clientHeight)) return; + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer; + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy) + setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); + setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); + e_preventDefault(e); + display.wheelStartX = null; // Abort measurement, if in progress + return; + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) top = Math.max(0, top + pixels - 50); + else bot = Math.min(cm.doc.height, bot + pixels + 50); + updateDisplaySimple(cm, {top: top, bottom: bot}); + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function() { + if (display.wheelStartX == null) return; + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) return; + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } + } + } + + // KEY EVENTS + + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) return false; + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, done = false; + try { + if (isReadOnly(cm)) cm.state.suppressEdits = true; + if (dropShift) cm.display.shift = false; + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done; + } + + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) return result; + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm); + } + + var stopSeq = new Delayed; + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) return "handled"; + stopSeq.set(50, function() { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); + name = seq + " " + name; + } + var result = lookupKeyForEditor(cm, name, handle); + + if (result == "multi") + cm.state.keySeq = name; + if (result == "handled") + signalLater(cm, "keyHandled", cm, name, e); + + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } + + if (seq && !result && /\'$/.test(name)) { + e_preventDefault(e); + return true; + } + return !!result; + } + + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) return false; + + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) + || dispatchKey(cm, name, e, function(b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + return doHandleBinding(cm, b); + }); + } else { + return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); + } + } + + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, + function(b) { return doHandleBinding(cm, b, true); }); + } + + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + cm.curOp.focus = activeElt(); + if (signalDOMEvent(cm, e)) return; + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + cm.replaceSelection("", null, "cut"); + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + showCrossHair(cm); + } + + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + + function onKeyUp(e) { + if (e.keyCode == 16) this.doc.sel.shift = false; + signalDOMEvent(this, e); + } + + function onKeyPress(e) { + var cm = this; + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; + var keyCode = e.keyCode, charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return; + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + if (handleCharBinding(cm, e, ch)) return; + cm.display.input.onKeyPress(e); + } + + // FOCUS/BLUR EVENTS + + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function() { + if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + onBlur(cm); + } + }, 100); + } + + function onFocus(cm) { + if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false; + + if (cm.options.readOnly == "nocursor") return; + if (!cm.state.focused) { + signal(cm, "focus", cm); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) setTimeout(function() { cm.display.input.reset(true); }, 20); // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm) { + if (cm.state.delayingBlurEvent) return; + + if (cm.state.focused) { + signal(cm, "blur", cm); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); + } + + // CONTEXT MENU HANDLING + + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return; + cm.display.input.onContextMenu(e); + } + + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) return false; + return gutterEvent(cm, e, "gutterContextMenu", false, signal); + } + + // UPDATING + + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + var changeEnd = CodeMirror.changeEnd = function(change) { + if (!change.text) return change.to; + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); + }; + + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) return pos; + if (cmp(pos, change.to) <= 0) return changeEnd(change); + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; + return Pos(line, ch); + } + + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))); + } + return normalizeSelection(out, doc.sel.primIndex); + } + + function offsetPos(pos, old, nw) { + if (pos.line == old.line) + return Pos(nw.line, pos.ch - old.ch + nw.ch); + else + return Pos(nw.line + (pos.line - old.line), pos.ch); + } + + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex); + } + + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function() { this.canceled = true; } + }; + if (update) obj.update = function(from, to, text, origin) { + if (from) this.from = clipPos(doc, from); + if (to) this.to = clipPos(doc, to); + if (text) this.text = text; + if (origin !== undefined) this.origin = origin; + }; + signal(doc, "beforeChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); + + if (obj.canceled) return null; + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; + } + + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); + if (doc.cm.state.suppressEdits) return; + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) return; + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) + makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); + } else { + makeChangeInner(doc, change); + } + } + + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + if (doc.cm && doc.cm.state.suppressEdits) return; + + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + for (var i = 0; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + break; + } + if (i == source.length) return; + hist.lastOrigin = hist.lastSelOrigin = null; + + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}); + return; + } + selAfter = event; + } + else break; + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); + hist.generation = event.generation || ++hist.maxGeneration; + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + + for (var i = event.changes.length - 1; i >= 0; --i) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return; + } + + antiChanges.push(historyChangeFromChange(doc, change)); + + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) return; + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function(range) { + return new Range(Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch)); + }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + regLineChange(doc.cm, l, "gutter"); + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return; + } + if (change.from.line > doc.lastLine()) return; + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin}; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin}; + } + + change.removed = getBetween(doc, change.from, change.to); + + if (!selAfter) selAfter = computeSelAfterChange(doc, change); + if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); + else updateDoc(doc, change, spans); + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function(line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true; + } + }); + } + + if (doc.sel.contains(change.from, change.to) > -1) + signalCursorActivity(cm); + + updateDoc(doc, change, spans, estimateHeight(cm)); + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function(line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) cm.curOp.updateMaxLine = true; + } + + // Adjust frontier, schedule worker + doc.frontier = Math.min(doc.frontier, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) + regChange(cm); + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + regLineChange(cm, from.line, "text"); + else + regChange(cm, from.line, to.line + 1, lendiff); + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) signalLater(cm, "change", cm, obj); + if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); + } + cm.display.selForContextMenu = null; + } + + function replaceRange(doc, code, from, to, origin) { + if (!to) to = from; + if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } + if (typeof code == "string") code = splitLines(code); + makeChange(doc, {from: from, to: to, text: code, origin: origin}); + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, coords) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) return; + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + if (coords.top + box.top < 0) doScroll = true; + else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px; left: " + + coords.left + "px; width: 2px;"); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) margin = 0; + for (var limit = 0; limit < 5; limit++) { + var changed = false, coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), + Math.min(coords.top, endCoords.top) - margin, + Math.max(coords.left, endCoords.left), + Math.max(coords.bottom, endCoords.bottom) + margin); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + setScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; + } + if (!changed) break; + } + return coords; + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, x1, y1, x2, y2) { + var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); + if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); + if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, x1, y1, x2, y2) { + var display = cm.display, snapMargin = textHeight(cm.display); + if (y1 < 0) y1 = 0; + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), result = {}; + if (y2 - y1 > screen) y2 = y1 + screen; + var docBottom = cm.doc.height + paddingVert(display); + var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; + if (y1 < screentop) { + result.scrollTop = atTop ? 0 : y1; + } else if (y2 > screentop + screen) { + var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); + if (newTop != screentop) result.scrollTop = newTop; + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = x2 - x1 > screenw; + if (tooWide) x2 = x1 + screenw; + if (x1 < 10) + result.scrollLeft = 0; + else if (x1 < screenleft) + result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); + else if (x2 > screenw + screenleft - 3) + result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; + return result; + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollPos(cm, left, top) { + if (left != null || top != null) resolveScrollToPos(cm); + if (left != null) + cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; + if (top != null) + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(), from = cur, to = cur; + if (!cm.options.lineWrapping) { + from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; + to = Pos(cur.line, cur.ch + 1); + } + cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); + var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), + Math.min(from.top, to.top) - range.margin, + Math.max(from.right, to.right), + Math.max(from.bottom, to.bottom) + range.margin); + cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } + } + + // API UTILITIES + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state; + if (how == null) how = "add"; + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) how = "prev"; + else state = getStateBefore(cm, n); + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) line.stateAfter = null; + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) return; + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); + else indentation = 0; + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} + if (pos < indentation) indentString += spaceStr(indentation - pos); + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + return true; + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i, new Range(pos, pos)); + break; + } + } + } + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle; + if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); + else no = lineNo(handle); + if (no == null) return null; + if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); + return line; + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break; + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function() { + for (var i = kill.length - 1; i >= 0; i--) + replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); + ensureCursorVisible(cm); + }); + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var line = pos.line, ch = pos.ch, origDir = dir; + var lineObj = getLine(doc, line); + var possible = true; + function findNextLine() { + var l = line + dir; + if (l < doc.first || l >= doc.first + doc.size) return (possible = false); + line = l; + return lineObj = getLine(doc, l); + } + function moveOnce(boundToLine) { + var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); + if (next == null) { + if (!boundToLine && findNextLine()) { + if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); + else ch = dir < 0 ? lineObj.text.length : 0; + } else return (possible = false); + } else ch = next; + return true; + } + + if (unit == "char") moveOnce(); + else if (unit == "column") moveOnce(true); + else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) break; + var cur = lineObj.text.charAt(ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p"; + if (group && !first && !type) type = "s"; + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce();} + break; + } + + if (type) sawType = type; + if (dir > 0 && !moveOnce(!first)) break; + } + } + var result = skipAtomic(doc, Pos(line, ch), origDir, true); + if (!possible) result.hitSide = true; + return result; + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + for (;;) { + var target = coordsChar(cm, x, y); + if (!target.outside) break; + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } + y += dir * 5; + } + return target; + } + + // EDITOR METHODS + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){window.focus(); this.display.input.focus();}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") return; + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + operation(this, optionHandlers[option])(this, value, old); + }, + + getOption: function(option) {return this.options[option];}, + getDoc: function() {return this.doc;}, + + addKeyMap: function(map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); + }, + removeKeyMap: function(map) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) + if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1); + return true; + } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) throw new Error("Overlays may not be stateful."); + this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function(spec) { + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this.state.modeGen++; + regChange(this); + return; + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; + else dir = dir ? "add" : "subtract"; + } + if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); + }), + indentSelection: methodOp(function(how) { + var ranges = this.doc.sel.ranges, end = -1; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) { + var from = range.from(), to = range.to(); + var start = Math.max(end, from.line); + end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) + indentLine(this, j, how); + var newRanges = this.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); + } else if (range.head.line > end) { + indentLine(this, range.head.line, how, true); + end = range.head.line; + if (i == this.doc.sel.primIndex) ensureCursorVisible(this); + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise); + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true); + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; + var type; + if (ch == 0) type = styles[2]; + else for (;;) { + var mid = (before + after) >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; + else if (styles[mid * 2 + 1] < ch) before = mid + 1; + else { type = styles[mid * 2 + 2]; break; } + } + var cut = type ? type.indexOf("cm-overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); + }, + + getModeAt: function(pos) { + var mode = this.doc.mode; + if (!mode.innerMode) return mode; + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0]; + }, + + getHelpers: function(pos, type) { + var found = []; + if (!helpers.hasOwnProperty(type)) return found; + var help = helpers[type], mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) found.push(help[mode[type]]); + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) found.push(val); + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i = 0; i < help._global.length; i++) { + var cur = help._global[i]; + if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) + found.push(cur.val); + } + return found; + }, + + getStateAfter: function(line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getStateBefore(this, line + 1, precise); + }, + + cursorCoords: function(start, mode) { + var pos, range = this.doc.sel.primary(); + if (start == null) pos = range.head; + else if (typeof start == "object") pos = clipPos(this.doc, start); + else pos = start ? range.from() : range.to(); + return cursorCoords(this, pos, mode || "page"); + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page"); + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top); + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset); + }, + heightAtLine: function(line, mode) { + var end = false, lineObj; + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) line = this.doc.first; + else if (line > last) { line = last; end = true; } + lineObj = getLine(this.doc, line); + } else { + lineObj = line; + } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + + (end ? this.doc.height - heightAtLine(lineObj) : 0); + }, + + defaultTextHeight: function() { return textHeight(this.display); }, + defaultCharWidth: function() { return charWidth(this.display); }, + + setGutterMarker: methodOp(function(line, gutterID, value) { + return changeLine(this.doc, line, "gutter", function(line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) line.gutterMarkers = null; + return true; + }); + }), + + clearGutter: methodOp(function(gutterID) { + var cm = this, doc = cm.doc, i = doc.first; + doc.iter(function(line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + line.gutterMarkers[gutterID] = null; + regLineChange(cm, i, "gutter"); + if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; + } + ++i; + }); + }), + + lineInfo: function(line) { + if (typeof line == "number") { + if (!isLine(this.doc, line)) return null; + var n = line; + line = getLine(this.doc, line); + if (!line) return null; + } else { + var n = lineNo(line); + if (n == null) return null; + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets}; + }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + top = pos.top - node.offsetHeight; + else if (pos.bottom + node.offsetHeight <= vspace) + top = pos.bottom; + if (left + node.offsetWidth > hspace) + left = hspace - node.offsetWidth; + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") left = 0; + else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; + node.style.left = left + "px"; + } + if (scroll) + scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + return commands[cmd](this); + }, + + triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), + + findPosH: function(from, amount, unit, visually) { + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + cur = findPosH(this.doc, cur, dir, unit, visually); + if (cur.hitSide) break; + } + return cur; + }, + + moveH: methodOp(function(dir, unit) { + var cm = this; + cm.extendSelectionsBy(function(range) { + if (cm.display.shift || cm.doc.extend || range.empty()) + return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); + else + return dir < 0 ? range.from() : range.to(); + }, sel_move); + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc; + if (sel.somethingSelected()) + doc.replaceSelection("", null, "+delete"); + else + deleteNearSelection(this, function(range) { + var other = findPosH(doc, range.head, dir, unit, false); + return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; + }); + }), + + findPosV: function(from, amount, unit, goalColumn) { + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + var coords = cursorCoords(this, cur, "div"); + if (x == null) x = coords.left; + else coords.left = x; + cur = findPosV(this, coords, dir, unit); + if (cur.hitSide) break; + } + return cur; + }, + + moveV: methodOp(function(dir, unit) { + var cm = this, doc = this.doc, goals = []; + var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function(range) { + if (collapse) + return dir < 0 ? range.from() : range.to(); + var headPos = cursorCoords(cm, range.head, "div"); + if (range.goalColumn != null) headPos.left = range.goalColumn; + goals.push(headPos.left); + var pos = findPosV(cm, headPos, dir, unit); + if (unit == "page" && range == doc.sel.primary()) + addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); + return pos; + }, sel_move); + if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) + doc.sel.ranges[i].goalColumn = goals[i]; + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) + ? function(ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} + : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; + while (start > 0 && check(line.charAt(start - 1))) --start; + while (end < line.length && check(line.charAt(end))) ++end; + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)); + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) return; + if (this.state.overwrite = !this.state.overwrite) + addClass(this.display.cursorDiv, "CodeMirror-overwrite"); + else + rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); + + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function() { return this.display.input.getField() == activeElt(); }, + + scrollTo: methodOp(function(x, y) { + if (x != null || y != null) resolveScrollToPos(this); + if (x != null) this.curOp.scrollLeft = x; + if (y != null) this.curOp.scrollTop = y; + }), + getScrollInfo: function() { + var scroller = this.display.scroller; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)}; + }, + + scrollIntoView: methodOp(function(range, margin) { + if (range == null) { + range = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) margin = this.options.cursorScrollMargin; + } else if (typeof range == "number") { + range = {from: Pos(range, 0), to: null}; + } else if (range.from == null) { + range = {from: range, to: null}; + } + if (!range.to) range.to = range.from; + range.margin = margin || 0; + + if (range.from.line != null) { + resolveScrollToPos(this); + this.curOp.scrollToPos = range; + } else { + var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), + Math.min(range.from.top, range.to.top) - range.margin, + Math.max(range.from.right, range.to.right), + Math.max(range.from.bottom, range.to.bottom) + range.margin); + this.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } + }), + + setSize: methodOp(function(width, height) { + var cm = this; + function interpret(val) { + return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; + } + if (width != null) cm.display.wrapper.style.width = interpret(width); + if (height != null) cm.display.wrapper.style.height = interpret(height); + if (cm.options.lineWrapping) clearLineMeasurementCache(this); + var lineNo = cm.display.viewFrom; + cm.doc.iter(lineNo, cm.display.viewTo, function(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) + if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } + ++lineNo; + }); + cm.curOp.forceUpdate = true; + signal(cm, "refresh", this); + }), + + operation: function(f){return runInOp(this, f);}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) + estimateLineHeights(this); + signal(this, "refresh", this); + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc; + old.cm = null; + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + this.scrollTo(doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old; + }), + + getInputField: function(){return this.display.input.getField();}, + getWrapperElement: function(){return this.display.wrapper;}, + getScrollerElement: function(){return this.display.scroller;}, + getGutterElement: function(){return this.display.gutters;} + }; + eventMixin(CodeMirror); + + // OPTION DEFAULTS + + // The default configuration options. + var defaults = CodeMirror.defaults = {}; + // Functions to run when options are changed. + var optionHandlers = CodeMirror.optionHandlers = {}; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) optionHandlers[name] = + notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; + } + + // Passed to option handlers when there is no old value. + var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function(cm, val) { + cm.setValue(val); + }, true); + option("mode", null, function(cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function(cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != CodeMirror.Init) cm.refresh(); + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function() { + throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME + }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + + option("theme", "default", function(cm) { + themeChanged(cm); + guttersChanged(cm); + }, true); + option("keyMap", "default", function(cm, val, old) { + var next = getKeyMap(val); + var prev = old != CodeMirror.Init && getKeyMap(old); + if (prev && prev.detach) prev.detach(cm, next); + if (next.attach) next.attach(cm, prev || null); + }); + option("extraKeys", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("fixedGutter", true, function(cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function(cm) {updateScrollbars(cm);}, true); + option("scrollbarStyle", "native", function(cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + + option("readOnly", false, function(cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + cm.display.disabled = true; + } else { + cm.display.disabled = false; + if (!val) cm.display.input.reset(); + } + }); + option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); + option("dragDrop", true, dragDropChanged); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function(cm){cm.refresh();}, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function(cm, val) { + if (!val) cm.display.input.resetPosition(); + }); + + option("tabindex", null, function(cm, val) { + cm.display.input.getField().tabIndex = val || ""; + }); + option("autofocus", null); + + // MODE DEFINITION AND QUERYING + + // Known modes, by name and by MIME + var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function(name, mode) { + if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; + if (arguments.length > 2) + mode.dependencies = Array.prototype.slice.call(arguments, 2); + modes[name] = mode; + }; + + CodeMirror.defineMIME = function(mime, spec) { + mimeModes[mime] = spec; + }; + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + CodeMirror.resolveMode = function(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") found = {name: found}; + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return CodeMirror.resolveMode("application/xml"); + } + if (typeof spec == "string") return {name: spec}; + else return spec || {name: "null"}; + }; + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + CodeMirror.getMode = function(options, spec) { + var spec = CodeMirror.resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) return CodeMirror.getMode(options, "text/plain"); + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) continue; + if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) modeObj.helperType = spec.helperType; + if (spec.modeProps) for (var prop in spec.modeProps) + modeObj[prop] = spec.modeProps[prop]; + + return modeObj; + }; + + // Minimal default mode. + CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; + }); + CodeMirror.defineMIME("text/plain", "null"); + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = CodeMirror.modeExtensions = {}; + CodeMirror.extendMode = function(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); + }; + + // EXTENSIONS + + CodeMirror.defineExtension = function(name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function(name, func) { + Doc.prototype[name] = func; + }; + CodeMirror.defineOption = option; + + var initHooks = []; + CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; + + var helpers = CodeMirror.helpers = {}; + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []}; + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({pred: predicate, val: value}); + }; + + // MODE STATE HANDLING + + // Utility functions for working with state. Exported because nested + // modes need to do this for their inner modes. + + var copyState = CodeMirror.copyState = function(mode, state) { + if (state === true) return state; + if (mode.copyState) return mode.copyState(state); + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) val = val.concat([]); + nstate[n] = val; + } + return nstate; + }; + + var startState = CodeMirror.startState = function(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + }; + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + CodeMirror.innerMode = function(mode, state) { + while (mode.innerMode) { + var info = mode.innerMode(state); + if (!info || info.mode == mode) break; + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state}; + }; + + // STANDARD COMMANDS + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = CodeMirror.commands = { + selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, + singleSelection: function(cm) { + cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); + }, + killLine: function(cm) { + deleteNearSelection(cm, function(range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) + return {from: range.head, to: Pos(range.head.line + 1, 0)}; + else + return {from: range.head, to: Pos(range.head.line, len)}; + } else { + return {from: range.from(), to: range.to()}; + } + }); + }, + deleteLine: function(cm) { + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; + }); + }, + delLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), to: range.from()}; + }); + }, + delWrappedLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); + return {from: leftPos, to: range.from()}; + }); + }, + delWrappedLineRight: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + return {from: range.from(), to: rightPos }; + }); + }, + undo: function(cm) {cm.undo();}, + redo: function(cm) {cm.redo();}, + undoSelection: function(cm) {cm.undoSelection();}, + redoSelection: function(cm) {cm.redoSelection();}, + goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, + goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, + goLineStart: function(cm) { + cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1}); + }, + goLineStartSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + return lineStartSmart(cm, range.head); + }, {origin: "+move", bias: 1}); + }, + goLineEnd: function(cm) { + cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1}); + }, + goLineRight: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + }, sel_move); + }, + goLineLeft: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: 0, top: top}, "div"); + }, sel_move); + }, + goLineLeftSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); + return pos; + }, sel_move); + }, + goLineUp: function(cm) {cm.moveV(-1, "line");}, + goLineDown: function(cm) {cm.moveV(1, "line");}, + goPageUp: function(cm) {cm.moveV(-1, "page");}, + goPageDown: function(cm) {cm.moveV(1, "page");}, + goCharLeft: function(cm) {cm.moveH(-1, "char");}, + goCharRight: function(cm) {cm.moveH(1, "char");}, + goColumnLeft: function(cm) {cm.moveH(-1, "column");}, + goColumnRight: function(cm) {cm.moveH(1, "column");}, + goWordLeft: function(cm) {cm.moveH(-1, "word");}, + goGroupRight: function(cm) {cm.moveH(1, "group");}, + goGroupLeft: function(cm) {cm.moveH(-1, "group");}, + goWordRight: function(cm) {cm.moveH(1, "word");}, + delCharBefore: function(cm) {cm.deleteH(-1, "char");}, + delCharAfter: function(cm) {cm.deleteH(1, "char");}, + delWordBefore: function(cm) {cm.deleteH(-1, "word");}, + delWordAfter: function(cm) {cm.deleteH(1, "word");}, + delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, + delGroupAfter: function(cm) {cm.deleteH(1, "group");}, + indentAuto: function(cm) {cm.indentSelection("smart");}, + indentMore: function(cm) {cm.indentSelection("add");}, + indentLess: function(cm) {cm.indentSelection("subtract");}, + insertTab: function(cm) {cm.replaceSelection("\t");}, + insertSoftTab: function(cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(new Array(tabSize - col % tabSize + 1).join(" ")); + } + cm.replaceSelections(spaces); + }, + defaultTab: function(cm) { + if (cm.somethingSelected()) cm.indentSelection("add"); + else cm.execCommand("insertTab"); + }, + transposeChars: function(cm) { + runInOp(cm, function() { + var ranges = cm.listSelections(), newSel = []; + for (var i = 0; i < ranges.length; i++) { + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) + cm.replaceRange(line.charAt(0) + "\n" + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); + }, + newlineAndIndent: function(cm) { + runInOp(cm, function() { + var len = cm.listSelections().length; + for (var i = 0; i < len; i++) { + var range = cm.listSelections()[i]; + cm.replaceRange("\n", range.anchor, range.head, "+input"); + cm.indentLine(range.from().line + 1, null, true); + ensureCursorVisible(cm); + } + }); + }, + toggleOverwrite: function(cm) {cm.toggleOverwrite();} + }; + + + // STANDARD KEYMAPS + + var keyMap = CodeMirror.keyMap = {}; + + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + fallthrough: "basic" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + fallthrough: ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/), name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) cmd = true; + else if (/^a(lt)?$/i.test(mod)) alt = true; + else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true; + else if (/^s(hift)$/i.test(mod)) shift = true; + else throw new Error("Unrecognized modifier name: " + mod); + } + if (alt) name = "Alt-" + name; + if (ctrl) name = "Ctrl-" + name; + if (cmd) name = "Cmd-" + name; + if (shift) name = "Shift-" + name; + return name; + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + CodeMirror.normalizeKeyMap = function(keymap) { + var copy = {}; + for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue; + if (value == "...") { delete keymap[keyname]; continue; } + + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val, name; + if (i == keys.length - 1) { + name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) copy[name] = val; + else if (prev != val) throw new Error("Inconsistent bindings for " + name); + } + delete keymap[keyname]; + } + for (var prop in copy) keymap[prop] = copy[prop]; + return keymap; + }; + + var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) { + map = getKeyMap(map); + var found = map.call ? map.call(key, context) : map[key]; + if (found === false) return "nothing"; + if (found === "...") return "multi"; + if (found != null && handle(found)) return "handled"; + + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") + return lookupKey(key, map.fallthrough, handle, context); + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context); + if (result) return result; + } + } + }; + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + var isModifierKey = CodeMirror.isModifierKey = function(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + }; + + // Look up the name of a key as indicated by an event object. + var keyName = CodeMirror.keyName = function(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) return false; + var base = keyNames[event.keyCode], name = base; + if (name == null || event.altGraphKey) return false; + if (event.altKey && base != "Alt") name = "Alt-" + name; + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") name = "Ctrl-" + name; + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") name = "Cmd-" + name; + if (!noShift && event.shiftKey && base != "Shift") name = "Shift-" + name; + return name; + }; + + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val; + } + + // FROMTEXTAREA + + CodeMirror.fromTextArea = function(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) + options.tabindex = textarea.tabIndex; + if (!options.placeholder && textarea.placeholder) + options.placeholder = textarea.placeholder; + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(); + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form, realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function() { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + } + + options.finishInit = function(cm) { + cm.save = save; + cm.getTextArea = function() { return textarea; }; + cm.toTextArea = function() { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") + textarea.form.submit = realSubmit; + } + }; + }; + + textarea.style.display = "none"; + var cm = CodeMirror(function(node) { + textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + return cm; + }; + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = CodeMirror.StringStream = function(string, tabSize) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + }; + + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == this.lineStart;}, + peek: function() {return this.string.charAt(this.pos) || undefined;}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }, + indentation: function() { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) return null; + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);}, + hideFirstChars: function(n, inner) { + this.lineStart += n; + try { return inner(); } + finally { this.lineStart -= n; } + } + }; + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + var nextMarkerId = 0; + + var TextMarker = CodeMirror.TextMarker = function(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + eventMixin(TextMarker); + + // Clear the marker. + TextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) startOperation(cm); + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) signalLater(this, "clear", found.from, found.to); + } + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); + else if (cm) { + if (span.to != null) max = lineNo(line); + if (span.from != null) min = lineNo(line); + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) + updateLineHeight(line, textHeight(cm.display)); + } + if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { + var visual = visualLine(this.lines[i]), len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } + + if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) reCheckSelection(cm.doc); + } + if (cm) signalLater(cm, "markerCleared", cm, this); + if (withOp) endOperation(cm); + if (this.parent) this.parent.clear(); + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function(side, lineObj) { + if (side == null && this.type == "bookmark") side = 1; + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) return from; + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) return to; + } + } + return from && {from: from, to: to}; + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function() { + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; + if (!pos || !cm) return; + runInOp(cm, function() { + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) + updateLineHeight(line, line.height + dHeight); + } + }); + }; + + TextMarker.prototype.attachLine = function(line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); + } + this.lines.push(line); + }; + TextMarker.prototype.detachLine = function(line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) return markTextShared(doc, from, to, options, type); + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); + + var marker = new TextMarker(doc, type), diff = cmp(from, to); + if (options) copyObj(options, marker, false); + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + return marker; + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) marker.widgetNode.setAttribute("cm-ignore-events", "true"); + if (options.insertLeft) marker.widgetNode.insertLeft = true; + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + throw new Error("Inserting collapsed marker partially overlapping an existing one"); + sawCollapsedSpans = true; + } + + if (marker.addToHistory) + addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); + + var curLine = from.line, cm = doc.cm, updateMaxLine; + doc.iter(curLine, to.line + 1, function(line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + updateMaxLine = true; + if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { + if (lineIsHidden(doc, line)) updateLineHeight(line, 0); + }); + + if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); + + if (marker.readOnly) { + sawReadOnlySpans = true; + if (doc.history.done.length || doc.history.undone.length) + doc.clearHistory(); + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) cm.curOp.updateMaxLine = true; + if (marker.collapsed) + regChange(cm, from.line, to.line + 1); + else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) + for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); + if (marker.atomic) reCheckSelection(cm.doc); + signalLater(cm, "markerAdded", cm, marker); + } + return marker; + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) + markers[i].parent = this; + }; + eventMixin(SharedTextMarker); + + SharedTextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) + this.markers[i].clear(); + signalLater(this, "clear"); + }; + SharedTextMarker.prototype.find = function(side, lineObj) { + return this.primary.find(side, lineObj); + }; + + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function(doc) { + if (widget) options.widgetNode = widget.cloneNode(true); + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) + if (doc.linked[i].isParent) return; + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary); + } + + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), + function(m) { return m.parent; }); + } + + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + + function detachSharedMarkers(markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], linked = [marker.primary.doc];; + linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + } + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) return span; + } + } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + for (var r, i = 0; i < spans.length; ++i) + if (spans[i] != span) (r || (r = [])).push(spans[i]); + return r; + } + // Add a span to a line. + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } + return nw; + } + function markedSpansAfter(old, endCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); + } + } + return nw; + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) return null; + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) return null; + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) span.to = startCh; + else if (sameLine) span.to = found.to == null ? null : found.to + offset; + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i = 0; i < last.length; ++i) { + var span = last[i]; + if (span.to != null) span.to += offset; + if (span.from == null) { + var found = getMarkedSpanFor(first, span.marker); + if (!found) { + span.from = offset; + if (sameLine) (first || (first = [])).push(span); + } + } else { + span.from += offset; + if (sameLine) (first || (first = [])).push(span); + } + } + } + // Make sure we didn't create any zero-length spans + if (first) first = clearEmptySpans(first); + if (last && last != first) last = clearEmptySpans(last); + + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers; + if (gap > 0 && first) + for (var i = 0; i < first.length; ++i) + if (first[i].to == null) + (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); + for (var i = 0; i < gap; ++i) + newMarkers.push(gapMarkers); + newMarkers.push(last); + } + return newMarkers; + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + spans.splice(i--, 1); + } + if (!spans.length) return null; + return spans; + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) return stretched; + if (!stretched) return old; + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) + if (oldCur[k].marker == span.marker) continue spans; + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old; + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function(line) { + if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + (markers || (markers = [])).push(mark); + } + }); + if (!markers) return null; + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + newParts.push({from: p.from, to: m.from}); + if (dto > 0 || !mk.inclusiveRight && !dto) + newParts.push({from: m.to, to: p.to}); + parts.splice.apply(parts, newParts); + j += newParts.length - 1; + } + } + return parts; + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.detachLine(line); + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.attachLine(line); + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } + function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) return lenDiff; + var aPos = a.find(), bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) return -fromCmp; + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) return toCmp; + return b.id - a.id; + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + found = sp.marker; + } + return found; + } + function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } + function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) continue; + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; + if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) || + fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight))) + return true; + } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + line = merged.find(-1, true).line; + return line; + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + (lines || (lines = [])).push(line); + } + return lines; + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line); + if (line == vis) return lineN; + return lineNo(vis); + } + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) return lineN; + var line = getLine(doc, lineN), merged; + if (!lineIsHidden(doc, line)) return lineN; + while (merged = collapsedSpanAtEnd(line)) + line = merged.find(1, true).line; + return lineNo(line) + 1; + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) continue; + if (sp.from == null) return true; + if (sp.marker.widgetNode) continue; + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + return true; + } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); + } + if (span.marker.inclusiveRight && span.to == line.text.length) + return true; + for (var sp, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) return true; + } + } + + // LINE WIDGETS + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = CodeMirror.LineWidget = function(doc, node, options) { + if (options) for (var opt in options) if (options.hasOwnProperty(opt)) + this[opt] = options[opt]; + this.doc = doc; + this.node = node; + }; + eventMixin(LineWidget); + + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + addToScrollPos(cm, null, diff); + } + + LineWidget.prototype.clear = function() { + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); + if (no == null || !ws) return; + for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); + if (!ws.length) line.widgets = null; + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) runInOp(cm, function() { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + }; + LineWidget.prototype.changed = function() { + var oldH = this.height, cm = this.doc.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) return; + updateLineHeight(line, line.height + diff); + if (cm) runInOp(cm, function() { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + }); + }; + + function widgetHeight(widget) { + if (widget.height != null) return widget.height; + var cm = widget.doc.cm; + if (!cm) return 0; + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; + if (widget.noHScroll) + parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.offsetHeight; + } + + function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) cm.display.alignWidgets = true; + changeLine(doc, handle, "widget", function(line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) widgets.push(widget); + else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); + widget.line = line; + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) addToScrollPos(cm, null, widget.height); + cm.curOp.forceUpdate = true; + } + return true; + }); + return widget; + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + eventMixin(Line); + Line.prototype.lineNo = function() { return lineNo(this); }; + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + if (line.order != null) line.order = null; + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) updateLineHeight(line, estHeight); + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + function extractLineClasses(type, output) { + if (type) for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) break; + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) + output[prop] = lineClass[2]; + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + output[prop] += " " + lineClass[2]; + } + return type; + } + + function callBlankLine(mode, state) { + if (mode.blankLine) return mode.blankLine(state); + if (!mode.innerMode) return; + var inner = CodeMirror.innerMode(mode, state); + if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); + } + + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; + var style = mode.token(stream, state); + if (stream.pos > stream.start) return style; + } + throw new Error("Mode " + mode.name + " failed to advance stream."); + } + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + function getObj(copy) { + return {start: stream.start, end: stream.pos, + string: stream.current(), + type: style || null, + state: copy ? copyState(doc.mode, state) : state}; + } + + var doc = cm.doc, mode = doc.mode, style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize), tokens; + if (asArray) tokens = []; + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, state); + if (asArray) tokens.push(getObj(true)); + } + return asArray ? tokens : getObj(); + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; + var curStart = 0, curStyle = null; + var stream = new StringStream(text, cm.options.tabSize), style; + var inner = cm.options.addModeClass && [null]; + if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) processLine(cm, text, state, stream.pos); + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) style = "m-" + (style ? mName + " " + style : mName); + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 50000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 characters + var pos = Math.min(stream.pos, curStart + 50000); + f(pos, curStyle); + curStart = pos; + } + } + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, state, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, state, function(end, style) { + st.push(end, style); + }, lineClasses, forceToEnd); + + // Run overlays, adjust style array. + for (var o = 0; o < cm.state.overlays.length; ++o) { + var overlay = cm.state.overlays[o], i = 1, at = 0; + runMode(cm, line.text, overlay.mode, true, function(end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) + st.splice(i, 1, end, st[i+1], i_end); + i += 2; + at = Math.min(end, i_end); + } + if (!style) return; + if (overlay.opaque) { + st.splice(start, i - start, end, "cm-overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start+1]; + st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; + } + } + }, lineClasses); + } + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; + } + + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); + line.styles = result.styles; + if (result.classes) line.styleClasses = result.classes; + else if (line.styleClasses) line.styleClasses = null; + if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; + } + return line.styles; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, state, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize); + stream.start = stream.pos = startAt || 0; + if (text == "") callBlankLine(mode, state); + while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) { + readToken(mode, stream, state); + stream.start = stream.pos; + } + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}, styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) return null; + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")); + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content, + col: 0, pos: 0, cm: cm, + splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order; + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) + builder.addToken = buildTokenBadBidi(builder.addToken, order); + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) + builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); + if (line.styleClasses.textClass) + builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); + (lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit && /\bcm-tab\b/.test(builder.content.lastChild.className)) + builder.content.className = "cm-tab-wrap-hack"; + + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) + builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); + + return builder; + } + + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token; + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) return; + var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text; + var special = builder.cm.state.specialChars, mustWrap = false; + if (!special.test(text)) { + builder.col += text.length; + var content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) mustWrap = true; + builder.pos += text.length; + } else { + var content = document.createDocumentFragment(), pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) break; + pos += skipped + 1; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt.setAttribute("role", "presentation"); + txt.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else { + var txt = builder.cm.options.specialCharPlaceholder(m[0]); + txt.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt); + builder.pos++; + } + } + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || ""; + if (startStyle) fullStyle += startStyle; + if (endStyle) fullStyle += endStyle; + var token = elt("span", [content], fullStyle, css); + if (title) token.title = title; + return builder.content.appendChild(token); + } + builder.content.appendChild(content); + } + + function splitSpaces(old) { + var out = " "; + for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; + out += " "; + return out; + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function(builder, text, style, startStyle, endStyle, title, css) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + for (var i = 0; i < order.length; i++) { + var part = order[i]; + if (part.to > start && part.from <= start) break; + } + if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css); + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + }; + } + + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) builder.map.push(builder.pos, builder.pos + size, widget); + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + widget = builder.content.appendChild(document.createElement("span")); + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0; + if (!spans) { + for (var i = 1; i < styles.length; i+=2) + builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); + return; + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = title = css = ""; + collapsed = null; nextChange = Infinity; + var foundBookmarks = []; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) spanStyle += " " + m.className; + if (m.css) css = m.css; + if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; + if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; + if (m.title && !title) title = m.title; + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + collapsed = sp; + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null); + if (collapsed.to == null) return; + if (collapsed.to == pos) collapsed = false; + } + if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) + buildCollapsedSpan(builder, 0, foundBookmarks[j]); + } + if (pos >= len) break; + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore); + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null;} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + for (var i = start, result = []; i < end; ++i) + result.push(new Line(text[i], spansFor(i), estimateHeight)); + return result; + } + + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) doc.remove(from.line, nlines); + if (added.length) doc.insert(from.line, added); + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added = linesFor(1, text.length - 1); + added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added = linesFor(1, text.length - 1); + if (nlines > 1) doc.remove(from.line + 1, nlines - 1); + doc.insert(from.line + 1, added); + } + + signalLater(doc, "change", doc, change); + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + this.lines = lines; + this.parent = null; + for (var i = 0, height = 0; i < lines.length; ++i) { + lines[i].parent = this; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length; }, + // Remove the n lines at offset 'at'. + removeInner: function(at, n) { + for (var i = at, e = at + n; i < e; ++i) { + var line = this.lines[i]; + this.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + // Helper used to collapse a small branch into a single leaf. + collapse: function(lines) { + lines.push.apply(lines, this.lines); + }, + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function(at, lines, height) { + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) lines[i].parent = this; + }, + // Used to iterate over a part of the tree. + iterN: function(at, n, op) { + for (var e = at + n; at < e; ++at) + if (op(this.lines[at])) return true; + } + }; + + function BranchChunk(children) { + this.children = children; + var size = 0, height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size; }, + removeInner: function(at, n) { + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this.height -= oldHeight - child.height; + if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) break; + at = 0; + } else at -= sz; + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function(lines) { + for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); + }, + insertInner: function(at, lines, height) { + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + while (child.lines.length > 50) { + var spilled = child.lines.splice(child.lines.length - 25, 25); + var newleaf = new LeafChunk(spilled); + child.height -= newleaf.height; + this.children.splice(i + 1, 0, newleaf); + newleaf.parent = this; + } + this.maybeSpill(); + } + break; + } + at -= sz; + } + }, + // When a node has grown, check whether it should be split. + maybeSpill: function() { + if (this.children.length <= 10) return; + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iterN: function(at, n, op) { + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) return true; + if ((n -= used) == 0) break; + at = 0; + } else at -= sz; + } + } + }; + + var nextDocId = 0; + var Doc = CodeMirror.Doc = function(text, mode, firstLine) { + if (!(this instanceof Doc)) return new Doc(text, mode, firstLine); + if (firstLine == null) firstLine = 0; + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.frontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + + if (typeof text == "string") text = splitLines(text); + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) this.iterN(from - this.first, to - from, op); + else this.iterN(this.first, this.first + this.size, from); + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) height += lines[i].height; + this.insertInner(at - this.first, lines, height); + }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep, lineFilter) { + var lines = getLines(this, this.first, this.first + this.size, lineFilter); + if (lineSep === false) return lines; + return lines.join(lineSep || "\n"); + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1; + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: splitLines(code), origin: "setValue", full: true}, true); + setSelection(this, simpleSelection(top)); + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) return lines; + return lines.join(lineSep || "\n"); + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, + + getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, + getLineNumber: function(line) {return lineNo(line);}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") line = getLine(this, line); + return visualLine(line); + }, + + lineCount: function() {return this.size;}, + firstLine: function() {return this.first;}, + lastLine: function() {return this.first + this.size - 1;}, + + clipPos: function(pos) {return clipPos(this, pos);}, + + getCursor: function(start) { + var range = this.sel.primary(), pos; + if (start == null || start == "head") pos = range.head; + else if (start == "anchor") pos = range.anchor; + else if (start == "end" || start == "to" || start === false) pos = range.to(); + else pos = range.from(); + return pos; + }, + listSelections: function() { return this.sel.ranges; }, + somethingSelected: function() {return this.sel.somethingSelected();}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads, options)); + }), + extendSelectionsBy: docMethodOp(function(f, options) { + extendSelections(this, map(this.sel.ranges, f), options); + }), + setSelections: docMethodOp(function(ranges, primary, options) { + if (!ranges.length) return; + for (var i = 0, out = []; i < ranges.length; i++) + out[i] = new Range(clipPos(this, ranges[i].anchor), + clipPos(this, ranges[i].head)); + if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); + setSelection(this, normalizeSelection(out, primary), options); + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); + }), + + getSelection: function(lineSep) { + var ranges = this.sel.ranges, lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) return lines; + else return lines.join(lineSep || "\n"); + }, + getSelections: function(lineSep) { + var parts = [], ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) sel = sel.join(lineSep || "\n"); + parts[i] = sel; + } + return parts; + }, + replaceSelection: function(code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) + dup[i] = code; + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var changes = [], sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin}; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i = changes.length - 1; i >= 0; i--) + makeChange(this, changes[i]); + if (newSel) setSelectionReplaceHistory(this, newSel); + else if (this.cm) ensureCursorVisible(this.cm); + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), + + setExtending: function(val) {this.extend = val;}, + getExtending: function() {return this.extend;}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; + for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; + return {undo: done, redo: undone}; + }, + clearHistory: function() {this.history = new History(this.history.maxGeneration);}, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; + return this.history.generation; + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration); + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)}; + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) line[prop] = cls; + else if (classTest(cls).test(line[prop])) return false; + else line[prop] += " " + cls; + return true; + }); + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) return false; + else if (cls == null) line[prop] = null; + else { + var found = cur.match(classTest(cls)); + if (!found) return false; + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true; + }); + }), + + addLineWidget: docMethodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options); + }), + removeLineWidget: function(widget) { widget.clear(); }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark"); + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + markers.push(span.marker.parent || span.marker); + } + return markers; + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo = from.line; + this.iter(from.line, to.line + 1, function(line) { + var spans = line.markedSpans; + if (spans) for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(lineNo == from.line && from.ch > span.to || + span.from == null && lineNo != from.line|| + lineNo == to.line && span.from > to.ch) && + (!filter || filter(span.marker))) + found.push(span.marker.parent || span.marker); + } + ++lineNo; + }); + return found; + }, + getAllMarks: function() { + var markers = []; + this.iter(function(line) { + var sps = line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) + if (sps[i].from != null) markers.push(sps[i].marker); + }); + return markers; + }, + + posFromIndex: function(off) { + var ch, lineNo = this.first; + this.iter(function(line) { + var sz = line.text.length + 1; + if (sz > off) { ch = off; return true; } + off -= sz; + ++lineNo; + }); + return clipPos(this, Pos(lineNo, ch)); + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) return 0; + this.iter(this.first, coords.line, function (line) { + index += line.text.length + 1; + }); + return index; + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc; + }, + + linkedDoc: function(options) { + if (!options) options = {}; + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) from = options.from; + if (options.to != null && options.to < to) to = options.to; + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from); + if (options.sharedHist) copy.history = this.history; + (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy; + }, + unlinkDoc: function(other) { + if (other instanceof CodeMirror) other = other.doc; + if (this.linked) for (var i = 0; i < this.linked.length; ++i) { + var link = this.linked[i]; + if (link.doc != other) continue; + this.linked.splice(i, 1); + other.unlinkDoc(this); + detachSharedMarkers(findSharedMarkers(this)); + break; + } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, + + getMode: function() {return this.mode;}, + getEditor: function() {return this.cm;} + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); + for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments);}; + })(Doc.prototype[prop]); + + eventMixin(Doc); + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) continue; + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) continue; + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) throw new Error("This document is already in use."); + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + if (!cm.options.lineWrapping) findMaxLine(cm); + cm.options.mode = doc.modeOption; + regChange(cm); + } + + // LINE UTILITIES + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); + for (var chunk = doc; !chunk.lines;) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break; } + n -= sz; + } + } + return chunk.lines[n]; + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], n = start.line; + doc.iter(start.line, end.line + 1, function(line) { + var text = line.text; + if (n == end.line) text = text.slice(0, end.ch); + if (n == start.line) text = text.slice(start.ch); + out.push(text); + ++n; + }); + return out; + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to, lineFilter) { + var out = []; + doc.iter(from, to, function(line) { + var text = line.text; + if(lineFilter){ + text = lineFilter(line); + } + out.push(text); + }); + return out; + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) for (var n = line; n; n = n.parent) n.height += diff; + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) return null; + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) break; + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first; + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i = 0; i < chunk.children.length; ++i) { + var child = chunk.children[i], ch = child.height; + if (h < ch) { chunk = child; continue outer; } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) break; + h -= lh; + } + return n + i; + } + + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) break; + else h += line.height; + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i = 0; i < p.children.length; ++i) { + var cur = p.children[i]; + if (cur == chunk) break; + else h += cur.height; + } + } + return h; + } + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line) { + var order = line.order; + if (order == null) order = line.order = bidiOrdering(line.text); + return order; + } + + // HISTORY + + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); + return histChange; + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) array.pop(); + else break; + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done); + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done); + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done); + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, ore are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur; + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + var last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) + pushSelectionToHistory(doc.sel, hist.done); + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation}; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) hist.done.shift(); + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + + if (!last) signal(doc, "historyAdded"); + } + + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + hist.done[hist.done.length - 1] = sel; + else + pushSelectionToHistory(sel, hist.done); + + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) + clearSelectionEvents(hist.undone); + } + + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) + dest.push(sel); + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { + if (line.markedSpans) + (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) return null; + for (var i = 0, out; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } + else if (out) out.push(spans[i]); + } + return !out ? spans : out.length ? out : null; + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) return null; + for (var i = 0, nw = []; i < change.text.length; ++i) + nw.push(removeClearedSpans(found[i])); + return nw; + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + for (var i = 0, copy = []; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue; + } + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m; + newChanges.push({from: change.from, to: change.to, text: change.text}); + if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } + } + } + return copy; + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true; + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue; + } + for (var j = 0; j < sub.changes.length; ++j) { + var cur = sub.changes[j]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break; + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + + function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // EVENT UTILITIES + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + var e_preventDefault = CodeMirror.e_preventDefault = function(e) { + if (e.preventDefault) e.preventDefault(); + else e.returnValue = false; + }; + var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { + if (e.stopPropagation) e.stopPropagation(); + else e.cancelBubble = true; + }; + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; + } + var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; + + function e_target(e) {return e.target || e.srcElement;} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) b = 1; + else if (e.button & 2) b = 3; + else if (e.button & 4) b = 2; + } + if (mac && e.ctrlKey && b == 1) b = 3; + return b; + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var on = CodeMirror.on = function(emitter, type, f) { + if (emitter.addEventListener) + emitter.addEventListener(type, f, false); + else if (emitter.attachEvent) + emitter.attachEvent("on" + type, f); + else { + var map = emitter._handlers || (emitter._handlers = {}); + var arr = map[type] || (map[type] = []); + arr.push(f); + } + }; + + var off = CodeMirror.off = function(emitter, type, f) { + if (emitter.removeEventListener) + emitter.removeEventListener(type, f, false); + else if (emitter.detachEvent) + emitter.detachEvent("on" + type, f); + else { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + for (var i = 0; i < arr.length; ++i) + if (arr[i] == f) { arr.splice(i, 1); break; } + } + }; + + var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); + }; + + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2), list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + function bnd(f) {return function(){f.apply(null, args);};}; + for (var i = 0; i < arr.length; ++i) + list.push(bnd(arr[i])); + } + + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) delayed[i](); + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore; + } + + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) return; + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) + set.push(arr[i]); + } + + function hasHandler(emitter, type) { + var arr = emitter._handlers && emitter._handlers[type]; + return arr && arr.length > 0; + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f);}; + ctor.prototype.off = function(type, f) {off(this, type, f);}; + } + + // MISC UTILITIES + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; + + // Reused option objects for setSelection & friends + var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; + + function Delayed() {this.id = null;} + Delayed.prototype.set = function(ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) end = string.length; + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) + return n + (end - i); + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; + } + }; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) nextTab = string.length; + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) + return pos + Math.min(skipped, goal - col); + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; + if (col >= goal) return pos; + } + } + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + spaceStrs.push(lst(spaceStrs) + " "); + return spaceStrs[n]; + } + + function lst(arr) { return arr[arr.length-1]; } + + var selectInput = function(node) { node.select(); }; + if (ios) // Mobile Safari apparently has a bug where select() is broken. + selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; + else if (ie) // Suppress mysterious IE10 errors + selectInput = function(node) { try { node.select(); } catch(_e) {} }; + + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + if (array[i] == elt) return i; + return -1; + } + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); + return out; + } + + function nothing() {} + + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) copyObj(props, inst); + return inst; + }; + + function copyObj(obj, target, overwrite) { + if (!target) target = {}; + for (var prop in obj) + if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + target[prop] = obj[prop]; + return target; + } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args);}; + } + + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + var isWordCharBasic = CodeMirror.isWordChar = function(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + }; + function isWordChar(ch, helper) { + if (!helper) return isWordCharBasic(ch); + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; + return helper.test(ch); + } + + function isEmpty(obj) { + for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; + return true; + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; + function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } + + // DOM UTILITIES + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) e.className = className; + if (style) e.style.cssText = style; + if (typeof content == "string") e.appendChild(document.createTextNode(content)); + else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); + return e; + } + + var range; + if (document.createRange) range = function(node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r; + }; + else range = function(node, start, end) { + var r = document.body.createTextRange(); + try { r.moveToElementText(node.parentNode); } + catch(e) { return r; } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r; + }; + + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + e.removeChild(e.firstChild); + return e; + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); + } + + var contains = CodeMirror.contains = function(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + child = child.parentNode; + if (parent.contains) + return parent.contains(child); + do { + if (child.nodeType == 11) child = child.host; + if (child == parent) return true; + } while (child = child.parentNode); + }; + + function activeElt() { return document.activeElement; } + // Older versions of IE throws unspecified error when touching + // document.activeElement in some cases (during loading, in iframe) + if (ie && ie_version < 11) activeElt = function() { + try { return document.activeElement; } + catch(e) { return document.body; } + }; + + function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); } + var rmClass = CodeMirror.rmClass = function(node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + var addClass = CodeMirror.addClass = function(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) node.className += (current ? " " : "") + cls; + }; + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) + if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; + return b; + } + + // WINDOW-WIDE EVENTS + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.body.getElementsByClassName) return; + var byClass = document.body.getElementsByClassName("CodeMirror"); + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) f(cm); + } + } + + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) return; + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function() { + if (resizeTimer == null) resizeTimer = setTimeout(function() { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function() { + forEachCodeMirror(onBlur); + }); + } + + // FEATURE DETECTION + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) return false; + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node; + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) return badBidiRects; + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) + var r1 = range(txt, 1, 2).getBoundingClientRect(); + return badBidiRects = (r1.right - r0.right < 3); + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLines = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) nl = string.length; + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function(string){return string.split(/\r\n?|\n/);}; + + var hasSelection = window.getSelection ? function(te) { + try { return te.selectionStart != te.selectionEnd; } + catch(e) { return false; } + } : function(te) { + try {var range = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range || range.parentElement() != te) return false; + return range.compareEndPoints("StartToEnd", range) != 0; + }; + + var hasCopyEvent = (function() { + var e = elt("div"); + if ("oncopy" in e) return true; + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function"; + })(); + + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) return badZoomedRects; + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; + } + + // KEY NAMES + + var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"}; + CodeMirror.keyNames = keyNames; + (function() { + // Number keys + for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); + // Alphabetic keys + for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); + // Function keys + for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; + })(); + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) return f(from, to, "ltr"); + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); + found = true; + } + } + if (!found) f(from, to, "ltr"); + } + + function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } + function bidiRight(part) { return part.level % 2 ? part.from : part.to; } + + function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } + function lineRight(line) { + var order = getOrder(line); + if (!order) return line.text.length; + return bidiRight(lst(order)); + } + + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) lineN = lineNo(visual); + var order = getOrder(visual); + var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); + return Pos(lineN, ch); + } + function lineEnd(cm, lineN) { + var merged, line = getLine(cm.doc, lineN); + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + lineN = null; + } + var order = getOrder(line); + var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); + return Pos(lineN == null ? lineNo(line) : lineN, ch); + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS); + } + return start; + } + + function compareBidiLevel(order, a, b) { + var linedir = order[0].level; + if (a == linedir) return true; + if (b == linedir) return false; + return a < b; + } + var bidiOther; + function getBidiPartAt(order, pos) { + bidiOther = null; + for (var i = 0, found; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < pos && cur.to > pos) return i; + if ((cur.from == pos || cur.to == pos)) { + if (found == null) { + found = i; + } else if (compareBidiLevel(order, cur.level, order[found].level)) { + if (cur.from != cur.to) bidiOther = found; + return i; + } else { + if (cur.from != cur.to) bidiOther = i; + return found; + } + } + } + return found; + } + + function moveInLine(line, pos, dir, byUnit) { + if (!byUnit) return pos + dir; + do pos += dir; + while (pos > 0 && isExtendingChar(line.text.charAt(pos))); + return pos; + } + + // This is needed in order to move 'visually' through bi-directional + // text -- i.e., pressing left should make the cursor go left, even + // when in RTL text. The tricky part is the 'jumps', where RTL and + // LTR text touch each other. This often requires the cursor offset + // to move more than one unit, in order to visually move one unit. + function moveVisually(line, start, dir, byUnit) { + var bidi = getOrder(line); + if (!bidi) return moveLogically(line, start, dir, byUnit); + var pos = getBidiPartAt(bidi, start), part = bidi[pos]; + var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit); + + for (;;) { + if (target > part.from && target < part.to) return target; + if (target == part.from || target == part.to) { + if (getBidiPartAt(bidi, target) == pos) return target; + part = bidi[pos += dir]; + return (dir > 0) == part.level % 2 ? part.to : part.from; + } else { + part = bidi[pos += dir]; + if (!part) return null; + if ((dir > 0) == part.level % 2) + target = moveInLine(line, part.to, -1, byUnit); + else + target = moveInLine(line, part.from, 1, byUnit); + } + } + } + + function moveLogically(line, start, dir, byUnit) { + var target = start + dir; + if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir; + return target < 0 || target > line.text.length ? null : target; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6ff + var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; + function charType(code) { + if (code <= 0xf7) return lowTypes.charAt(code); + else if (0x590 <= code && code <= 0x5f4) return "R"; + else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); + else if (0x6ee <= code && code <= 0x8ac) return "r"; + else if (0x2000 <= code && code <= 0x200b) return "w"; + else if (code == 0x200c) return "b"; + else return "L"; + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + // Browsers seem to always treat the boundaries of block elements as being L. + var outerType = "L"; + + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; this.to = to; + } + + return function(str) { + if (!bidiRE.test(str)) return false; + var len = str.length, types = []; + for (var i = 0, type; i < len; ++i) + types.push(type = charType(str.charCodeAt(i))); + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i = 0, prev = outerType; i < len; ++i) { + var type = types[i]; + if (type == "m") types[i] = prev; + else prev = type; + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (type == "1" && cur == "r") types[i] = "n"; + else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i = 1, prev = types[0]; i < len - 1; ++i) { + var type = types[i]; + if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; + else if (type == "," && prev == types[i+1] && + (prev == "1" || prev == "n")) types[i] = prev; + prev = type; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i = 0; i < len; ++i) { + var type = types[i]; + if (type == ",") types[i] = "N"; + else if (type == "%") { + for (var end = i + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (cur == "L" && type == "1") types[i] = "L"; + else if (isStrong.test(type)) cur = type; + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i = 0; i < len; ++i) { + if (isNeutral.test(types[i])) { + for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} + var before = (i ? types[i-1] : outerType) == "L"; + var after = (end < len ? types[end] : outerType) == "L"; + var replace = before || after ? "L" : "R"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i = 0; i < len;) { + if (countsAsLeft.test(types[i])) { + var start = i; + for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} + order.push(new BidiSpan(0, start, i)); + } else { + var pos = i, at = order.length; + for (++i; i < len && types[i] != "L"; ++i) {} + for (var j = pos; j < i;) { + if (countsAsNum.test(types[j])) { + if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); + var nstart = j; + for (++j; j < i && countsAsNum.test(types[j]); ++j) {} + order.splice(at, 0, new BidiSpan(2, nstart, j)); + pos = j; + } else ++j; + } + if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); + } + } + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + if (order[0].level == 2) + order.unshift(new BidiSpan(1, order[0].to, order[0].to)); + if (order[0].level != lst(order).level) + order.push(new BidiSpan(order[0].level, len, len)); + + return order; + }; + })(); + + // THE END + + CodeMirror.version = "5.4.1"; + + return CodeMirror; +}); \ No newline at end of file diff --git a/src/base/formula/formulaeditor.js b/src/base/formula/formulaeditor.js index d2433ebf95..96228a992d 100644 --- a/src/base/formula/formulaeditor.js +++ b/src/base/formula/formulaeditor.js @@ -11,7 +11,8 @@ baseCls: 'bi-formula-editor', watermark: '', value: '', - fieldTextValueMap: {} + fieldTextValueMap: {}, + showHint: true }); }, _init: function () { @@ -25,7 +26,9 @@ }); this.editor.on("change", function (cm, change) { self._checkWaterMark(); - CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false}); + if(o.showHint){ + CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false}); + } BI.nextTick(function () { self.fireEvent(BI.FormulaEditor.EVENT_CHANGE) }); @@ -99,6 +102,10 @@ this._checkWaterMark(); }, + focus: function() { + this.editor.focus(); + }, + /** * 添加字段 * @param field diff --git a/src/base/foundation/bi.message.js b/src/base/foundation/bi.message.js index 92ad284179..e79e1bae77 100644 --- a/src/base/foundation/bi.message.js +++ b/src/base/foundation/bi.message.js @@ -9,6 +9,15 @@ $.extend(BI, { var messageShow, $mask, $pop; return { + alert: function (title, message, callback) { + this._show(false, title, message, callback); + }, + confirm: function (title, message, callback, min_width) { + this._show(true, title, message, callback); + }, + prompt: function (title, message, value, callback, min_width) { + FR.Msg.prompt(title, message, value, callback, min_width); + }, toast: function (message, level, context) { context = context || $("body"); var toast = BI.createWidget({ @@ -41,16 +50,16 @@ $.extend(BI, { _show: function (hasCancel, title, message, callback) { $mask = $('
      ').css({ position: 'absolute', - 'zIndex': 99999998, + 'zIndex': BI.zIndex_tip - 2, top: 0, left: 0, right: 0, bottom: 0, - opacity: 0.1 + opacity: 0.5 }).appendTo('body'); $pop = $('
      ').css({ position: 'absolute', - 'zIndex': 99999999, + 'zIndex': BI.zIndex_tip - 1, top: 0, left: 0, right: 0, @@ -65,7 +74,7 @@ $.extend(BI, { controlItems.push({ el: { type: 'bi.button', - text: BI.i18nText("BI-Cancel"), + text: BI.i18nText("BI-Basic_Cancel"), height: 30, level: 'ignore', handler: function () { @@ -80,7 +89,7 @@ $.extend(BI, { controlItems.push({ el: { type: 'bi.button', - text: BI.i18nText("BI-OK"), + text: BI.i18nText("BI-Basic_OK"), height: 30, handler: function () { close(); @@ -106,7 +115,7 @@ $.extend(BI, { center: { el: { type: 'bi.label', - text: title || BI.i18nText("BI-Prompt"), + text: title || BI.i18nText("BI-Basic_Prompt"), textAlign: 'left', hgap: 20, height: 50 diff --git a/src/base/grid/grid.js b/src/base/grid/grid.js index 03b5336a2c..c95930f6be 100644 --- a/src/base/grid/grid.js +++ b/src/base/grid/grid.js @@ -60,13 +60,11 @@ BI.Grid = BI.inherit(BI.Widget, { if (o.items.length > 0) { this._populate(); } - }, - - mounted: function () { - var o = this.options; if (o.scrollLeft !== 0 || o.scrollTop !== 0) { - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); + BI.nextTick(function () { + self.element.scrollTop(o.scrollTop); + self.element.scrollLeft(o.scrollLeft); + }); } }, diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 6345077058..fa7683a757 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -53,7 +53,14 @@ BI.PopupView = BI.inherit(BI.Widget, { "z-index": BI.zIndex_popup, "min-width": o.minWidth + "px", "max-width": o.maxWidth + "px" - }).bind({"click": fn, "mousewheel": fn}); + }).bind({"click": fn}); + + //FIXME IE8下 jquery.mousewheeel.js 第一次执行65行$elem["offsetParent"]()的时候报错:未指明的错误 但是第二次或者调试的时候展开一下$elem内容均能避免上述问题 + try { + this.element.bind("mousewheel", fn); + } catch (e) { + this.element.bind("mousewheel", fn); + } o.stopPropagation && this.element.bind({"mousedown": fn, "mouseup": fn, "mouseover": fn}); o.stopEvent && this.element.bind({"mousedown": stop, "mouseup": stop, "mouseover": stop}); @@ -135,6 +142,10 @@ BI.PopupView = BI.inherit(BI.Widget, { }) }, + getView: function () { + return this.button_group; + }, + populate: function (items) { this.button_group.populate.apply(this.button_group, arguments); }, @@ -145,9 +156,9 @@ BI.PopupView = BI.inherit(BI.Widget, { }, resetHeight: function (h) { - var tbHeight = 30 * (this.toolbar ? 1 : 0), - tabHeight = 25 * (this.tab ? 1 : 0), - toolHeight = ((this.tool && this.tool.element.outerHeight()) || 25) * ((this.tool && this.tool.isVisible()) ? 1 : 0); + var tbHeight = this.toolbar ? (this.toolbar.attr("height") || 30) : 0, + tabHeight = this.tab ? (this.tab.attr("height") || 25) : 0, + toolHeight = ((this.tool && this.tool.attr("height")) || 25) * ((this.tool && this.tool.isVisible()) ? 1 : 0); this.view.resetHeight ? this.view.resetHeight(h - tbHeight - tabHeight - toolHeight - 2) : this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"}) }, diff --git a/src/base/pager/pager.js b/src/base/pager/pager.js index 126cda3298..f4128c0fa2 100644 --- a/src/base/pager/pager.js +++ b/src/base/pager/pager.js @@ -52,15 +52,6 @@ BI.Pager = BI.inherit(BI.Widget, { this._populate(); }, - populate: function () { - this.currPage = BI.result(this.options, "curr"); - this._populate(); - }, - - refresh: function () { - this._populate(); - }, - _populate: function () { var self = this, o = this.options, view = [], dict = {}; this.empty(); @@ -279,6 +270,17 @@ BI.Pager = BI.inherit(BI.Widget, { default : return val; } + }, + + attr: function (key, value) { + BI.Pager.superclass.attr.apply(this, arguments); + if (key === "curr") { + this.currPage = BI.result(this.options, "curr"); + } + }, + + populate: function () { + this._populate(); } }); BI.Pager.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/base/pane.js b/src/base/pane.js index 941ab39965..ca56775929 100644 --- a/src/base/pane.js +++ b/src/base/pane.js @@ -56,7 +56,7 @@ BI.Pane = BI.inherit(BI.Widget, { }); } BI.Maskers.show(self.getName()); - } else { + } else if (BI.isNull(this._loading)) { this._loading = BI.createWidget({ type: "bi.layout", cls: "loading-background", diff --git a/src/base/reqloading/loading.request.js b/src/base/reqloading/loading.request.js new file mode 100644 index 0000000000..c54d5578f4 --- /dev/null +++ b/src/base/reqloading/loading.request.js @@ -0,0 +1,192 @@ +/** + * Created by Young's on 2016/8/17. + * 加载面板,一般只用于 requestAsync 中 + */ +BI.RequstLoading = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.RequstLoading.superclass._defaultConfig.apply(this, arguments), {}); + }, + + _init: function () { + BI.RequstLoading.superclass._init.apply(this, arguments); + var self = this, o = this.options; + var mask = BI.Maskers.create(BI.RequstLoading.MASK_ID); + this.callback = o.callback; + this.paneTab = BI.createWidget({ + type: "bi.tab", + cardCreator: BI.bind(this._cardCreator, this), + defaultShowIndex: BI.RequstLoading.ERROR, + width: 400, + height: 300 + }); + var tempIcon = BI.createWidget({ + type: "bi.icon_button", + cls: "data-link-test-fail-icon", + width: 0, + height: 0 + }); + BI.createWidget({ + type: "bi.absolute", + element: $('body'), + items: [{ + el: tempIcon, + bottom: 0 + }] + }); + + BI.createWidget({ + type: "bi.absolute", + element: mask, + cls: "bi-request-loading", + items: [{ + el: { + type: "bi.layout", + cls: "mask-pane" + }, + top: 0, + left: 0, + bottom: 0, + right: 0 + }, { + el: { + type: "bi.center_adapt", + items: [this.paneTab] + }, + top: 0, + left: 0, + right: 0, + bottom: 0 + }] + }); + }, + + _cardCreator: function (v) { + var self = this; + var cancel = BI.createWidget({ + type: "bi.button", + text: BI.i18nText("BI-Basic_Cancel"), + title: BI.i18nText("BI-Basic_Cancel"), + level: "ignore", + height: 28, + width: 90, + handler: function () { + BI.Maskers.hide(BI.RequstLoading.MASK_ID); + } + }); + var retry = BI.createWidget({ + type: "bi.button", + text: BI.i18nText("BI-Basic_Retry"), + title: BI.i18nText("BI-Basic_Retry"), + level: "common", + height: 28, + width: 90, + handler: function () { + self.paneTab.setSelect(BI.RequstLoading.LOADING); + self.callback(); + } + }); + switch (v) { + case BI.RequstLoading.LOADING: + return BI.createWidget({ + type: "bi.vertical", + items: [{ + type: "bi.center_adapt", + cls: "loading-bar-icon", + items: [{ + type: "bi.icon", + width: 208, + height: 15 + }] + }, { + type: "bi.label", + cls: "loading-comment", + text: BI.i18nText("BI-Basic_Loading"), + height: 30 + }], + width: 208, + height: 200, + vgap: 10 + }); + case BI.RequstLoading.LOADING_TIMEOUT: + return BI.createWidget({ + type: "bi.vertical", + items: [{ + type: "bi.center_adapt", + cls: "loading-bar-icon", + items: [{ + type: "bi.icon", + width: 208, + height: 15 + }] + }, { + type: "bi.label", + cls: "loading-comment", + text: BI.i18nText("BI-Basic_Loading"), + height: 30 + }, { + type: "bi.label", + text: BI.i18nText("BI-Request_Time_Out_Toast_Tip"), + cls: "load-timeout-warning" + }, { + type: "bi.left_right_vertical_adapt", + items: { + left: [cancel], + right: [retry] + }, + height: 30, + llgap: 100, + rrgap: 100 + }], + vgap: 10 + }); + case BI.RequstLoading.ERROR: + return BI.createWidget({ + type: "bi.vertical", + items: [{ + type: "bi.center_adapt", + cls: "data-link-test-fail-icon", + items: [{ + type: "bi.icon", + width: 126, + height: 126 + }] + }, { + type: "bi.label", + text: BI.i18nText("BI-Connection_Lost"), + cls: "load-fail-comment" + }, { + type: "bi.left_right_vertical_adapt", + items: { + left: [cancel], + right: [retry] + }, + height: 30, + llgap: 100, + rrgap: 100 + }], + vgap: 20 + }); + } + }, + + showLoading: function () { + BI.Maskers.show(BI.RequstLoading.MASK_ID); + this.paneTab.setSelect(BI.RequstLoading.LOADING); + }, + + showError: function () { + BI.Maskers.show(BI.RequstLoading.MASK_ID); + this.paneTab.setSelect(BI.RequstLoading.ERROR); + }, + + setCallback: function (callback) { + this.callback = callback; + } +}); +BI.extend(BI.RequstLoading, { + MASK_ID: "___request__loading___", + LOADING: 1, + LOADING_TIMEOUT: 2, + ERROR: 3 +}); +$.shortcut("bi.request_loading", BI.RequstLoading); \ No newline at end of file diff --git a/src/base/single/a/a.js b/src/base/single/a/a.js index db50fe4b8e..4f804c30fc 100644 --- a/src/base/single/a/a.js +++ b/src/base/single/a/a.js @@ -13,13 +13,14 @@ BI.A = BI.inherit(BI.Text, { baseCls: (conf.baseCls || "") + " bi-a display-block", href: "", target: "_blank", - el: null + el: null, + element: "" }) }, _init: function () { var o = this.options; - this.options.element = $(""); BI.A.superclass._init.apply(this, arguments); + this.element.attr({href: o.href, target: o.target}); if (o.el) { BI.createWidget(o.el, { element: this diff --git a/src/base/single/bar/bar.loading.js b/src/base/single/bar/bar.loading.js index 326cb2579c..a02c8665e9 100644 --- a/src/base/single/bar/bar.loading.js +++ b/src/base/single/bar/bar.loading.js @@ -5,8 +5,8 @@ */ BI.LoadingBar = BI.inherit(BI.Single, { consts: { - loadedText: '加载更多', - endText: '无更多数据' + loadedText: BI.i18nText("BI-Load_More"), + endText: BI.i18nText("BI-No_More_Data") }, _defaultConfig: function() { var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments); diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 1b62145361..41f23794c6 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -9,7 +9,7 @@ BI.BasicButton = BI.inherit(BI.Single, { _defaultConfig: function () { var conf = BI.BasicButton.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-basic-button cursor-pointer", + baseCls: (conf.baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer"), value: "", text: "", stopEvent: false, @@ -122,42 +122,36 @@ BI.BasicButton = BI.inherit(BI.Single, { var selected = false; hand.mousedown(function (e) { // if (e.button === 0) { - if (mouseDown === true) { - return; + $(document).bind("mouseup." + self.getName(), function (e) { + // if (e.button === 0) { + if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + self.setSelected(!self.isSelected()); + self._trigger(); } - if (self.isSelected()) { - selected = true; - } else { - clk(e); - } - mouseDown = true; - ev(e); + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + // } + }); + if (mouseDown === true) { + return; + } + if (self.isSelected()) { + selected = true; + } else { + clk(e); + } + mouseDown = true; + ev(e); // } }); hand.mouseup(function (e) { // if (e.button === 0) { - if (mouseDown === true && selected === true) { - clk(e); - } - mouseDown = false; - selected = false; - // } - }); - var checking = BI.debounce(function () { - if (!BI.DOM.isExist(self)) { - $(document).unbind("mouseup." + self.getName()); + if (BI.DOM.isExist(self) && mouseDown === true && selected === true) { + clk(e); } - }, 3000); - $(document).bind("mouseup." + this.getName(), function (e) { - // if (e.button === 0) { - if (BI.DOM.isExist(self)) { - if (!hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { - self.setSelected(!self.isSelected()); - self._trigger(); - } - mouseDown = false; - checking(); - } + mouseDown = false; + selected = false; + $(document).unbind("mouseup." + self.getName()); // } }); break; @@ -284,8 +278,13 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - destroyed: function () { + empty: function () { $(document).unbind("mouseup." + this.getName()); + BI.BasicButton.superclass.empty.apply(this, arguments); + }, + + destroy: function () { + BI.BasicButton.superclass.destroy.apply(this, arguments); } }); BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; \ No newline at end of file diff --git a/src/base/single/button/buttons/button.icon.js b/src/base/single/button/buttons/button.icon.js index 6e65366e04..4ec092e62e 100644 --- a/src/base/single/button/buttons/button.icon.js +++ b/src/base/single/button/buttons/button.icon.js @@ -7,8 +7,7 @@ BI.IconButton = BI.inherit(BI.BasicButton, { _defaultConfig: function () { var conf = BI.IconButton.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - tagName: "a", - baseCls: (conf.baseCls || "") + " bi-icon-button horizon-center display-block", + baseCls: (conf.baseCls || "") + " bi-icon-button horizon-center", iconWidth: null, iconHeight: null }) diff --git a/src/base/single/button/buttons/button.image.js b/src/base/single/button/buttons/button.image.js index 7bc567d04b..40fe14a966 100644 --- a/src/base/single/button/buttons/button.image.js +++ b/src/base/single/button/buttons/button.image.js @@ -9,8 +9,7 @@ BI.ImageButton = BI.inherit(BI.BasicButton, { _defaultConfig: function () { var conf = BI.ImageButton.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - tagName: "a", - baseCls: (conf.baseCls || "") + " bi-image-button display-block", + baseCls: (conf.baseCls || "") + " bi-image-button", src: "", iconWidth: "100%", iconHeight: "100%" diff --git a/src/base/single/button/buttons/button.text.js b/src/base/single/button/buttons/button.text.js index a66f5f36fe..ab6e1aa116 100644 --- a/src/base/single/button/buttons/button.text.js +++ b/src/base/single/button/buttons/button.text.js @@ -6,11 +6,10 @@ * 文字button */ BI.TextButton = BI.inherit(BI.BasicButton, { - _defaultConfig: function() { + _defaultConfig: function () { var conf = BI.TextButton.superclass._defaultConfig.apply(this, arguments); - return BI.extend( conf, { - tagName: "a", - baseCls: (conf.baseCls || "") + " bi-text-button display-block", + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-button", textAlign: "center", whiteSpace: "nowrap", forceCenter: false, @@ -19,12 +18,12 @@ BI.TextButton = BI.inherit(BI.BasicButton, { hgap: 0, lgap: 0, rgap: 0, - text:"", + text: "", py: "" }) }, - _init:function() { + _init: function () { BI.TextButton.superclass._init.apply(this, arguments); var o = this.options; this.text = BI.createWidget({ @@ -46,18 +45,18 @@ BI.TextButton = BI.inherit(BI.BasicButton, { }); }, - doClick: function(){ + doClick: function () { BI.TextButton.superclass.doClick.apply(this, arguments); - if(this.isValid()) { + if (this.isValid()) { this.fireEvent(BI.TextButton.EVENT_CHANGE, this.getValue(), this); } }, - doRedMark: function(){ + doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, - unRedMark: function(){ + unRedMark: function () { this.text.unRedMark.apply(this.text, arguments); }, @@ -69,15 +68,19 @@ BI.TextButton = BI.inherit(BI.BasicButton, { this.text.unHighLight.apply(this.text, arguments); }, - setText: function(text){ + setText: function (text) { BI.TextButton.superclass.setText.apply(this, arguments); text = BI.isArray(text) ? text.join(",") : text; this.text.setText(text); }, - setValue: function(text){ + setStyle: function (style) { + this.text.setStyle(style); + }, + + setValue: function (text) { BI.TextButton.superclass.setValue.apply(this, arguments); - if(!this.isReadOnly()) { + if (!this.isReadOnly()) { text = BI.isArray(text) ? text.join(",") : text; this.text.setValue(text); } diff --git a/src/base/single/button/listitem/blankiconicontextitem.js b/src/base/single/button/listitem/blankiconicontextitem.js new file mode 100644 index 0000000000..f7d37f44af --- /dev/null +++ b/src/base/single/button/listitem/blankiconicontextitem.js @@ -0,0 +1,119 @@ +/** + * 带有一个占位 + * + * Created by GUY on 2015/9/11. + * @class BI.BlankIconIconTextItem + * @extends BI.BasicButton + */ +BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, { + _const: { + commonWidth: 25 + }, + + _defaultConfig: function () { + var conf = BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item", + logic: { + dynamic: false + }, + iconCls1: "close-ha-font", + iconCls2: "close-ha-font", + blankWidth: 0, + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.BlankIconIconTextItem.superclass._init.apply(this, arguments); + var o = this.options, c = this._const; + var blank = BI.createWidget({ + type: "bi.layout", + width: o.blankWidth + }) + this.text = BI.createWidget({ + type: "bi.label", + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }); + this.icon1 = BI.createWidget({ + type: "bi.icon_button", + cls: o.iconCls1, + forceNotSelected: true, + width: c.commonWidth + }); + this.icon2 = BI.createWidget({ + type: "bi.icon_button", + cls: o.iconCls2, + forceNotSelected: true, + width: c.commonWidth + }); + + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon1, this.icon2, this.text) + })))); + }, + + doClick: function () { + BI.BlankIconIconTextItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE, this.getValue(), this); + } + }, + + setSelected: function (b) { + BI.BlankIconIconTextItem.superclass.setSelected.apply(this, arguments); + this.icon1.setSelected(b); + this.icon2.setSelected(b); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + getValue: function () { + return this.text.getValue(); + }, + + setText: function () { + this.text.setText.apply(this.text, arguments); + }, + + getText: function () { + return this.text.getText(); + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + } +}); +BI.BlankIconIconTextItem.EVENT_CHANGE = "EVENT_CHANGE"; +$.shortcut("bi.blank_icon_icon_text_item", BI.BlankIconIconTextItem); \ No newline at end of file diff --git a/src/base/single/editor/editor.code.js b/src/base/single/editor/editor.code.js index 54a8b11500..03b55707c2 100644 --- a/src/base/single/editor/editor.code.js +++ b/src/base/single/editor/editor.code.js @@ -104,7 +104,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { case "param": var fieldNameLength = i.to - i.from; value = value.substr(0, i.from + num) + "$\{" + value.substr(i.from + num, fieldNameLength) + "\}" + value.substr(i.to + num, value.length); - num += fieldNameLength + 3; + num += 3; break; } }); @@ -113,7 +113,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { }, _analyzeContent: function (v) { - var regx = /\$[\{][^\}]*[\}]|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)|\n/g; + var regx = /\$[\{][^\}]*[\}]|(\s+)|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)|\n/g; return v.match(regx); }, diff --git a/src/base/single/editor/editor.js b/src/base/single/editor/editor.js index 521c39bb0b..70df8c8081 100644 --- a/src/base/single/editor/editor.js +++ b/src/base/single/editor/editor.js @@ -50,7 +50,9 @@ BI.Editor = BI.inherit(BI.Single, { type: "bi.label", cls: "bi-water-mark", text: this.options.watermark, + height: this.options.height, forceCenter: true, + height: o.height - 2 * (o.vgap + o.tgap), whiteSpace: "nowrap", textAlign: "left" }); @@ -275,7 +277,7 @@ BI.Editor = BI.inherit(BI.Single, { }, getLastValidValue: function () { - return BI.trim(this.editor.getLastValidValue()); + return this.editor.getLastValidValue(); }, resetLastValidValue: function () { diff --git a/src/base/single/editor/editor.textarea.js b/src/base/single/editor/editor.textarea.js index 44eea92068..b4045ae907 100644 --- a/src/base/single/editor/editor.textarea.js +++ b/src/base/single/editor/editor.textarea.js @@ -37,26 +37,96 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { }] }); + this.content.element.on("input propertychange", function (e) { + self._checkWaterMark(); + self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE); + }); + this.content.element.focus(function () { - self.content.element.addClass("textarea-editor-focus"); - self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS); + if (self.isValid()) { + self._focus(); + self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS); + } + $(document).bind("mousedown." + self.getName(), function (e) { + if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) { + $(document).unbind("mousedown." + self.getName()); + self.content.element.blur(); + } + }); }); this.content.element.blur(function () { - self.content.element.removeClass("textarea-editor-focus"); - self.fireEvent(BI.TextAreaEditor.EVENT_BLUR); + if (self.isValid()) { + self._blur(); + self.fireEvent(BI.TextAreaEditor.EVENT_BLUR); + } + $(document).unbind("mousedown." + self.getName()); }); if (BI.isKey(o.value)) { self.setValue(o.value); } + if (BI.isNotNull(o.style)) { + self.setValue(o.style); + } + this._checkWaterMark(); }, - focus: function () { + _checkWaterMark: function () { + var self = this, o = this.options; + var val = this.getValue(); + if (BI.isNotEmptyString(val)) { + this.watermark && this.watermark.destroy(); + this.watermark = null; + } else { + if (BI.isNotEmptyString(o.watermark)) { + if (!this.watermark) { + this.watermark = BI.createWidget({ + type: "bi.text_button", + cls: "bi-water-mark", + textAlign: "left", + height: 30, + text: o.watermark, + invalid: o.invalid, + disabled: o.disabled + }); + this.watermark.on(BI.TextButton.EVENT_CHANGE, function () { + self.focus(); + }); + BI.createWidget({ + type: 'bi.absolute', + element: this, + items: [{ + el: this.watermark, + left: 0, + top: 0, + right: 0 + }] + }) + } else { + this.watermark.setText(o.watermark); + this.watermark.setValid(!o.invalid); + this.watermark.setEnable(!o.disabled); + } + } + } + }, + + _focus: function () { this.content.element.addClass("textarea-editor-focus"); + this._checkWaterMark(); + }, + + _blur: function () { + this.content.element.removeClass("textarea-editor-focus"); + this._checkWaterMark(); + }, + + focus: function () { + this._focus(); this.content.element.focus(); }, blur: function () { - this.content.element.removeClass("textarea-editor-focus"); + this._blur(); this.content.element.blur(); }, @@ -81,13 +151,16 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { setValid: function (b) { BI.TextAreaEditor.superclass.setValid.apply(this, arguments); this.content.setValid(b); + this.watermark && this.watermark.setValid(b); }, setEnable: function (b) { BI.TextAreaEditor.superclass.setEnable.apply(this, arguments); this.content.setEnable(b); + this.watermark && this.watermark.setEnable(b); } }); +BI.TextAreaEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.TextAreaEditor.EVENT_BLUR = "EVENT_BLUR"; BI.TextAreaEditor.EVENT_FOCUS = "EVENT_FOCUS"; $.shortcut("bi.textarea_editor", BI.TextAreaEditor); \ No newline at end of file diff --git a/src/base/single/img/img.js b/src/base/single/img/img.js index c89db0a849..9a037ac07b 100644 --- a/src/base/single/img/img.js +++ b/src/base/single/img/img.js @@ -10,7 +10,7 @@ BI.Img = BI.inherit(BI.Single, { _defaultConfig: function () { var conf = BI.Img.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-img", + baseCls: (conf.baseCls || "") + " bi-img display-block", src: "", width: "100%", height: "100%" @@ -33,4 +33,4 @@ BI.Img = BI.inherit(BI.Single, { } }); -$.shortcut("bi.img", BI.Img); \ No newline at end of file +$.shortcut("bi.img", BI.Img); diff --git a/src/base/single/input/checkbox.js b/src/base/single/input/checkbox.js index bb76d962ba..92b295d67e 100644 --- a/src/base/single/input/checkbox.js +++ b/src/base/single/input/checkbox.js @@ -7,7 +7,6 @@ BI.Checkbox = BI.inherit(BI.IconButton, { _defaultConfig: function() { var conf = BI.Checkbox.superclass._defaultConfig.apply(this,arguments); return BI.extend(conf, { - tagName: "a", baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon", selected: false, handler: BI.emptyFn, diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index f896131f10..2aa47b8781 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -16,8 +16,9 @@ var F = (function (item) { return function (input) { var files = input.files || [input]; - if (!files.item) + if (!files.item) { files.item = item; + } return files; }; })(function (i) { @@ -67,8 +68,9 @@ */ stop: function (e) { if (!e) { - if (self.event) + if (self.event) { event.returnValue = !(event.cancelBubble = true); + } } else { e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true; e.preventDefault ? e.preventDefault() : e.returnValue = false; @@ -82,7 +84,7 @@ var multipart = function (boundary, name, file) { return "--".concat( boundary, CRLF, - 'Content-Disposition: form-data; name="', name, '"; filename="', BI.cjkEncode(file.fileName), '"', CRLF, + 'Content-Disposition: form-data; name="', name, '"; filename="', FR.cjkEncode(file.fileName), '"', CRLF, "Content-Type: application/octet-stream", CRLF, CRLF, file.getAsBinary(), CRLF, @@ -99,11 +101,12 @@ sendFile; // FireFox 3+, Safari 4 beta (Chrome 2 beta file is buggy and will not work) - if (xhr.upload || xhr.sendAsBinary) + if (xhr.upload || xhr.sendAsBinary) { sendFile = function (handler, maxSize, width, height) { if (-1 < maxSize && maxSize < handler.file.fileSize) { - if (isFunction(handler.onerror)) + if (isFunction(handler.onerror)) { handler.onerror(); + } return; } for (var @@ -116,28 +119,32 @@ i = 0; i < length; i++ - ) + ) { upload.addEventListener( split[i].substring(2), (function (event) { return function (rpe) { - if (isFunction(handler[event])) + if (isFunction(handler[event])) { handler[event](rpe, xhr); + } }; })(split[i]), false ); + } upload.addEventListener( "load", function (rpe) { if (handler.onreadystatechange === false) { - if (isFunction(handler.onload)) + if (isFunction(handler.onload)) { handler.onload(rpe, xhr); + } } else { setTimeout(function () { if (xhr.readyState === 4) { - if (isFunction(handler.onload)) + if (isFunction(handler.onload)) { handler.onload(rpe, xhr); + } } else { setTimeout(arguments.callee, 15); } @@ -146,13 +153,14 @@ }, false ); - xhr.open("post", handler.url + '&filename=' + BI.cjkEncode(handler.file.fileName), true); + xhr.open("post", handler.url + '&filename=' + FR.cjkEncode(handler.file.fileName), true); if (!xhr.upload) { var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true}; rpe.interval = setInterval(function () { rpe.loaded += 1024 / 4; - if (rpe.total <= rpe.loaded) + if (rpe.total <= rpe.loaded) { rpe.loaded = rpe.total; + } upload.onprogress(rpe); }, 100); xhr.onabort = function () { @@ -176,8 +184,8 @@ upload.onprogress(rpe); if (199 < xhr.status && xhr.status < 400) { upload["onload"]({}); - var attachO = BI.jsonDecode(xhr.responseText); - attachO.filename = BI.cjkDecode(handler.file.fileName); + var attachO = FR.jsonDecode(xhr.responseText); + attachO.filename = FR.cjkDecode(handler.file.fileName); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } @@ -193,11 +201,11 @@ xhr.onreadystatechange = function () { switch (xhr.readyState) { case 4: - var attachO = BI.jsonDecode(xhr.responseText); + var attachO = FR.jsonDecode(xhr.responseText); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } - attachO.filename = BI.cjkDecode(handler.file.fileName); + attachO.filename = handler.file.fileName; if (handler.maxlength == 1) { handler.attach_array[0] = attachO; // handler.attach_array.push(attachO); @@ -222,8 +230,9 @@ } return handler; }; + } // Internet Explorer, Opera, others - else + else { sendFile = function (handler, maxSize, width, height) { var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"), rpe = { @@ -242,13 +251,13 @@ //rpe.loaded = rpe.total; try { var responseText = (iframe.contentWindow.document || iframe.contentWindow.contentDocument).body.innerHTML; - var attachO = BI.jsonDecode(responseText); + var attachO = FR.jsonDecode(responseText); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } //attachO.fileSize = responseText.length; - attachO.filename = BI.cjkDecode(handler.file.fileName); + attachO.filename = FR.cjkDecode(handler.file.fileName); if (handler.maxlength == 1) { handler.attach_array[0] = attachO; } else { @@ -272,13 +281,13 @@ iframe.setAttribute("name", iframe.id = target); iframe.setAttribute("src", url); } - ; iframe.style.position = "absolute"; iframe.style.left = iframe.style.top = "-10000px"; iframe.onload = onload; iframe.onerror = function (event) { - if (isFunction(handler.onerror)) + if (isFunction(handler.onerror)) { handler.onerror(rpe, event || window.event); + } }; iframe.onreadystatechange = function () { if (/loaded|complete/i.test(iframe.readyState)) { @@ -287,8 +296,9 @@ //wei : todo,将附件信息放到handler.attach } else if (isFunction(handler.onloadprogress)) { - if (rpe.loaded < rpe.total) + if (rpe.loaded < rpe.total) { ++rpe.loaded; + } handler.onloadprogress(rpe, { readyState: { loading: 2, @@ -299,13 +309,14 @@ }); } }; - form.setAttribute("action", handler.url + '&width=' + width + '&height=' + height); + form.setAttribute("action", handler.url); form.setAttribute("target", iframe.id); form.setAttribute("method", "post"); form.appendChild(handler.file); form.style.display = "none"; - if (isFunction(handler.onloadstart)) + if (isFunction(handler.onloadstart)) { handler.onloadstart(rpe, {}); + } with (document.body || document.documentElement) { appendChild(iframe); appendChild(form); @@ -314,6 +325,7 @@ ; return handler; }; + } xhr = null; return sendFile; })(Object.prototype.toString); @@ -359,7 +371,6 @@ handler.iframe.parentNode.removeChild(handler.iframe); handler.iframe = null; } - ; setTimeout(function () { handler.file = handler.files[handler.current]; sendFile(handler, maxSize, width, height).onload = callee; @@ -463,7 +474,7 @@ // enable again the submit button/element }, 1000); }; - _wrap.url = o.url ? o.url : BI.servletURL + _wrap.url = o.url ? o.url : FR.servletURL + '?op=fr_attach&cmd=ah_upload'; _wrap.fileType = o.accept; //文件类型限制 _wrap.attach_array = []; @@ -484,14 +495,14 @@ size = item.fileSize || item.size; if (wrap.fileType && -1 === wrap.fileType.indexOf("*." + ext)) { //文件类型不支持 - BI.Msg.toast("文件类型不支持"); + BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error")); self.fireEvent(BI.File.EVENT_ERROR, { errorType: 0, file: item }); } else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) { //文件大小不支持 - BI.Msg.toast("文件大小不支持"); + BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error")); self.fireEvent(BI.File.EVENT_ERROR, { errorType: 1, file: item @@ -516,7 +527,9 @@ var self = this, o = this.options; // be sure input accept multiple files var input = this.element[0]; - this.element.attr("multiple", "multiple"); + if (o.multiple === true) { + this.element.attr("multiple", "multiple"); + } input.value = ""; // wrap Object @@ -542,8 +555,9 @@ // something like {onload:function(){alert("OK")},onerror:function(){alert("Error")}, etc ...} upload: function (handler) { if (handler) { - for (var key in handler) + for (var key in handler) { this[key] = handler[key]; + } } sendFiles(this, this.maxSize); return this; diff --git a/src/base/single/input/input.js b/src/base/single/input/input.js index f362632b2a..eb8cd27567 100644 --- a/src/base/single/input/input.js +++ b/src/base/single/input/input.js @@ -20,21 +20,28 @@ BI.Input = BI.inherit(BI.Single, { _init: function () { BI.Input.superclass._init.apply(this, arguments); var self = this; + var ctrlKey = false; + var inputEventValid = false; var _keydown = BI.debounce(function (keyCode) { - self.onKeyDown(keyCode); + self.onKeyDown(keyCode, ctrlKey); self._keydown_ = false; }, 300); var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, true); this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, true); this.element .keydown(function (e) { + inputEventValid = false; + ctrlKey = e.ctrlKey; self.fireEvent(BI.Input.EVENT_QUICK_DOWN); }) .keyup(function (e) { - self._keydown_ = true; - _keydown(e.keyCode); + if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { + self._keydown_ = true; + _keydown(e.keyCode); + } }) .on("input propertychange", function (e) { + inputEventValid = true; self._keydown_ = true; _keydown(e.keyCode); }) @@ -97,29 +104,10 @@ BI.Input = BI.inherit(BI.Single, { this._click(); }, - onKeyDown: function (keyCode) { + onKeyDown: function (keyCode, ctrlKey) { if (!this.isValid() || BI.trim(this._lastValidValue) !== BI.trim(this.getValue())) { this._checkValidationOnValueChange(); } - if (keyCode == BI.keyCode.ENTER) { - if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) { - this.blur(); - this.fireEvent(BI.Input.EVENT_ENTER); - } else { - this.fireEvent(BI.Input.EVENT_RESTRICT); - } - } - if (keyCode == BI.keyCode.SPACE) { - this.fireEvent(BI.Input.EVENT_SPACE); - } - if (keyCode == BI.keyCode.BACKSPACE && this._lastValue == "") { - this.fireEvent(BI.Input.EVENT_REMOVE); - } - if (keyCode == BI.keyCode.BACKSPACE || keyCode == BI.keyCode.DELETE) { - this.fireEvent(BI.Input.EVENT_BACKSPACE); - } - this.fireEvent(BI.Input.EVENT_KEY_DOWN); - if (this.isValid() && BI.trim(this.getValue()) !== "") { if (BI.trim(this.getValue()) !== this._lastValue && (!this._start || this._lastValue == null || this._lastValue === "") || (this._pause === true && !/(\s|\u00A0)$/.test(this.getValue()))) { @@ -129,13 +117,35 @@ BI.Input = BI.inherit(BI.Single, { this.fireEvent(BI.Input.EVENT_START); } } + if (ctrlKey === true && keyCode === 86) {//ctrlKey+V + this._valueChange(); + } else { + if (keyCode == BI.KeyCode.ENTER) { + if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) { + this.blur(); + this.fireEvent(BI.Input.EVENT_ENTER); + } else { + this.fireEvent(BI.Input.EVENT_RESTRICT); + } + } + if (keyCode == BI.KeyCode.SPACE) { + this.fireEvent(BI.Input.EVENT_SPACE); + } + if (keyCode == BI.KeyCode.BACKSPACE && this._lastValue == "") { + this.fireEvent(BI.Input.EVENT_REMOVE); + } + if (keyCode == BI.KeyCode.BACKSPACE || keyCode == BI.KeyCode.DELETE) { + this.fireEvent(BI.Input.EVENT_BACKSPACE); + } + } + this.fireEvent(BI.Input.EVENT_KEY_DOWN); - if (/(\s|\u00A0)$/.test(this.getValue())) { + if (BI.isEndWithBlank(this.getValue())) { this._pause = true; this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.PAUSE, "", this); this.fireEvent(BI.Input.EVENT_PAUSE); this._defaultState(); - } else if ((keyCode === BI.keyCode.BACKSPACE || keyCode === BI.keyCode.DELETE) && + } else if ((keyCode === BI.KeyCode.BACKSPACE || keyCode === BI.KeyCode.DELETE) && BI.trim(this.getValue()) === "" && (this._lastValue !== null && BI.trim(this._lastValue) !== "")) { this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT, this.getValue(), this); this.fireEvent(BI.Input.EVENT_STOP); diff --git a/src/base/single/input/radio.js b/src/base/single/input/radio.js index 583f5ee414..5b95e0ca9b 100644 --- a/src/base/single/input/radio.js +++ b/src/base/single/input/radio.js @@ -7,7 +7,6 @@ BI.Radio = BI.inherit(BI.IconButton, { _defaultConfig: function() { var conf = BI.Radio.superclass._defaultConfig.apply(this,arguments); return BI.extend(conf, { - tagName: "a", baseCls: (conf.baseCls || "") + " bi-radio radio-icon", selected: false, handler: BI.emptyFn, diff --git a/src/base/single/label/label.js b/src/base/single/label/label.js index 48cc0cc6e9..ab4fc8bf1a 100644 --- a/src/base/single/label/label.js +++ b/src/base/single/label/label.js @@ -58,7 +58,7 @@ BI.Label = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.adaptive", height: o.height, - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [ { @@ -76,7 +76,7 @@ BI.Label = BI.inherit(BI.Single, { json.width = o.textWidth; BI.createWidget({ type: "bi.center_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [ { @@ -90,7 +90,7 @@ BI.Label = BI.inherit(BI.Single, { this.text = BI.createWidget(json); BI.createWidget({ type: "bi.center_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, lgap: o.lgap, @@ -108,7 +108,7 @@ BI.Label = BI.inherit(BI.Single, { }); BI.createWidget({ type: "bi.absolute", - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [{ el: (this.text = BI.createWidget(json)), @@ -123,7 +123,7 @@ BI.Label = BI.inherit(BI.Single, { json.width = o.width - 2 * o.hgap; BI.createWidget({ type: "bi.center_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [{ el: (this.text = BI.createWidget(json)) @@ -135,7 +135,7 @@ BI.Label = BI.inherit(BI.Single, { json.width = o.textWidth; BI.createWidget({ type: "bi.center_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [ { @@ -155,7 +155,7 @@ BI.Label = BI.inherit(BI.Single, { rgap: o.rgap, tgap: o.tgap, bgap: o.bgap, - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [this.text] }); @@ -169,7 +169,7 @@ BI.Label = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.adaptive", height: o.height, - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [{ el: (this.text = BI.createWidget(json)), @@ -198,7 +198,7 @@ BI.Label = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.layout", element: this.text, - scrollable: true + scrollable: o.whiteSpace === "normal" }); return; } @@ -225,7 +225,7 @@ BI.Label = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.layout", element: this.text, - scrollable: true + scrollable: o.whiteSpace === "normal" }) }, @@ -238,7 +238,7 @@ BI.Label = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.adaptive", height: o.height, - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [ { @@ -256,7 +256,7 @@ BI.Label = BI.inherit(BI.Single, { json.width = o.textWidth; BI.createWidget({ type: "bi.vertical_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, lgap: o.lgap, @@ -276,7 +276,7 @@ BI.Label = BI.inherit(BI.Single, { this.text = BI.createWidget(json); BI.createWidget({ type: "bi.vertical_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, lgap: o.lgap, @@ -294,7 +294,7 @@ BI.Label = BI.inherit(BI.Single, { }); BI.createWidget({ type: "bi.absolute", - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [{ el: (this.text = BI.createWidget(json)), @@ -309,7 +309,7 @@ BI.Label = BI.inherit(BI.Single, { json.width = o.width - 2 * o.hgap - o.lgap - o.rgap; BI.createWidget({ type: "bi.vertical_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, lgap: o.lgap, @@ -327,7 +327,7 @@ BI.Label = BI.inherit(BI.Single, { json.width = o.textWidth; BI.createWidget({ type: "bi.vertical_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, lgap: o.lgap, @@ -347,7 +347,7 @@ BI.Label = BI.inherit(BI.Single, { this.text = BI.createWidget(json) this.text = BI.createWidget({ type: "bi.vertical_adapt", - scrollable: true, + scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, lgap: o.lgap, @@ -367,7 +367,7 @@ BI.Label = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.adaptive", height: o.height, - scrollable: true, + scrollable: o.whiteSpace === "normal", element: this, items: [{ el: (this.text = BI.createWidget(json)), @@ -396,7 +396,7 @@ BI.Label = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.layout", element: this.text, - scrollable: true + scrollable: o.whiteSpace === "normal" }); return; } @@ -423,7 +423,7 @@ BI.Label = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.layout", element: this.text, - scrollable: true + scrollable: o.whiteSpace === "normal" }) }, @@ -452,6 +452,10 @@ BI.Label = BI.inherit(BI.Single, { return this.options.text; }, + setStyle: function (css) { + this.text.setStyle(css) + }, + setValue: function (v) { BI.Label.superclass.setValue.apply(this, arguments); if (!this.isReadOnly()) { diff --git a/src/base/single/text.js b/src/base/single/text.js index c92d934b25..b4bcdfd482 100644 --- a/src/base/single/text.js +++ b/src/base/single/text.js @@ -99,6 +99,10 @@ BI.Text = BI.inherit(BI.Single, { } }, + setStyle: function (css) { + this.text.element.css(css) + }, + setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; diff --git a/src/base/timeouttoast/widget.timeouttoast.js b/src/base/timeouttoast/widget.timeouttoast.js new file mode 100644 index 0000000000..b9ebf121be --- /dev/null +++ b/src/base/timeouttoast/widget.timeouttoast.js @@ -0,0 +1,117 @@ +/** + * 组件请求数据超时提示 + * Created by Young's on 2017/2/4. + */ +BI.TimeoutToast = BI.inherit(BI.Tip, { + _defaultConfig: function () { + return BI.extend(BI.TimeoutToast.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-timeout-toast" + }); + }, + + _init: function () { + BI.TimeoutToast.superclass._init.apply(this, arguments); + var self = this; + this.requests = []; + this.toast = BI.createWidget({ + type: "bi.vertical_adapt", + element: this, + items: [{ + type: "bi.label", + text: BI.i18nText("BI-Request_Time_Out_Toast_Tip") + }, { + type: "bi.text_button", + cls: "cancel-button", + width: 60, + height: 22, + text: BI.i18nText("BI-Basic_Cancel"), + title: BI.i18nText("BI-Basic_Cancel"), + handler: function () { + self.cancelAllRequests(); + } + }, { + type: "bi.text_button", + cls: "retry-button", + width: 60, + height: 22, + text: BI.i18nText("BI-Basic_Retry"), + title: BI.i18nText("BI-Basic_Retry"), + handler: function () { + self.toast.element.slideUp(500); + self._retryAll(); + } + }, { + type: "bi.icon_button", + cls: "close-font", + width: 20, + height: 20, + title: BI.i18nText("BI-Basic_Close"), + handler: function () { + self.toast.element.slideUp(500); + } + }], + width: 520, + height: 30, + hgap: 2 + }); + + BI.createWidget({ + type: "bi.absolute", + element: $("body"), + items: [{ + el: this.toast, + left: "50%", + top: 0 + }] + }); + this.toast.element.css({"margin-left": -1 * this.toast.element.outerWidth() / 2}); + this.toast.setVisible(false); + }, + + _retryAll: function () { + var self = this; + var clonedRequests = BI.deepClone(this.requests); + this.requests = []; + BI.each(clonedRequests, function (i, options) { + BI.isFunction(self.callback) && self.callback(options); + }); + }, + + cancelAllRequests: function () { + this.toast.element.slideUp(500); + BI.each(this.requests, function (i, reqArgs) { + if (BI.isNotNull(reqArgs) && BI.isFunction(reqArgs.complete)) { + reqArgs.complete(); + } + }); + this.requests = []; + }, + + setCallback: function (callback) { + this.callback = callback; + }, + + addReq: function (options) { + var self = this; + if (this.requests.length === 0) { + setTimeout(function () { + if (self.requests.contains(options)) { + self.toast.element.slideDown(500); + } + }, 5 * 60 * 1000); //5 min + } + this.requests.push(options); + }, + + removeReq: function (options) { + BI.remove(this.requests, options); + if (this.requests.length === 0) { + this.toast.element.slideUp(500); + } + }, + + hasReq: function (options) { + return this.requests.contains(options); + } +}); +$.shortcut("bi.timeout_toast", BI.TimeoutToast); \ No newline at end of file diff --git a/src/base/tree/3parttree.js b/src/base/tree/parttree.js similarity index 100% rename from src/base/tree/3parttree.js rename to src/base/tree/parttree.js diff --git a/src/base/tree/2synctree.js b/src/base/tree/synctree.js similarity index 87% rename from src/base/tree/2synctree.js rename to src/base/tree/synctree.js index 5f0e4becb4..52486fa838 100644 --- a/src/base/tree/2synctree.js +++ b/src/base/tree/synctree.js @@ -19,7 +19,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { var setting = { async: { enable: false, - otherParam: BI.cjkEncodeDO(paras) + otherParam: FR.cjkEncodeDO(paras) }, check: { enable: true @@ -157,36 +157,24 @@ BI.SyncTree = BI.inherit(BI.TreeView, { } }, - _joinTree: function (map, values, isLast) { - var cur = map; - BI.each(values, function (i, value) { - if (i > 0 && BI.isPlainObject(cur) && BI.isEmpty(cur)) { - return; - } - if (isLast === true && i === values.length - 1) { - cur[value] = {}; - return; - } - if (cur[value] == null) { - cur[value] = {}; - } - cur = cur[value]; - }) - }, - _join: function (valueA, valueB) { var self = this; - var hashMap = valueA || {}; - track([], valueB); - function track(parent, node) { + var map = {}; + track([], valueA, valueB); + track([], valueB, valueA); + function track(parent, node, compare) { BI.each(node, function (n, item) { - var next = parent.concat([n]); - self._joinTree(hashMap, next, BI.isPlainObject(item) && BI.isEmpty(item)); - track(next, item); + if (BI.isNull(compare[n])) { + self._addTreeNode(map, parent, n, item); + } else if (BI.isEmpty(compare[n])) { + self._addTreeNode(map, parent, n, {}); + } else { + track(parent.concat([n]), node[n], compare[n]); + } }) } - return hashMap; + return map; }, hasChecked: function () { diff --git a/src/base/tree/1treeview.js b/src/base/tree/treeview.js similarity index 95% rename from src/base/tree/1treeview.js rename to src/base/tree/treeview.js index be25bed807..c65c5e7303 100644 --- a/src/base/tree/1treeview.js +++ b/src/base/tree/treeview.js @@ -14,6 +14,9 @@ BI.TreeView = BI.inherit(BI.Pane, { }, _init: function () { BI.TreeView.superclass._init.apply(this, arguments); + FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.core-3.5.js', 'js'); + FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.excheck-3.5.js', 'js'); + FR.$defaultImport('/com/fr/bi/web/css/base/third/ztree/zTreeStyle.css', 'css'); this._stop = false; this.container = BI.createWidget(); @@ -68,7 +71,7 @@ BI.TreeView = BI.inherit(BI.Pane, { enable: true, url: getUrl, autoParam: ["id", "name"], - otherParam: BI.cjkEncodeDO(paras) + otherParam: FR.cjkEncodeDO(paras) }, check: { enable: true @@ -110,10 +113,10 @@ BI.TreeView = BI.inherit(BI.Pane, { treeNode.times = treeNode.times || 1; var param = "id=" + treeNode.id + "×=" + (treeNode.times++) - + "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) - + "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + + "&parent_values= " + window.encodeURIComponent(FR.jsonEncode(parentNode)) + + "&check_state=" + window.encodeURIComponent(FR.jsonEncode(treeNode.getCheckStatus())); - return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; + return FR.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; } function beforeExpand(treeId, treeNode) { @@ -310,7 +313,7 @@ BI.TreeView = BI.inherit(BI.Pane, { //处理标红 if (BI.isKey(o.paras.keyword)) { var keyword = o.paras.keyword; - var ns = BI.Tree.transformToArrayFormat(nodes); + var ns = BI.Tree.arrayFormat(nodes); BI.each(ns, function (i, n) { n.text = $("
      ").__textKeywordMarked__(n.text, keyword, n.py).html(); }); @@ -443,13 +446,17 @@ BI.TreeView = BI.inherit(BI.Pane, { }, setValue: function (value, param) { - this.options.paras.selected_values = value || {}; - this.selected_values = BI.deepClone(value) || {}; + this.setSelectedValue(value); this.checkAll(false); this.updateValue(value, param); this.refresh(); }, + setSelectedValue: function (value) { + this.options.paras.selected_values = value || {}; + this.selected_values = BI.deepClone(value) || {}; + }, + updateValue: function (values, param) { if (!this.nodes) { return; diff --git a/src/core/base.js b/src/core/base.js index 9d3da48350..0ea04ee91d 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -33,7 +33,7 @@ if (!window.BI) { //Utility _.extend(BI, { i18nText: function (key) { - var localeText = key; + var localeText = FR.i18n[key]; if (!localeText) { localeText = key; } @@ -50,7 +50,7 @@ if (!window.BI) { assert: function (v, is) { if (this.isFunction(is)) { if (!is(v)) { - throw new Error(v + "值不合法"); + throw new Error(v + " error"); } else { return true; } @@ -59,7 +59,7 @@ if (!window.BI) { is = [is]; } if (!this.deepContains(is, v)) { - throw new Error(v + "值不合法"); + throw new Error(v + " error"); } }, @@ -81,9 +81,33 @@ if (!window.BI) { return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View); }, + createWidget: function (item, options) { + var el; + options || (options = {}); + if (BI.isEmpty(item) && BI.isEmpty(options)) { + return BI.Plugin.getObject("bi.layout", BI.createWidget({ + type: "bi.layout" + })); + } + if (BI.isWidget(item)) { + return item; + } + if (item && (item.type || options.type)) { + el = BI.extend({}, options, item); + return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); + } + if (item && item.el && (item.el.type || options.type)) { + el = BI.extend({}, options, item.el); + return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); + } + if (item && BI.isWidget(item.el)) { + return item.el; + } + }, + createWidgets: function (items, options) { if (!BI.isArray(items)) { - throw new Error("无法根据items创建组件?") + throw new Error("cannot create Widgets") } return BI.map(BI.flatten(items), function (i, item) { return BI.createWidget(item, BI.deepClone(options)); @@ -254,7 +278,9 @@ if (!window.BI) { backAny: function (obj, predicate, context) { predicate = BI.iteratee(predicate, context); for (var index = obj.length - 1; index >= 0; index--) { - if (predicate(index, obj[index], obj)) return true; + if (predicate(index, obj[index], obj)) { + return true; + } } return false; }, @@ -262,7 +288,9 @@ if (!window.BI) { backEvery: function (obj, predicate, context) { predicate = BI.iteratee(predicate, context); for (var index = obj.length - 1; index >= 0; index--) { - if (!predicate(index, obj[index], obj)) return false; + if (!predicate(index, obj[index], obj)) { + return false; + } } return true; }, @@ -388,7 +416,9 @@ if (!window.BI) { }, uniq: function (array, isSorted, iteratee, context) { - if (array == null) return []; + if (array == null) { + return []; + } if (!_.isBoolean(isSorted)) { context = iteratee; iteratee = isSorted; @@ -455,11 +485,7 @@ if (!window.BI) { }, isWidthOrHeight: function (w) { - if (typeof w == 'number') { - return w >= 0; - } else if (typeof w == 'string') { - return /^\d{1,3}%$/.exec(w) || w == 'auto' || /^\d+px$/.exec(w); - } + return FR.isWidthOrHeight(w); }, isNotNull: function (obj) { @@ -550,11 +576,15 @@ if (!window.BI) { isDeepMatch: function (object, attrs) { var keys = BI.keys(attrs), length = keys.length; - if (object == null) return !length; + if (object == null) { + return !length; + } var obj = Object(object); for (var i = 0; i < length; i++) { var key = keys[i]; - if (!BI.isEqual(attrs[key], obj[key]) || !(key in obj)) return false; + if (!BI.isEqual(attrs[key], obj[key]) || !(key in obj)) { + return false; + } } return true; }, @@ -580,20 +610,24 @@ if (!window.BI) { }, deepRemove: function (obj, target) { + var done = false; var i; if (BI.isArray(obj)) { for (i = 0; i < obj.length; i++) { if (BI.isEqual(target, obj[i])) { obj.splice(i--, 1); + done = true; } } } else { BI.each(obj, function (i, v) { if (BI.isEqual(target, obj[i])) { delete obj[i]; + done = true; } }); } + return done; }, deepWithout: function (obj, target) { @@ -616,8 +650,14 @@ if (!window.BI) { } }, - deepUniq: function () { - + deepUnique: function (array) { + var result = []; + BI.each(array, function (i, item) { + if (!BI.deepContains(result, item)) { + result.push(item); + } + }); + return result; }, //比较两个对象得出不一样的key值 @@ -668,31 +708,54 @@ if (!window.BI) { var copies = callbacks.slice(0); callbacks = []; for (var i = 0; i < copies.length; i++) { - copies[i].func.apply(null, copies[i].args); + copies[i](); } } + if (typeof Promise !== 'undefined') { + var p = Promise.resolve(); + timerFunc = function () { + p.then(nextTickHandler); + } + } else + /* istanbul ignore if */ if (typeof MutationObserver !== 'undefined') { var counter = 1; var observer = new MutationObserver(nextTickHandler); - var textNode = document.createTextNode(counter); + var textNode = document.createTextNode(counter + ""); observer.observe(textNode, { characterData: true }); timerFunc = function () { counter = (counter + 1) % 2; - textNode.data = counter; + textNode.data = counter + ""; } } else { - timerFunc = setTimeout + timerFunc = function () { + setTimeout(nextTickHandler, 0) + } } - return function (cb) { + return function queueNextTick(cb) { + var _resolve; var args = [].slice.call(arguments, 1); - callbacks.push({func: cb, args: args}); - if (pending) return; - pending = true; - timerFunc(nextTickHandler, 0); + callbacks.push(function () { + if (cb) { + cb.apply(null, args); + } + if (_resolve) { + _resolve.apply(null, args); + } + }); + if (!pending) { + pending = true; + timerFunc(); + } + if (!cb && typeof Promise !== 'undefined') { + return new Promise(function (resolve) { + _resolve = resolve + }) + } } })() }); @@ -726,7 +789,7 @@ if (!window.BI) { try { return parseInt(number, radix); } catch (e) { - throw new Error("转成int类型失败"); + throw new Error(number + "parse int error"); return NaN; } }, @@ -735,7 +798,7 @@ if (!window.BI) { try { return parseFloat(number); } catch (e) { - throw new Error("转成float类型失败"); + throw new Error(number + "parse float error"); return NaN; } }, @@ -797,9 +860,9 @@ if (!window.BI) { var sum = 0; BI.each(array, function (i, item) { if (iteratee) { - sum += new Number(iteratee.apply(context, [i, item])); + sum += Number(iteratee.apply(context, [i, item])); } else { - sum += new Number(item); + sum += Number(item); } }); return sum; @@ -825,6 +888,10 @@ if (!window.BI) { return (string + "").toLocaleLowerCase(); }, + isEndWithBlank: function (string) { + return /(\s|\u00A0)$/.test(string); + }, + isLiteral: function (exp) { var literalValueRE = /^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/ return literalValueRE.test(exp) @@ -858,6 +925,10 @@ if (!window.BI) { return BI.isString(str) && BI.isEmpty(str); }, + contentFormat: function () { + return FR.contentFormat.apply(FR, arguments); + }, + /** * 对字符串进行加密 {@link #decrypt} * @static @@ -971,23 +1042,23 @@ if (!window.BI) { //浏览器相关方法 _.extend(BI, { isIE: function () { - return $.browser.msie; + return /(msie|trident)/i.test(navigator.userAgent.toLowerCase()); }, isChrome: function () { - return $.browser.chrome; + return /chrome/i.test(navigator.userAgent.toLowerCase()); }, isFireFox: function () { - return $.browser.mozilla; + return /firefox/i.test(navigator.userAgent.toLowerCase()); }, isOpera: function () { - return $.browser.opera; + return /opera/i.test(navigator.userAgent.toLowerCase()); }, isSafari: function () { - return $.browser.safari; + return /safari/i.test(navigator.userAgent.toLowerCase()); }, isKhtml: function () { @@ -1021,6 +1092,124 @@ if (!window.BI) { //BI请求 _.extend(BI, { + ajax: (function () { + var loading, timeoutToast; + return function (option) { + option || (option = {}); + option.data = BI.extend({}, Data.SharingPool.cat("urlParameters"), option.data); + //encode + encodeBIParam(option.data); + + var async = true; + if (BI.isNotNull(option.async)) { + async = option.async; + } + + if (BI.isNull(loading)) { + loading = BI.createWidget({ + type: "bi.request_loading" + }); + } + + if (BI.isNull(timeoutToast)) { + timeoutToast = BI.createWidget({ + type: "bi.timeout_toast" + }); + timeoutToast.setCallback(function (op) { + decodeBIParam(op.data); + BI.ajax(op); + }); + } + timeoutToast.addReq(option); + + FR.ajax({ + url: option.url, + type: "POST", + data: option.data, + async: async, + error: function () { + if (!timeoutToast.hasReq(option)) { + return; + } + timeoutToast.removeReq(option); + //失败 取消、重新加载 + loading.setCallback(function () { + decodeBIParam(option.data); + BI.ajax(option); + }); + loading.showError(); + }, + complete: function (res, status) { + if (!timeoutToast.hasReq(option)) { + return; + } + timeoutToast.removeReq(option); + //登录超时 + if (BI.isNotNull(res.responseText) && + res.responseText.indexOf("fs-login-content") > -1 && + res.responseText.indexOf("fs-login-input-password-confirm") === -1) { + if (BI.Popovers.isVisible(BI.LoginTimeOut.POPOVER_ID)) { + return; + } + if (BI.isNotNull(BI.Popovers.get(BI.LoginTimeOut.POPOVER_ID))) { + BI.Popovers.open(BI.LoginTimeOut.POPOVER_ID); + return; + } + var loginTimeout = BI.createWidget({ + type: "bi.login_timeout" + }); + loginTimeout.on(BI.LoginTimeOut.EVENT_LOGIN, function () { + decodeBIParam(option.data); + BI.ajax(option); + BI.Popovers.remove(BI.LoginTimeOut.POPOVER_ID); + }); + BI.Popovers.create(BI.LoginTimeOut.POPOVER_ID, loginTimeout, { + width: 600, + height: 400 + }).open(BI.LoginTimeOut.POPOVER_ID); + } else if (BI.isNotNull(res.responseText) && + res.responseText.indexOf("script") > -1 && + res.responseText.indexOf("Session Timeout...") > -1) { + //登录失效 + loading.setCallback(function () { + location.reload(); + }); + loading.showError(); + + } else if (status === "success" && BI.isFunction(option.success)) { + option.success(FR.jsonDecode(res.responseText)); + } + if (BI.isFunction(option.complete)) { + option.complete(FR.jsonDecode(res.responseText), status); + } + } + }); + + return function cancel() { + timeoutToast.removeReq(option); + }; + + function encodeBIParam(data) { + for (var key in data) { + if (_.isObject(data[key])) { + data[key] = window.encodeURIComponent(FR.jsonEncode(data[key])); + } else { + data[key] = window.encodeURIComponent(data[key]); + } + } + } + + function decodeBIParam(data) { + for (var key in data) { + data[key] = window.decodeURIComponent(data[key]); + if (_.isObject(data[key])) { + data[key] = FR.jsonDecode(data[key]); + } + } + } + } + })(), + /** * 异步ajax请求 * @param {String} op op参数 @@ -1030,38 +1219,29 @@ if (!window.BI) { * @param {Function} complete 回调 */ requestAsync: function (op, cmd, data, callback, complete) { - // if (BI.isNull(BI.REQUEST_LOADING)) { - // BI.REQUEST_LOADING = BI.createWidget({ - // type: "bi.request_loading" - // }); - // } data = data || {}; if (!BI.isKey(op)) { op = 'fr_bi_dezi'; } - if (op === "fr_bi_dezi") { + if (op === "fr_bi_dezi" || op === "fr_bi_configure") { data.sessionID = Data.SharingPool.get("sessionID"); } var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); - (BI.ajax || FR.ajax)({ + return (BI.ajax)({ url: url, type: 'POST', data: data, error: function () { // BI.Msg.toast(BI.i18nText("BI-Ajax_Error")); - //失败 取消、重新加载 - // BI.REQUEST_LOADING.setCallback(function () { - // BI.requestAsync(op, cmd, data, callback, complete); - // }); - // BI.REQUEST_LOADING.showError(); }, - complete: function (res, status) { - if (BI.isFunction(callback) && status === 'success') { - callback(BI.jsonDecode(res.responseText)); - BI.Maskers.hide(BI.RequstLoading.MASK_ID); + success: function (res) { + if (BI.isFunction(callback)) { + callback(res); } + }, + complete: function (res, status) { if (BI.isFunction(complete)) { - complete(); + complete(res); } } }); @@ -1084,7 +1264,7 @@ if (!window.BI) { } var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); var result = {}; - (BI.ajax || FR.ajax)({ + (BI.ajax)({ url: url, type: 'POST', async: false, @@ -1094,7 +1274,7 @@ if (!window.BI) { }, complete: function (res, status) { if (status === 'success') { - result = BI.jsonDecode(res.responseText); + result = res; } } }); diff --git a/src/core/controller.js b/src/core/controller.js index c192ec5426..91b5e4aeef 100644 --- a/src/core/controller.js +++ b/src/core/controller.js @@ -3,7 +3,7 @@ * 控制器 * Controller层超类 * @class BI.Controller - * @extends FR.OB + * @extends BI.OB * @abstract */ BI.Controller = BI.inherit(BI.OB, { diff --git a/src/core/loader/loader.style.js b/src/core/loader/loader.style.js new file mode 100644 index 0000000000..fbf027ce11 --- /dev/null +++ b/src/core/loader/loader.style.js @@ -0,0 +1,47 @@ +/** + * style加载管理器 + * + * Created by GUY on 2015/9/7. + * @class + */ +BI.StyleLoaderManager = BI.inherit(BI.OB, { + _defaultConfig: function () { + return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this, arguments), {}); + }, + + _init: function () { + BI.StyleLoaderManager.superclass._init.apply(this, arguments); + this.stylesManager = {}; + }, + + loadStyle: function (name, styleString) { + var d = document, styles = d.createElement('style'); + d.getElementsByTagName('head')[0].appendChild(styles); + styles.setAttribute('type', 'text/css'); + if (styles.styleSheet) { + styles.styleSheet.cssText = styleString; + } else { + styles.appendChild(document.createTextNode(styleString)); + } + this.stylesManager[name] = styles; + + return this; + }, + + get: function (name) { + return this.stylesManager[name]; + }, + + has: function (name) { + return this.stylesManager[name] != null; + }, + + removeStyle: function (name) { + if (!this.has(name)) { + return this; + } + this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]); + delete this.stylesManager[name]; + return this; + } +}); \ No newline at end of file diff --git a/src/core/var.js b/src/core/var.js index 91c1e6338c..e2f9947dd8 100644 --- a/src/core/var.js +++ b/src/core/var.js @@ -15,7 +15,7 @@ _.extend(BI, { emptyFn: function () { }, empty: null, - keyCode: { + KeyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, diff --git a/src/core/wrapper/layout/layout.card.js b/src/core/wrapper/layout/layout.card.js index a1aa6b3d09..910866da10 100644 --- a/src/core/wrapper/layout/layout.card.js +++ b/src/core/wrapper/layout/layout.card.js @@ -83,7 +83,6 @@ BI.CardLayout = BI.inherit(BI.Layout, { .appendTo(this.element); widget.invisible(); this.addWidget(this._getCardName(cardName), widget); - widget._mount(); return widget; }, @@ -101,7 +100,10 @@ BI.CardLayout = BI.inherit(BI.Layout, { //动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了 !flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.element.hide(); } else { - (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, callback); + (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, function () { + el._mount(); + callback && callback(); + }); } }); }, diff --git a/src/css/base/base.css b/src/css/base/base.css new file mode 100644 index 0000000000..f3ec3f4509 --- /dev/null +++ b/src/css/base/base.css @@ -0,0 +1,21 @@ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +@font-face { + font-family: 'bbr'; + src: url('/resources/fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('/resources/fonts/iconfont.woff') format('woff'), /* chrome、firefox */ url('/resources/fonts/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('/resources/fonts/iconfont.svg#svgFontName') format('svg'); + + /* iOS 4.1- */ +} +.b-font { + font-family: "bi"; + font-style: normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2px; + -moz-osx-font-smoothing: grayscale; +} +.bi-base-request-fail-mask .mask-pane { + background: #ffffff; + opacity: 0.8; + filter: alpha(opacity=80); +} diff --git a/src/css/base/chart/chart.combine.css b/src/css/base/chart/chart.combine.css new file mode 100644 index 0000000000..1c94930a02 --- /dev/null +++ b/src/css/base/chart/chart.combine.css @@ -0,0 +1,11 @@ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +.bi-combine-chart .bi-linkage-list { + background-color: #ffffff; + border: 1px solid #eaeaea; + z-index: 1000000000; +} +.bi-combine-chart .bi-linkage-list .bi-linkage-list-item:hover { + background-color: #f4f4f4; +} diff --git a/src/css/base/combo/popup.bubble.css b/src/css/base/combo/popup.bubble.css new file mode 100644 index 0000000000..2423ffe25a --- /dev/null +++ b/src/css/base/combo/popup.bubble.css @@ -0,0 +1,11 @@ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +.bi-bubble-popup-view { + -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); +} +.bi-bubble-popup-view .bubble-popup-line { + background-color: #009de3; +} diff --git a/src/css/base/dom.css b/src/css/base/dom.css new file mode 100644 index 0000000000..4429e36252 --- /dev/null +++ b/src/css/base/dom.css @@ -0,0 +1,9 @@ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +/************hing light*****************/ +.bi-z-index-mask { + background-color: #1a1a1a; + opacity: 0.5; + filter: alpha(opacity=50); +} diff --git a/src/css/base/logintimeout/login.timeout.css b/src/css/base/logintimeout/login.timeout.css new file mode 100644 index 0000000000..321da08dd9 --- /dev/null +++ b/src/css/base/logintimeout/login.timeout.css @@ -0,0 +1,32 @@ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +.bi-login-timeout-center .input-wrapper { + border-bottom: 1px solid #eaeaea; +} +.bi-login-timeout-center .input-wrapper .login-input { + font-size: 16px; +} +.bi-login-timeout-center .input-wrapper .error-mask { + background: #1a1a1a; + opacity: 0.25; + filter: alpha(opacity=25); + color: #ffffff; + font-size: 16px; +} +.bi-login-timeout-center .login-button { + background: #009de3; + -webkit-border-radius: 25px; + -moz-border-radius: 25px; + border-radius: 25px; + font-size: 22px; + color: #ffffff; +} +.bi-login-timeout-center .login-button:hover { + opacity: 0.8; + filter: alpha(opacity=80); +} +.bi-login-timeout-south .keep-state { + font-size: 14px; + color: #808080; +} diff --git a/src/css/base/pager/pager.all.count.css b/src/css/base/pager/pager.all.count.css new file mode 100644 index 0000000000..61dead7114 --- /dev/null +++ b/src/css/base/pager/pager.all.count.css @@ -0,0 +1,9 @@ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +.bi-all-count-pager .all-pager-prev { + font-size: 16px; +} +.bi-all-count-pager .all-pager-next { + font-size: 16px; +} diff --git a/src/css/base/pager/pager.direction.css b/src/css/base/pager/pager.direction.css index 4323bd17ab..1984a00e9c 100644 --- a/src/css/base/pager/pager.direction.css +++ b/src/css/base/pager/pager.direction.css @@ -3,9 +3,7 @@ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-direction-pager .direction-pager-prev { font-size: 16px; - background: #f4f4f4; } .bi-direction-pager .direction-pager-next { font-size: 16px; - background: #f4f4f4; } diff --git a/src/css/base/reqloading/loading.request.css b/src/css/base/reqloading/loading.request.css index c44f3b3fbc..235bd2f212 100644 --- a/src/css/base/reqloading/loading.request.css +++ b/src/css/base/reqloading/loading.request.css @@ -7,8 +7,14 @@ filter: alpha(opacity=80); } .bi-request-loading .loading-comment { - font-size: 14px; + font-size: 20px; + color: #808080; } .bi-request-loading .load-fail-comment { - font-size: 14px; + font-size: 20px; + color: #808080; +} +.bi-request-loading .load-timeout-warning { + font-size: 16px; + color: #e85050; } diff --git a/src/css/base/single/editor/editor.state.css b/src/css/base/single/editor/editor.state.css index d1532829a9..0d3f1bb148 100644 --- a/src/css/base/single/editor/editor.state.css +++ b/src/css/base/single/editor/editor.state.css @@ -1,10 +1,6 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-state-editor { - font-size: 12px; -} .bi-state-editor .state-editor-infinite-text { - font-size: 12px; - color: #1a1a1a; + color: #cccccc; } diff --git a/src/css/base/single/editor/editor.state.simple.css b/src/css/base/single/editor/editor.state.simple.css index 1e5c5a286b..c2c8927812 100644 --- a/src/css/base/single/editor/editor.state.simple.css +++ b/src/css/base/single/editor/editor.state.simple.css @@ -1,10 +1,6 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-simple-state-editor { - font-size: 12px; -} .bi-simple-state-editor .state-editor-infinite-text { - font-size: 12px; - color: #1a1a1a; + color: #cccccc; } diff --git a/src/css/base/single/text.css b/src/css/base/single/text.css index cf2c45754f..0128c7c7c3 100644 --- a/src/css/base/single/text.css +++ b/src/css/base/single/text.css @@ -5,5 +5,5 @@ text-overflow: ellipsis; overflow-x: hidden; white-space: nowrap; - word-break: break-word; + word-break: break-all; } diff --git a/src/css/base/third/ztree/zTreeStyle.css b/src/css/base/third/ztree/zTreeStyle.css index 2272c08b62..1ac2cf043f 100644 --- a/src/css/base/third/ztree/zTreeStyle.css +++ b/src/css/base/third/ztree/zTreeStyle.css @@ -10,13 +10,10 @@ website: http://code.google.com/p/jquerytree/ .ztree * { padding: 0; margin: 0; - font-size: 12px; - font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif; } .ztree { margin: 0; padding: 5px; - color: #333333; } .ztree li { padding: 0; @@ -32,14 +29,13 @@ website: http://code.google.com/p/jquerytree/ padding: 0 0 0 18px; } .ztree li ul.line { - background: url(icon/tree-vertical-line-1.png) 0 0 repeat-y; + background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-1.png) 0 0 repeat-y; } .ztree li a { padding: 1px 3px 0 0; margin: 0; cursor: pointer; height: 24px; - color: #333; background-color: transparent; text-decoration: none; vertical-align: top; @@ -98,31 +94,31 @@ website: http://code.google.com/p/jquerytree/ cursor: auto; } .ztree li span.button.chk.checkbox_false_full { - background-image: url("icon/check-box-normal.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_full_focus { - background-image: url("icon/check-box-normal.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_part { - background-image: url("icon/half_selected.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_part_focus { - background-image: url("icon/half_selected.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_disable { background-position: 0 -56px; } .ztree li span.button.chk.checkbox_true_full { - background-image: url("icon/check-box-active.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_full_focus { - background-image: url("icon/check-box-active.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_part { - background-image: url("icon/half_selected.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_part_focus { - background-image: url("icon/half_selected.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_disable { background-position: -14px -56px; @@ -162,28 +158,28 @@ website: http://code.google.com/p/jquerytree/ height: 25px; } .ztree li span.button.root_open { - background-image: url("icon/tree-expand-1.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-1.png"); } .ztree li span.button.root_close { - background-image: url("icon/tree-collapse-1.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-1.png"); } .ztree li span.button.roots_open { - background-image: url("icon/tree-expand-2.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-2.png"); } .ztree li span.button.roots_close { - background-image: url("icon/tree-collapse-2.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-2.png"); } .ztree li span.button.center_open { - background-image: url("icon/tree-expand-3.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-3.png"); } .ztree li span.button.center_close { - background-image: url("icon/tree-collapse-3.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-3.png"); } .ztree li span.button.bottom_open { - background-image: url("icon/tree-expand-4.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-4.png"); } .ztree li span.button.bottom_close { - background-image: url("icon/tree-collapse-4.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-4.png"); } .ztree li span.button.noline_open { background-position: -92px -72px; @@ -195,13 +191,13 @@ website: http://code.google.com/p/jquerytree/ background: none; } .ztree li span.button.roots_docu { - background-image: url("icon/tree-vertical-line-2.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); } .ztree li span.button.center_docu { - background-image: url("icon/tree-vertical-line-3.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); } .ztree li span.button.bottom_docu { - background-image: url("icon/tree-vertical-line-4.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); } .ztree li span.button.noline_docu { background: none; diff --git a/src/css/base/timeouttoast/widget.timeouttoast.css b/src/css/base/timeouttoast/widget.timeouttoast.css new file mode 100644 index 0000000000..6efd304246 --- /dev/null +++ b/src/css/base/timeouttoast/widget.timeouttoast.css @@ -0,0 +1,34 @@ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +.bi-timeout-toast { + font-size: 14px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + background: #fddddd; + color: #e85050; +} +.bi-timeout-toast .cancel-button { + background: #ffffff; + border: 1px solid #d4dadd; + color: #1a1a1a; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-timeout-toast .cancel-button:hover { + opacity: 0.8; + filter: alpha(opacity=80); +} +.bi-timeout-toast .retry-button { + background: #009de3; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + color: #ffffff; +} +.bi-timeout-toast .retry-button:hover { + opacity: 0.8; + filter: alpha(opacity=80); +} diff --git a/src/css/base/view/popupview.css b/src/css/base/view/popupview.css index 38b7fba5f1..0294fa968d 100644 --- a/src/css/base/view/popupview.css +++ b/src/css/base/view/popupview.css @@ -14,6 +14,7 @@ -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; + color: #1a1a1a; background: #ffffff; } .bi-list-view .list-view-toolbar { diff --git a/src/css/base/wrapper/flex.center.css b/src/css/base/wrapper/flex.center.css new file mode 100644 index 0000000000..74feeac543 --- /dev/null +++ b/src/css/base/wrapper/flex.center.css @@ -0,0 +1,38 @@ +.bi-flex-center-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} diff --git a/src/css/base/wrapper/flex.horizontal.css b/src/css/base/wrapper/flex.horizontal.css new file mode 100644 index 0000000000..1956492672 --- /dev/null +++ b/src/css/base/wrapper/flex.horizontal.css @@ -0,0 +1,66 @@ +.bi-flex-horizontal-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: flex-start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.bi-flex-horizontal-layout.middle { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-horizontal-layout.bottom { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -o-align-items: flex-end; + align-items: flex-end; +} diff --git a/src/css/base/wrapper/flex.vertical.center.css b/src/css/base/wrapper/flex.vertical.center.css new file mode 100644 index 0000000000..dd331f8491 --- /dev/null +++ b/src/css/base/wrapper/flex.vertical.center.css @@ -0,0 +1,46 @@ +.bi-flex-vertical-center { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; +} diff --git a/src/css/base/wrapper/flex.wrapper.center.css b/src/css/base/wrapper/flex.wrapper.center.css new file mode 100644 index 0000000000..a3f2e030e6 --- /dev/null +++ b/src/css/base/wrapper/flex.wrapper.center.css @@ -0,0 +1,41 @@ +.bi-flex-wrapper-center-layout .flex-wrapper-center-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; + min-width: 100%; + min-height: 100%; + float: left; +} diff --git a/src/css/base/wrapper/flex.wrapper.horizontal.css b/src/css/base/wrapper/flex.wrapper.horizontal.css new file mode 100644 index 0000000000..d3435658bc --- /dev/null +++ b/src/css/base/wrapper/flex.wrapper.horizontal.css @@ -0,0 +1,67 @@ +.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: flex-start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; + min-height: 100%; +} +.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper.middle { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper.bottom { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -o-align-items: flex-end; + align-items: flex-end; +} diff --git a/src/css/base/wrapper/flex.wrapper.vertical.center.css b/src/css/base/wrapper/flex.wrapper.vertical.center.css new file mode 100644 index 0000000000..7779832815 --- /dev/null +++ b/src/css/base/wrapper/flex.wrapper.vertical.center.css @@ -0,0 +1,48 @@ +.bi-flex-wrapper-vertical-center .flex-wrapper-vertical-center-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; + min-height: 100%; + float: left; +} diff --git a/src/less/base/base.less b/src/less/base/base.less new file mode 100644 index 0000000000..b863c2e624 --- /dev/null +++ b/src/less/base/base.less @@ -0,0 +1,24 @@ +@import "../bibase"; + +@font-face { + font-family: 'bbr'; + src: url('@{webUrl}/resources/fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('@{webUrl}/resources/fonts/iconfont.woff') format('woff'), /* chrome、firefox */ + url('@{webUrl}/resources/fonts/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ + url('@{webUrl}/resources/fonts/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ +} + +.b-font { + font-family: "bi"; + font-style: normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2px; + -moz-osx-font-smoothing: grayscale; +} + +.bi-base-request-fail-mask{ + & .mask-pane{ + background: @color-bi-background-default; + .opacity(0.8); + } +} \ No newline at end of file diff --git a/src/less/base/chart/chart.combine.less b/src/less/base/chart/chart.combine.less new file mode 100644 index 0000000000..5a04261067 --- /dev/null +++ b/src/less/base/chart/chart.combine.less @@ -0,0 +1,13 @@ +@import "../../bibase"; +.bi-combine-chart { + & .bi-linkage-list { + background-color: @background-color-default; + border: 1px solid @border-color-line; + z-index: @zIndex-tip; + & .bi-linkage-list-item { + &:hover { + background-color: @color-bi-background-gray; + } + } + } +} \ No newline at end of file diff --git a/src/less/base/combo/combo.bubble.less b/src/less/base/combo/combo.bubble.less new file mode 100644 index 0000000000..8eac71ceab --- /dev/null +++ b/src/less/base/combo/combo.bubble.less @@ -0,0 +1,16 @@ +@import "../../bibase"; + +.bi-bubble-combo { + & .bubble-combo-triangle-left { + .solid-triangle-right(@color-bi-background-highlight); + } + & .bubble-combo-triangle-right { + .solid-triangle-left(@color-bi-background-highlight); + } + & .bubble-combo-triangle-top { + .solid-triangle-down(@color-bi-background-highlight); + } + & .bubble-combo-triangle-bottom { + .solid-triangle-up(@color-bi-background-highlight); + } +} \ No newline at end of file diff --git a/src/less/base/combo/popup.bubble.less b/src/less/base/combo/popup.bubble.less new file mode 100644 index 0000000000..6c5ec13136 --- /dev/null +++ b/src/less/base/combo/popup.bubble.less @@ -0,0 +1,8 @@ +@import "../../bibase"; + +.bi-bubble-popup-view { + & .bubble-popup-line { + background-color: @color-bi-background-highlight; + } + .box-shadow(0 0 10px, rgba(0, 0, 0, 0.2)); +} \ No newline at end of file diff --git a/src/less/base/dom.less b/src/less/base/dom.less new file mode 100644 index 0000000000..95c195b4b6 --- /dev/null +++ b/src/less/base/dom.less @@ -0,0 +1,7 @@ +@import "../bibase"; +@import "../lib/colors"; +/************hing light*****************/ +.bi-z-index-mask{ + background-color: @color-bi-background-black; + .opacity(0.5); +} \ No newline at end of file diff --git a/src/less/base/logintimeout/login.timeout.less b/src/less/base/logintimeout/login.timeout.less new file mode 100644 index 0000000000..ebfa997366 --- /dev/null +++ b/src/less/base/logintimeout/login.timeout.less @@ -0,0 +1,30 @@ +@import "../../bibase"; +.bi-login-timeout-center{ + & .input-wrapper{ + border-bottom: 1px solid @color-bi-border-line; + & .login-input{ + font-size: @font-size-16; + } + & .error-mask{ + background: @color-bi-background-black; + .opacity(0.25); + color: @color-bi-text; + font-size: @font-size-16; + } + } + & .login-button{ + background: @color-bi-background-highlight; + .border-radius(25px); + font-size: @font-size-22; + color: @color-bi-text; + &:hover{ + .opacity(0.8); + } + } +} +.bi-login-timeout-south{ + & .keep-state{ + font-size: @font-size-14; + color: @color-bi-text-gray; + } +} \ No newline at end of file diff --git a/src/less/base/pager/pager.all.less b/src/less/base/pager/pager.all.count.less similarity index 50% rename from src/less/base/pager/pager.all.less rename to src/less/base/pager/pager.all.count.less index 4fad1a5294..4b14999611 100644 --- a/src/less/base/pager/pager.all.less +++ b/src/less/base/pager/pager.all.count.less @@ -1,15 +1,12 @@ @import "../../bibase"; -.bi-all-pager { +.bi-all-count-pager { & .pager-editor { - background-color: @color-bi-background-default; } & .all-pager-prev { font-size: @font-size-16; - background: @color-bi-background-gray; } & .all-pager-next { font-size: @font-size-16; - background: @color-bi-background-gray; } } \ No newline at end of file diff --git a/src/less/base/pager/pager.direction.less b/src/less/base/pager/pager.direction.less index 8b4eaff8aa..c15512fdba 100644 --- a/src/less/base/pager/pager.direction.less +++ b/src/less/base/pager/pager.direction.less @@ -3,10 +3,8 @@ .bi-direction-pager { & .direction-pager-prev { font-size: @font-size-16; - background: @color-bi-background-gray; } & .direction-pager-next { font-size: @font-size-16; - background: @color-bi-background-gray; } } \ No newline at end of file diff --git a/src/less/base/pager/pager.number.less b/src/less/base/pager/pager.number.less deleted file mode 100644 index 8170f697e1..0000000000 --- a/src/less/base/pager/pager.number.less +++ /dev/null @@ -1,12 +0,0 @@ -@import "../../bibase"; - -.bi-number-pager { - & .number-pager-prev { - font-size: @font-size-16; - background: @color-bi-background-gray; - } - & .number-pager-next { - font-size: @font-size-16; - background: @color-bi-background-gray; - } -} \ No newline at end of file diff --git a/src/less/base/pager/pager.skip.less b/src/less/base/pager/pager.skip.less deleted file mode 100644 index e4d956e7cf..0000000000 --- a/src/less/base/pager/pager.skip.less +++ /dev/null @@ -1,12 +0,0 @@ -@import "../../bibase"; - -.bi-skip-pager { - & .skip-pager-prev { - font-size: @font-size-16; - background: @color-bi-background-gray; - } - & .skip-pager-next { - font-size: @font-size-16; - background: @color-bi-background-gray; - } -} \ No newline at end of file diff --git a/src/less/base/reqloading/loading.request.less b/src/less/base/reqloading/loading.request.less index ee77ee0746..ea2affda21 100644 --- a/src/less/base/reqloading/loading.request.less +++ b/src/less/base/reqloading/loading.request.less @@ -1,13 +1,20 @@ @import "../../bibase"; -.bi-request-loading{ - & .mask-pane{ + +.bi-request-loading { + & .mask-pane { background: @color-bi-background-default; .opacity(0.8); } - & .loading-comment{ - font-size: @font-size-14; + & .loading-comment { + font-size: 20px; + color: @color-bi-text-gray; } - & .load-fail-comment{ - font-size: @font-size-14; + & .load-fail-comment { + font-size: 20px; + color: @color-bi-text-gray; + } + & .load-timeout-warning { + font-size: @font-size-16; + color: @color-bi-text-warning; } } \ No newline at end of file diff --git a/src/less/base/single/editor/editor.state.less b/src/less/base/single/editor/editor.state.less index 9a541a2421..d0db6d41eb 100644 --- a/src/less/base/single/editor/editor.state.less +++ b/src/less/base/single/editor/editor.state.less @@ -2,9 +2,7 @@ .bi-state-editor{ - font-size: @font-size-12; & .state-editor-infinite-text{ - font-size: @font-size-12; - color: @font-color-normal; + color: @water-mark-color; } } \ No newline at end of file diff --git a/src/less/base/single/editor/editor.state.simple.less b/src/less/base/single/editor/editor.state.simple.less index c27a2a813b..2204a08c00 100644 --- a/src/less/base/single/editor/editor.state.simple.less +++ b/src/less/base/single/editor/editor.state.simple.less @@ -2,9 +2,7 @@ .bi-simple-state-editor{ - font-size: @font-size-12; & .state-editor-infinite-text{ - font-size: @font-size-12; - color: @font-color-normal; + color: @water-mark-color; } } \ No newline at end of file diff --git a/src/less/base/single/text.less b/src/less/base/single/text.less index a6f1d83cd4..568122a9c2 100644 --- a/src/less/base/single/text.less +++ b/src/less/base/single/text.less @@ -2,5 +2,5 @@ .bi-text{ .overflow-dot(); - word-break: break-word; + word-break: break-all; } \ No newline at end of file diff --git a/src/less/base/table/table.grid.scrollbar.less b/src/less/base/table/table.grid.scrollbar.less index 0322c095c6..408c42002e 100644 --- a/src/less/base/table/table.grid.scrollbar.less +++ b/src/less/base/table/table.grid.scrollbar.less @@ -7,15 +7,14 @@ transition-timing-function: ease; user-select: none; background-color: rgba(0, 0, 0, 0.1); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000, endColorstr=#19000000); - border-radius: 5px; + border-radius:5px; } .scrollbar-layout-main-vertical { bottom: 0; right: 0; top: 0; - transition-property: background-color; + transition-property: background-color ; width: 10px; } @@ -28,9 +27,8 @@ bottom: 0; height: 10px; left: 0; - transition-property: background-color; + transition-property: background-color ; background-color: rgba(0, 0, 0, 0.1); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000, endColorstr=#19000000); } /* Touching the scroll-track directly makes the scroll-track bolder */ diff --git a/src/less/base/third/jquery.mCustomScrollbar.less b/src/less/base/third/jquery.mCustomScrollbar.less deleted file mode 100644 index 898d601b86..0000000000 --- a/src/less/base/third/jquery.mCustomScrollbar.less +++ /dev/null @@ -1,1796 +0,0 @@ -/* -== malihu jquery custom scrollbar plugin == -Plugin URI: http://manos.malihu.gr/jquery-custom-content-scroller -*/ -/* -CONTENTS: - 1. BASIC STYLE - Plugin's basic/essential CSS properties (normally, should not be edited). - 2. VERTICAL SCROLLBAR - Positioning and dimensions of vertical scrollbar. - 3. HORIZONTAL SCROLLBAR - Positioning and dimensions of horizontal scrollbar. - 4. VERTICAL AND HORIZONTAL SCROLLBARS - Positioning and dimensions of 2-axis scrollbars. - 5. TRANSITIONS - CSS3 transitions for hover events, auto-expanded and auto-hidden scrollbars. - 6. SCROLLBAR COLORS, OPACITY AND BACKGROUNDS - 6.1 THEMES - Scrollbar colors, opacity, dimensions, backgrounds etc. via ready-to-use themes. -*/ -/* ------------------------------------------------------------------------------------------------------------------------- -1. BASIC STYLE ------------------------------------------------------------------------------------------------------------------------- -*/ -@import "../../bibase"; -@import "../../lib/font"; -@import "../../lib/colors"; - -.mCustomScrollbar { - -ms-touch-action: pinch-zoom; - touch-action: pinch-zoom; /* direct pointer events to js */ -} - -.mCustomScrollbar.mCS_no_scrollbar, .mCustomScrollbar.mCS_touch_action { - -ms-touch-action: auto; - touch-action: auto; -} - -.mCustomScrollBox { - /* contains plugin's markup */ - position: relative; - overflow: hidden; - height: 100%; - max-width: 100%; - outline: none; - direction: ltr; -} - -.mCSB_container { - /* contains the original content */ - overflow: hidden; - width: auto; - height: auto; -} - -/* ------------------------------------------------------------------------------------------------------------------------- -2. VERTICAL SCROLLBAR -y-axis ------------------------------------------------------------------------------------------------------------------------- -*/ - -.mCSB_inside > .mCSB_container { - margin-right: 30px; -} - -.mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden { - margin-right: 0; -} - -/* non-visible scrollbar */ - -.mCS-dir-rtl > .mCSB_inside > .mCSB_container { - /* RTL direction/left-side scrollbar */ - margin-right: 0; - margin-left: 30px; -} - -.mCS-dir-rtl > .mCSB_inside > .mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden { - margin-left: 0; -} - -/* RTL direction/left-side scrollbar */ - -.mCSB_scrollTools { - /* contains scrollbar markup (draggable element, dragger rail, buttons etc.) */ - position: absolute; - width: 16px; - height: auto; - left: auto; - top: 0; - right: 0; - bottom: 0; -} - -.mCSB_outside + .mCSB_scrollTools { - right: -26px; -} - -/* scrollbar position: outside */ - -.mCS-dir-rtl > .mCSB_inside > .mCSB_scrollTools, -.mCS-dir-rtl > .mCSB_outside + .mCSB_scrollTools { - /* RTL direction/left-side scrollbar */ - right: auto; - left: 0; -} - -.mCS-dir-rtl > .mCSB_outside + .mCSB_scrollTools { - left: -26px; -} - -/* RTL direction/left-side scrollbar (scrollbar position: outside) */ - -.mCSB_scrollTools .mCSB_draggerContainer { - /* contains the draggable element and dragger rail markup */ - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - height: auto; -} - -.mCSB_scrollTools a + .mCSB_draggerContainer { - margin: 20px 0; -} - -.mCSB_scrollTools .mCSB_draggerRail { - width: 2px; - height: 100%; - margin: 0 auto; - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; -} - -.mCSB_scrollTools .mCSB_dragger { - /* the draggable element */ - cursor: pointer; - width: 100%; - height: 30px; /* minimum dragger height */ - z-index: 1; -} - -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - /* the dragger element */ - position: relative; - width: 4px; - height: 100%; - margin: 0 auto; - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; - text-align: center; -} - -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - width: 12px; /* auto-expanded scrollbar */ -} - -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 8px; /* auto-expanded scrollbar */ -} - -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown { - display: block; - position: absolute; - height: 20px; - width: 100%; - overflow: hidden; - margin: 0 auto; - cursor: pointer; -} - -.mCSB_scrollTools .mCSB_buttonDown { - bottom: 0; -} - -/* ------------------------------------------------------------------------------------------------------------------------- -3. HORIZONTAL SCROLLBAR -x-axis ------------------------------------------------------------------------------------------------------------------------- -*/ - -.mCSB_horizontal.mCSB_inside > .mCSB_container { - margin-right: 0; - margin-bottom: 30px; -} - -.mCSB_horizontal.mCSB_outside > .mCSB_container { - min-height: 100%; -} - -.mCSB_horizontal > .mCSB_container.mCS_no_scrollbar_x.mCS_x_hidden { - margin-bottom: 0; -} - -/* non-visible scrollbar */ - -.mCSB_scrollTools.mCSB_scrollTools_horizontal { - width: auto; - height: 16px; - top: auto; - right: 0; - bottom: 0; - left: 0; -} - -.mCustomScrollBox + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal { - bottom: -26px; -} - -/* scrollbar position: outside */ - -.mCSB_scrollTools.mCSB_scrollTools_horizontal a + .mCSB_draggerContainer { - margin: 0 20px; -} - -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 2px; - margin: 7px 0; -} - -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 30px; /* minimum dragger width */ - height: 100%; - left: 0; -} - -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 4px; - margin: 6px auto; -} - -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - height: 12px; /* auto-expanded scrollbar */ - margin: 2px auto; -} - -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 8px; /* auto-expanded scrollbar */ - margin: 4px 0; -} - -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft, -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight { - display: block; - position: absolute; - width: 20px; - height: 100%; - overflow: hidden; - margin: 0 auto; - cursor: pointer; -} - -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft { - left: 0; -} - -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight { - right: 0; -} - -/* ------------------------------------------------------------------------------------------------------------------------- -4. VERTICAL AND HORIZONTAL SCROLLBARS -yx-axis ------------------------------------------------------------------------------------------------------------------------- -*/ - -.mCSB_container_wrapper { - position: absolute; - height: auto; - width: auto; - overflow: hidden; - top: 0; - left: 0; - right: 0; - bottom: 0; - margin-right: 30px; - margin-bottom: 30px; -} - -.mCSB_container_wrapper > .mCSB_container { - padding-right: 30px; - padding-bottom: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.mCSB_vertical_horizontal > .mCSB_scrollTools.mCSB_scrollTools_vertical { - bottom: 20px; -} - -.mCSB_vertical_horizontal > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - right: 20px; -} - -/* non-visible horizontal scrollbar */ -.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden + .mCSB_scrollTools.mCSB_scrollTools_vertical { - bottom: 0; -} - -/* non-visible vertical scrollbar/RTL direction/left-side scrollbar */ -.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden + .mCSB_scrollTools ~ .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - right: 0; -} - -/* RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - left: 20px; -} - -/* non-visible scrollbar/RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden + .mCSB_scrollTools ~ .mCSB_scrollTools.mCSB_scrollTools_horizontal { - left: 0; -} - -.mCS-dir-rtl > .mCSB_inside > .mCSB_container_wrapper { - /* RTL direction/left-side scrollbar */ - margin-right: 0; - margin-left: 30px; -} - -.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden > .mCSB_container { - padding-right: 0; -} - -.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden > .mCSB_container { - padding-bottom: 0; -} - -.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden { - margin-right: 0; /* non-visible scrollbar */ - margin-left: 0; -} - -/* non-visible horizontal scrollbar */ -.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden { - margin-bottom: 0; -} - -/* ------------------------------------------------------------------------------------------------------------------------- -5. TRANSITIONS ------------------------------------------------------------------------------------------------------------------------- -*/ - -.mCSB_scrollTools, -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown, -.mCSB_scrollTools .mCSB_buttonLeft, -.mCSB_scrollTools .mCSB_buttonRight { - -webkit-transition: opacity .2s ease-in-out, background-color .2s ease-in-out; - -moz-transition: opacity .2s ease-in-out, background-color .2s ease-in-out; - -o-transition: opacity .2s ease-in-out, background-color .2s ease-in-out; - transition: opacity .2s ease-in-out, background-color .2s ease-in-out; -} - -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar, /* auto-expanded scrollbar */ -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail { - -webkit-transition: width .2s ease-out .2s, height .2s ease-out .2s, - margin-left .2s ease-out .2s, margin-right .2s ease-out .2s, - margin-top .2s ease-out .2s, margin-bottom .2s ease-out .2s, - opacity .2s ease-in-out, background-color .2s ease-in-out; - -moz-transition: width .2s ease-out .2s, height .2s ease-out .2s, - margin-left .2s ease-out .2s, margin-right .2s ease-out .2s, - margin-top .2s ease-out .2s, margin-bottom .2s ease-out .2s, - opacity .2s ease-in-out, background-color .2s ease-in-out; - -o-transition: width .2s ease-out .2s, height .2s ease-out .2s, - margin-left .2s ease-out .2s, margin-right .2s ease-out .2s, - margin-top .2s ease-out .2s, margin-bottom .2s ease-out .2s, - opacity .2s ease-in-out, background-color .2s ease-in-out; - transition: width .2s ease-out .2s, height .2s ease-out .2s, - margin-left .2s ease-out .2s, margin-right .2s ease-out .2s, - margin-top .2s ease-out .2s, margin-bottom .2s ease-out .2s, - opacity .2s ease-in-out, background-color .2s ease-in-out; -} - -/* ------------------------------------------------------------------------------------------------------------------------- -6. SCROLLBAR COLORS, OPACITY AND BACKGROUNDS ------------------------------------------------------------------------------------------------------------------------- -*/ - -/* ----------------------------------------- -6.1 THEMES ----------------------------------------- -*/ - -/* default theme ("light") */ - -.mCSB_scrollTools { - opacity: 0.75; - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} - -.mCS-autoHide > .mCustomScrollBox > .mCSB_scrollTools, -.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools { - opacity: 0; - filter: "alpha(opacity=0)"; - -ms-filter: "alpha(opacity=0)"; -} - -.mCustomScrollbar > .mCustomScrollBox > .mCSB_scrollTools.mCSB_scrollTools_onDrag, -.mCustomScrollbar > .mCustomScrollBox ~ .mCSB_scrollTools.mCSB_scrollTools_onDrag, -.mCustomScrollBox:hover > .mCSB_scrollTools, -.mCustomScrollBox:hover ~ .mCSB_scrollTools, -.mCS-autoHide:hover > .mCustomScrollBox > .mCSB_scrollTools, -.mCS-autoHide:hover > .mCustomScrollBox ~ .mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=100)"; - -ms-filter: "alpha(opacity=100)"; -} - -.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.4); - filter: "alpha(opacity=40)"; - -ms-filter: "alpha(opacity=40)"; -} - -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} - -.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); - filter: "alpha(opacity=85)"; - -ms-filter: "alpha(opacity=85)"; -} - -.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); - filter: "alpha(opacity=90)"; - -ms-filter: "alpha(opacity=90)"; -} - -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown, -.mCSB_scrollTools .mCSB_buttonLeft, -.mCSB_scrollTools .mCSB_buttonRight { - background-image: url('@{imageUrl}background/mCSB_buttons.png'); /* css sprites */ - background-repeat: no-repeat; - opacity: 0.4; - filter: "alpha(opacity=40)"; - -ms-filter: "alpha(opacity=40)"; -} - -.mCSB_scrollTools .mCSB_buttonUp { - background-position: 0 0; - /* - sprites locations - light: 0 0, -16px 0, -32px 0, -48px 0, 0 -72px, -16px -72px, -32px -72px - dark: -80px 0, -96px 0, -112px 0, -128px 0, -80px -72px, -96px -72px, -112px -72px - */ -} - -.mCSB_scrollTools .mCSB_buttonDown { - background-position: 0 -20px; - /* - sprites locations - light: 0 -20px, -16px -20px, -32px -20px, -48px -20px, 0 -92px, -16px -92px, -32px -92px - dark: -80px -20px, -96px -20px, -112px -20px, -128px -20px, -80px -92px, -96px -92px, -112 -92px - */ -} - -.mCSB_scrollTools .mCSB_buttonLeft { - background-position: 0 -40px; - /* - sprites locations - light: 0 -40px, -20px -40px, -40px -40px, -60px -40px, 0 -112px, -20px -112px, -40px -112px - dark: -80px -40px, -100px -40px, -120px -40px, -140px -40px, -80px -112px, -100px -112px, -120px -112px - */ -} - -.mCSB_scrollTools .mCSB_buttonRight { - background-position: 0 -56px; - /* - sprites locations - light: 0 -56px, -20px -56px, -40px -56px, -60px -56px, 0 -128px, -20px -128px, -40px -128px - dark: -80px -56px, -100px -56px, -120px -56px, -140px -56px, -80px -128px, -100px -128px, -120px -128px - */ -} - -.mCSB_scrollTools .mCSB_buttonUp:hover, -.mCSB_scrollTools .mCSB_buttonDown:hover, -.mCSB_scrollTools .mCSB_buttonLeft:hover, -.mCSB_scrollTools .mCSB_buttonRight:hover { - opacity: 0.75; - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} - -.mCSB_scrollTools .mCSB_buttonUp:active, -.mCSB_scrollTools .mCSB_buttonDown:active, -.mCSB_scrollTools .mCSB_buttonLeft:active, -.mCSB_scrollTools .mCSB_buttonRight:active { - opacity: 0.9; - filter: "alpha(opacity=90)"; - -ms-filter: "alpha(opacity=90)"; -} - -/* theme: "dark" */ - -.mCS-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} - -.mCS-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} - -.mCS-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: rgba(0, 0, 0, 0.85); -} - -.mCS-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: rgba(0, 0, 0, 0.9); -} - -.mCS-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px 0; -} - -.mCS-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -20px; -} - -.mCS-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -40px; -} - -.mCS-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -56px; -} - -/* ---------------------------------------- */ - -/* theme: "light-2", "dark-2" */ - -.mCS-light-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} - -.mCS-light-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} - -.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 4px; - margin: 6px auto; -} - -.mCS-light-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} - -.mCS-light-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-light-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} - -.mCS-light-2.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px 0; -} - -.mCS-light-2.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -20px; -} - -.mCS-light-2.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -40px; -} - -.mCS-light-2.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -56px; -} - -/* theme: "dark-2" */ - -.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} - -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} - -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} - -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} - -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px 0; -} - -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -20px; -} - -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -40px; -} - -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -56px; -} - -/* ---------------------------------------- */ - -/* theme: "light-thick", "dark-thick" */ - -.mCS-light-thick.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - -.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 4px; - margin: 6px 0; -} - -.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 6px; - margin: 5px auto; -} - -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} - -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} - -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -16px 0; -} - -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -16px -20px; -} - -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -20px -40px; -} - -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -20px -56px; -} - -/* theme: "dark-thick" */ - -.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} - -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} - -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -96px 0; -} - -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -96px -20px; -} - -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -100px -40px; -} - -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -100px -56px; -} - -/* ---------------------------------------- */ - -/* theme: "light-thin", "dark-thin" */ - -.mCS-light-thin.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); -} - -.mCS-light-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 2px; -} - -.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; -} - -.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 2px; - margin: 7px auto; -} - -/* theme "dark-thin" */ - -.mCS-dark-thin.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} - -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} - -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} - -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} - -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px 0; -} - -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -20px; -} - -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -40px; -} - -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -56px; -} - -/* ---------------------------------------- */ - -/* theme "rounded", "rounded-dark", "rounded-dots", "rounded-dots-dark" */ - -.mCS-rounded.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.15); -} - -.mCS-rounded.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger { - height: 14px; -} - -.mCS-rounded.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 14px; - margin: 0 1px; -} - -.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 14px; -} - -.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 14px; - margin: 1px 0; -} - -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - width: 16px; /* auto-expanded scrollbar */ - height: 16px; - margin: -1px 0; -} - -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 4px; /* auto-expanded scrollbar */ -} - -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - height: 16px; /* auto-expanded scrollbar */ - width: 16px; - margin: 0 -1px; -} - -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 4px; /* auto-expanded scrollbar */ - margin: 6px 0; -} - -.mCS-rounded.mCSB_scrollTools .mCSB_buttonUp { - background-position: 0 -72px; -} - -.mCS-rounded.mCSB_scrollTools .mCSB_buttonDown { - background-position: 0 -92px; -} - -.mCS-rounded.mCSB_scrollTools .mCSB_buttonLeft { - background-position: 0 -112px; -} - -.mCS-rounded.mCSB_scrollTools .mCSB_buttonRight { - background-position: 0 -128px; -} - -/* theme "rounded-dark", "rounded-dots-dark" */ - -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} - -.mCS-rounded-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} - -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} - -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} - -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px -72px; -} - -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -92px; -} - -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -112px; -} - -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -128px; -} - -/* theme "rounded-dots", "rounded-dots-dark" */ - -.mCS-rounded-dots.mCSB_scrollTools_vertical .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_vertical .mCSB_draggerRail { - width: 4px; -} - -.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - background-color: transparent; - background-position: center; -} - -.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAANElEQVQYV2NkIAAYiVbw//9/Y6DiM1ANJoyMjGdBbLgJQAX/kU0DKgDLkaQAvxW4HEvQFwCRcxIJK1XznAAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - opacity: 0.3; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} - -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - height: 4px; - margin: 6px 0; - background-repeat: repeat-x; -} - -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonUp { - background-position: -16px -72px; -} - -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonDown { - background-position: -16px -92px; -} - -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -20px -112px; -} - -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonRight { - background-position: -20px -128px; -} - -/* theme "rounded-dots-dark" */ - -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYV2NkIAAYSVFgDFR8BqrBBEifBbGRTfiPZhpYjiQFBK3A6l6CvgAAE9kGCd1mvgEAAAAASUVORK5CYII="); -} - -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -96px -72px; -} - -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -96px -92px; -} - -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -100px -112px; -} - -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -100px -128px; -} - -/* ---------------------------------------- */ - -/* theme "3d", "3d-dark", "3d-thick", "3d-thick-dark" */ - -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-repeat: repeat-y; - background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0.5)), color-stop(100%, rgba(255, 255, 255, 0))); - background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -o-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: linear-gradient(to right, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); -} - -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - background-repeat: repeat-x; - background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 0.5)), color-stop(100%, rgba(255, 255, 255, 0))); - background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); -} - -/* theme "3d", "3d-dark" */ - -.mCS-3d.mCSB_scrollTools_vertical .mCSB_dragger, -.mCS-3d-dark.mCSB_scrollTools_vertical .mCSB_dragger { - height: 70px; -} - -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 70px; -} - -.mCS-3d.mCSB_scrollTools, -.mCS-3d-dark.mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} - -.mCS-3d.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; -} - -.mCS-3d.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail { - width: 8px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5), inset -1px 0 1px rgba(255, 255, 255, 0.2); -} - -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #555; -} - -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 8px; -} - -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 8px; - margin: 4px 0; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5), inset 0 -1px 1px rgba(255, 255, 255, 0.2); -} - -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 8px; - margin: 4px auto; -} - -.mCS-3d.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} - -.mCS-3d.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} - -.mCS-3d.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} - -.mCS-3d.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} - -/* theme "3d-dark" */ - -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.1); -} - -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1); -} - -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} - -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} - -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} - -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} - -/* ---------------------------------------- */ - -/* theme: "3d-thick", "3d-thick-dark" */ - -.mCS-3d-thick.mCSB_scrollTools, -.mCS-3d-thick-dark.mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} - -.mCS-3d-thick.mCSB_scrollTools, -.mCS-3d-thick-dark.mCSB_scrollTools, -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer { - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} - -.mCSB_inside + .mCS-3d-thick.mCSB_scrollTools_vertical, -.mCSB_inside + .mCS-3d-thick-dark.mCSB_scrollTools_vertical { - right: 1px; -} - -.mCS-3d-thick.mCSB_scrollTools_vertical, -.mCS-3d-thick-dark.mCSB_scrollTools_vertical { - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.5); -} - -.mCS-3d-thick.mCSB_scrollTools_horizontal, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal { - bottom: 1px; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.5); -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.4); - width: 12px; - margin: 2px; - position: absolute; - height: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} - -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #555; -} - -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 12px; - width: auto; -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer { - background-color: #000; - background-color: rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 1px 16px rgba(0, 0, 0, 0.1); -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} - -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} - -/* theme: "3d-thick-dark" */ - -.mCS-3d-thick-dark.mCSB_scrollTools { - box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.2); -} - -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.2); -} - -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.4), inset -1px 0 0 rgba(0, 0, 0, 0.2); -} - -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.2); -} - -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #777; -} - -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer { - background-color: #fff; - background-color: rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 1px 16px rgba(0, 0, 0, 0.1); -} - -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} - -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} - -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} - -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} - -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} - -/* ---------------------------------------- */ - -/* theme: "minimal", "minimal-dark" */ - -.mCSB_outside + .mCS-minimal.mCSB_scrollTools_vertical, -.mCSB_outside + .mCS-minimal-dark.mCSB_scrollTools_vertical { - right: 0; - margin: 12px 0; -} - -.mCustomScrollBox.mCS-minimal + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal-dark + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal-dark + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal { - bottom: 0; - margin: 0 12px; -} - -/* RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCSB_outside + .mCS-minimal.mCSB_scrollTools_vertical, -.mCS-dir-rtl > .mCSB_outside + .mCS-minimal-dark.mCSB_scrollTools_vertical { - left: 0; - right: auto; -} - -.mCS-minimal.mCSB_scrollTools .mCSB_draggerRail, -.mCS-minimal-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} - -.mCS-minimal.mCSB_scrollTools_vertical .mCSB_dragger, -.mCS-minimal-dark.mCSB_scrollTools_vertical .mCSB_dragger { - height: 50px; -} - -.mCS-minimal.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-minimal-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 50px; -} - -.mCS-minimal.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.2); - filter: "alpha(opacity=20)"; - -ms-filter: "alpha(opacity=20)"; -} - -.mCS-minimal.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-minimal.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.5); - filter: "alpha(opacity=50)"; - -ms-filter: "alpha(opacity=50)"; -} - -/* theme: "minimal-dark" */ - -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); - filter: "alpha(opacity=20)"; - -ms-filter: "alpha(opacity=20)"; -} - -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.5); - filter: "alpha(opacity=50)"; - -ms-filter: "alpha(opacity=50)"; -} - -/* ---------------------------------------- */ - -/* theme "light-3", "dark-3" */ - -.mCS-light-3.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail { - width: 6px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); -} - -.mCS-light-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; -} - -.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 6px; - margin: 5px 0; -} - -.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 12px; -} - -.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 12px; - margin: 2px 0; -} - -.mCS-light-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} - -.mCS-light-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} - -.mCS-light-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} - -.mCS-light-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} - -/* theme "dark-3" */ - -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} - -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} - -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} - -.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); -} - -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} - -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} - -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} - -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} - -/* ---------------------------------------- */ - -/* theme "inset", "inset-dark", "inset-2", "inset-2-dark", "inset-3", "inset-3-dark" */ - -.mCS-inset.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - width: 12px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); -} - -.mCS-inset.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; - margin: 3px 5px; - position: absolute; - height: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} - -.mCS-inset.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 6px; - margin: 5px 3px; - position: absolute; - width: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} - -.mCS-inset.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 12px; - margin: 2px 0; -} - -.mCS-inset.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} - -.mCS-inset.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} - -.mCS-inset.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} - -.mCS-inset.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} - -/* theme "inset-dark", "inset-2-dark", "inset-3-dark" */ - -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} - -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} - -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} - -.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); -} - -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} - -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} - -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} - -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} - -/* theme "inset-2", "inset-2-dark" */ - -.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; - border-width: 1px; - border-style: solid; - border-color: #fff; - border-color: rgba(255, 255, 255, 0.2); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail { - border-color: #000; - border-color: rgba(0, 0, 0, 0.2); -} - -/* theme "inset-3", "inset-3-dark" */ - -.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.6); -} - -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.6); -} - -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} - -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} - -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} - -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); -} - -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} - -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} - -/* ---------------------------------------- */ - -/* theme "bi-default" */ -.mCS-bi-default { - & { - background-color: #dddddd; - } - & .mCSB_scrollTools.mCSB_scrollTools_horizontal { - height: 18px; - } - & .mCSB_scrollTools.mCSB_scrollTools_vertical { - width: 18px; - } - & .mCSB_scrollTools .mCSB_draggerRail { - border-radius: 0px; - } - & .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - border-radius: 2px; - } - & .mCSB_scrollTools.mCSB_scrollTools_horizontal a + .mCSB_draggerContainer { - margin: 0 18px; - } - & .mCSB_scrollTools.mCSB_scrollTools_vertical a + .mCSB_draggerContainer { - margin: 18px 0; - } -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 14px; - margin: 0 2px; -} - -.mCS-bi-default.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 14px; - margin: 2px auto; -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_draggerRail { - width: 18px; - height: 100%; - margin: 0; -} - -.mCS-bi-default.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 18px; - margin: 0; -} - -.mCS-bi-default.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-bi-default.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 14px; -} - -.mCS-bi-default.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-bi-default.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 14px; - margin: 2px 0; -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: @color-bi-background-gray; -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_draggerRail { - background-color: #dddddd; -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonUp, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonDown, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonRight { - width: 16px; - height: 16px; - background-color: @color-bi-background-gray; - border: 1px solid @color-bi-border-line; - .opacity(1); -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonUp { - background-position: -128px -1px; -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonDown { - background-position: -128px -21px; -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -142px -40px; -} - -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonRight { - background-position: -141px -56px; -} - -/* ---------------------------------------- */ \ No newline at end of file diff --git a/src/less/base/third/ztree/img/line_conn.gif b/src/less/base/third/ztree/img/line_conn.gif new file mode 100644 index 0000000000000000000000000000000000000000..d561d36a915776730eb3069cee4c949f027667ed GIT binary patch literal 45 xcmZ?wbhEHbT_)p@)n z{^qIIq1(T$e$~zMQ}6t1w^a|Cj;Amo3}FHq!p^`7G=x7ROJIXqM}S9S9}m;(SWbi* zHiVjpkZW$u7K%QH zEX1o>_L}Xs`W>m5xx>h#V7OG2< zoq3~FS4nm^l$rbe{C>~B&mZUUIR8A)oj29ga;5>!z_lohQ{m)OUUypp5`9Pnjaj*H{9dv7b zb!Kn=h4ov*xw+ZYSx)RU$G-TzW2@@?CTFkTlg(b+`gP~mD0QwoAbriBy|&~LU%dCN zdV71T>qi%7ucflFoi>&q921w@m;NRFM%>$#udO8N!1~VGo88~Tt8bk1^Pc|e%syz2 z4QFz?ra8MC(*Y@!cS6e-r*F5iN`J1dS5%j;O{K4VFKuqBNo`xX%UF%euIRpJy)Y1c z=V8I84^^er&D6Yszq_2#vBEh<2><}2L!Cc=E*KRsoAdb>7Jkev{Yq{O-5U*F+gO#b zp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K8MD=P#lPq0Y@p|d0MYi$1Nq`uoAtK8d6M?5Ah4A z>T#&*u&hc3s>MgD%m&b1mV@$18vZyCD1;{_gXk!1(u~LpXtz6lK!FBv2f8nl;9qeZ zs~aIABi-y7lIyZgeayJcWgS?X@VkCk!| zE7Tkf(Os8bI)3s&3{)uvuuK8|c0m5Dj0n;onv`f=6I*~)Q7%4GR{^spVnvBZbqj~L z{YM4Fka7UxPX|Qh#HbN~u*D+hjqG0K#5su8Nbyw4oE?+@C#`QYC|dr%4*@y3I<_?k zh_m$q?5ROsH99<%+zdc~HLmZc%u5+dW&?7pG53`*IW~}sPe51FS%)U`&3gl7HCj^T z(6hjFI=y@$QZ(uVD6XBh=4Ri z&I8E3Lh12A6s;P9!9pZQKo8=C66It5e7jw__uEe&1JJEYzgz0|WXS|*qo1-2?z5^O z++pZh_pyodhan&->bK78UzIZhl>d&(wojp6c^U$NWMD-1ossiEcqiIWqKjkt<%eI& z?B2`b)~{*?KpC!ko9B$Ia5}1-A$?a^oeUreQ0SUP;Jqx=w422|`eF*?B904&M>J?4 zAP20u$2s?#b6#h99RpyZQe5U_;NM+fo#)#t;a-P9j??4|l!)Hz{H$+`Gqo#%AQB7e zNrCPHwfF<|+B|U^9jX*QC|^EAY#61(VA(TR9_%a++z-r!Y?HOxcj;xA`~$-oDNAFgD;nm!S&SN(1RdWp1n9H`NtWhb!#YxV+Wc)=RSOw+5*(0HxPgsOEf zCec|CoFC8irSUdkvrX?^<5C_0sP;s-(ibFD{wFY7f4v~1c`<(kv?ux}9l)%~{`RcC zH+su~j3sC8MI;F!NrnZ#T38SjTg|A3`K+;$3D7T+3tyy0gcVnQzFJGdq5z%$10c8r Ap8x;= literal 0 HcmV?d00001 diff --git a/src/less/base/third/ztree/img/zTreeStandard.png b/src/less/base/third/ztree/img/zTreeStandard.png new file mode 100644 index 0000000000000000000000000000000000000000..ffda01ef1cccc398ee4e2327f4093ba1130a4961 GIT binary patch literal 11173 zcmYLvWmFwav?YFV4Z+>r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DM}0T2YjGa2iQ~tYaoh9ls`6ev<$W(P#3!oTV!9)^KVc#`(y^Di>sLrt zuwCW(?VHC>{%pMs9`DPlnc@Bsxqhf8O7{hK5H=aHN4Wa$FdRd*P{ zEpTo+NI6QN?iFd0PiX?GM{QXAJ=^MPd+-*gJad=4GJ?!rL53HWX1)#lsL}W z;h2UmX>03_ro*}86A+x20=`RyvZLDe+4GxxWG^~z4=U`wj|>b*lmjZu%F@LD5)Ha^ zP2M%yKpD^=NfNEC+rO3-2#Jmk2fv4imSJfK_k=B0Wa_M&ELN@*kV#|+c-;Oh2fRL? z)ErW=oaBApET}sY_Ut`-(jH8F-06C8)Rl7*xFuG8JU?CagdXfCs#fggTdfKG#!Fy$!+(u9xUaOS-Sd$h6HKhXWhR| zO-;4lFZa{~E}lI$&>Uo175{t%u+=eQA5#DvTmL2zJO9+5t#`Jk$~R1=PwWR{QOl3? zZV-xMVqWZPUyzX%h4TYf(IF%$p=zi=QzcS$mTWAxJvqnZ`-_a?(J&RCbBHa03rvhG7XuD!1! zyW$z#*7(H+wUxTErlzLMR}MPJA~D25Ite*B-PkYawmcj(G$l06gF{36&CSimWQFVl zE?BiIQ0|g*Z)vabXjNrp;f4ogqx?z=9XexejtBRIymp&d+puNCag}e)i76?<;G`t3 zB#9AA%*;!^{*!B+b{6>$NL@WWLSLMcP5*&0l=A9o;M&rX)@nP?gGsDrwI1a5(=!bX z4O+Lyoh1f>qOy@V1&E!>^;0hY<<`r>c`sgk^;?i=SnC9qm?7ZY>GOk4>01s2G=xQn X3wf1`XyoU;TL_tNiW1dgpn(4aGkUu% literal 0 HcmV?d00001 diff --git a/src/less/base/third/ztree/zTreeStyle.less b/src/less/base/third/ztree/zTreeStyle.less index f6edbb45c5..5a94e02301 100644 --- a/src/less/base/third/ztree/zTreeStyle.less +++ b/src/less/base/third/ztree/zTreeStyle.less @@ -8,13 +8,13 @@ website: http://code.google.com/p/jquerytree/ -------------------------------------*/ -.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} -.ztree {margin:0; padding:5px; color:#333} +.ztree * {padding:0; margin:0; } +.ztree {margin:0; padding:5px; } .ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} .ztree li ul{ margin:0; padding:0 0 0 18px} -.ztree li ul.line{ background:url(icon/tree-vertical-line-1.png) 0 0 repeat-y;} +.ztree li ul.line{ background:url(${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-1.png) 0 0 repeat-y;} -.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:24px; color:#333; background-color: transparent; +.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:24px; background-color: transparent; text-decoration:none; vertical-align:top; display: inline-block} .ztree li a.curSelectedNode {} .ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} @@ -32,29 +32,29 @@ website: http://code.google.com/p/jquerytree/ .ztree li span.button.chk {width:16px; height:16px; margin:0 3px 0 0; cursor: auto} .ztree li span.button.chk.checkbox_false_full { - background-image:url("icon/check-box-normal.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_full_focus { - background-image:url("icon/check-box-normal.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_part { - background-image:url("icon/half_selected.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_part_focus { - background-image:url("icon/half_selected.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} .ztree li span.button.chk.checkbox_true_full { - background-image:url("icon/check-box-active.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_full_focus { - background-image:url("icon/check-box-active.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_part { - background-image:url("icon/half_selected.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_part_focus { - background-image:url("icon/half_selected.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} .ztree li span.button.chk.radio_false_full {background-position:-28px 0} @@ -70,40 +70,40 @@ website: http://code.google.com/p/jquerytree/ .ztree li span.button.switch {width:25px; height:25px} .ztree li span.button.root_open{ - background-image:url("icon/tree-expand-1.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-1.png"); } .ztree li span.button.root_close{ - background-image:url("icon/tree-collapse-1.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-1.png"); } .ztree li span.button.roots_open{ - background-image:url("icon/tree-expand-2.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-2.png"); } .ztree li span.button.roots_close{ - background-image:url("icon/tree-collapse-2.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-2.png"); } .ztree li span.button.center_open{ - background-image:url("icon/tree-expand-3.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-3.png"); } .ztree li span.button.center_close{ - background-image:url("icon/tree-collapse-3.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-3.png"); } .ztree li span.button.bottom_open{ - background-image:url("icon/tree-expand-4.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-4.png"); } .ztree li span.button.bottom_close{ - background-image:url("icon/tree-collapse-4.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-4.png"); } .ztree li span.button.noline_open{background-position:-92px -72px} .ztree li span.button.noline_close{background-position:-74px -72px} .ztree li span.button.root_docu{ background:none;} .ztree li span.button.roots_docu{ - background-image:url("icon/tree-vertical-line-2.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); } .ztree li span.button.center_docu{ - background-image:url("icon/tree-vertical-line-3.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); } .ztree li span.button.bottom_docu{ - background-image:url("icon/tree-vertical-line-4.png"); + background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); } .ztree li span.button.noline_docu{ background:none;} diff --git a/src/less/base/timeouttoast/widget.timeouttoast.less b/src/less/base/timeouttoast/widget.timeouttoast.less new file mode 100644 index 0000000000..b9447cd366 --- /dev/null +++ b/src/less/base/timeouttoast/widget.timeouttoast.less @@ -0,0 +1,25 @@ +@import "../../bibase"; + +.bi-timeout-toast { + font-size: @font-size-14; + .border-radius(2px); + background: @color-bi-tip-warning-background; + color: @color-bi-text-warning; + & .cancel-button { + background: @color-bi-background-default; + border: 1px solid @color-bi-border-normal; + color: @color-bi-text-black; + .border-radius(2px); + &:hover { + .opacity(0.8); + } + } + & .retry-button { + background: @color-bi-background-highlight; + .border-radius(2px); + color: @color-bi-text; + &:hover { + .opacity(0.8); + } + } +} \ No newline at end of file diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index e077d7f20c..79bc39e2e5 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -11,6 +11,7 @@ & .list-view-outer{ border: 1px solid @color-bi-split-dark; .border-radius(2px); + color: @color-bi-text-black; background:@color-bi-background-default; } & .list-view-toolbar { From fb06141b8d50e772ade37d060544f7bc42f8bb16 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 15:14:25 +0800 Subject: [PATCH 08/19] add --- dist/base.css | 2005 ++++------------- dist/core.js | 276 ++- src/core/base.js | 8 +- src/css/base/pager/pager.all.css | 14 - src/css/base/pager/pager.number.css | 11 - src/css/base/pager/pager.skip.css | 11 - .../base/third/jquery.mCustomScrollbar.css | 1481 ------------ 7 files changed, 691 insertions(+), 3115 deletions(-) delete mode 100644 src/css/base/pager/pager.all.css delete mode 100644 src/css/base/pager/pager.number.css delete mode 100644 src/css/base/pager/pager.skip.css delete mode 100644 src/css/base/third/jquery.mCustomScrollbar.css diff --git a/dist/base.css b/dist/base.css index 6505eea156..867afd4676 100644 --- a/dist/base.css +++ b/dist/base.css @@ -1,6 +1,38 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ +@font-face { + font-family: 'bbr'; + src: url('/resources/fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('/resources/fonts/iconfont.woff') format('woff'), /* chrome、firefox */ url('/resources/fonts/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('/resources/fonts/iconfont.svg#svgFontName') format('svg'); + + /* iOS 4.1- */ +} +.b-font { + font-family: "bi"; + font-style: normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2px; + -moz-osx-font-smoothing: grayscale; +} +.bi-base-request-fail-mask .mask-pane { + background: #ffffff; + opacity: 0.8; + filter: alpha(opacity=80); +} +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +.bi-combine-chart .bi-linkage-list { + background-color: #ffffff; + border: 1px solid #eaeaea; + z-index: 1000000000; +} +.bi-combine-chart .bi-linkage-list .bi-linkage-list-item:hover { + background-color: #f4f4f4; +} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ @@ -41,6 +73,26 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ +.bi-bubble-popup-view { + -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); +} +.bi-bubble-popup-view .bubble-popup-line { + background-color: #009de3; +} +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +/************hing light*****************/ +.bi-z-index-mask { + background-color: #1a1a1a; + opacity: 0.5; + filter: alpha(opacity=50); +} +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ /* BASICS */ .CodeMirror { /* Set height, width, borders, and global font properties here */ @@ -586,62 +638,65 @@ li.CodeMirror-hint-active { /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-all-pager .pager-editor { - background-color: #ffffff; +.bi-login-timeout-center .input-wrapper { + border-bottom: 1px solid #eaeaea; } -.bi-all-pager .all-pager-prev { +.bi-login-timeout-center .input-wrapper .login-input { font-size: 16px; - background: #f4f4f4; } -.bi-all-pager .all-pager-next { +.bi-login-timeout-center .input-wrapper .error-mask { + background: #1a1a1a; + opacity: 0.25; + filter: alpha(opacity=25); + color: #ffffff; font-size: 16px; - background: #f4f4f4; } -/****添加计算宽度的--运算符直接需要space****/ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ -.bi-pager .page-item { - border: 1px solid #d4dadd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.bi-pager .page-item.active { +.bi-login-timeout-center .login-button { background: #009de3; + -webkit-border-radius: 25px; + -moz-border-radius: 25px; + border-radius: 25px; + font-size: 22px; color: #ffffff; } +.bi-login-timeout-center .login-button:hover { + opacity: 0.8; + filter: alpha(opacity=80); +} +.bi-login-timeout-south .keep-state { + font-size: 14px; + color: #808080; +} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-direction-pager .direction-pager-prev { +.bi-all-count-pager .all-pager-prev { font-size: 16px; - background: #f4f4f4; } -.bi-direction-pager .direction-pager-next { +.bi-all-count-pager .all-pager-next { font-size: 16px; - background: #f4f4f4; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-number-pager .number-pager-prev { - font-size: 16px; - background: #f4f4f4; +.bi-pager .page-item { + border: 1px solid #d4dadd; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; } -.bi-number-pager .number-pager-next { - font-size: 16px; - background: #f4f4f4; +.bi-pager .page-item.active { + background: #009de3; + color: #ffffff; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-skip-pager .skip-pager-prev { +.bi-direction-pager .direction-pager-prev { font-size: 16px; - background: #f4f4f4; } -.bi-skip-pager .skip-pager-next { +.bi-direction-pager .direction-pager-next { font-size: 16px; - background: #f4f4f4; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ @@ -652,10 +707,16 @@ li.CodeMirror-hint-active { filter: alpha(opacity=80); } .bi-request-loading .loading-comment { - font-size: 14px; + font-size: 20px; + color: #808080; } .bi-request-loading .load-fail-comment { - font-size: 14px; + font-size: 20px; + color: #808080; +} +.bi-request-loading .load-timeout-warning { + font-size: 16px; + color: #e85050; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ @@ -857,22 +918,14 @@ li.CodeMirror-hint-active { /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-state-editor { - font-size: 12px; -} .bi-state-editor .state-editor-infinite-text { - font-size: 12px; - color: #1a1a1a; + color: #cccccc; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-simple-state-editor { - font-size: 12px; -} .bi-simple-state-editor .state-editor-infinite-text { - font-size: 12px; - color: #1a1a1a; + color: #cccccc; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ @@ -930,7 +983,7 @@ li.CodeMirror-hint-active { text-overflow: ellipsis; overflow-x: hidden; white-space: nowrap; - word-break: break-word; + word-break: break-all; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ @@ -1271,1487 +1324,6 @@ li.CodeMirror-hint-active { overflow: hidden; background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/marker.png) no-repeat; } -/* -== malihu jquery custom scrollbar plugin == -Plugin URI: http://manos.malihu.gr/jquery-custom-content-scroller -*/ -/* -CONTENTS: - 1. BASIC STYLE - Plugin's basic/essential CSS properties (normally, should not be edited). - 2. VERTICAL SCROLLBAR - Positioning and dimensions of vertical scrollbar. - 3. HORIZONTAL SCROLLBAR - Positioning and dimensions of horizontal scrollbar. - 4. VERTICAL AND HORIZONTAL SCROLLBARS - Positioning and dimensions of 2-axis scrollbars. - 5. TRANSITIONS - CSS3 transitions for hover events, auto-expanded and auto-hidden scrollbars. - 6. SCROLLBAR COLORS, OPACITY AND BACKGROUNDS - 6.1 THEMES - Scrollbar colors, opacity, dimensions, backgrounds etc. via ready-to-use themes. -*/ -/* ------------------------------------------------------------------------------------------------------------------------- -1. BASIC STYLE ------------------------------------------------------------------------------------------------------------------------- -*/ -/****添加计算宽度的--运算符直接需要space****/ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ -.mCustomScrollbar { - -ms-touch-action: pinch-zoom; - touch-action: pinch-zoom; - /* direct pointer events to js */ -} -.mCustomScrollbar.mCS_no_scrollbar, -.mCustomScrollbar.mCS_touch_action { - -ms-touch-action: auto; - touch-action: auto; -} -.mCustomScrollBox { - /* contains plugin's markup */ - position: relative; - overflow: hidden; - height: 100%; - max-width: 100%; - outline: none; - direction: ltr; -} -.mCSB_container { - /* contains the original content */ - overflow: hidden; - width: auto; - height: auto; -} -/* ------------------------------------------------------------------------------------------------------------------------- -2. VERTICAL SCROLLBAR -y-axis ------------------------------------------------------------------------------------------------------------------------- -*/ -.mCSB_inside > .mCSB_container { - margin-right: 30px; -} -.mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden { - margin-right: 0; -} -/* non-visible scrollbar */ -.mCS-dir-rtl > .mCSB_inside > .mCSB_container { - /* RTL direction/left-side scrollbar */ - margin-right: 0; - margin-left: 30px; -} -.mCS-dir-rtl > .mCSB_inside > .mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden { - margin-left: 0; -} -/* RTL direction/left-side scrollbar */ -.mCSB_scrollTools { - /* contains scrollbar markup (draggable element, dragger rail, buttons etc.) */ - position: absolute; - width: 16px; - height: auto; - left: auto; - top: 0; - right: 0; - bottom: 0; -} -.mCSB_outside + .mCSB_scrollTools { - right: -26px; -} -/* scrollbar position: outside */ -.mCS-dir-rtl > .mCSB_inside > .mCSB_scrollTools, -.mCS-dir-rtl > .mCSB_outside + .mCSB_scrollTools { - /* RTL direction/left-side scrollbar */ - right: auto; - left: 0; -} -.mCS-dir-rtl > .mCSB_outside + .mCSB_scrollTools { - left: -26px; -} -/* RTL direction/left-side scrollbar (scrollbar position: outside) */ -.mCSB_scrollTools .mCSB_draggerContainer { - /* contains the draggable element and dragger rail markup */ - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - height: auto; -} -.mCSB_scrollTools a + .mCSB_draggerContainer { - margin: 20px 0; -} -.mCSB_scrollTools .mCSB_draggerRail { - width: 2px; - height: 100%; - margin: 0 auto; - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; -} -.mCSB_scrollTools .mCSB_dragger { - /* the draggable element */ - cursor: pointer; - width: 100%; - height: 30px; - /* minimum dragger height */ - z-index: 1; -} -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - /* the dragger element */ - position: relative; - width: 4px; - height: 100%; - margin: 0 auto; - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; - text-align: center; -} -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - width: 12px; - /* auto-expanded scrollbar */ -} -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 8px; - /* auto-expanded scrollbar */ -} -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown { - display: block; - position: absolute; - height: 20px; - width: 100%; - overflow: hidden; - margin: 0 auto; - cursor: pointer; -} -.mCSB_scrollTools .mCSB_buttonDown { - bottom: 0; -} -/* ------------------------------------------------------------------------------------------------------------------------- -3. HORIZONTAL SCROLLBAR -x-axis ------------------------------------------------------------------------------------------------------------------------- -*/ -.mCSB_horizontal.mCSB_inside > .mCSB_container { - margin-right: 0; - margin-bottom: 30px; -} -.mCSB_horizontal.mCSB_outside > .mCSB_container { - min-height: 100%; -} -.mCSB_horizontal > .mCSB_container.mCS_no_scrollbar_x.mCS_x_hidden { - margin-bottom: 0; -} -/* non-visible scrollbar */ -.mCSB_scrollTools.mCSB_scrollTools_horizontal { - width: auto; - height: 16px; - top: auto; - right: 0; - bottom: 0; - left: 0; -} -.mCustomScrollBox + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal { - bottom: -26px; -} -/* scrollbar position: outside */ -.mCSB_scrollTools.mCSB_scrollTools_horizontal a + .mCSB_draggerContainer { - margin: 0 20px; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 2px; - margin: 7px 0; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 30px; - /* minimum dragger width */ - height: 100%; - left: 0; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 4px; - margin: 6px auto; -} -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - height: 12px; - /* auto-expanded scrollbar */ - margin: 2px auto; -} -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 8px; - /* auto-expanded scrollbar */ - margin: 4px 0; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft, -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight { - display: block; - position: absolute; - width: 20px; - height: 100%; - overflow: hidden; - margin: 0 auto; - cursor: pointer; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft { - left: 0; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight { - right: 0; -} -/* ------------------------------------------------------------------------------------------------------------------------- -4. VERTICAL AND HORIZONTAL SCROLLBARS -yx-axis ------------------------------------------------------------------------------------------------------------------------- -*/ -.mCSB_container_wrapper { - position: absolute; - height: auto; - width: auto; - overflow: hidden; - top: 0; - left: 0; - right: 0; - bottom: 0; - margin-right: 30px; - margin-bottom: 30px; -} -.mCSB_container_wrapper > .mCSB_container { - padding-right: 30px; - padding-bottom: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.mCSB_vertical_horizontal > .mCSB_scrollTools.mCSB_scrollTools_vertical { - bottom: 20px; -} -.mCSB_vertical_horizontal > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - right: 20px; -} -/* non-visible horizontal scrollbar */ -.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden + .mCSB_scrollTools.mCSB_scrollTools_vertical { - bottom: 0; -} -/* non-visible vertical scrollbar/RTL direction/left-side scrollbar */ -.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden + .mCSB_scrollTools ~ .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - right: 0; -} -/* RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - left: 20px; -} -/* non-visible scrollbar/RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden + .mCSB_scrollTools ~ .mCSB_scrollTools.mCSB_scrollTools_horizontal { - left: 0; -} -.mCS-dir-rtl > .mCSB_inside > .mCSB_container_wrapper { - /* RTL direction/left-side scrollbar */ - margin-right: 0; - margin-left: 30px; -} -.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden > .mCSB_container { - padding-right: 0; -} -.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden > .mCSB_container { - padding-bottom: 0; -} -.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden { - margin-right: 0; - /* non-visible scrollbar */ - margin-left: 0; -} -/* non-visible horizontal scrollbar */ -.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden { - margin-bottom: 0; -} -/* ------------------------------------------------------------------------------------------------------------------------- -5. TRANSITIONS ------------------------------------------------------------------------------------------------------------------------- -*/ -.mCSB_scrollTools, -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown, -.mCSB_scrollTools .mCSB_buttonLeft, -.mCSB_scrollTools .mCSB_buttonRight { - -webkit-transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - -moz-transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - -o-transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; -} -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar, -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail { - -webkit-transition: width 0.2s ease-out 0.2s, height 0.2s ease-out 0.2s, margin-left 0.2s ease-out 0.2s, margin-right 0.2s ease-out 0.2s, margin-top 0.2s ease-out 0.2s, margin-bottom 0.2s ease-out 0.2s, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - -moz-transition: width 0.2s ease-out 0.2s, height 0.2s ease-out 0.2s, margin-left 0.2s ease-out 0.2s, margin-right 0.2s ease-out 0.2s, margin-top 0.2s ease-out 0.2s, margin-bottom 0.2s ease-out 0.2s, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - -o-transition: width 0.2s ease-out 0.2s, height 0.2s ease-out 0.2s, margin-left 0.2s ease-out 0.2s, margin-right 0.2s ease-out 0.2s, margin-top 0.2s ease-out 0.2s, margin-bottom 0.2s ease-out 0.2s, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - transition: width 0.2s ease-out 0.2s, height 0.2s ease-out 0.2s, margin-left 0.2s ease-out 0.2s, margin-right 0.2s ease-out 0.2s, margin-top 0.2s ease-out 0.2s, margin-bottom 0.2s ease-out 0.2s, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; -} -/* ------------------------------------------------------------------------------------------------------------------------- -6. SCROLLBAR COLORS, OPACITY AND BACKGROUNDS ------------------------------------------------------------------------------------------------------------------------- -*/ -/* ----------------------------------------- -6.1 THEMES ----------------------------------------- -*/ -/* default theme ("light") */ -.mCSB_scrollTools { - opacity: 0.75; - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} -.mCS-autoHide > .mCustomScrollBox > .mCSB_scrollTools, -.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools { - opacity: 0; - filter: "alpha(opacity=0)"; - -ms-filter: "alpha(opacity=0)"; -} -.mCustomScrollbar > .mCustomScrollBox > .mCSB_scrollTools.mCSB_scrollTools_onDrag, -.mCustomScrollbar > .mCustomScrollBox ~ .mCSB_scrollTools.mCSB_scrollTools_onDrag, -.mCustomScrollBox:hover > .mCSB_scrollTools, -.mCustomScrollBox:hover ~ .mCSB_scrollTools, -.mCS-autoHide:hover > .mCustomScrollBox > .mCSB_scrollTools, -.mCS-autoHide:hover > .mCustomScrollBox ~ .mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=100)"; - -ms-filter: "alpha(opacity=100)"; -} -.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.4); - filter: "alpha(opacity=40)"; - -ms-filter: "alpha(opacity=40)"; -} -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} -.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); - filter: "alpha(opacity=85)"; - -ms-filter: "alpha(opacity=85)"; -} -.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); - filter: "alpha(opacity=90)"; - -ms-filter: "alpha(opacity=90)"; -} -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown, -.mCSB_scrollTools .mCSB_buttonLeft, -.mCSB_scrollTools .mCSB_buttonRight { - background-image: url('background/mCSB_buttons.png'); - /* css sprites */ - background-repeat: no-repeat; - opacity: 0.4; - filter: "alpha(opacity=40)"; - -ms-filter: "alpha(opacity=40)"; -} -.mCSB_scrollTools .mCSB_buttonUp { - background-position: 0 0; - /* - sprites locations - light: 0 0, -16px 0, -32px 0, -48px 0, 0 -72px, -16px -72px, -32px -72px - dark: -80px 0, -96px 0, -112px 0, -128px 0, -80px -72px, -96px -72px, -112px -72px - */ -} -.mCSB_scrollTools .mCSB_buttonDown { - background-position: 0 -20px; - /* - sprites locations - light: 0 -20px, -16px -20px, -32px -20px, -48px -20px, 0 -92px, -16px -92px, -32px -92px - dark: -80px -20px, -96px -20px, -112px -20px, -128px -20px, -80px -92px, -96px -92px, -112 -92px - */ -} -.mCSB_scrollTools .mCSB_buttonLeft { - background-position: 0 -40px; - /* - sprites locations - light: 0 -40px, -20px -40px, -40px -40px, -60px -40px, 0 -112px, -20px -112px, -40px -112px - dark: -80px -40px, -100px -40px, -120px -40px, -140px -40px, -80px -112px, -100px -112px, -120px -112px - */ -} -.mCSB_scrollTools .mCSB_buttonRight { - background-position: 0 -56px; - /* - sprites locations - light: 0 -56px, -20px -56px, -40px -56px, -60px -56px, 0 -128px, -20px -128px, -40px -128px - dark: -80px -56px, -100px -56px, -120px -56px, -140px -56px, -80px -128px, -100px -128px, -120px -128px - */ -} -.mCSB_scrollTools .mCSB_buttonUp:hover, -.mCSB_scrollTools .mCSB_buttonDown:hover, -.mCSB_scrollTools .mCSB_buttonLeft:hover, -.mCSB_scrollTools .mCSB_buttonRight:hover { - opacity: 0.75; - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} -.mCSB_scrollTools .mCSB_buttonUp:active, -.mCSB_scrollTools .mCSB_buttonDown:active, -.mCSB_scrollTools .mCSB_buttonLeft:active, -.mCSB_scrollTools .mCSB_buttonRight:active { - opacity: 0.9; - filter: "alpha(opacity=90)"; - -ms-filter: "alpha(opacity=90)"; -} -/* theme: "dark" */ -.mCS-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} -.mCS-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px 0; -} -.mCS-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -20px; -} -.mCS-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -40px; -} -.mCS-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -56px; -} -/* ---------------------------------------- */ -/* theme: "light-2", "dark-2" */ -.mCS-light-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} -.mCS-light-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} -.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 4px; - margin: 6px auto; -} -.mCS-light-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} -.mCS-light-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-light-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} -.mCS-light-2.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px 0; -} -.mCS-light-2.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -20px; -} -.mCS-light-2.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -40px; -} -.mCS-light-2.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -56px; -} -/* theme: "dark-2" */ -.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px 0; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -20px; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -40px; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -56px; -} -/* ---------------------------------------- */ -/* theme: "light-thick", "dark-thick" */ -.mCS-light-thick.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 4px; - margin: 6px 0; -} -.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 6px; - margin: 5px auto; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -16px 0; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -16px -20px; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -20px -40px; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -20px -56px; -} -/* theme: "dark-thick" */ -.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -96px 0; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -96px -20px; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -100px -40px; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -100px -56px; -} -/* ---------------------------------------- */ -/* theme: "light-thin", "dark-thin" */ -.mCS-light-thin.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); -} -.mCS-light-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 2px; -} -.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; -} -.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 2px; - margin: 7px auto; -} -/* theme "dark-thin" */ -.mCS-dark-thin.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px 0; -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -20px; -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -40px; -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -56px; -} -/* ---------------------------------------- */ -/* theme "rounded", "rounded-dark", "rounded-dots", "rounded-dots-dark" */ -.mCS-rounded.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.15); -} -.mCS-rounded.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger { - height: 14px; -} -.mCS-rounded.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 14px; - margin: 0 1px; -} -.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 14px; -} -.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 14px; - margin: 1px 0; -} -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - width: 16px; - /* auto-expanded scrollbar */ - height: 16px; - margin: -1px 0; -} -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 4px; - /* auto-expanded scrollbar */ -} -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - height: 16px; - /* auto-expanded scrollbar */ - width: 16px; - margin: 0 -1px; -} -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 4px; - /* auto-expanded scrollbar */ - margin: 6px 0; -} -.mCS-rounded.mCSB_scrollTools .mCSB_buttonUp { - background-position: 0 -72px; -} -.mCS-rounded.mCSB_scrollTools .mCSB_buttonDown { - background-position: 0 -92px; -} -.mCS-rounded.mCSB_scrollTools .mCSB_buttonLeft { - background-position: 0 -112px; -} -.mCS-rounded.mCSB_scrollTools .mCSB_buttonRight { - background-position: 0 -128px; -} -/* theme "rounded-dark", "rounded-dots-dark" */ -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px -72px; -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -92px; -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -112px; -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -128px; -} -/* theme "rounded-dots", "rounded-dots-dark" */ -.mCS-rounded-dots.mCSB_scrollTools_vertical .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_vertical .mCSB_draggerRail { - width: 4px; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - background-color: transparent; - background-position: center; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAANElEQVQYV2NkIAAYiVbw//9/Y6DiM1ANJoyMjGdBbLgJQAX/kU0DKgDLkaQAvxW4HEvQFwCRcxIJK1XznAAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - opacity: 0.3; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - height: 4px; - margin: 6px 0; - background-repeat: repeat-x; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonUp { - background-position: -16px -72px; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonDown { - background-position: -16px -92px; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -20px -112px; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonRight { - background-position: -20px -128px; -} -/* theme "rounded-dots-dark" */ -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYV2NkIAAYSVFgDFR8BqrBBEifBbGRTfiPZhpYjiQFBK3A6l6CvgAAE9kGCd1mvgEAAAAASUVORK5CYII="); -} -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -96px -72px; -} -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -96px -92px; -} -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -100px -112px; -} -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -100px -128px; -} -/* ---------------------------------------- */ -/* theme "3d", "3d-dark", "3d-thick", "3d-thick-dark" */ -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-repeat: repeat-y; - background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0.5)), color-stop(100%, rgba(255, 255, 255, 0))); - background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -o-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: linear-gradient(to right, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); -} -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - background-repeat: repeat-x; - background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 0.5)), color-stop(100%, rgba(255, 255, 255, 0))); - background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); -} -/* theme "3d", "3d-dark" */ -.mCS-3d.mCSB_scrollTools_vertical .mCSB_dragger, -.mCS-3d-dark.mCSB_scrollTools_vertical .mCSB_dragger { - height: 70px; -} -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 70px; -} -.mCS-3d.mCSB_scrollTools, -.mCS-3d-dark.mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} -.mCS-3d.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; -} -.mCS-3d.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail { - width: 8px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5), inset -1px 0 1px rgba(255, 255, 255, 0.2); -} -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #555; -} -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 8px; -} -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 8px; - margin: 4px 0; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5), inset 0 -1px 1px rgba(255, 255, 255, 0.2); -} -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 8px; - margin: 4px auto; -} -.mCS-3d.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} -.mCS-3d.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} -.mCS-3d.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} -.mCS-3d.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} -/* theme "3d-dark" */ -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.1); -} -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1); -} -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} -/* ---------------------------------------- */ -/* theme: "3d-thick", "3d-thick-dark" */ -.mCS-3d-thick.mCSB_scrollTools, -.mCS-3d-thick-dark.mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} -.mCS-3d-thick.mCSB_scrollTools, -.mCS-3d-thick-dark.mCSB_scrollTools, -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer { - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.mCSB_inside + .mCS-3d-thick.mCSB_scrollTools_vertical, -.mCSB_inside + .mCS-3d-thick-dark.mCSB_scrollTools_vertical { - right: 1px; -} -.mCS-3d-thick.mCSB_scrollTools_vertical, -.mCS-3d-thick-dark.mCSB_scrollTools_vertical { - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.5); -} -.mCS-3d-thick.mCSB_scrollTools_horizontal, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal { - bottom: 1px; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.5); -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.4); - width: 12px; - margin: 2px; - position: absolute; - height: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #555; -} -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 12px; - width: auto; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer { - background-color: #000; - background-color: rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 1px 16px rgba(0, 0, 0, 0.1); -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} -/* theme: "3d-thick-dark" */ -.mCS-3d-thick-dark.mCSB_scrollTools { - box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.2); -} -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.2); -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.4), inset -1px 0 0 rgba(0, 0, 0, 0.2); -} -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.2); -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #777; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer { - background-color: #fff; - background-color: rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 1px 16px rgba(0, 0, 0, 0.1); -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} -/* ---------------------------------------- */ -/* theme: "minimal", "minimal-dark" */ -.mCSB_outside + .mCS-minimal.mCSB_scrollTools_vertical, -.mCSB_outside + .mCS-minimal-dark.mCSB_scrollTools_vertical { - right: 0; - margin: 12px 0; -} -.mCustomScrollBox.mCS-minimal + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal-dark + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal-dark + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal { - bottom: 0; - margin: 0 12px; -} -/* RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCSB_outside + .mCS-minimal.mCSB_scrollTools_vertical, -.mCS-dir-rtl > .mCSB_outside + .mCS-minimal-dark.mCSB_scrollTools_vertical { - left: 0; - right: auto; -} -.mCS-minimal.mCSB_scrollTools .mCSB_draggerRail, -.mCS-minimal-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} -.mCS-minimal.mCSB_scrollTools_vertical .mCSB_dragger, -.mCS-minimal-dark.mCSB_scrollTools_vertical .mCSB_dragger { - height: 50px; -} -.mCS-minimal.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-minimal-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 50px; -} -.mCS-minimal.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.2); - filter: "alpha(opacity=20)"; - -ms-filter: "alpha(opacity=20)"; -} -.mCS-minimal.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-minimal.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.5); - filter: "alpha(opacity=50)"; - -ms-filter: "alpha(opacity=50)"; -} -/* theme: "minimal-dark" */ -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); - filter: "alpha(opacity=20)"; - -ms-filter: "alpha(opacity=20)"; -} -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.5); - filter: "alpha(opacity=50)"; - -ms-filter: "alpha(opacity=50)"; -} -/* ---------------------------------------- */ -/* theme "light-3", "dark-3" */ -.mCS-light-3.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail { - width: 6px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); -} -.mCS-light-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; -} -.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 6px; - margin: 5px 0; -} -.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 12px; -} -.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 12px; - margin: 2px 0; -} -.mCS-light-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} -.mCS-light-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} -.mCS-light-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} -.mCS-light-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} -/* theme "dark-3" */ -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); -} -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} -/* ---------------------------------------- */ -/* theme "inset", "inset-dark", "inset-2", "inset-2-dark", "inset-3", "inset-3-dark" */ -.mCS-inset.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - width: 12px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); -} -.mCS-inset.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; - margin: 3px 5px; - position: absolute; - height: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.mCS-inset.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 6px; - margin: 5px 3px; - position: absolute; - width: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.mCS-inset.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 12px; - margin: 2px 0; -} -.mCS-inset.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} -.mCS-inset.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} -.mCS-inset.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} -.mCS-inset.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} -/* theme "inset-dark", "inset-2-dark", "inset-3-dark" */ -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} -/* theme "inset-2", "inset-2-dark" */ -.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; - border-width: 1px; - border-style: solid; - border-color: #fff; - border-color: rgba(255, 255, 255, 0.2); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail { - border-color: #000; - border-color: rgba(0, 0, 0, 0.2); -} -/* theme "inset-3", "inset-3-dark" */ -.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.6); -} -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.6); -} -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); -} -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} -/* ---------------------------------------- */ -/* theme "bi-default" */ -.mCS-bi-default { - background-color: #dddddd; -} -.mCS-bi-default .mCSB_scrollTools.mCSB_scrollTools_horizontal { - height: 18px; -} -.mCS-bi-default .mCSB_scrollTools.mCSB_scrollTools_vertical { - width: 18px; -} -.mCS-bi-default .mCSB_scrollTools .mCSB_draggerRail { - border-radius: 0px; -} -.mCS-bi-default .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - border-radius: 2px; -} -.mCS-bi-default .mCSB_scrollTools.mCSB_scrollTools_horizontal a + .mCSB_draggerContainer { - margin: 0 18px; -} -.mCS-bi-default .mCSB_scrollTools.mCSB_scrollTools_vertical a + .mCSB_draggerContainer { - margin: 18px 0; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 14px; - margin: 0 2px; -} -.mCS-bi-default.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 14px; - margin: 2px auto; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_draggerRail { - width: 18px; - height: 100%; - margin: 0; -} -.mCS-bi-default.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 18px; - margin: 0; -} -.mCS-bi-default.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-bi-default.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 14px; -} -.mCS-bi-default.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-bi-default.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 14px; - margin: 2px 0; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #f4f4f4; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_draggerRail { - background-color: #dddddd; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonUp, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonDown, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonRight { - width: 16px; - height: 16px; - background-color: #f4f4f4; - border: 1px solid #eaeaea; - opacity: 1; - filter: alpha(opacity=100); -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonUp { - background-position: -128px -1px; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonDown { - background-position: -128px -21px; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -142px -40px; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonRight { - background-position: -141px -56px; -} -/* ---------------------------------------- */ /* required styles */ .leaflet-pane, .leaflet-tile, @@ -3255,13 +1827,10 @@ website: http://code.google.com/p/jquerytree/ .ztree * { padding: 0; margin: 0; - font-size: 12px; - font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif; } .ztree { margin: 0; padding: 5px; - color: #333333; } .ztree li { padding: 0; @@ -3277,14 +1846,13 @@ website: http://code.google.com/p/jquerytree/ padding: 0 0 0 18px; } .ztree li ul.line { - background: url(icon/tree-vertical-line-1.png) 0 0 repeat-y; + background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-1.png) 0 0 repeat-y; } .ztree li a { padding: 1px 3px 0 0; margin: 0; cursor: pointer; height: 24px; - color: #333; background-color: transparent; text-decoration: none; vertical-align: top; @@ -3343,31 +1911,31 @@ website: http://code.google.com/p/jquerytree/ cursor: auto; } .ztree li span.button.chk.checkbox_false_full { - background-image: url("icon/check-box-normal.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_full_focus { - background-image: url("icon/check-box-normal.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_part { - background-image: url("icon/half_selected.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_part_focus { - background-image: url("icon/half_selected.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_disable { background-position: 0 -56px; } .ztree li span.button.chk.checkbox_true_full { - background-image: url("icon/check-box-active.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_full_focus { - background-image: url("icon/check-box-active.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_part { - background-image: url("icon/half_selected.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_part_focus { - background-image: url("icon/half_selected.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_disable { background-position: -14px -56px; @@ -3407,28 +1975,28 @@ website: http://code.google.com/p/jquerytree/ height: 25px; } .ztree li span.button.root_open { - background-image: url("icon/tree-expand-1.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-1.png"); } .ztree li span.button.root_close { - background-image: url("icon/tree-collapse-1.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-1.png"); } .ztree li span.button.roots_open { - background-image: url("icon/tree-expand-2.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-2.png"); } .ztree li span.button.roots_close { - background-image: url("icon/tree-collapse-2.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-2.png"); } .ztree li span.button.center_open { - background-image: url("icon/tree-expand-3.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-3.png"); } .ztree li span.button.center_close { - background-image: url("icon/tree-collapse-3.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-3.png"); } .ztree li span.button.bottom_open { - background-image: url("icon/tree-expand-4.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-4.png"); } .ztree li span.button.bottom_close { - background-image: url("icon/tree-collapse-4.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-4.png"); } .ztree li span.button.noline_open { background-position: -92px -72px; @@ -3440,13 +2008,13 @@ website: http://code.google.com/p/jquerytree/ background: none; } .ztree li span.button.roots_docu { - background-image: url("icon/tree-vertical-line-2.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); } .ztree li span.button.center_docu { - background-image: url("icon/tree-vertical-line-3.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); } .ztree li span.button.bottom_docu { - background-image: url("icon/tree-vertical-line-4.png"); + background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); } .ztree li span.button.noline_docu { background: none; @@ -3538,6 +2106,40 @@ ul.ztree.zTreeDragUL { /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ +.bi-timeout-toast { + font-size: 14px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + background: #fddddd; + color: #e85050; +} +.bi-timeout-toast .cancel-button { + background: #ffffff; + border: 1px solid #d4dadd; + color: #1a1a1a; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-timeout-toast .cancel-button:hover { + opacity: 0.8; + filter: alpha(opacity=80); +} +.bi-timeout-toast .retry-button { + background: #009de3; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + color: #ffffff; +} +.bi-timeout-toast .retry-button:hover { + opacity: 0.8; + filter: alpha(opacity=80); +} +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ .bi-branch-tree .bi-branch-tree-view { min-width: 300px; } @@ -3637,6 +2239,7 @@ ul.ztree.zTreeDragUL { -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; + color: #1a1a1a; background: #ffffff; } .bi-list-view .list-view-toolbar { @@ -3668,6 +2271,312 @@ ul.ztree.zTreeDragUL { .bi-scroll-view .scroll-drop-down-icon:active { background: #d4dadd; } +.bi-flex-center-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-horizontal-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: flex-start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.bi-flex-horizontal-layout.middle { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-horizontal-layout.bottom { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-vertical-center { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.bi-flex-wrapper-center-layout .flex-wrapper-center-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; + min-width: 100%; + min-height: 100%; + float: left; +} +.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: flex-start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; + min-height: 100%; +} +.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper.middle { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper.bottom { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-wrapper-vertical-center .flex-wrapper-vertical-center-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; + min-height: 100%; + float: left; +} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ diff --git a/dist/core.js b/dist/core.js index 61b8b721e7..918dffeaba 100644 --- a/dist/core.js +++ b/dist/core.js @@ -12906,7 +12906,7 @@ if (!window.BI) { //Utility _.extend(BI, { i18nText: function (key) { - var localeText = key; + var localeText = ""; if (!localeText) { localeText = key; } @@ -12923,7 +12923,7 @@ if (!window.BI) { assert: function (v, is) { if (this.isFunction(is)) { if (!is(v)) { - throw new Error(v + "值不合法"); + throw new Error(v + " error"); } else { return true; } @@ -12932,7 +12932,7 @@ if (!window.BI) { is = [is]; } if (!this.deepContains(is, v)) { - throw new Error(v + "值不合法"); + throw new Error(v + " error"); } }, @@ -12954,9 +12954,33 @@ if (!window.BI) { return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View); }, + createWidget: function (item, options) { + var el; + options || (options = {}); + if (BI.isEmpty(item) && BI.isEmpty(options)) { + return BI.Plugin.getObject("bi.layout", BI.createWidget({ + type: "bi.layout" + })); + } + if (BI.isWidget(item)) { + return item; + } + if (item && (item.type || options.type)) { + el = BI.extend({}, options, item); + return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); + } + if (item && item.el && (item.el.type || options.type)) { + el = BI.extend({}, options, item.el); + return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); + } + if (item && BI.isWidget(item.el)) { + return item.el; + } + }, + createWidgets: function (items, options) { if (!BI.isArray(items)) { - throw new Error("无法根据items创建组件?") + throw new Error("cannot create Widgets") } return BI.map(BI.flatten(items), function (i, item) { return BI.createWidget(item, BI.deepClone(options)); @@ -13127,7 +13151,9 @@ if (!window.BI) { backAny: function (obj, predicate, context) { predicate = BI.iteratee(predicate, context); for (var index = obj.length - 1; index >= 0; index--) { - if (predicate(index, obj[index], obj)) return true; + if (predicate(index, obj[index], obj)) { + return true; + } } return false; }, @@ -13135,7 +13161,9 @@ if (!window.BI) { backEvery: function (obj, predicate, context) { predicate = BI.iteratee(predicate, context); for (var index = obj.length - 1; index >= 0; index--) { - if (!predicate(index, obj[index], obj)) return false; + if (!predicate(index, obj[index], obj)) { + return false; + } } return true; }, @@ -13261,7 +13289,9 @@ if (!window.BI) { }, uniq: function (array, isSorted, iteratee, context) { - if (array == null) return []; + if (array == null) { + return []; + } if (!_.isBoolean(isSorted)) { context = iteratee; iteratee = isSorted; @@ -13423,11 +13453,15 @@ if (!window.BI) { isDeepMatch: function (object, attrs) { var keys = BI.keys(attrs), length = keys.length; - if (object == null) return !length; + if (object == null) { + return !length; + } var obj = Object(object); for (var i = 0; i < length; i++) { var key = keys[i]; - if (!BI.isEqual(attrs[key], obj[key]) || !(key in obj)) return false; + if (!BI.isEqual(attrs[key], obj[key]) || !(key in obj)) { + return false; + } } return true; }, @@ -13453,20 +13487,24 @@ if (!window.BI) { }, deepRemove: function (obj, target) { + var done = false; var i; if (BI.isArray(obj)) { for (i = 0; i < obj.length; i++) { if (BI.isEqual(target, obj[i])) { obj.splice(i--, 1); + done = true; } } } else { BI.each(obj, function (i, v) { if (BI.isEqual(target, obj[i])) { delete obj[i]; + done = true; } }); } + return done; }, deepWithout: function (obj, target) { @@ -13489,8 +13527,14 @@ if (!window.BI) { } }, - deepUniq: function () { - + deepUnique: function (array) { + var result = []; + BI.each(array, function (i, item) { + if (!BI.deepContains(result, item)) { + result.push(item); + } + }); + return result; }, //比较两个对象得出不一样的key值 @@ -13541,31 +13585,54 @@ if (!window.BI) { var copies = callbacks.slice(0); callbacks = []; for (var i = 0; i < copies.length; i++) { - copies[i].func.apply(null, copies[i].args); + copies[i](); } } + if (typeof Promise !== 'undefined') { + var p = Promise.resolve(); + timerFunc = function () { + p.then(nextTickHandler); + } + } else + /* istanbul ignore if */ if (typeof MutationObserver !== 'undefined') { var counter = 1; var observer = new MutationObserver(nextTickHandler); - var textNode = document.createTextNode(counter); + var textNode = document.createTextNode(counter + ""); observer.observe(textNode, { characterData: true }); timerFunc = function () { counter = (counter + 1) % 2; - textNode.data = counter; + textNode.data = counter + ""; } } else { - timerFunc = setTimeout + timerFunc = function () { + setTimeout(nextTickHandler, 0) + } } - return function (cb) { + return function queueNextTick(cb) { + var _resolve; var args = [].slice.call(arguments, 1); - callbacks.push({func: cb, args: args}); - if (pending) return; - pending = true; - timerFunc(nextTickHandler, 0); + callbacks.push(function () { + if (cb) { + cb.apply(null, args); + } + if (_resolve) { + _resolve.apply(null, args); + } + }); + if (!pending) { + pending = true; + timerFunc(); + } + if (!cb && typeof Promise !== 'undefined') { + return new Promise(function (resolve) { + _resolve = resolve + }) + } } })() }); @@ -13599,7 +13666,7 @@ if (!window.BI) { try { return parseInt(number, radix); } catch (e) { - throw new Error("转成int类型失败"); + throw new Error(number + "parse int error"); return NaN; } }, @@ -13608,7 +13675,7 @@ if (!window.BI) { try { return parseFloat(number); } catch (e) { - throw new Error("转成float类型失败"); + throw new Error(number + "parse float error"); return NaN; } }, @@ -13670,9 +13737,9 @@ if (!window.BI) { var sum = 0; BI.each(array, function (i, item) { if (iteratee) { - sum += new Number(iteratee.apply(context, [i, item])); + sum += Number(iteratee.apply(context, [i, item])); } else { - sum += new Number(item); + sum += Number(item); } }); return sum; @@ -13735,6 +13802,10 @@ if (!window.BI) { return BI.isString(str) && BI.isEmpty(str); }, + contentFormat: function () { + return FR.contentFormat.apply(FR, arguments); + }, + /** * 对字符串进行加密 {@link #decrypt} * @static @@ -13848,23 +13919,23 @@ if (!window.BI) { //浏览器相关方法 _.extend(BI, { isIE: function () { - return $.browser.msie; + return /(msie|trident)/i.test(navigator.userAgent.toLowerCase()); }, isChrome: function () { - return $.browser.chrome; + return /chrome/i.test(navigator.userAgent.toLowerCase()); }, isFireFox: function () { - return $.browser.mozilla; + return /firefox/i.test(navigator.userAgent.toLowerCase()); }, isOpera: function () { - return $.browser.opera; + return /opera/i.test(navigator.userAgent.toLowerCase()); }, isSafari: function () { - return $.browser.safari; + return /safari/i.test(navigator.userAgent.toLowerCase()); }, isKhtml: function () { @@ -13898,6 +13969,124 @@ if (!window.BI) { //BI请求 _.extend(BI, { + ajax: (function () { + var loading, timeoutToast; + return function (option) { + option || (option = {}); + option.data = BI.extend({}, Data.SharingPool.cat("urlParameters"), option.data); + //encode + encodeBIParam(option.data); + + var async = true; + if (BI.isNotNull(option.async)) { + async = option.async; + } + + if (BI.isNull(loading)) { + loading = BI.createWidget({ + type: "bi.request_loading" + }); + } + + if (BI.isNull(timeoutToast)) { + timeoutToast = BI.createWidget({ + type: "bi.timeout_toast" + }); + timeoutToast.setCallback(function (op) { + decodeBIParam(op.data); + BI.ajax(op); + }); + } + timeoutToast.addReq(option); + + FR.ajax({ + url: option.url, + type: "POST", + data: option.data, + async: async, + error: function () { + if (!timeoutToast.hasReq(option)) { + return; + } + timeoutToast.removeReq(option); + //失败 取消、重新加载 + loading.setCallback(function () { + decodeBIParam(option.data); + BI.ajax(option); + }); + loading.showError(); + }, + complete: function (res, status) { + if (!timeoutToast.hasReq(option)) { + return; + } + timeoutToast.removeReq(option); + //登录超时 + if (BI.isNotNull(res.responseText) && + res.responseText.indexOf("fs-login-content") > -1 && + res.responseText.indexOf("fs-login-input-password-confirm") === -1) { + if (BI.Popovers.isVisible(BI.LoginTimeOut.POPOVER_ID)) { + return; + } + if (BI.isNotNull(BI.Popovers.get(BI.LoginTimeOut.POPOVER_ID))) { + BI.Popovers.open(BI.LoginTimeOut.POPOVER_ID); + return; + } + var loginTimeout = BI.createWidget({ + type: "bi.login_timeout" + }); + loginTimeout.on(BI.LoginTimeOut.EVENT_LOGIN, function () { + decodeBIParam(option.data); + BI.ajax(option); + BI.Popovers.remove(BI.LoginTimeOut.POPOVER_ID); + }); + BI.Popovers.create(BI.LoginTimeOut.POPOVER_ID, loginTimeout, { + width: 600, + height: 400 + }).open(BI.LoginTimeOut.POPOVER_ID); + } else if (BI.isNotNull(res.responseText) && + res.responseText.indexOf("script") > -1 && + res.responseText.indexOf("Session Timeout...") > -1) { + //登录失效 + loading.setCallback(function () { + location.reload(); + }); + loading.showError(); + + } else if (status === "success" && BI.isFunction(option.success)) { + option.success(FR.jsonDecode(res.responseText)); + } + if (BI.isFunction(option.complete)) { + option.complete(FR.jsonDecode(res.responseText), status); + } + } + }); + + return function cancel() { + timeoutToast.removeReq(option); + }; + + function encodeBIParam(data) { + for (var key in data) { + if (_.isObject(data[key])) { + data[key] = window.encodeURIComponent(FR.jsonEncode(data[key])); + } else { + data[key] = window.encodeURIComponent(data[key]); + } + } + } + + function decodeBIParam(data) { + for (var key in data) { + data[key] = window.decodeURIComponent(data[key]); + if (_.isObject(data[key])) { + data[key] = FR.jsonDecode(data[key]); + } + } + } + } + })(), + /** * 异步ajax请求 * @param {String} op op参数 @@ -13907,38 +14096,29 @@ if (!window.BI) { * @param {Function} complete 回调 */ requestAsync: function (op, cmd, data, callback, complete) { - // if (BI.isNull(BI.REQUEST_LOADING)) { - // BI.REQUEST_LOADING = BI.createWidget({ - // type: "bi.request_loading" - // }); - // } data = data || {}; if (!BI.isKey(op)) { op = 'fr_bi_dezi'; } - if (op === "fr_bi_dezi") { + if (op === "fr_bi_dezi" || op === "fr_bi_configure") { data.sessionID = Data.SharingPool.get("sessionID"); } var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); - (BI.ajax || FR.ajax)({ + return (BI.ajax)({ url: url, type: 'POST', data: data, error: function () { // BI.Msg.toast(BI.i18nText("BI-Ajax_Error")); - //失败 取消、重新加载 - // BI.REQUEST_LOADING.setCallback(function () { - // BI.requestAsync(op, cmd, data, callback, complete); - // }); - // BI.REQUEST_LOADING.showError(); }, - complete: function (res, status) { - if (BI.isFunction(callback) && status === 'success') { - callback(BI.jsonDecode(res.responseText)); - BI.Maskers.hide(BI.RequstLoading.MASK_ID); + success: function (res) { + if (BI.isFunction(callback)) { + callback(res); } + }, + complete: function (res, status) { if (BI.isFunction(complete)) { - complete(); + complete(res); } } }); @@ -13961,7 +14141,7 @@ if (!window.BI) { } var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); var result = {}; - (BI.ajax || FR.ajax)({ + (BI.ajax)({ url: url, type: 'POST', async: false, @@ -13971,7 +14151,7 @@ if (!window.BI) { }, complete: function (res, status) { if (status === 'success') { - result = BI.jsonDecode(res.responseText); + result = res; } } }); diff --git a/src/core/base.js b/src/core/base.js index 0ea04ee91d..aa33e64a39 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -33,7 +33,7 @@ if (!window.BI) { //Utility _.extend(BI, { i18nText: function (key) { - var localeText = FR.i18n[key]; + var localeText = ""; if (!localeText) { localeText = key; } @@ -485,7 +485,11 @@ if (!window.BI) { }, isWidthOrHeight: function (w) { - return FR.isWidthOrHeight(w); + if (typeof w == 'number') { + return w >= 0; + } else if (typeof w == 'string') { + return /^\d{1,3}%$/.exec(w) || w == 'auto' || /^\d+px$/.exec(w); + } }, isNotNull: function (obj) { diff --git a/src/css/base/pager/pager.all.css b/src/css/base/pager/pager.all.css deleted file mode 100644 index 278e4a9b76..0000000000 --- a/src/css/base/pager/pager.all.css +++ /dev/null @@ -1,14 +0,0 @@ -/****添加计算宽度的--运算符直接需要space****/ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ -.bi-all-pager .pager-editor { - background-color: #ffffff; -} -.bi-all-pager .all-pager-prev { - font-size: 16px; - background: #f4f4f4; -} -.bi-all-pager .all-pager-next { - font-size: 16px; - background: #f4f4f4; -} diff --git a/src/css/base/pager/pager.number.css b/src/css/base/pager/pager.number.css deleted file mode 100644 index 637e904e2a..0000000000 --- a/src/css/base/pager/pager.number.css +++ /dev/null @@ -1,11 +0,0 @@ -/****添加计算宽度的--运算符直接需要space****/ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ -.bi-number-pager .number-pager-prev { - font-size: 16px; - background: #f4f4f4; -} -.bi-number-pager .number-pager-next { - font-size: 16px; - background: #f4f4f4; -} diff --git a/src/css/base/pager/pager.skip.css b/src/css/base/pager/pager.skip.css deleted file mode 100644 index 26b5a82aba..0000000000 --- a/src/css/base/pager/pager.skip.css +++ /dev/null @@ -1,11 +0,0 @@ -/****添加计算宽度的--运算符直接需要space****/ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ -.bi-skip-pager .skip-pager-prev { - font-size: 16px; - background: #f4f4f4; -} -.bi-skip-pager .skip-pager-next { - font-size: 16px; - background: #f4f4f4; -} diff --git a/src/css/base/third/jquery.mCustomScrollbar.css b/src/css/base/third/jquery.mCustomScrollbar.css deleted file mode 100644 index b42acb6ec9..0000000000 --- a/src/css/base/third/jquery.mCustomScrollbar.css +++ /dev/null @@ -1,1481 +0,0 @@ -/* -== malihu jquery custom scrollbar plugin == -Plugin URI: http://manos.malihu.gr/jquery-custom-content-scroller -*/ -/* -CONTENTS: - 1. BASIC STYLE - Plugin's basic/essential CSS properties (normally, should not be edited). - 2. VERTICAL SCROLLBAR - Positioning and dimensions of vertical scrollbar. - 3. HORIZONTAL SCROLLBAR - Positioning and dimensions of horizontal scrollbar. - 4. VERTICAL AND HORIZONTAL SCROLLBARS - Positioning and dimensions of 2-axis scrollbars. - 5. TRANSITIONS - CSS3 transitions for hover events, auto-expanded and auto-hidden scrollbars. - 6. SCROLLBAR COLORS, OPACITY AND BACKGROUNDS - 6.1 THEMES - Scrollbar colors, opacity, dimensions, backgrounds etc. via ready-to-use themes. -*/ -/* ------------------------------------------------------------------------------------------------------------------------- -1. BASIC STYLE ------------------------------------------------------------------------------------------------------------------------- -*/ -/****添加计算宽度的--运算符直接需要space****/ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ -.mCustomScrollbar { - -ms-touch-action: pinch-zoom; - touch-action: pinch-zoom; - /* direct pointer events to js */ -} -.mCustomScrollbar.mCS_no_scrollbar, -.mCustomScrollbar.mCS_touch_action { - -ms-touch-action: auto; - touch-action: auto; -} -.mCustomScrollBox { - /* contains plugin's markup */ - position: relative; - overflow: hidden; - height: 100%; - max-width: 100%; - outline: none; - direction: ltr; -} -.mCSB_container { - /* contains the original content */ - overflow: hidden; - width: auto; - height: auto; -} -/* ------------------------------------------------------------------------------------------------------------------------- -2. VERTICAL SCROLLBAR -y-axis ------------------------------------------------------------------------------------------------------------------------- -*/ -.mCSB_inside > .mCSB_container { - margin-right: 30px; -} -.mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden { - margin-right: 0; -} -/* non-visible scrollbar */ -.mCS-dir-rtl > .mCSB_inside > .mCSB_container { - /* RTL direction/left-side scrollbar */ - margin-right: 0; - margin-left: 30px; -} -.mCS-dir-rtl > .mCSB_inside > .mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden { - margin-left: 0; -} -/* RTL direction/left-side scrollbar */ -.mCSB_scrollTools { - /* contains scrollbar markup (draggable element, dragger rail, buttons etc.) */ - position: absolute; - width: 16px; - height: auto; - left: auto; - top: 0; - right: 0; - bottom: 0; -} -.mCSB_outside + .mCSB_scrollTools { - right: -26px; -} -/* scrollbar position: outside */ -.mCS-dir-rtl > .mCSB_inside > .mCSB_scrollTools, -.mCS-dir-rtl > .mCSB_outside + .mCSB_scrollTools { - /* RTL direction/left-side scrollbar */ - right: auto; - left: 0; -} -.mCS-dir-rtl > .mCSB_outside + .mCSB_scrollTools { - left: -26px; -} -/* RTL direction/left-side scrollbar (scrollbar position: outside) */ -.mCSB_scrollTools .mCSB_draggerContainer { - /* contains the draggable element and dragger rail markup */ - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - height: auto; -} -.mCSB_scrollTools a + .mCSB_draggerContainer { - margin: 20px 0; -} -.mCSB_scrollTools .mCSB_draggerRail { - width: 2px; - height: 100%; - margin: 0 auto; - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; -} -.mCSB_scrollTools .mCSB_dragger { - /* the draggable element */ - cursor: pointer; - width: 100%; - height: 30px; - /* minimum dragger height */ - z-index: 1; -} -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - /* the dragger element */ - position: relative; - width: 4px; - height: 100%; - margin: 0 auto; - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; - text-align: center; -} -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - width: 12px; - /* auto-expanded scrollbar */ -} -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 8px; - /* auto-expanded scrollbar */ -} -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown { - display: block; - position: absolute; - height: 20px; - width: 100%; - overflow: hidden; - margin: 0 auto; - cursor: pointer; -} -.mCSB_scrollTools .mCSB_buttonDown { - bottom: 0; -} -/* ------------------------------------------------------------------------------------------------------------------------- -3. HORIZONTAL SCROLLBAR -x-axis ------------------------------------------------------------------------------------------------------------------------- -*/ -.mCSB_horizontal.mCSB_inside > .mCSB_container { - margin-right: 0; - margin-bottom: 30px; -} -.mCSB_horizontal.mCSB_outside > .mCSB_container { - min-height: 100%; -} -.mCSB_horizontal > .mCSB_container.mCS_no_scrollbar_x.mCS_x_hidden { - margin-bottom: 0; -} -/* non-visible scrollbar */ -.mCSB_scrollTools.mCSB_scrollTools_horizontal { - width: auto; - height: 16px; - top: auto; - right: 0; - bottom: 0; - left: 0; -} -.mCustomScrollBox + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal { - bottom: -26px; -} -/* scrollbar position: outside */ -.mCSB_scrollTools.mCSB_scrollTools_horizontal a + .mCSB_draggerContainer { - margin: 0 20px; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 2px; - margin: 7px 0; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 30px; - /* minimum dragger width */ - height: 100%; - left: 0; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 4px; - margin: 6px auto; -} -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - height: 12px; - /* auto-expanded scrollbar */ - margin: 2px auto; -} -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 8px; - /* auto-expanded scrollbar */ - margin: 4px 0; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft, -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight { - display: block; - position: absolute; - width: 20px; - height: 100%; - overflow: hidden; - margin: 0 auto; - cursor: pointer; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft { - left: 0; -} -.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight { - right: 0; -} -/* ------------------------------------------------------------------------------------------------------------------------- -4. VERTICAL AND HORIZONTAL SCROLLBARS -yx-axis ------------------------------------------------------------------------------------------------------------------------- -*/ -.mCSB_container_wrapper { - position: absolute; - height: auto; - width: auto; - overflow: hidden; - top: 0; - left: 0; - right: 0; - bottom: 0; - margin-right: 30px; - margin-bottom: 30px; -} -.mCSB_container_wrapper > .mCSB_container { - padding-right: 30px; - padding-bottom: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.mCSB_vertical_horizontal > .mCSB_scrollTools.mCSB_scrollTools_vertical { - bottom: 20px; -} -.mCSB_vertical_horizontal > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - right: 20px; -} -/* non-visible horizontal scrollbar */ -.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden + .mCSB_scrollTools.mCSB_scrollTools_vertical { - bottom: 0; -} -/* non-visible vertical scrollbar/RTL direction/left-side scrollbar */ -.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden + .mCSB_scrollTools ~ .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - right: 0; -} -/* RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_scrollTools.mCSB_scrollTools_horizontal { - left: 20px; -} -/* non-visible scrollbar/RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden + .mCSB_scrollTools ~ .mCSB_scrollTools.mCSB_scrollTools_horizontal { - left: 0; -} -.mCS-dir-rtl > .mCSB_inside > .mCSB_container_wrapper { - /* RTL direction/left-side scrollbar */ - margin-right: 0; - margin-left: 30px; -} -.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden > .mCSB_container { - padding-right: 0; -} -.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden > .mCSB_container { - padding-bottom: 0; -} -.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden { - margin-right: 0; - /* non-visible scrollbar */ - margin-left: 0; -} -/* non-visible horizontal scrollbar */ -.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden { - margin-bottom: 0; -} -/* ------------------------------------------------------------------------------------------------------------------------- -5. TRANSITIONS ------------------------------------------------------------------------------------------------------------------------- -*/ -.mCSB_scrollTools, -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown, -.mCSB_scrollTools .mCSB_buttonLeft, -.mCSB_scrollTools .mCSB_buttonRight { - -webkit-transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - -moz-transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - -o-transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; -} -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar, -.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar, -.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail { - -webkit-transition: width 0.2s ease-out 0.2s, height 0.2s ease-out 0.2s, margin-left 0.2s ease-out 0.2s, margin-right 0.2s ease-out 0.2s, margin-top 0.2s ease-out 0.2s, margin-bottom 0.2s ease-out 0.2s, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - -moz-transition: width 0.2s ease-out 0.2s, height 0.2s ease-out 0.2s, margin-left 0.2s ease-out 0.2s, margin-right 0.2s ease-out 0.2s, margin-top 0.2s ease-out 0.2s, margin-bottom 0.2s ease-out 0.2s, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - -o-transition: width 0.2s ease-out 0.2s, height 0.2s ease-out 0.2s, margin-left 0.2s ease-out 0.2s, margin-right 0.2s ease-out 0.2s, margin-top 0.2s ease-out 0.2s, margin-bottom 0.2s ease-out 0.2s, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; - transition: width 0.2s ease-out 0.2s, height 0.2s ease-out 0.2s, margin-left 0.2s ease-out 0.2s, margin-right 0.2s ease-out 0.2s, margin-top 0.2s ease-out 0.2s, margin-bottom 0.2s ease-out 0.2s, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out; -} -/* ------------------------------------------------------------------------------------------------------------------------- -6. SCROLLBAR COLORS, OPACITY AND BACKGROUNDS ------------------------------------------------------------------------------------------------------------------------- -*/ -/* ----------------------------------------- -6.1 THEMES ----------------------------------------- -*/ -/* default theme ("light") */ -.mCSB_scrollTools { - opacity: 0.75; - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} -.mCS-autoHide > .mCustomScrollBox > .mCSB_scrollTools, -.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools { - opacity: 0; - filter: "alpha(opacity=0)"; - -ms-filter: "alpha(opacity=0)"; -} -.mCustomScrollbar > .mCustomScrollBox > .mCSB_scrollTools.mCSB_scrollTools_onDrag, -.mCustomScrollbar > .mCustomScrollBox ~ .mCSB_scrollTools.mCSB_scrollTools_onDrag, -.mCustomScrollBox:hover > .mCSB_scrollTools, -.mCustomScrollBox:hover ~ .mCSB_scrollTools, -.mCS-autoHide:hover > .mCustomScrollBox > .mCSB_scrollTools, -.mCS-autoHide:hover > .mCustomScrollBox ~ .mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=100)"; - -ms-filter: "alpha(opacity=100)"; -} -.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.4); - filter: "alpha(opacity=40)"; - -ms-filter: "alpha(opacity=40)"; -} -.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} -.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); - filter: "alpha(opacity=85)"; - -ms-filter: "alpha(opacity=85)"; -} -.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); - filter: "alpha(opacity=90)"; - -ms-filter: "alpha(opacity=90)"; -} -.mCSB_scrollTools .mCSB_buttonUp, -.mCSB_scrollTools .mCSB_buttonDown, -.mCSB_scrollTools .mCSB_buttonLeft, -.mCSB_scrollTools .mCSB_buttonRight { - background-image: url('background/mCSB_buttons.png'); - /* css sprites */ - background-repeat: no-repeat; - opacity: 0.4; - filter: "alpha(opacity=40)"; - -ms-filter: "alpha(opacity=40)"; -} -.mCSB_scrollTools .mCSB_buttonUp { - background-position: 0 0; - /* - sprites locations - light: 0 0, -16px 0, -32px 0, -48px 0, 0 -72px, -16px -72px, -32px -72px - dark: -80px 0, -96px 0, -112px 0, -128px 0, -80px -72px, -96px -72px, -112px -72px - */ -} -.mCSB_scrollTools .mCSB_buttonDown { - background-position: 0 -20px; - /* - sprites locations - light: 0 -20px, -16px -20px, -32px -20px, -48px -20px, 0 -92px, -16px -92px, -32px -92px - dark: -80px -20px, -96px -20px, -112px -20px, -128px -20px, -80px -92px, -96px -92px, -112 -92px - */ -} -.mCSB_scrollTools .mCSB_buttonLeft { - background-position: 0 -40px; - /* - sprites locations - light: 0 -40px, -20px -40px, -40px -40px, -60px -40px, 0 -112px, -20px -112px, -40px -112px - dark: -80px -40px, -100px -40px, -120px -40px, -140px -40px, -80px -112px, -100px -112px, -120px -112px - */ -} -.mCSB_scrollTools .mCSB_buttonRight { - background-position: 0 -56px; - /* - sprites locations - light: 0 -56px, -20px -56px, -40px -56px, -60px -56px, 0 -128px, -20px -128px, -40px -128px - dark: -80px -56px, -100px -56px, -120px -56px, -140px -56px, -80px -128px, -100px -128px, -120px -128px - */ -} -.mCSB_scrollTools .mCSB_buttonUp:hover, -.mCSB_scrollTools .mCSB_buttonDown:hover, -.mCSB_scrollTools .mCSB_buttonLeft:hover, -.mCSB_scrollTools .mCSB_buttonRight:hover { - opacity: 0.75; - filter: "alpha(opacity=75)"; - -ms-filter: "alpha(opacity=75)"; -} -.mCSB_scrollTools .mCSB_buttonUp:active, -.mCSB_scrollTools .mCSB_buttonDown:active, -.mCSB_scrollTools .mCSB_buttonLeft:active, -.mCSB_scrollTools .mCSB_buttonRight:active { - opacity: 0.9; - filter: "alpha(opacity=90)"; - -ms-filter: "alpha(opacity=90)"; -} -/* theme: "dark" */ -.mCS-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} -.mCS-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px 0; -} -.mCS-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -20px; -} -.mCS-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -40px; -} -.mCS-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -56px; -} -/* ---------------------------------------- */ -/* theme: "light-2", "dark-2" */ -.mCS-light-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} -.mCS-light-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} -.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 4px; - margin: 6px auto; -} -.mCS-light-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} -.mCS-light-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-light-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} -.mCS-light-2.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px 0; -} -.mCS-light-2.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -20px; -} -.mCS-light-2.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -40px; -} -.mCS-light-2.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -56px; -} -/* theme: "dark-2" */ -.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px 0; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -20px; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -40px; -} -.mCS-dark-2.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -56px; -} -/* ---------------------------------------- */ -/* theme: "light-thick", "dark-thick" */ -.mCS-light-thick.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail { - width: 4px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 4px; - margin: 6px 0; -} -.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 6px; - margin: 5px auto; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-light-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -16px 0; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -16px -20px; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -20px -40px; -} -.mCS-light-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -20px -56px; -} -/* theme: "dark-thick" */ -.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -96px 0; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -96px -20px; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -100px -40px; -} -.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -100px -56px; -} -/* ---------------------------------------- */ -/* theme: "light-thin", "dark-thin" */ -.mCS-light-thin.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.1); -} -.mCS-light-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 2px; -} -.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; -} -.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 2px; - margin: 7px auto; -} -/* theme "dark-thin" */ -.mCS-dark-thin.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px 0; -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -20px; -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -40px; -} -.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -56px; -} -/* ---------------------------------------- */ -/* theme "rounded", "rounded-dark", "rounded-dots", "rounded-dots-dark" */ -.mCS-rounded.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.15); -} -.mCS-rounded.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger { - height: 14px; -} -.mCS-rounded.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 14px; - margin: 0 1px; -} -.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 14px; -} -.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 14px; - margin: 1px 0; -} -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - width: 16px; - /* auto-expanded scrollbar */ - height: 16px; - margin: -1px 0; -} -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 4px; - /* auto-expanded scrollbar */ -} -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar { - height: 16px; - /* auto-expanded scrollbar */ - width: 16px; - margin: 0 -1px; -} -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 4px; - /* auto-expanded scrollbar */ - margin: 6px 0; -} -.mCS-rounded.mCSB_scrollTools .mCSB_buttonUp { - background-position: 0 -72px; -} -.mCS-rounded.mCSB_scrollTools .mCSB_buttonDown { - background-position: 0 -92px; -} -.mCS-rounded.mCSB_scrollTools .mCSB_buttonLeft { - background-position: 0 -112px; -} -.mCS-rounded.mCSB_scrollTools .mCSB_buttonRight { - background-position: 0 -128px; -} -/* theme "rounded-dark", "rounded-dots-dark" */ -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.15); -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -80px -72px; -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -80px -92px; -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -80px -112px; -} -.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -80px -128px; -} -/* theme "rounded-dots", "rounded-dots-dark" */ -.mCS-rounded-dots.mCSB_scrollTools_vertical .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_vertical .mCSB_draggerRail { - width: 4px; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - background-color: transparent; - background-position: center; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAANElEQVQYV2NkIAAYiVbw//9/Y6DiM1ANJoyMjGdBbLgJQAX/kU0DKgDLkaQAvxW4HEvQFwCRcxIJK1XznAAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - opacity: 0.3; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} -.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - height: 4px; - margin: 6px 0; - background-repeat: repeat-x; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonUp { - background-position: -16px -72px; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonDown { - background-position: -16px -92px; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -20px -112px; -} -.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonRight { - background-position: -20px -128px; -} -/* theme "rounded-dots-dark" */ -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYV2NkIAAYSVFgDFR8BqrBBEifBbGRTfiPZhpYjiQFBK3A6l6CvgAAE9kGCd1mvgEAAAAASUVORK5CYII="); -} -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -96px -72px; -} -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -96px -92px; -} -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -100px -112px; -} -.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -100px -128px; -} -/* ---------------------------------------- */ -/* theme "3d", "3d-dark", "3d-thick", "3d-thick-dark" */ -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-repeat: repeat-y; - background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0.5)), color-stop(100%, rgba(255, 255, 255, 0))); - background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -o-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: linear-gradient(to right, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); -} -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - background-repeat: repeat-x; - background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 0.5)), color-stop(100%, rgba(255, 255, 255, 0))); - background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); - background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%); -} -/* theme "3d", "3d-dark" */ -.mCS-3d.mCSB_scrollTools_vertical .mCSB_dragger, -.mCS-3d-dark.mCSB_scrollTools_vertical .mCSB_dragger { - height: 70px; -} -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 70px; -} -.mCS-3d.mCSB_scrollTools, -.mCS-3d-dark.mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} -.mCS-3d.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; -} -.mCS-3d.mCSB_scrollTools .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail { - width: 8px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5), inset -1px 0 1px rgba(255, 255, 255, 0.2); -} -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #555; -} -.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 8px; -} -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 8px; - margin: 4px 0; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5), inset 0 -1px 1px rgba(255, 255, 255, 0.2); -} -.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 8px; - margin: 4px auto; -} -.mCS-3d.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} -.mCS-3d.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} -.mCS-3d.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} -.mCS-3d.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} -/* theme "3d-dark" */ -.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.1); -} -.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1); -} -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} -.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} -/* ---------------------------------------- */ -/* theme: "3d-thick", "3d-thick-dark" */ -.mCS-3d-thick.mCSB_scrollTools, -.mCS-3d-thick-dark.mCSB_scrollTools { - opacity: 1; - filter: "alpha(opacity=30)"; - -ms-filter: "alpha(opacity=30)"; -} -.mCS-3d-thick.mCSB_scrollTools, -.mCS-3d-thick-dark.mCSB_scrollTools, -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer { - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.mCSB_inside + .mCS-3d-thick.mCSB_scrollTools_vertical, -.mCSB_inside + .mCS-3d-thick-dark.mCSB_scrollTools_vertical { - right: 1px; -} -.mCS-3d-thick.mCSB_scrollTools_vertical, -.mCS-3d-thick-dark.mCSB_scrollTools_vertical { - box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.5); -} -.mCS-3d-thick.mCSB_scrollTools_horizontal, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal { - bottom: 1px; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.5); -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.4); - width: 12px; - margin: 2px; - position: absolute; - height: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #555; -} -.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 12px; - width: auto; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer { - background-color: #000; - background-color: rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 1px 16px rgba(0, 0, 0, 0.1); -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} -.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} -/* theme: "3d-thick-dark" */ -.mCS-3d-thick-dark.mCSB_scrollTools { - box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.2); -} -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 0 14px rgba(0, 0, 0, 0.2); -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.4), inset -1px 0 0 rgba(0, 0, 0, 0.2); -} -.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.2); -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #777; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer { - background-color: #fff; - background-color: rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 1px 16px rgba(0, 0, 0, 0.1); -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} -.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} -/* ---------------------------------------- */ -/* theme: "minimal", "minimal-dark" */ -.mCSB_outside + .mCS-minimal.mCSB_scrollTools_vertical, -.mCSB_outside + .mCS-minimal-dark.mCSB_scrollTools_vertical { - right: 0; - margin: 12px 0; -} -.mCustomScrollBox.mCS-minimal + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal-dark + .mCSB_scrollTools.mCSB_scrollTools_horizontal, -.mCustomScrollBox.mCS-minimal-dark + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal { - bottom: 0; - margin: 0 12px; -} -/* RTL direction/left-side scrollbar */ -.mCS-dir-rtl > .mCSB_outside + .mCS-minimal.mCSB_scrollTools_vertical, -.mCS-dir-rtl > .mCSB_outside + .mCS-minimal-dark.mCSB_scrollTools_vertical { - left: 0; - right: auto; -} -.mCS-minimal.mCSB_scrollTools .mCSB_draggerRail, -.mCS-minimal-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; -} -.mCS-minimal.mCSB_scrollTools_vertical .mCSB_dragger, -.mCS-minimal-dark.mCSB_scrollTools_vertical .mCSB_dragger { - height: 50px; -} -.mCS-minimal.mCSB_scrollTools_horizontal .mCSB_dragger, -.mCS-minimal-dark.mCSB_scrollTools_horizontal .mCSB_dragger { - width: 50px; -} -.mCS-minimal.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.2); - filter: "alpha(opacity=20)"; - -ms-filter: "alpha(opacity=20)"; -} -.mCS-minimal.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-minimal.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.5); - filter: "alpha(opacity=50)"; - -ms-filter: "alpha(opacity=50)"; -} -/* theme: "minimal-dark" */ -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); - filter: "alpha(opacity=20)"; - -ms-filter: "alpha(opacity=20)"; -} -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.5); - filter: "alpha(opacity=50)"; - -ms-filter: "alpha(opacity=50)"; -} -/* ---------------------------------------- */ -/* theme "light-3", "dark-3" */ -.mCS-light-3.mCSB_scrollTools .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail { - width: 6px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); -} -.mCS-light-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; -} -.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 6px; - margin: 5px 0; -} -.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 12px; -} -.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 12px; - margin: 2px 0; -} -.mCS-light-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} -.mCS-light-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} -.mCS-light-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} -.mCS-light-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} -/* theme "dark-3" */ -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-dark-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); -} -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} -.mCS-dark-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} -/* ---------------------------------------- */ -/* theme "inset", "inset-dark", "inset-2", "inset-2-dark", "inset-3", "inset-3-dark" */ -.mCS-inset.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - width: 12px; - background-color: #000; - background-color: rgba(0, 0, 0, 0.2); -} -.mCS-inset.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 6px; - margin: 3px 5px; - position: absolute; - height: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.mCS-inset.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - height: 6px; - margin: 5px 3px; - position: absolute; - width: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.mCS-inset.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 12px; - margin: 2px 0; -} -.mCS-inset.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonUp { - background-position: -32px -72px; -} -.mCS-inset.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonDown { - background-position: -32px -92px; -} -.mCS-inset.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -40px -112px; -} -.mCS-inset.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-2.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-3.mCSB_scrollTools .mCSB_buttonRight { - background-position: -40px -128px; -} -/* theme "inset-dark", "inset-2-dark", "inset-3-dark" */ -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.1); -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonUp, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonUp { - background-position: -112px -72px; -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonDown, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonDown { - background-position: -112px -92px; -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -120px -112px; -} -.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonRight, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonRight { - background-position: -120px -128px; -} -/* theme "inset-2", "inset-2-dark" */ -.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail, -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: transparent; - border-width: 1px; - border-style: solid; - border-color: #fff; - border-color: rgba(255, 255, 255, 0.2); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail { - border-color: #000; - border-color: rgba(0, 0, 0, 0.2); -} -/* theme "inset-3", "inset-3-dark" */ -.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.6); -} -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail { - background-color: #000; - background-color: rgba(0, 0, 0, 0.6); -} -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.75); -} -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.85); -} -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #000; - background-color: rgba(0, 0, 0, 0.9); -} -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.75); -} -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.85); -} -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar, -.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar { - background-color: #fff; - background-color: rgba(255, 255, 255, 0.9); -} -/* ---------------------------------------- */ -/* theme "bi-default" */ -.mCS-bi-default { - background-color: #dddddd; -} -.mCS-bi-default .mCSB_scrollTools.mCSB_scrollTools_horizontal { - height: 18px; -} -.mCS-bi-default .mCSB_scrollTools.mCSB_scrollTools_vertical { - width: 18px; -} -.mCS-bi-default .mCSB_scrollTools .mCSB_draggerRail { - border-radius: 0px; -} -.mCS-bi-default .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - border-radius: 2px; -} -.mCS-bi-default .mCSB_scrollTools.mCSB_scrollTools_horizontal a + .mCSB_draggerContainer { - margin: 0 18px; -} -.mCS-bi-default .mCSB_scrollTools.mCSB_scrollTools_vertical a + .mCSB_draggerContainer { - margin: 18px 0; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - width: 14px; - margin: 0 2px; -} -.mCS-bi-default.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { - width: 100%; - height: 14px; - margin: 2px auto; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_draggerRail { - width: 18px; - height: 100%; - margin: 0; -} -.mCS-bi-default.mCSB_scrollTools_horizontal .mCSB_draggerRail { - width: 100%; - height: 18px; - margin: 0; -} -.mCS-bi-default.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-bi-default.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - width: 14px; -} -.mCS-bi-default.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, -.mCS-bi-default.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail { - height: 14px; - margin: 2px 0; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { - background-color: #f4f4f4; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_draggerRail { - background-color: #dddddd; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonUp, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonDown, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonLeft, -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonRight { - width: 16px; - height: 16px; - background-color: #f4f4f4; - border: 1px solid #eaeaea; - opacity: 1; - filter: alpha(opacity=100); -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonUp { - background-position: -128px -1px; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonDown { - background-position: -128px -21px; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonLeft { - background-position: -142px -40px; -} -.mCS-bi-default.mCSB_scrollTools .mCSB_buttonRight { - background-position: -141px -56px; -} -/* ---------------------------------------- */ From 47ab82194994dc3e4087e675e84ab338db006dbe Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 22 Mar 2017 15:19:47 +0800 Subject: [PATCH 09/19] update --- dist/icon/bubble_no_projector.png | Bin 0 -> 3106 bytes dist/icon/bubble_projector.png | Bin 0 -> 3290 bytes dist/icon/business_package.png | Bin 0 -> 559 bytes dist/icon/business_package_add.png | Bin 0 -> 525 bytes dist/icon/business_package_add_disable.png | Bin 0 -> 502 bytes dist/icon/chartsetting/address_marker_big.png | Bin 0 -> 3465 bytes .../icon/chartsetting/address_marker_small.png | Bin 0 -> 3224 bytes dist/icon/chartsetting/icon_bubble_3d.png | Bin 0 -> 694 bytes dist/icon/chartsetting/icon_bubble_normal.png | Bin 0 -> 400 bytes dist/icon/chartsetting/icon_dashboard_1.png | Bin 0 -> 868 bytes dist/icon/chartsetting/icon_dashboard_2.png | Bin 0 -> 769 bytes dist/icon/chartsetting/icon_dashboard_3.png | Bin 0 -> 971 bytes dist/icon/chartsetting/icon_dashboard_4.png | Bin 0 -> 3298 bytes dist/icon/chartsetting/icon_dashboard_5.png | Bin 0 -> 3362 bytes dist/icon/chartsetting/icon_dashboard_6.png | Bin 0 -> 386 bytes dist/icon/chartsetting/icon_dashboard_7.png | Bin 0 -> 329 bytes .../chartsetting/icon_gradual_highlight.png | Bin 0 -> 556 bytes .../icon_multi_pie_gradient_darker.png | Bin 0 -> 514 bytes .../icon_multi_pie_gradient_lighter.png | Bin 0 -> 523 bytes dist/icon/chartsetting/icon_style_3d.png | Bin 0 -> 256 bytes .../icon_style_acc_radar_circle.png | Bin 0 -> 1057 bytes .../icon_style_acc_radar_polygon.png | Bin 0 -> 1124 bytes .../chartsetting/icon_style_area_broken.png | Bin 0 -> 369 bytes .../chartsetting/icon_style_area_curve.png | Bin 0 -> 391 bytes .../chartsetting/icon_style_area_vertical.png | Bin 0 -> 210 bytes dist/icon/chartsetting/icon_style_gradual.png | Bin 0 -> 290 bytes .../chartsetting/icon_style_line_broken.png | Bin 0 -> 356 bytes .../chartsetting/icon_style_line_curve.png | Bin 0 -> 366 bytes .../chartsetting/icon_style_line_vertical.png | Bin 0 -> 208 bytes dist/icon/chartsetting/icon_style_normal.png | Bin 0 -> 179 bytes .../icon_style_pie_equal_arc_rose.png | Bin 0 -> 347 bytes .../chartsetting/icon_style_pie_normal.png | Bin 0 -> 432 bytes .../icon_style_pie_not_equal_arc_rose.png | Bin 0 -> 413 bytes .../chartsetting/icon_style_radar_circle.png | Bin 0 -> 793 bytes .../chartsetting/icon_style_radar_polygon.png | Bin 0 -> 826 bytes .../chartsetting/icon_style_transparent.png | Bin 0 -> 195 bytes dist/icon/check-box-active.png | Bin 0 -> 302 bytes dist/icon/check-box-disable2.png | Bin 0 -> 303 bytes dist/icon/dots.png | Bin 0 -> 2834 bytes dist/icon/drag/icon_area.png | Bin 0 -> 666 bytes dist/icon/drag/icon_area_a.png | Bin 0 -> 594 bytes dist/icon/drag/icon_area_c.png | Bin 0 -> 459 bytes dist/icon/drag/icon_area_pa.png | Bin 0 -> 475 bytes dist/icon/drag/icon_area_r.png | Bin 0 -> 569 bytes dist/icon/drag/icon_axis.png | Bin 0 -> 218 bytes dist/icon/drag/icon_axis_a.png | Bin 0 -> 205 bytes dist/icon/drag/icon_axis_c.png | Bin 0 -> 224 bytes dist/icon/drag/icon_axis_f.png | Bin 0 -> 196 bytes dist/icon/drag/icon_axis_pa.png | Bin 0 -> 202 bytes dist/icon/drag/icon_bar.png | Bin 0 -> 222 bytes dist/icon/drag/icon_bar_a.png | Bin 0 -> 199 bytes dist/icon/drag/icon_bar_c.png | Bin 0 -> 191 bytes dist/icon/drag/icon_bubble.png | Bin 0 -> 372 bytes dist/icon/drag/icon_bubble_f.png | Bin 0 -> 352 bytes dist/icon/drag/icon_combine.png | Bin 0 -> 424 bytes dist/icon/drag/icon_combine_m.png | Bin 0 -> 431 bytes dist/icon/drag/icon_complex.png | Bin 0 -> 208 bytes dist/icon/drag/icon_cross.png | Bin 0 -> 214 bytes dist/icon/drag/icon_dashboard.png | Bin 0 -> 865 bytes dist/icon/drag/icon_donut.png | Bin 0 -> 510 bytes dist/icon/drag/icon_funnel.png | Bin 0 -> 284 bytes dist/icon/drag/icon_group.png | Bin 0 -> 221 bytes dist/icon/drag/icon_line.png | Bin 0 -> 504 bytes dist/icon/drag/icon_map_c.png | Bin 0 -> 403 bytes dist/icon/drag/icon_map_g.png | Bin 0 -> 452 bytes dist/icon/drag/icon_map_gis.png | Bin 0 -> 438 bytes dist/icon/drag/icon_map_s.png | Bin 0 -> 311 bytes dist/icon/drag/icon_multi_pie.png | Bin 0 -> 625 bytes dist/icon/drag/icon_multi_pie_lighter.png | Bin 0 -> 523 bytes dist/icon/drag/icon_multi_pie_thicker.png | Bin 0 -> 514 bytes dist/icon/drag/icon_pie.png | Bin 0 -> 432 bytes dist/icon/drag/icon_radar.png | Bin 0 -> 826 bytes dist/icon/drag/icon_radar_a.png | Bin 0 -> 1124 bytes dist/icon/drag/icon_rect_tree.png | Bin 0 -> 242 bytes dist/icon/drag/icon_scatter.png | Bin 0 -> 176 bytes dist/icon/drag/pure/icon_date.png | Bin 0 -> 2876 bytes dist/icon/drag/pure/icon_date_range.png | Bin 0 -> 195 bytes dist/icon/drag/pure/icon_detail.png | Bin 0 -> 160 bytes dist/icon/drag/pure/icon_image.png | Bin 0 -> 409 bytes dist/icon/drag/pure/icon_input.png | Bin 0 -> 191 bytes dist/icon/drag/pure/icon_interval_slider.png | Bin 0 -> 236 bytes dist/icon/drag/pure/icon_list_label.png | Bin 0 -> 169 bytes dist/icon/drag/pure/icon_more.png | Bin 0 -> 238 bytes dist/icon/drag/pure/icon_number.png | Bin 0 -> 205 bytes dist/icon/drag/pure/icon_query.png | Bin 0 -> 247 bytes dist/icon/drag/pure/icon_query_g.png | Bin 0 -> 223 bytes dist/icon/drag/pure/icon_reset.png | Bin 0 -> 256 bytes dist/icon/drag/pure/icon_reuse.png | Bin 0 -> 171 bytes dist/icon/drag/pure/icon_single_slider.png | Bin 0 -> 229 bytes dist/icon/drag/pure/icon_string.png | Bin 0 -> 198 bytes dist/icon/drag/pure/icon_string_list.png | Bin 0 -> 183 bytes dist/icon/drag/pure/icon_tree.png | Bin 0 -> 278 bytes dist/icon/drag/pure/icon_tree_label.png | Bin 0 -> 176 bytes dist/icon/drag/pure/icon_tree_list.png | Bin 0 -> 181 bytes dist/icon/drag/pure/icon_web.png | Bin 0 -> 210 bytes dist/icon/drag/pure/icon_year.png | Bin 0 -> 223 bytes dist/icon/drag/pure/icon_year_m.png | Bin 0 -> 235 bytes dist/icon/drag/pure/icon_year_m_d.png | Bin 0 -> 234 bytes dist/icon/drag/pure/icon_year_s.png | Bin 0 -> 232 bytes dist/icon/drag/small/icin_select_tab.png | Bin 0 -> 263 bytes dist/icon/drag/small/icon_area.png | Bin 0 -> 3353 bytes dist/icon/drag/small/icon_area_a.png | Bin 0 -> 3240 bytes dist/icon/drag/small/icon_area_c.png | Bin 0 -> 3294 bytes dist/icon/drag/small/icon_area_pa.png | Bin 0 -> 3242 bytes dist/icon/drag/small/icon_area_r.png | Bin 0 -> 3242 bytes dist/icon/drag/small/icon_axis.png | Bin 0 -> 3203 bytes dist/icon/drag/small/icon_axis_a.png | Bin 0 -> 3184 bytes dist/icon/drag/small/icon_axis_c.png | Bin 0 -> 3307 bytes dist/icon/drag/small/icon_axis_f.png | Bin 0 -> 3117 bytes dist/icon/drag/small/icon_axis_pa.png | Bin 0 -> 3184 bytes dist/icon/drag/small/icon_bar.png | Bin 0 -> 3196 bytes dist/icon/drag/small/icon_bar_a.png | Bin 0 -> 3168 bytes dist/icon/drag/small/icon_bar_c.png | Bin 0 -> 3036 bytes dist/icon/drag/small/icon_bubble.png | Bin 0 -> 3191 bytes dist/icon/drag/small/icon_bubble_f.png | Bin 0 -> 3257 bytes dist/icon/drag/small/icon_combine.png | Bin 0 -> 3339 bytes dist/icon/drag/small/icon_combine_m.png | Bin 0 -> 3341 bytes dist/icon/drag/small/icon_complex.png | Bin 0 -> 2999 bytes dist/icon/drag/small/icon_cross.png | Bin 0 -> 3032 bytes dist/icon/drag/small/icon_dashboard.png | Bin 0 -> 3546 bytes dist/icon/drag/small/icon_detail.png | Bin 0 -> 2977 bytes dist/icon/drag/small/icon_donut.png | Bin 0 -> 3269 bytes dist/icon/drag/small/icon_funnel.png | Bin 0 -> 274 bytes .../drag/small/icon_funnel_not_continue.png | Bin 0 -> 271 bytes dist/icon/drag/small/icon_gis.png | Bin 0 -> 3033 bytes dist/icon/drag/small/icon_group.png | Bin 0 -> 2994 bytes dist/icon/drag/small/icon_image.png | Bin 0 -> 3172 bytes dist/icon/drag/small/icon_input.png | Bin 0 -> 2982 bytes dist/icon/drag/small/icon_interval_slider.png | Bin 0 -> 301 bytes dist/icon/drag/small/icon_line.png | Bin 0 -> 3367 bytes dist/icon/drag/small/icon_map_c.png | Bin 0 -> 3043 bytes dist/icon/drag/small/icon_map_g.png | Bin 0 -> 3083 bytes dist/icon/drag/small/icon_map_s.png | Bin 0 -> 2978 bytes dist/icon/drag/small/icon_multi_pie.png | Bin 0 -> 474 bytes dist/icon/drag/small/icon_multi_select.png | Bin 0 -> 267 bytes dist/icon/drag/small/icon_multi_tree.png | Bin 0 -> 262 bytes dist/icon/drag/small/icon_number_interval.png | Bin 0 -> 306 bytes dist/icon/drag/small/icon_pie.png | Bin 0 -> 3217 bytes dist/icon/drag/small/icon_radar.png | Bin 0 -> 3486 bytes dist/icon/drag/small/icon_radar_a.png | Bin 0 -> 3555 bytes dist/icon/drag/small/icon_rect_tree.png | Bin 0 -> 218 bytes dist/icon/drag/small/icon_scatter.png | Bin 0 -> 2901 bytes dist/icon/drag/small/icon_single_slider.png | Bin 0 -> 295 bytes dist/icon/drag/small/icon_string_label.png | Bin 0 -> 208 bytes dist/icon/drag/small/icon_string_list.png | Bin 0 -> 212 bytes dist/icon/drag/small/icon_tree_label.png | Bin 0 -> 257 bytes dist/icon/drag/small/icon_tree_list.png | Bin 0 -> 219 bytes dist/icon/drag/small/icon_web.png | Bin 0 -> 3058 bytes dist/icon/drag_helper.png | Bin 0 -> 3585 bytes dist/icon/example.png | Bin 0 -> 190645 bytes dist/icon/half_selected.png | Bin 0 -> 2881 bytes dist/icon/icon_down_arrow.png | Bin 0 -> 203 bytes dist/icon/inner-join.png | Bin 0 -> 255 bytes dist/icon/left-join.png | Bin 0 -> 250 bytes dist/icon/loading.gif | Bin 381 -> 1810 bytes dist/icon/loading_bar.gif | Bin 0 -> 5886 bytes dist/icon/no_auth.png | Bin 0 -> 1864 bytes dist/icon/no_data.png | Bin 0 -> 4286 bytes dist/icon/outer-join.png | Bin 0 -> 256 bytes dist/icon/package_selected.png | Bin 0 -> 367 bytes dist/icon/push_down.png | Bin 0 -> 200 bytes dist/icon/push_up.png | Bin 0 -> 199 bytes dist/icon/radio-active.png | Bin 0 -> 296 bytes dist/icon/radio-disable.png | Bin 0 -> 361 bytes dist/icon/radio-disable2.png | Bin 0 -> 319 bytes dist/icon/radio-normal.png | Bin 0 -> 357 bytes dist/icon/real_time.png | Bin 0 -> 4802 bytes dist/icon/report.png | Bin 0 -> 676 bytes dist/icon/right-join.png | Bin 0 -> 251 bytes dist/icon/slider-active.png | Bin 0 -> 416 bytes dist/icon/slider-normal.png | Bin 0 -> 425 bytes dist/icon/table_style_1.png | Bin 0 -> 211 bytes dist/icon/table_style_2.png | Bin 0 -> 211 bytes dist/icon/table_style_3.png | Bin 0 -> 260 bytes dist/icon/test_fail.png | Bin 0 -> 3724 bytes dist/icon/test_success.png | Bin 0 -> 1201 bytes dist/icon/union.png | Bin 0 -> 226 bytes 177 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 dist/icon/bubble_no_projector.png create mode 100644 dist/icon/bubble_projector.png create mode 100644 dist/icon/business_package.png create mode 100644 dist/icon/business_package_add.png create mode 100644 dist/icon/business_package_add_disable.png create mode 100644 dist/icon/chartsetting/address_marker_big.png create mode 100644 dist/icon/chartsetting/address_marker_small.png create mode 100644 dist/icon/chartsetting/icon_bubble_3d.png create mode 100644 dist/icon/chartsetting/icon_bubble_normal.png create mode 100644 dist/icon/chartsetting/icon_dashboard_1.png create mode 100644 dist/icon/chartsetting/icon_dashboard_2.png create mode 100644 dist/icon/chartsetting/icon_dashboard_3.png create mode 100644 dist/icon/chartsetting/icon_dashboard_4.png create mode 100644 dist/icon/chartsetting/icon_dashboard_5.png create mode 100644 dist/icon/chartsetting/icon_dashboard_6.png create mode 100644 dist/icon/chartsetting/icon_dashboard_7.png create mode 100644 dist/icon/chartsetting/icon_gradual_highlight.png create mode 100644 dist/icon/chartsetting/icon_multi_pie_gradient_darker.png create mode 100644 dist/icon/chartsetting/icon_multi_pie_gradient_lighter.png create mode 100644 dist/icon/chartsetting/icon_style_3d.png create mode 100644 dist/icon/chartsetting/icon_style_acc_radar_circle.png create mode 100644 dist/icon/chartsetting/icon_style_acc_radar_polygon.png create mode 100644 dist/icon/chartsetting/icon_style_area_broken.png create mode 100644 dist/icon/chartsetting/icon_style_area_curve.png create mode 100644 dist/icon/chartsetting/icon_style_area_vertical.png create mode 100644 dist/icon/chartsetting/icon_style_gradual.png create mode 100644 dist/icon/chartsetting/icon_style_line_broken.png create mode 100644 dist/icon/chartsetting/icon_style_line_curve.png create mode 100644 dist/icon/chartsetting/icon_style_line_vertical.png create mode 100644 dist/icon/chartsetting/icon_style_normal.png create mode 100644 dist/icon/chartsetting/icon_style_pie_equal_arc_rose.png create mode 100644 dist/icon/chartsetting/icon_style_pie_normal.png create mode 100644 dist/icon/chartsetting/icon_style_pie_not_equal_arc_rose.png create mode 100644 dist/icon/chartsetting/icon_style_radar_circle.png create mode 100644 dist/icon/chartsetting/icon_style_radar_polygon.png create mode 100644 dist/icon/chartsetting/icon_style_transparent.png create mode 100644 dist/icon/check-box-active.png create mode 100644 dist/icon/check-box-disable2.png create mode 100644 dist/icon/dots.png create mode 100644 dist/icon/drag/icon_area.png create mode 100644 dist/icon/drag/icon_area_a.png create mode 100644 dist/icon/drag/icon_area_c.png create mode 100644 dist/icon/drag/icon_area_pa.png create mode 100644 dist/icon/drag/icon_area_r.png create mode 100644 dist/icon/drag/icon_axis.png create mode 100644 dist/icon/drag/icon_axis_a.png create mode 100644 dist/icon/drag/icon_axis_c.png create mode 100644 dist/icon/drag/icon_axis_f.png create mode 100644 dist/icon/drag/icon_axis_pa.png create mode 100644 dist/icon/drag/icon_bar.png create mode 100644 dist/icon/drag/icon_bar_a.png create mode 100644 dist/icon/drag/icon_bar_c.png create mode 100644 dist/icon/drag/icon_bubble.png create mode 100644 dist/icon/drag/icon_bubble_f.png create mode 100644 dist/icon/drag/icon_combine.png create mode 100644 dist/icon/drag/icon_combine_m.png create mode 100644 dist/icon/drag/icon_complex.png create mode 100644 dist/icon/drag/icon_cross.png create mode 100644 dist/icon/drag/icon_dashboard.png create mode 100644 dist/icon/drag/icon_donut.png create mode 100644 dist/icon/drag/icon_funnel.png create mode 100644 dist/icon/drag/icon_group.png create mode 100644 dist/icon/drag/icon_line.png create mode 100644 dist/icon/drag/icon_map_c.png create mode 100644 dist/icon/drag/icon_map_g.png create mode 100644 dist/icon/drag/icon_map_gis.png create mode 100644 dist/icon/drag/icon_map_s.png create mode 100644 dist/icon/drag/icon_multi_pie.png create mode 100644 dist/icon/drag/icon_multi_pie_lighter.png create mode 100644 dist/icon/drag/icon_multi_pie_thicker.png create mode 100644 dist/icon/drag/icon_pie.png create mode 100644 dist/icon/drag/icon_radar.png create mode 100644 dist/icon/drag/icon_radar_a.png create mode 100644 dist/icon/drag/icon_rect_tree.png create mode 100644 dist/icon/drag/icon_scatter.png create mode 100644 dist/icon/drag/pure/icon_date.png create mode 100644 dist/icon/drag/pure/icon_date_range.png create mode 100644 dist/icon/drag/pure/icon_detail.png create mode 100644 dist/icon/drag/pure/icon_image.png create mode 100644 dist/icon/drag/pure/icon_input.png create mode 100644 dist/icon/drag/pure/icon_interval_slider.png create mode 100644 dist/icon/drag/pure/icon_list_label.png create mode 100644 dist/icon/drag/pure/icon_more.png create mode 100644 dist/icon/drag/pure/icon_number.png create mode 100644 dist/icon/drag/pure/icon_query.png create mode 100644 dist/icon/drag/pure/icon_query_g.png create mode 100644 dist/icon/drag/pure/icon_reset.png create mode 100644 dist/icon/drag/pure/icon_reuse.png create mode 100644 dist/icon/drag/pure/icon_single_slider.png create mode 100644 dist/icon/drag/pure/icon_string.png create mode 100644 dist/icon/drag/pure/icon_string_list.png create mode 100644 dist/icon/drag/pure/icon_tree.png create mode 100644 dist/icon/drag/pure/icon_tree_label.png create mode 100644 dist/icon/drag/pure/icon_tree_list.png create mode 100644 dist/icon/drag/pure/icon_web.png create mode 100644 dist/icon/drag/pure/icon_year.png create mode 100644 dist/icon/drag/pure/icon_year_m.png create mode 100644 dist/icon/drag/pure/icon_year_m_d.png create mode 100644 dist/icon/drag/pure/icon_year_s.png create mode 100644 dist/icon/drag/small/icin_select_tab.png create mode 100644 dist/icon/drag/small/icon_area.png create mode 100644 dist/icon/drag/small/icon_area_a.png create mode 100644 dist/icon/drag/small/icon_area_c.png create mode 100644 dist/icon/drag/small/icon_area_pa.png create mode 100644 dist/icon/drag/small/icon_area_r.png create mode 100644 dist/icon/drag/small/icon_axis.png create mode 100644 dist/icon/drag/small/icon_axis_a.png create mode 100644 dist/icon/drag/small/icon_axis_c.png create mode 100644 dist/icon/drag/small/icon_axis_f.png create mode 100644 dist/icon/drag/small/icon_axis_pa.png create mode 100644 dist/icon/drag/small/icon_bar.png create mode 100644 dist/icon/drag/small/icon_bar_a.png create mode 100644 dist/icon/drag/small/icon_bar_c.png create mode 100644 dist/icon/drag/small/icon_bubble.png create mode 100644 dist/icon/drag/small/icon_bubble_f.png create mode 100644 dist/icon/drag/small/icon_combine.png create mode 100644 dist/icon/drag/small/icon_combine_m.png create mode 100644 dist/icon/drag/small/icon_complex.png create mode 100644 dist/icon/drag/small/icon_cross.png create mode 100644 dist/icon/drag/small/icon_dashboard.png create mode 100644 dist/icon/drag/small/icon_detail.png create mode 100644 dist/icon/drag/small/icon_donut.png create mode 100644 dist/icon/drag/small/icon_funnel.png create mode 100644 dist/icon/drag/small/icon_funnel_not_continue.png create mode 100644 dist/icon/drag/small/icon_gis.png create mode 100644 dist/icon/drag/small/icon_group.png create mode 100644 dist/icon/drag/small/icon_image.png create mode 100644 dist/icon/drag/small/icon_input.png create mode 100644 dist/icon/drag/small/icon_interval_slider.png create mode 100644 dist/icon/drag/small/icon_line.png create mode 100644 dist/icon/drag/small/icon_map_c.png create mode 100644 dist/icon/drag/small/icon_map_g.png create mode 100644 dist/icon/drag/small/icon_map_s.png create mode 100644 dist/icon/drag/small/icon_multi_pie.png create mode 100644 dist/icon/drag/small/icon_multi_select.png create mode 100644 dist/icon/drag/small/icon_multi_tree.png create mode 100644 dist/icon/drag/small/icon_number_interval.png create mode 100644 dist/icon/drag/small/icon_pie.png create mode 100644 dist/icon/drag/small/icon_radar.png create mode 100644 dist/icon/drag/small/icon_radar_a.png create mode 100644 dist/icon/drag/small/icon_rect_tree.png create mode 100644 dist/icon/drag/small/icon_scatter.png create mode 100644 dist/icon/drag/small/icon_single_slider.png create mode 100644 dist/icon/drag/small/icon_string_label.png create mode 100644 dist/icon/drag/small/icon_string_list.png create mode 100644 dist/icon/drag/small/icon_tree_label.png create mode 100644 dist/icon/drag/small/icon_tree_list.png create mode 100644 dist/icon/drag/small/icon_web.png create mode 100644 dist/icon/drag_helper.png create mode 100644 dist/icon/example.png create mode 100644 dist/icon/half_selected.png create mode 100644 dist/icon/icon_down_arrow.png create mode 100644 dist/icon/inner-join.png create mode 100644 dist/icon/left-join.png create mode 100644 dist/icon/loading_bar.gif create mode 100644 dist/icon/no_auth.png create mode 100644 dist/icon/no_data.png create mode 100644 dist/icon/outer-join.png create mode 100644 dist/icon/package_selected.png create mode 100644 dist/icon/push_down.png create mode 100644 dist/icon/push_up.png create mode 100644 dist/icon/radio-active.png create mode 100644 dist/icon/radio-disable.png create mode 100644 dist/icon/radio-disable2.png create mode 100644 dist/icon/radio-normal.png create mode 100644 dist/icon/real_time.png create mode 100644 dist/icon/report.png create mode 100644 dist/icon/right-join.png create mode 100644 dist/icon/slider-active.png create mode 100644 dist/icon/slider-normal.png create mode 100644 dist/icon/table_style_1.png create mode 100644 dist/icon/table_style_2.png create mode 100644 dist/icon/table_style_3.png create mode 100644 dist/icon/test_fail.png create mode 100644 dist/icon/test_success.png create mode 100644 dist/icon/union.png diff --git a/dist/icon/bubble_no_projector.png b/dist/icon/bubble_no_projector.png new file mode 100644 index 0000000000000000000000000000000000000000..573381726c44a6b081a8c103aa4525ee146e40a4 GIT binary patch literal 3106 zcmV+-4BhjIP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};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W%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z0Z&OpK~#9!?A0-AlTj1~;3uWrNWjK^mzs_D8Mi*LiN~Z!fvloxDeeBm9W;Q*5I@YE}0Nx2V>gyuwR-!Wph(o#G?1 zI9=g8co&sl{eUy;ygGjbI}Z?Wdu&~cme(-993AL7j7x%VCBGi3vD_b zw>R(s^+*k|o1~pzb2dGUp5IiyjlsN4{}7mt+mCRJ0}LXap^42T?feXp*LaKP!8t*1 z)T(}2_|T@~_5m(2Pi&x)q@Cunv#5@5IlMtUu>XIW4zZQP%h3N9)3lB6x5RGR_69GO wK0%UpF0hFTKF6wrgD#2)lpg-%I~Vvp07!UWCxPH8-2eap07*qoM6N<$g7E_Jng9R* literal 0 HcmV?d00001 diff --git a/dist/icon/bubble_projector.png b/dist/icon/bubble_projector.png new file mode 100644 index 0000000000000000000000000000000000000000..bc579e005856bf0d88e83fc31f1efd8d94be8157 GIT binary patch literal 3290 zcmV<03?=i4P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCz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Yn@=yLd Y0NgafT28ISbpQYW07*qoM6N<$g043_w*UYD literal 0 HcmV?d00001 diff --git a/dist/icon/business_package.png b/dist/icon/business_package.png new file mode 100644 index 0000000000000000000000000000000000000000..e0f3b387ba7435617ba73867654b78aee9f8088a GIT binary patch literal 559 zcmeAS@N?(olHy`uVBq!ia0vp^Q9$g?!3HEhC{3^dQk(@Ik;M!Q+`=Ht$S`Y;1W-`2 z#5JNMI6tkVJh3R1!7(L2DOJHUH!(dmC^a#qvhZXoP$%OaPZ!6Kid%249rR*ylxg_* ze@%4kV!k-*mP<>M!~JEsxZ<5&aDI}kYOZR~i|tyX@J6Y`aFugH%9IjqWy6n@dDcDM|L&q@D*u+5JI_}KGH=W1H9L^TX0CUWhnYDqCgVx4 zpKS8#+d`GE=SrM;xiGZzjgX<%)4O?ovtu`Iw+?c!RA^`CE%La)Vgf=A!eGSg>i|N$ xCX8T2s^q?f+y*Rh2OX9l(RTJ zZr{>+`6fL7ex^$@_s}|L{o2>|3AeYcTKD?(-q*X%mMNTb;$C;=%)a-%H{MyY>uQHL zJk1NT4o_RK=8nzzUgk2ksD{++(9o$D-xsGFZ+O79i8qo__rCJuzJ-~yURM~Dy4c*g zw={Ft(Zv6+-!3*S;rV2BK}Lm<*93?z7%)KSX8U}fi7AzZCsTon7-x98IEGZ*dUMA&tJy)K;i2J!g4=wydU9?)|J?)r?%2ujch1Qsi#vJ^ zylR`byf+u+%3!`x<&@LT{xAMK&*1=8M~0g%pKQV-r``SQ)8F^rQ(NlEOWRFJB@(B~ z|BA199W^zza<92>@|Uf@WABu*KibVRXW7cE+t<2eJKig8sL?oicbRO5@r6xAtP#gp zjH}cVZbpf^9&CRYb6`^y>(1A2>@6c$w>a=wv(4Na8hX>LS^k-B$&LRdxejLRyqgp= zn4~~x0VfD)M_+w;_xjJ8?>|bnC%Xz?aA5WYBVH3mAlmD2FX(@#shxt+)gbo3H5m&U zmzkb@@qfl^nLijxedOW~9_wP8)xZWe9&SVT!eogweX$qJH$E$Mf9z*qW>8r-S0u(E RI2;&}44$rjF6*2UngE{H&l~^% literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/address_marker_big.png b/dist/icon/chartsetting/address_marker_big.png new file mode 100644 index 0000000000000000000000000000000000000000..8365a270e9285dd62cdcf170de34f02472adab08 GIT binary patch literal 3465 zcmV;44R-R0P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFK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ue(&&kO%=w(qMFhbWWv9T0@g5~eO|KEVY6~e;IWU}MvZBY60 zi{j$?-J#N8W+tY|>}<@E;2;CKeD{fay&)y54*Y@&`al30p|CIqx%@GyhK~ZG c06>5N0BQx{(qjIQTL1t607*qoM6N<$f?WhQm;e9( literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_bubble_normal.png b/dist/icon/chartsetting/icon_bubble_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..dfe3819037e050627a4e00b7f1cedccd888468f4 GIT binary patch literal 400 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6H#21Z#=7srr_TS*BLtjxR;o>vp@ ze|BQ<5M?N|6X14ewP*Nvq*+yn_sWI`HWPwaANe}euxhPgK2qmUBi$j}C|29BGF|cF z2euUtLmg`5Jzp6K%x8FHw&MK*yF{gn%s&IB-#@NYF0VDcU+08N(hY6}R&KKbR?WB* zpBPUzWNbP0l+XkK97K#2 literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_dashboard_1.png b/dist/icon/chartsetting/icon_dashboard_1.png new file mode 100644 index 0000000000000000000000000000000000000000..89e25f2b278f88fff9b676da79e46b7b88ceb39e GIT binary patch literal 868 zcmV-q1DpJbP)wjCX8Xgb?gx<59qe5VszJ4bQ3{z zVHng^;$M(RG*npHCTYVlwz(g=?esmL=N!KskIf`sIQ!mx@B2Q__v3xv4>)6Sb#j=W zpC1v!l=u=h)1vt1CMPGCPDLPq37YKf?Y$fhhY<(_u(Pv+fq?;O&*$^l-rh#BSX>u> zX9dyRi3kL6p8-4*i^bsedg1r`rEPU}6~n{BmT#p}L9JFpDwQJ9YlEnu;<+8b7lww0 zW=2Ox<*J*_CK`=~wEKKM%a`-@dR_X^mobbrFq{dva^X0_plY=$C&W&mX`0j{k%;B! z@p#bR-!Ju6t0jpTOAJQ>o;i;t9*-j!45Ik?J@)taJ7x*Nb06Nwg)o*F#{C`HL6T=q z;kjQJpFr)?JLuKQvEa1rete7I*j-6LF))&C1WZL{3y*^5O3?-{q5JAJXKLLJ-SHZ)*orOhq$WOz~d71?~0&lwLeR>(|f2V-Y&%XrqrQ zrBVrddwU?3Q9IBKTY{Iwi{qzC>Bbn`YboSkJ;#^mO*wZj^A(|3T-welzCArXay0HP zp%NS`4PE?9KgL4#8P>jkJ1CyPD5k|6^v}>-}M$k7YFh1(aaHB+b(q-E|<$B zSX7T_j*W{Mz)VoZ=W!wAb+@gSI_GFprCctfP$Zp?NVnytdy8076I8K?R u3W5Lj;QZ5*X$L;llli|N{WF(80t^5nU8ZXP@vKb%0000{U%`6JZdZESt2u#;{2W`SN3P2_%QK#9}}R;z7ASou87)q?}5n!0mQ3lKr4*8Y`Yory(AX%jnwLZE)`d6d>|MBEg7BlEXmP zb*NM-P_0%;rpx9eoJI2u>;i(pAas3cWuBUd1R!H+m zB*HY0EciixyE$|Bz0K#~69qQ4EX#l!V+otSJKiy99fW~;8>7*PnfiXqXg^ywhH7u@ zvm3=IhjOj{X0vG^XU&`-huupqmuoBwL0HZJA3g)^N2_4`()M&sK8jHe<(g1cm8pQ! z$XFyt1r~86n46meuh%<4B4)0DGkg|W_wPVcQ9#lDFr#boQH*k|5Cj1vNdo$I=;P$+ zXWEYOd`6LcNs z;f5w3^e*PzC)xV@r#j24V~5}IKjP8juK)u8F4!*UNiocW00000NkvXXu0mjf&1GR< literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_dashboard_3.png b/dist/icon/chartsetting/icon_dashboard_3.png new file mode 100644 index 0000000000000000000000000000000000000000..f140c7c427b0e2c67f89f576f9d84b8d4e51da7b GIT binary patch literal 971 zcmV;+12p`JP)i%}H+^=rF+>uha0s_S$*L1!b%BBq(egrp{B7Cd{9h(wsg177@%KMyh_ zo_OE|^Ws6oWI@?1OOQ1FOl=+0nw3qp%g}b+>Yh)(`ntB#B_24*$^E`_?){x}?mhQ+ zf&X1(e{yO!95Sj{GOa2d`+M7>?rW0FUEsYY^u4!80Pqtnzl~ zbV0b?B~*@`x2$Rj^*juv4Zxfy+0a1X75T&1^0X1xoih-QMDaN=ihAQK6ez>!@|y+Q z4TlUawpEo&T`(Gl#2`Eia970SCLL%KZ42p>l4DqDs}X!J-uZ;FJl}^Ey8a~F`eoHH z#P(y}T(6*n5yuilAt`{m1&1wg~e6YEA$VuM@Gc5U$>H z3bx9ni&0zqL_80|+M84XwPHp75HxHHrrVm5z^B=^A$Or2Jvmi^(l^=2C(2sOPVlM- z^m;$yZH>tRtSfW_==2vS$|s@BoY-!kG9}QOZ-(9I`mr@NfOt8AG6iCN zeK>fjH8Ejq(3KHX>Z3I;gWrM3SjGyRoty@?iJmu`n8{J2M{998PF-^dtvK3wSvXK}&na`UO-XjvSK-499a?-r#QYm-fKGKWT{1SL&s_ZCvni|T68bsTjn0PN#TPiYaf-2bc4lt_Fx;b^# zyx0%yhz`KAsSfkY%y|0dLt0?Ud|BmuI88-}4SvD+bGOK>Eos?QN_JEQRkKaC0FT+( zq|IDc0A-y`$eOaJy=UM{GO{VLAh98_;vIRR!Oi8Oms4Xzrbr(kSB01_k-0$EQYOv% t!O23he{lZxlQ|`!GZJa#pOK#e3;=b#SGTV0d}aUu002ovPDHLkV1g@_zZU=i literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_dashboard_4.png b/dist/icon/chartsetting/icon_dashboard_4.png new file mode 100644 index 0000000000000000000000000000000000000000..079b9db426c8daddf9fbe38619aff491f2d6d745 GIT binary patch literal 3298 zcmV<83?1`{P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL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2ThC#Vpp7~8&*L{)@oQ;ibxnotQvRro< zMkb=2gh0)h7xl%mERrjI3zeV&umRjjMZbGI{VaNxqgX7e(*}UvvxS*l6DVl^VGCOJ z@QfIfRe4d*77;)hc=sHP!p*=YlgUgKH=9jOSBwh}xcGhZXoDb7r$beu#0|fmK^R^i zJPgBhMLQ}%U#_|%_<4g{_`aWB>L&!BwoFGddcen1xbl|=A7}l@kv&4qqHb(djDYl0@VQN2EfRqJQ@q<)EQcrdx<_hb9R zAE*C+P~%|JSjD@h6YNzK8Ez)^cC@aIh+l zFRX2*+$Ww#HfwnF_y0-LxcPCy!`svEziuq*y3)bSYA(vS;h_Sm{^pD{7(XG3e}%*Ouia*pRIH4QiB_-teS!6U1??xpa_BhONt#8eiA|7zh` eV$Hx|z@SqbZT)-wm1)56WAJqKb6Mw<&;$Spu%H3} literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_dashboard_7.png b/dist/icon/chartsetting/icon_dashboard_7.png new file mode 100644 index 0000000000000000000000000000000000000000..45f6a85029f56a89f11b5ce457568e8062d8fb87 GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqHCTmjv*Ddk`g3X7dL17Nmmvq@VQ}Rv-%Ymfb?`jf${CRBdyj4)T*?_$*T6pTzsp1D7 zCD8j^*pw6pLjO1DJAeE)&D+xpy1C_`<$p}lSNNHvRNbXX1o2rV13cO ze?Cb!_o`MrXkZnKYia82Zti~g`TKevRcpCLM;OH~uy_})dFQjlTT2S)i6RDp1cqDl W{NFZyn{W*1Lk3S*KbLh*2~7Zi*@8C! literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_gradual_highlight.png b/dist/icon/chartsetting/icon_gradual_highlight.png new file mode 100644 index 0000000000000000000000000000000000000000..e617c565a9dbb738b26da88deb11f61bde983871 GIT binary patch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Bs>^-qK~4Yw N002ovPDHLkV1ltj?1%sW literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_3d.png b/dist/icon/chartsetting/icon_style_3d.png new file mode 100644 index 0000000000000000000000000000000000000000..3a3285707ef0e540e70365f57f39d7e536f55651 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqFzrI$B>F!Nq_$Tw`bO6e7s;w zL*c*Rrdj{gy^NbO#EN3gZaOtQe1CsGPyPSDsXxAdmv7;Hdi`!f%j)EXM}7;huSxpx z^|$!p_woA!GuRX(cSxzRNi_#@yXh{F*)Ul!_;~PQ?gD&#MU0?eW8p32@D;-(!|gF%Kvgv1Ruxw)OrJ>PfEcOC<< z-50mf%gM<}D;|Bg?YPB1UI%geaeF&DI;1TVAow62F5D8&^HNPsjhsv-9VU~>pUGsT zNF*XCibAC1ga=97n<7A90gorlaG<@ty=mx8!ucVZfgj46dS?%>g$wmYI8i3*OMOWAC8 zn6$R<)2kZqDAf=!G+T5O#W=oK^MWM7Jd*yR1T3L0_9!l;vSTETypkQP6SM>FuAgwU z;T1TJgy3RRnq&wDBI&?lVr@8Q!%i2&Du|$u>DX(rSo&{GEB0q!Qt)yv<;4GlEVm** zTYL>q7pI|0SK(7uSH=S0GH^SfIK$!aBJ;eLVe}Ovpi=Z>=iYk*2!1)Q^-mUvy6RA(|wFj<1d`kJDE{OUZ#-Udkp%B`PoYz2 zC7FOoj2eR~o6*>69SSPBim~79DkJ^9f9nGZu_yNs3WbCdHa$F;O~NVuEOb`3NN<-v zQo`wX@anEha5uEFZcIIby)nTsg2g1F3UFW~l%(NUEGD<@O?je<-eoH{_~(-IG7_lX z&Zic@%vFw5o8nF-y{a0YsVjk*nVDRP`ie#1Wt})iGYDmC#v$j%gkMID-3ac;U7T2W zAqqxr^jb@4kUE>nxlu^^;_>(}!|)bFKqD8ur@7+H4-u0-g2}rH%ZH(>wDz}Aq84Jw zY@ek}(|x_oJX>MV_}&Gcds+Q^^2ay#k71`0&3sGGdS1k>`FF2~Ch7qj{l?14+0pQ8 z-qN_HX^9cIu(NwGFLusY?%!$F$Sk2F2=3fyTyN@w!;&`6h`ZSpsustVKREyUlezuZ bF98MsK4YcW!WJ(@00000NkvXXu0mjfPao^Q literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_acc_radar_polygon.png b/dist/icon/chartsetting/icon_style_acc_radar_polygon.png new file mode 100644 index 0000000000000000000000000000000000000000..6c15e6f24be634092b7faa8092914d4b740c2f72 GIT binary patch literal 1124 zcmV-q1e^PbP)g(&1{}TsjJZ!O8E}6|{uCZ3BROC{rG>%Tf z&+GsVi!PTdmN&ZvY10Tx#rp2vQM&=ocGcki;=F{@VRRIKk{x3U!veAxlBg(3d{H(C ziRJR&WR}s{U^jC^o8Cm7xaLUOYfs;dGZNvPMdEm#ANKit1Lt03QhSvGhfTnE(|E~N&0N>UQ80g=Rf39oe+$BShphBCq2di`cPo%W+# zf3uxd4%EZ(ZjU(mb4e94>VeBwY5^yc|g|Jz zdD5u81FQzB=QvgeCe0W;Y<)$V-}ptSC{>YiV9_(G97Sc?G5T4ZEA_)~)&5g%lLMFi zs3#?p$@Ujb8^J5zZH!X*YwR5;RM+9kv5$dprzoywJ_DECMuv&1!OSbMvQog4qmbk~_9xrS-WvaHupsGW<{|Y}IPPCOi8gpj${UWDH@V7t-HI_%~@gS6F@r8Z?%$f?QHY zvFbvhQ|5SQX^HYSr0ILx_5;muRI7{$-|>^e)jMSoPr57P!G7=&R?N!6-3je+i)&pj zb>Lo#j)su3v$L~GE|)7HRMGk6KaeS5n$tS%liV}6OzmxNJj0Y1p@~P3#-7%j58Ctv q4Yr_$bEsAK`qx8q^pD1$0t^5H(!tdxZo!@a0000$WdzEFoQ+@ zO!XrMm8A>xW-~oGe|(`IqlXy7N12>UKWZ3^D)a^Jvp*71*v2lkO-@SY!~*#abHAP*lL1;bYwnRe|_jN!-;=b_}gAIaeIy@tC%S@niIc^$IWd%Dw7X zeMan$Jt;-c;j%6B+8P6{Hbn*w0|x7MPxsjg7OcRKVDNPH Kb6Mw<&;$Vetbfk{ literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_area_curve.png b/dist/icon/chartsetting/icon_style_area_curve.png new file mode 100644 index 0000000000000000000000000000000000000000..e8bee4d650fc29dd985b279d1a7795839633fdbd GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6H#21XH27srr_TS*BLtjxR;E7LCR zQD<^6V(j2IP&paXz_~f#;>OpF5iB{3LJ12ez2$k-S|U$7mKjm;oprZass~@K31;KE@Z4$*w^IS#M!Sl;dOLlg_3|i%cH*z-XaAn zN*NxVJ`&AP_*PpZt)c3_fQiz@t4%!n`*kZm{B&SASs)R?cO=MxS^C0}zlA&H=Cj_| z^G8%FU}h*i?7{yyv+ffx5E(pO{an^LB{Ts5q!*Bs literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_area_vertical.png b/dist/icon/chartsetting/icon_style_area_vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..68755fa42fb2aca6c63d8f7626b02d42056d939b GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqIgdi$B>F!NeL3Hhvf_=EzQ0+ z`M*Sxr%}Y&q=g3x>pb50?hrA&Xw{LC$H=`j(Ptj3O3OzDUL~)|dO-z2r3bcyB)78&qol`;+0Jg$H A1^@s6 literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_gradual.png b/dist/icon/chartsetting/icon_style_gradual.png new file mode 100644 index 0000000000000000000000000000000000000000..862bc17af725ed0053c07025d06c073f97296358 GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqV=9Gjv*DdlK%YvZ_ljDD9qf; z$Za`G;<>%*i?{zfFZHBEGZ-@V%l7n4`N_ai5h+=Cs`lSuhn=i7YkVqnez-@=8`Las zz=vor^B@N)@?r;(`p#_*X-~Ny it-7vwe-#6V0Yhbl+U_%Pv!sAdXYh3Ob6Mw<&;$U_=5Uk% literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_line_broken.png b/dist/icon/chartsetting/icon_style_line_broken.png new file mode 100644 index 0000000000000000000000000000000000000000..9dd5ae62f05370ea9cacaa1d16d295e016d18cbb GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqK}>~jv*Ddk`g3X7dNOFyzgX` zP-axqiry&K!JF~)7n{Ppe!VkJ4#5mF{3hLWaG1+5;SBpDhZ0RE#}NK+-}b0;x~#Bf zC^^CSNO#8fBa9wRF=-q}{yO}tk$EN3kisY+o;3N`bLI)t#hGGD89lU{l=JUR{(9ko z1KVE*8^#sy7(a?R#5`rV#?jf#?{G;_YqxwJ=aK0OcREf_?Xl3A!Eb6I*dD`h#c9H8 zex|FY0{M(bO1~dW>_2?_f(Lu#7lsvXg7I&Xy_d0G5c$Zke4WZnRtImp39}R5IUk;; xw$qTY<9zUCk1ruCUXwZ(Fa4&Wz{$WO!Eob_kM;gVt3biV;OXk;vd$@?2>@uxfwBMq literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_line_curve.png b/dist/icon/chartsetting/icon_style_line_curve.png new file mode 100644 index 0000000000000000000000000000000000000000..b7cab0b4e61046362f8d622d47eab9b17b20e847 GIT binary patch literal 366 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqTik_jv*Ddk`g3X56c+@on2Dt z&(e^>Bp{#QF=;1*aN5E}$=97=s%xYI@`k63a?c{_v%*=D{`Av#sP~mO-p?qa};}TI( zf&BgKNsc)$XN4SSQFVWJd}`(i#v4VSoHnp7P7o2`W?A+xM@O1Ta JS?83{1OOpmi%S3i literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_line_vertical.png b/dist/icon/chartsetting/icon_style_line_vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..c654f3cf32b132c3f5c14bc92f400ee1808b5270 GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqF7HC$B>F!NoflV6Xdog{D?l_ zF>PI?|G(r8)sqH6=ObT;C2SVpnvo&vVzRxV^;+VYreL<44mOE49?cz>rnEk(eihN6 yUKgQpDkkK#M@TpGs$G-(61Lb$Fp4p-NHF+@OS;M}D+~u(#Ng@b=d#Wzp$P!;r9#{Q literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_normal.png b/dist/icon/chartsetting/icon_style_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..b0cd6374fe3d8ae47a82204c97b77f2140a5e1f5 GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlA_q?w$B>F!Nq_$Tw`bO66lU&a z5fy02IZUvw2 UnJ4T=fo3syy85}Sb4q9e0HcICBLDyZ literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_pie_equal_arc_rose.png b/dist/icon/chartsetting/icon_style_pie_equal_arc_rose.png new file mode 100644 index 0000000000000000000000000000000000000000..e5ee1145b8a7522d02ca0d3ba17957c90024002d GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6Jlq8FYnjv*Ddk`g3XSs0WJyWUjC zSum`uQDD2s#O|#k(Ydvuwc#L_Lzdl@giQ?Ga))^vuGCHF*5p)Dv(a0AqhOAhL$hmx z)WkDQ%1)eZKl_72|2JM?Q_y>2kX`N2#sA5(Ab~+(K6}(Mhc4D7%OnB&ZCcX6>2SSX z;b@baQ0zSqFF!Wc%dASeGZ}b)^Q%l>=HM;WAjp?=Ex9{j!s$XupP*WXEk_u#JQ;LE mFY3fPPyV2>K#qaKfML;2+xio-=T(7zX7F_Nb6Mw<&;$TBl6G7G literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_pie_normal.png b/dist/icon/chartsetting/icon_style_pie_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..9c5dbe98a7650003917aad099d53a57c2983568e GIT binary patch literal 432 zcmV;h0Z;ykP)#>M1t|hsjB}#<^>>L2*e9G%-TNSGJ^?^ z;Q>JEJ`nfA3`YY7P`Ud+3j;{90BAVK)$4&+fQV24saX%S#DORape~OSj}LxaxLlsJ`9r|p-+V;J6DbxfP*&#vxqSWG`(g1wOA5)c-~s`|VZma6$C3;9ELcc{ z;S2;US%}Yq1wj0P2*Z&r@dwh0Q2qy~8MsSRXi>4A2*XhvCZ;wAq?VyWy<`Ew;u>g) z1JG~<5{nJTdA5<14d#6m#fiA9j^4+WJ&K{K}eJp6Zk zey`L-9p~*b>sjSLNa|^vxx}BM&7k{&{gIQ&SN4vL4;UB^CmvL2I6A5INQA*ej>D20 zB8(Vk@S6#Q&SEmYU6;{yAl;&BgVnjuqB|UNRMeS1GEY!j@Q}$xC6+PfXZwmG*%?_5 zs@b*z>U?F86+Z8N<^btO@Kkm;OXk;vd$@? F2>>;XlFI-9 literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_radar_circle.png b/dist/icon/chartsetting/icon_style_radar_circle.png new file mode 100644 index 0000000000000000000000000000000000000000..635d41fcd749e827510629ec8d6ede5ce10e6ca8 GIT binary patch literal 793 zcmV+!1LpjRP)b&b!0RSyS})QEAG`bJoA14u_hwd-j{30e zXUymGUV3PRAR%BeX9;P7?)UpQ25H#$5r0IF0%3uLR5q!MG}{WyJy--pcGDw8!0wl6 zcL~APrf-{tAECz*0a2)AuMCX9BCd+!-EsS6WlyS@qq0wmHTp-up@vyJD~Q4=GG=ct zHCi1Pq-S~Mx;riS26%Hx@{RUHzy})P&j1U136J?K?wxivFdZjML5yrbQ1pQYYxSf^ z<2)`Rrw`wh3M_n$@Pu&poNEib3?W8%&|N6@>PMN+VUaboehXkHs}x?E;9EDwDyPP` zrK`uQ>nDyib7V8bbkbajY_&5KRk0y&zz4q2V6Dz@2tEigD&F&NrtCPYn8qbfO)obc zFEBYN?>YmM^?8rHGjHsUWIk_=u5nFt$8#aoe18 z04db{xIbMC)4i8Uro;EXtY~jHT~9GzZH^dt&y!?H0aiAQL@0uH$Ffv?cJdTx=t?OJ5pc^*SaVA4Aj`exLguH^t>h{eVw+^~Nr>&+Hl*2!{U|{B{y@E` zvml9A`t%_b-1&cQ*Y9#4+m~mj57n-1Lw-0Bc3kBOO$k4q5Fe_?2?>2 zK~#9!v{lV(6HyS~e60y-XhI=Uq&3@%A1G|`pai5XIrL;Gc=DD=JV(KkAW1L1+MX>Y zJ%|^<690e(m8d6ED)k_mh(aM0lDdhhF(3XW%*u1k+D*`fAG162o0)y@&6|;=|NPjj zkP3x@AL1Sm1G2!aa5!AE;%m1MJPlC-=2=Cu#QM=!fB+OI1B8HOU=^qW0pKQ(0?I%f ztI1nVfWRRRObIr5JIZY9;oTcs^o+D!&q8RR|p8#G#FK?z{`=I z?8GBJ`LVxwnbO_?@m9}KR%ESl*}He?th+ihs5+oOPj=!FpZo^h4W~(U72kg!_qlA{ z*OSghA~@EJer);flVMuclo?sO;gGt)y|#B9yo*q4W@T!YU>mr)dl-22**>;&#$An` zI(D!^29gIIIrr``kkh)Z22@et#jrP-%Jdw)P>^=d))0;K&A}z+6-P-RO}XmP$k>(lQ57brOFS-wBS-!R1aBZ0!*GlS)B0je>{%Wua?bsAXEgAiH?a0J)k=vBAFtaR2}S07*qoM6N<$ Ef<5kv3IG5A literal 0 HcmV?d00001 diff --git a/dist/icon/chartsetting/icon_style_transparent.png b/dist/icon/chartsetting/icon_style_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..fcf229c947fda6b08fab1bc7befe1abfd64a8e44 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6Jlq5w}9$B>F!Nq_$Tw`bO66lU&a zsWZRl)t zI>3}{aIStAgU3sWZRl)t zI>3}HV_R3lIH5~D=)P07_i2_A@gtKH3T;ltB_t*$K6w6^`LaqoqsQdFX=2TN+sv5F z#l z_Z#i0{?51NW1!-&acGP~?JA8kCz2uCUGdZ)|JUt9PJU=hrb~=20)8aQbKR-XR v+@)lFgTczmL`6KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>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ZT zes8AvOzF(F2#DZEY>2oYX&IRp`F#{ADl)1r>QS^)ba8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z06$4YK~#9!V*LOAKLa^{g@J*Ap|P>?FqCgwUtiDA*x1Oxz`%f0tiHb9mI=uaMl1&7 k6k{aUsQ>@~0RR630PBMi22Z^W=>Px#07*qoM6N<$f_dR)EdT%j literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_area.png b/dist/icon/drag/icon_area.png new file mode 100644 index 0000000000000000000000000000000000000000..d86416cbc68b23a5cc408452c30876819ba8638f GIT binary patch literal 666 zcmV;L0%iS)P)aA8bD%FO4ka2%qLJs5{%?lAWj8Zf}9NJv$HcD5)xs#jILNt z;{t=Y{2hiz*A0kHMX!K(BFIosd;nda0E}2uF-g|t*c5XLTu=G)i}%#`FZ?R#d4mN{ zWS#(Gogd$L&I1i+6%b-+V`FFhimpgdc5@^H!(XnyKP7gFNPfKd?uG0FqVmCu2Wl2K zPun{)Gymf-aoxTbThOrcJP>2$coX`f0tOz%=S^Ah5fA)m(T_A|Nq$U|NG1Ol8Nbu%8#$gQ}E?v z3?Bepy^UY!>rG@akPDGr$-?$Qo{{CdILPAv|5$(Evj8OyK;egOI5q&X?DsdxQ}}|0 z(!!2t059y)($W-=ieQSstXZ=d8AidN0RRC80N^ms+MO<@0%XnJ0=% zvF@d+1?YzJiXXA4xY=WXtcHaQLluA&2>SzZ0nBhg+0BuxoG<-=VyltWGZK?BpoW1A z1*Z^Z7RD<~ObjnMxtLB$%6-1fFSRS5ne~e}P-;SlddVcBd;oRnd`2b)Ep~RMy+Ffu zv$HcU;pSz21yjQ%a8;38_WvLII$)TJK@A0Y|2`o@G=KjRbN=x?Qt;nj3uXp}91gR#1vq^GG<*}( z@UMgn4*34nTIKg|Z=V1E6rp&Fk&#Pa_?KllItnt1GZ z1@&bsE(f9ez`^*}Pf%vL42?)o@Z2NDH$+7;(0dzxoT~au&4LgmlGD=C{!_!yS+iy_ gGK_*j0{{XH0E76PO(s;XUjP6A07*qoM6N<$f+r>ixc~qF literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_area_c.png b/dist/icon/drag/icon_area_c.png new file mode 100644 index 0000000000000000000000000000000000000000..23f54f06e855b9f315a88159b88a5c06c0afd7b6 GIT binary patch literal 459 zcmV;+0W|)JP)4LL5v4;)B4j zPDIiJN+9!rSPO{VfpQnf4WfJ?{s=O>;$}|(NT5T#WCM`@0LXL%S`>iS2S5b|K&lLg zuK@8&v~UH5wF@X%#MI^lKwS)yzXrsKK#Lv_8_7R`*cFH!pnQ;JUw~Kx5h!dGpq3o~8m@q3_+BKXVnAE~#5_P82(;t^Q5GNrpbHal z7>*1;`C>KE761)}`M@9QLVSiZKqGxK&Nu)XXaG$q3TSZvitsjQn3DvsMKU`O?*`%} zxN;{cfCClVkyp$QfN$&gVM6ze`^E{X^vC&o2tE z;F{Urar25D^<(9H8Tt1&-=SY$rFTp)4Y)wG1t0^s1TR(n`^WZ#h5fx17t=3!kodp9 zoLBz;WqZlQ@>LfY%HMx}R+s`5`+(I9d=?1EY_I075w=nu84VXy+SlHgV{rn=g znpQda!LM)9izy9voECJbmt3GmxMQsk($dltfYg0z7&>d#EXL8QmS_MFU;s?tg9Hx; ROIiQ`002ovPDHLkV1m@=(4YVS literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_area_r.png b/dist/icon/drag/icon_area_r.png new file mode 100644 index 0000000000000000000000000000000000000000..529d2a193b60c9650cb3695fdf27bfb0fb1299c2 GIT binary patch literal 569 zcmV-90>=G`P)K!y6xk5qfB+x`3f}`j{NP}T!~-O`0!AhVFKJn}d|dij z2pHbL$jDH_!peB!-#>=nzkmMg0L2)fmVE%qxeAN0R4#eV+$FaG`8KOIgkrYk}sESF(&uV4PQ`1IlLYM?JK;Pe4Bxy=W<`iG=6 zTh+%8e{^3y`==x*%yI(cQf^-6SKPb|uYhVUBU}3V)t>^O4|#yx)yU>CV@t~%oJ_}M z71*c0c=kKw>z98~zkdDy0CZW+=TCnXe}4bZ#>U3}_2>704xo@D$jhK$1M&mD{Qm3z<@4WsP`v#8`(FuY z@HLW=FQG7^2N5u39QpsBp$Dk3 zff_jwBZz>8#}IPW$O0&Fkd~JApBjeFnl+1YG-wA800=MuOq0QNI@>8m00000NkvXX Hu0mjfgscaV literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_axis.png b/dist/icon/drag/icon_axis.png new file mode 100644 index 0000000000000000000000000000000000000000..d366542862e4aa3e43d6ef475fa2ae730947efa6 GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqI6Fe$B>F!NeL3Hhvf_=ty=gf z?R>q&Zs)x%3+mLOekZ($KH%ixc_!?QTy2}1(|GlRfJ5k-#+R+>O789ZJ6 KT-G@yGywo9vq@M0 literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_axis_a.png b/dist/icon/drag/icon_axis_a.png new file mode 100644 index 0000000000000000000000000000000000000000..5bd017016314f04a2a2e7fd612c72dabc5596b90 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6Jlq9{)n$B>F!NeL3Hhvf_=ty=gf z?R>q&Zs)x%3+mLOekZ($KH!u&LwJ&Wg}lstndT$f3-2%mO;%K7zhK|Nv9sffg7n#p wC8A}SnVJ7rCcan`xmiNe?cfPU21Ygpk$hQirk97ZfwnMsy85}Sb4q9e0O#gG;{X5v literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_axis_c.png b/dist/icon/drag/icon_axis_c.png new file mode 100644 index 0000000000000000000000000000000000000000..3777d9050e98ce1e9da9b4730f65e31920d6a823 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqFhfG$B>F!NeL3Hhvf{EiZ5Nd z^e_1Eg~-imhDlo)ShVuK9ngIlpr5ERwLeczcx`h>>jb8pbxN!}d-yfJDmrq%sg66K z{4t@EMfs?mg6SDf%ZAolj!qYtob;4TPh`yNYTL(ZqW{M2AO`~jBOAkWPn~VbnfZl4 Piy1s!{an^LB{Ts5u;NDX literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_axis_f.png b/dist/icon/drag/icon_axis_f.png new file mode 100644 index 0000000000000000000000000000000000000000..2688e0580e1e059f7407b630f2b0d59491cbf6f8 GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqCig<$B>F!NeL3Hhvf_=tva~x z`O$ib-wB;8%2x8Rw!&*`9g4XlJa~n24jL@5li1qu#bcRCko)6=50MQ*jhUI5|5qly mSQEKfLelNv2}TA+Hip(TvE37j<<|oZXYh3Ob6Mw<&;$Stb3Fq9 literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_axis_pa.png b/dist/icon/drag/icon_axis_pa.png new file mode 100644 index 0000000000000000000000000000000000000000..43d3d75448a96e8f360c4874607d4fea2b71c538 GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqHs?a$B>F!NeL3Hhvf_wafjS_ z^OHZhe8qHwNvGV+`#Z1MNo-Acpqrq$mdKI;Vst0QG7>HUIzs literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_bar.png b/dist/icon/drag/icon_bar.png new file mode 100644 index 0000000000000000000000000000000000000000..7d0aa55f99b5029b3020955c246b4e5aae3e0283 GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqHIqW$B>F!NeL3H&0I^CF8#ZF z+f1DoOy6wvH$)X}aA}$-!#yKIR?B32Lu-_y;}%xW+4cfGFDmyj^(b5Ld3>~s6brfY zW}(IA(iPJU_#Rt0e3SFl`BAv4>xsn!gY0A($Da)I%iS4$85|lI8JJdxO|_EyavEqY NgQu&X%Q~loCIEB*NM!&3 literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_bar_a.png b/dist/icon/drag/icon_bar_a.png new file mode 100644 index 0000000000000000000000000000000000000000..fc25739b1ef5ed21f1d35de18ac9a7de00a397b9 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6Jlq7Y9P$B>F!NeL3H&0I^CF8#ZF z+f1DoOy6wv19UciiDg=5eZ^bi{1YYPvV{CUhE-EfrKu+UhF{YoeE69aWNh2y6) qWG<-5PYCksJ$6uIfeZtS1Vhtyd9e)+TP=a+GkCiCxvX}1r7bW_klWg@NiHVk?=G7mhKCJsL zcG!2Tn#jgxRiU0AUkonZy6$sWn~&ot>oyAq_7{alQtU^LGcL3-n8p8MHh;lUZo{7p nws~%k6CNDAuzoTl6AuH6k+#et$CO1t%NRUe{an^LB{Ts5GKE1* literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_bubble.png b/dist/icon/drag/icon_bubble.png new file mode 100644 index 0000000000000000000000000000000000000000..745053b7cd0cfff8d380ba246f5df5a36566982c GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6H#21Z6t7srr_TS*BLtcx3h4s>`Q z+V{MbVL}xD5x#(h%nmXY8(bbS@4B_*th`i1i0zcy7U#nkFsdDIIbJm3;U|YXY)3x@ z7?vDnUC^fA{-`RYQp`ro!hzSWQ6iDBcLqO_T=!uCuNg;RMa54maZj=!Dry$Q#wqm-B!bzr#tb(f@!u4aduw0uJjtXEH8WFY@6RLxw_8QF6nk!pKjI zuZq|-{xV9q@O$(!vnf3~E-A+D@-!u5!+~Oz_Q>eN8HwgxZVU_@1`M)_emzD0W=nt} O#^CAd=d#Wzp$Pzx0);aG literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_bubble_f.png b/dist/icon/drag/icon_bubble_f.png new file mode 100644 index 0000000000000000000000000000000000000000..d9e22f561bdfa10ea52e905462c348b3732b7d0b GIT binary patch literal 352 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqPLzdjv*Ddk`g3X7c;QEsgB#j zo+xlzHT`^j(pN*lpoX&>Y=dJYG>dc<#l>Xy707k`Z_aRf^>J6q;l;s>4q0{r+zcPt z75I227+W(K$t+82TFa>H>6mi0^tUaC^G<`qk_*06Y5Zm~(zXBku3F$&8Y6e(1tEv$ z%(Y7e6w(tsate|o3fB093UvNvJUfa1fI<}m&muO3-EvyjEDnZ6PI#f<^f^!AiqMSI z#(*;0Nz4E~#&tnL^G`0V`yDba5lz!})HJ-wtqBwZOMs*RgxxLZj7!B3I`arEi6pYQk(Gx=y3*5S3j3^P6wX`VMfh^hw>;2`0DqPX~>`F)r{!0=rFjP&`)k&c`Q zh{|XX7x^%hUJL>m_<*Vzt#kbchMQ_dRL#jWFDe*mQJT)0HH(p96pS1I5MTgfE^lm^ Sn1&eu0000w(ySlbwk)9}pAfK-c#JDF-0_FnjkW0jkD9%i{eY2NXcLg`glJ+6O?F1-$&R zfI*z&6T_vCG7NgBs@5-gc#`484?c#MKlvDTo~m;A^5+mFe4ZLGL ztN^4y3LQX(gMc3Y6A%>;BYzTE>3$xTpJ2;p+_fW|OgY&YL54Q~nfIY#%CO|2IYZp3 z1cuT}!60rTh=1&@64+1>cnS1P<5h3sl4+hdKZvRa5#S)F!NeL3HEDXvW9(OO9RwLT3>efob?;;fh5iOw#Ng@b=d#Wzp$Pz>5F!NeL3HEDXvW9(Oup3*qn}R(kMNw&)4RuB472ZcR`YM zre0h7{QCX_772>38*TKpb9EKe*0~wq(pX@}z+u49U?+KL?MB;lpmhwMu6{1-oD!M< D0?9!W literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_dashboard.png b/dist/icon/drag/icon_dashboard.png new file mode 100644 index 0000000000000000000000000000000000000000..ebbc98ce3d7b917ae3a8e4bae40062204d15e732 GIT binary patch literal 865 z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>mdKI;Vst01_ukAOHXW literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_line.png b/dist/icon/drag/icon_line.png new file mode 100644 index 0000000000000000000000000000000000000000..4bc87282bc9250545558e81f4ee2cac1473f969d GIT binary patch literal 504 zcmV*HiQbD2jW1WFAfmn0|g-7541=DkE8m5cp}ii2Otb$L&d-jggFwc z1wfZ?08$H}F2v^g1`rK2xB(^xW4lhh2eM>8)RDO30BA`e)HVHRhJ!Tb192f1y9=e1 zt`&gd1nNkFksJub2|!Dbli_@j@34inrSB33QQ3P87Z3Onmx_R{0EKNL$WTyx09~H| zWP`%C5m&tY`@=Hf+h=|Q^t^#HnZn}Z$2Xqy&`1o#mfnF50LMX}K^7?J9D(=&Q5g;D zlKF?4pqfMyUlUT_(X z;RB%I2GFDi(vS!X5}@HA%i^K&U;xd*51@`v1X}Qc6blr925-QZ{h<~bK$GQx;a#l5 ugD5R6O#!J0rU=ZMHH(p96bu>w5MTh$7L}xbb8qJW00007srr_TS*BLtjxR;nx+T# zJ#S^4V8wq#yy3>jgw7-EDV1tWvqU>KD9d>@>)hhMa+%>!g)W1Z0K=o74$o>+j#|XX zH>j{Yy578m>wq=z}bkah{Ne(VE^cj-a6^=by&F$bW@u=%bvy0js7M-@{7#qeZT^B?T>oVNh!*DZO zg^5`s?La1@=mFL*HVtQ+xJ4oY7<$~<_lPmXPT*L=q`BcpLxKRK?oEazA`4fhGI!eT zb_k1PId${GC${*Dj9&k_8~Jh+)F-hnkeGj(yD?(knh=(=2N(RXWbl368Q|>r$06WZ v6I-t0)k`V{H?A=k9?a-9|H0_cz{t>?9>JJD=SUzhKp8w;{an^LB{Ts5(ddvJ literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_map_g.png b/dist/icon/drag/icon_map_g.png new file mode 100644 index 0000000000000000000000000000000000000000..8bedc486243e93b09e807f5f88a0a54e40d15a2b GIT binary patch literal 452 zcmV;#0XzPQP){RWIf zvH}wXsyhde_(fuLKIok9g@kP|@X!~e7f4_)@!Anz=#O2*@`+jlsOF|DUpkv8qZOD2 zerh1!)(qIt9DhEuQl6@*GrezA7N74Q^gTwLmc&zY3Z4~YrLy>ZTLTao$l6b=hQ>O- z3!wm8OEd(QthP$E=+tDvOiCV@8dDBtxJIv*%D7X2QWq(LV*?I3;}r5`N*n7glwAVs zIErZS?J_~60)HI4+MLNYmGA!nv|Ct~OjG1$XRx*=jm@uodnwcdjw#ngVP~SI8XUAz u3fU&lT6UQPbCu=(W%tZ={l@EY6<`1ciGBZytVbsR0000{P)G!Y~XhhymcolM!G7$_Q)#6VOWhQU6GU3Caj;K$!qW;K{QiV52j#0!c~) zFNkE-Z5=zl%Q;DYYK_;|F55eMT1}GDBO_aoN%ER(OJ}=zE10YyVv^Vb3+3}k@5a6(rg;ItBbZl|_;GUh^6n+R{q39QECAw!yp&Fvs_xjA z_u5BtCvX71iYxdBN-VIXR!lU>Ms*>Hb@Cc9aRt!&&J(f^39SjqJ_w3vl2sQMM;AN% zdw&)YnHx)?6O4?+^Nr_H9xQ+>$QyIoVAS`L9y5jgRQ=<_Y@qha2@w=oLb>Jz7ov^A zg3&>Z)dwFML0oJU g(#U_^*G+%{0Kx2eKc0f@>Hq)$07*qoM6N<$f|PW!OaK4? literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_map_s.png b/dist/icon/drag/icon_map_s.png new file mode 100644 index 0000000000000000000000000000000000000000..10955a52b2be476f6d4d2f9b49ac9fc278487751 GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6Jlq9dLzjv*Ddk`g3X7bl1qBnhwC zar3jB2dBeMd8;elER9M38%>l${@G6uVtMr2WpQ6uohP_Izopr0L-Xp A;Q#;t literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_multi_pie.png b/dist/icon/drag/icon_multi_pie.png new file mode 100644 index 0000000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dist/icon/drag/icon_multi_pie_thicker.png b/dist/icon/drag/icon_multi_pie_thicker.png new file mode 100644 index 0000000000000000000000000000000000000000..ec17cfa7a2aee71b64c15e43a7577713a9d373b9 GIT binary patch literal 514 zcmV+d0{#7oP)F6XfKtFnP{q6_20$_% zh(WXh6hDCC3qX93AxUNf=@!g;k^m&@p#~BHAj=wo7A+ub!MrB|Kyp10JCG3~ARh$+ zEqZ|60*K-Jp}_$LoXm_2I)bbWx`HeWoGb|C-~aq)xbyih!|B(*7{34gk8H{ZAa(>= zaskx>EQZ@jurs(zvx67@-pGcFb22k1^RY0npm~HJs6?8Jnc?A=zd-y4ET+uM0`v_Ba&Xzh zf~XLj%z()a6f7_x%)!K<&W~w0GLYwC24WTlM7)6=w*VT^i5Ob@u6zyvWh@pZh5$2B zcD#logHx}6eE#>M1t|hsjB}#<^>>L2*e9G%-TNSGJ^?^ z;Q>JEJ`nfA3`YY7P`Ud+3j;{90BAVK)$4&+fQV24saX%S#DORape~OSj}LxaxLlsJ`9r|p-+V;J6DbxfP*&#vxqSWG`(g1wOA5)c-~s`|VZma6$C3;9ELcc{ z;S2;US%}Yq1wj0P2*Z&r@dwh0Q2qy~8MsSRXi>4A2*XhvCZ;wAq?VyWy<`Ew;u>g) z1JG~<5{nJTdA?>2 zK~#9!v{lV(6HyS~e60y-XhI=Uq&3@%A1G|`pai5XIrL;Gc=DD=JV(KkAW1L1+MX>Y zJ%|^<690e(m8d6ED)k_mh(aM0lDdhhF(3XW%*u1k+D*`fAG162o0)y@&6|;=|NPjj zkP3x@AL1Sm1G2!aa5!AE;%m1MJPlC-=2=Cu#QM=!fB+OI1B8HOU=^qW0pKQ(0?I%f ztI1nVfWRRRObIr5JIZY9;oTcs^o+D!&q8RR|p8#G#FK?z{`=I z?8GBJ`LVxwnbO_?@m9}KR%ESl*}He?th+ihs5+oOPj=!FpZo^h4W~(U72kg!_qlA{ z*OSghA~@EJer);flVMuclo?sO;gGt)y|#B9yo*q4W@T!YU>mr)dl-22**>;&#$An` zI(D!^29gIIIrr``kkh)Z22@et#jrP-%Jdw)P>^=d))0;K&A}z+6-P-RO}XmP$k>(lQ57brOFS-wBS-!R1aBZ0!*GlS)B0je>{%Wua?bsAXEgAiH?a0J)k=vBAFtaR2}S07*qoM6N<$ Ef<5kv3IG5A literal 0 HcmV?d00001 diff --git a/dist/icon/drag/icon_radar_a.png b/dist/icon/drag/icon_radar_a.png new file mode 100644 index 0000000000000000000000000000000000000000..6c15e6f24be634092b7faa8092914d4b740c2f72 GIT binary patch literal 1124 zcmV-q1e^PbP)g(&1{}TsjJZ!O8E}6|{uCZ3BROC{rG>%Tf z&+GsVi!PTdmN&ZvY10Tx#rp2vQM&=ocGcki;=F{@VRRIKk{x3U!veAxlBg(3d{H(C ziRJR&WR}s{U^jC^o8Cm7xaLUOYfs;dGZNvPMdEm#ANKit1Lt03QhSvGhfTnE(|E~N&0N>UQ80g=Rf39oe+$BShphBCq2di`cPo%W+# zf3uxd4%EZ(ZjU(mb4e94>VeBwY5^yc|g|Jz zdD5u81FQzB=QvgeCe0W;Y<)$V-}ptSC{>YiV9_(G97Sc?G5T4ZEA_)~)&5g%lLMFi zs3#?p$@Ujb8^J5zZH!X*YwR5;RM+9kv5$dprzoywJ_DECMuv&1!OSbMvQog4qmbk~_9xrS-WvaHupsGW<{|Y}IPPCOi8gpj${UWDH@V7t-HI_%~@gS6F@r8Z?%$f?QHY zvFbvhQ|5SQX^HYSr0ILx_5;muRI7{$-|>^e)jMSoPr57P!G7=&R?N!6-3je+i)&pj zb>Lo#j)su3v$L~GE|)7HRMGk6KaeS5n$tS%liV}6OzmxNJj0Y1p@~P3#-7%j58Ctv q4Yr_$bEsAK`qx8q^pD1$0t^5H(!tdxZo!@a0000VNmY)QMl?9qle{!le!F#SY&>QrR>#V zUKxHM{fA9_Bb%6p^pYKNzW*4+3{!Si==3?U^ZIPzTNKFc*1-B8<<F!NeL3HiyK4|?tgw{ z%c0zD*vrPQSn6}dh(kOmdKI;Vst0Ku~`6aWAK literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_date.png b/dist/icon/drag/pure/icon_date.png new file mode 100644 index 0000000000000000000000000000000000000000..564de143c4a3dafb9c07f6ff449aca9c4cc190fb GIT binary patch literal 2876 zcmV-C3&Zq@P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)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C z0BK1?K~#9!V*LOAKLafRBV8}Xma4Cz({00030 a{{sMYIaA>3xpGraa9}7JBUug7}4xZ)k|JlWG%FXjff&kfqDIM?q>UgJlG}Sw}&tRg7T2 zuWg+CgG&sX7^0mP++a$%o{$`z!&r6U08h)$wpU^gHVIgAu$zenM)@4*`hRf|Q@%%1 sZ%S5+?IuZ$LWkVL6VEQLT+PIAb;SkA)`u^vfv#fkboFyt=akR{0M3_1>Hq)$ literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_detail.png b/dist/icon/drag/pure/icon_detail.png new file mode 100644 index 0000000000000000000000000000000000000000..0dd1c90829edba16087c2274ae2b4a949496fbd5 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj>7Fi*As*hzDGLk}mTdgV^JU|K zeb0~9NBww`(8;2FgI$5!K_)AT$yoR(lan2zWzz(y3CfAD3~C%aKCfV1Jdwx$>0t}e z-e)Nh96fGEftiepcc^)ZcXmBEYTEhBBgpS66W{E!CfgYpjEi4LCTTh60Ig*3boFyt I=akR{0I|_FTL1t6 literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_image.png b/dist/icon/drag/pure/icon_image.png new file mode 100644 index 0000000000000000000000000000000000000000..5b134275c9df0c29702820a658793611699bcf45 GIT binary patch literal 409 zcmV;K0cQS*P)f!?6y1{%>r2nKH;H_#(M^Z>nqb;Z+-Y+XFYydp>_ zR0z=cb|f?3Z@!s%JcNM{4y+H`0q8EHA)JJ^j4KBMAU^tpWSajUaOyHRbaa^8IV=248}L}oVJ zETnm1O=-_~F!?pk@U<=L?00000NkvXXu0mjf DhQGGa literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_input.png b/dist/icon/drag/pure/icon_input.png new file mode 100644 index 0000000000000000000000000000000000000000..e51e61c026c23b61312ceff877d844cb9e346f85 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjZJsWUAs*hzDGLk}mTdgV^JU|K zeb0~9C)E^faAA6*5Oihon#LUNgmunl46!^j{d@Wyvo;)K)ZsW`C~!Avla7KV--TS& zC(N^=9ddr~U$$`IkI&KUd}N`Z+QYe0HYQb2@%p0E%}vvnZ0gA2_PFZN_3NU=0qLj@ o9%`ySo}u3JEflVXE?L3Ou#6!>vLrB82}1B`q*aklNZHkl^_2#`irx_!sd{^Dsyfc4s@0 z_2Fc4Xp670o}tqxogFa^XN`)U%~h4 literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_list_label.png b/dist/icon/drag/pure/icon_list_label.png new file mode 100644 index 0000000000000000000000000000000000000000..c9cc73878c79a09a2f3199752e882080aedea8ec GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gjk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XyggkULn>}1B`h#Z*z&&e`z+@HzRu8l>_WF^Gsg>oMb0Rq_&VdB-$gMraN!A($5sW4m)vk$T oio7ao|2MhpEb$@Ww&wp4ogO))8Ocg?>;M1&07*qoM6N<$f+l%q4*&oF literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_number.png b/dist/icon/drag/pure/icon_number.png new file mode 100644 index 0000000000000000000000000000000000000000..ccba87f6c4be826a5de45572c9780db951fe5944 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjQ#@T9Lp;2bQx+H|EZO*zXR(+7 z&%;D9mv6TE|C;~QY;a*Znr=||**&)6B5!IgYy@i@q<6Xe%_C#ibw?4vAHNA z>~#c4nXI?eX9{|D!B#SG?F{vr7RkfhWbLRny~N0NfaL2srH;vU0_9MJMRHO-p+$~* zstVAZu*jzfdi<^}8Cpb>w^G6CbP!OzNKsGrc@QgMRsxF@jqad3MI#R$vdFS3DVVv* xdML(_H-6n?H)0v;O)2^U3}LwZXe8PH30_inOso(T0w4eY002ovPDHLkV1f)`W-|Z) literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_query_g.png b/dist/icon/drag/pure/icon_query_g.png new file mode 100644 index 0000000000000000000000000000000000000000..baa471d3e710780570ab1e10ab5c8e01d8d39329 GIT binary patch literal 223 zcmV<503iQ~P)D`lCoFh)`ESkLf4~9t<8 literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_reset.png b/dist/icon/drag/pure/icon_reset.png new file mode 100644 index 0000000000000000000000000000000000000000..fe324f55d5fb5c11d7adea00c01f3bf09550a6b2 GIT binary patch literal 256 zcmV+b0ssDqP)CAMy2+j{Wd0CCiln0000B>As*hzDGLk}mTdgVlfeC^ zI_}T%Ba50}1B}lL`^GZy#{AR2FulYr@s!+tyiHw`1YCc7X zCSLCG?wMf2ttXzaxksi_ElKndH(!cniM*gFdrOnxbgKzcYDvM&8`~c9C`C#5O<`@} zapx=Fb8a=1=$b^afGK~id8y3{fsYy{u-?#V?L7Ep(PzUL&Y%Ww zLp|;bSCxMk6+|}3E#A@8{?G2fR4)g;gJS9@G})%xoDqLuaX`%TL{iI>jWZc9J5OTW w@rXgq&p=+_%(N5@3EejwY_~E51bLJggw8CiWxTnE8R#$uPgg&ebxsLQ0KrH}6aWAK literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_string_list.png b/dist/icon/drag/pure/icon_string_list.png new file mode 100644 index 0000000000000000000000000000000000000000..d861da26c99c10a8d2d782e3ad6db6568053336a GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gjk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XB0XIkLn>}1B`q*a*z&&eW(0 zJgb}F_+4nDR3~rPuU`#f6KxF&89sCFtYooNVKd`fA*jB%&_IfPaiIgd{DnP!%PbdE e3NW%rFzh$bJNonej>$kv7(8A5T-G@yGywp!+B`h~ literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_tree.png b/dist/icon/drag/pure/icon_tree.png new file mode 100644 index 0000000000000000000000000000000000000000..c7d4555ea37c7ce8d5abf3fe5ac344b37717a248 GIT binary patch literal 278 zcmV+x0qOpUP)}1B}lw#5Olfmeb0}6|BDBOINgeL6Bcddchgmn z73lil_?%g+sD{mJTg#6M-34g|8wF->T#@!NL#5yCQ-;cA#Yu&s{a5;CFJxw5;$ev6 WbV(>ETpA8Eox#)9&t;ucLK6UU|2t#= literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_tree_list.png b/dist/icon/drag/pure/icon_tree_list.png new file mode 100644 index 0000000000000000000000000000000000000000..c391a400bfb00beea8d12f954e9e62692de2099c GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gjk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X!aZFaLn>}1r7bW_Shkf_N8!-E=SS;ny7;Df7);7$6kc0v zkj412A)tldN`AwIQ|TL)oOODgkfdmqJTY67du5zl?~{uja=j^9KN!Lzf_G1mwOY&7 cz`)FK7<7|Kr0wLUHx3vIVCg!0FyO6YXATM literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_web.png b/dist/icon/drag/pure/icon_web.png new file mode 100644 index 0000000000000000000000000000000000000000..836dffbe6a95adba02c39b0e2d00ec2e9d8bb223 GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjGd*1#Lp;2bQx+H|EZO*z=gYp_4`V2D<|HzyJU5SF8xxba378N@iu{WLrf$Lq4aC3`ZI>nIb(p{5P@w zmz0#|6YVxXRO`?HxE{1D>8eK;}g(sI9LOZgeLiyf1k5p%2-=tu@nS3j3^ HP6ReyNbu-<55dE%53zHsx!Zpo&?hPZtXHZ!DI=&>I-trU~! zrNMV%6T{8ZN0w<#kjv>i@_}*bQI;w#>8%Xe9Z9~+u5eVR7zcD^XG!<|{Lp;2bQx+H|EZO*zCxQD- zb=;r!$dU~%OnI7{EcDtR1n~aV#O0qU|O0oIR?*Ji&C~=8K;N9JwzT^V@MJv^_3juvz?&D>&&fON!vO zgu@#eE~#|MxwGghOzGNS*|8#|MQ+=ULlsw;dUi2|-))o$Q8~(JxiTw3N8$L=A72)T jT)$!_bJJ$lb}fe0%_gTe~DWM4faf(>$ literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_year_m_d.png b/dist/icon/drag/pure/icon_year_m_d.png new file mode 100644 index 0000000000000000000000000000000000000000..697446bef0ada1f6cc814b233e5eceb13e0f733d GIT binary patch literal 234 zcmVEDEi{ayi}D`1Gq5t0$_g+MU^Uh1iL1#i*SsGQbh1qn3 kFx9yIu1AYgz3@}T2^rp4C=~6&=l}o!07*qoM6N<$f&f%yHvj+t literal 0 HcmV?d00001 diff --git a/dist/icon/drag/pure/icon_year_s.png b/dist/icon/drag/pure/icon_year_s.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed48d519f9eabf2ecbbbed4bebfffc542656dd0 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj>pfi@Lp;2bQx+H|EZO*zCxQD- zb=;r!$dU~%OnI7{EcDtR1n~aV#O0qU|O0oIR?*Ji&C~=8K;N9JwzT^V@MJv^_3juvz?&D>&&fON!vO zgu@#eE~#|Mxi=qX%4wC`SK}OFv{YpU+jQ0+uUKLZn(U}?@QX?K%4o^<@N#odOz`c3 fl+PLWRxvP4zw|>=X>FM+(CG}Gu6{1-oD!MB1Vtn%paLm3Yiu7Sd!RP3}@_N znskFvOe6W>L7`5z85$QZ{0%t!^+eY~lT8bGbSh%f`;UbmSjI7(k$a&OpU@_T)r=1B zbsRpOt6w3Z+?D5X!_Xj5iaR2f!NivFRV#CfBtvf)yG~ov5q*Ze!5xVV0gcQdmzibS zv=&Hry<>{lBd=i2Bj;cme?Y0tTP{6FjZMSh@@WR<1_ow^`LX&&wHkbRKu0rpy85}S Ib4q9e00yO1n*aa+ literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_area.png b/dist/icon/drag/small/icon_area.png new file mode 100644 index 0000000000000000000000000000000000000000..af7c63778c0ba1bd76a4ce431046c560d1a5574a GIT binary patch literal 3353 zcmV+!4d(KRP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)E2AN zsU20jsWz_8Qg>31P|s0cqrPALg8E|(v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T8Vjcx4(BEfDfxNsr55fLr=19VgT0WG+( z3(<{;%l-hRh)^sD6{$)=@d8>Esn#k<3yr0%Z5mQ1$;^D;=SEWt*>&N&JO`e0-g6;J zDeOlS`xFO&D~q=p0l!(n+nFJ(E%m`4DglZ>DO?7Cy4^CKJUEZsv1yE@#&!XJI*|b2 zxjNFlpHSY6L3$jNia4dX1^`N73W}^Yv%mpd1kf)8N7(uS-B*Q@6rQJUSTSwFYS$)& zkk>)wzl9qB2Y>GG8(n`6rdo5=63XK&RXgGg_UpFVlzM+fZLj0I|QOm*KFU_HjAwWL+p{~k`~7? zWU}`~HV~}f!?QD)JzFr$3Z!IIdi;B7BmTs5$-~5f?dN{2cT{*)pK$yef$--+rWa09 zr+Xq8t`vaCF5unF5F)W6H_YwPwWVw>)wB32d-O3%#jWFZxoedhm1;2d@>1Q7&q)!; zXZrK=K*ug%c{zu2DRHi&`^$+`*V;Xun@e^%Jm`R^ zdn|PRybF>!Je?R2F;Qdd!qatEbqw|9zr0Ex{98C6&q zu6^t~D{ZF=G#-Qq5UC_{2$38_a$@*Q_x)E5M^2420Lm~;y1tUEzZOLzglKZ|4InhO jC5s!;zX|f+zw!3~WoqxxSG0>300000NkvXXu0mjf*+ErZ literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_area_a.png b/dist/icon/drag/small/icon_area_a.png new file mode 100644 index 0000000000000000000000000000000000000000..0d70bb70952712801a7e560592727b65565550c3 GIT binary patch literal 3240 zcmV;Z3|I4sP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zV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ZQR zmCrqWpw#3`kIhu7j@@4u%U=iPU_a4^OKoSll=D*_D4#C@xZI12dMSeI)>nxp$SfV5 zPd7Ht8pmI^UU-d3mWlDk^c8aLbcd;WZ&c$-?b{Mm9s|HQSJC2^+OfsG*(U`3=g_i_ z#^5D@Tay4X=5c%Q6n?Re%J&thBHjXf5rSbCm23^c@C}Gd817FiIP&4%RXOfgM7il| zw~kyz00772==7e!I6iU}fsqA(0>HxwfInJ2QHo$s;dKDeb|Wm8D7`~Uy| literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_axis.png b/dist/icon/drag/small/icon_axis.png new file mode 100644 index 0000000000000000000000000000000000000000..13f463165aac552b5a739be3139870c62be4cc34 GIT binary patch literal 3203 zcmV-}41Dv6P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= z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O&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z0gXvSK~#9!#FITsBtZ~{pYG|I+1=q3IYmLlMASe;JWNCs1T(V*1N{ZYBK`yuL5wan z*$eML&`>Tp5QNJVvEVrc1%P$OrzAxn=W?Gy#xR=Ku2XE!j^X8rT-nSC7}h# zis-EChuMbDXVYiL-Te7If|n}RmjG-6IWJWpzdOj~N$0=(&X>mK_9Gl828e*dTYw&5 z!MJ6vPCGa~>aS?@5!l$MS{NR>2^01LhDa=5k;b|hO8n6xg)H)%t z4uALiaJ>>XHYmr^)N+D$Y^#V0o}2l~18riG*k$L}1R@$68~n^I!;{}IereuD?s+W_ zhJYbNffD@89RL+iPy(WkfUmUxKY(1Fr@vLbp+5XK-VXqs<&*fq9$41^0000yD literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_bar_c.png b/dist/icon/drag/small/icon_bar_c.png new file mode 100644 index 0000000000000000000000000000000000000000..b19ea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@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z0i;PpK~#9!?2|ueQ&AL$zkA=iNz;_}HKc{uQp6Gj>0k#Vx|l&X(MeD#PC^GA)kzR+ zH|;1@vG#Rwv7ine#8ps1oJ1Xz3XMXkg4CGiy?5_D4*rdf9bEjT!x=u#;dhP_5jKNn zll*%@2vDC{{k=B{oc&&3$})d#c%(>F3b8gl2Wk>{Hg~Y^$WOuhRzHO>p`33HJJIKX z3jj*{DVufO7s=jgEx0r~9OTxwfG>5daBSN{#-j!+trAu=3IQdOwF`kU5)SRSO*FDd zSMTdn-sSI!&rkmlC=r2ICrLLVPCuRC$%pFkP}_^WI>Di)ckWw?%R|dE?Y0>W&6g{m z-W_<*T-(jfL&aYcwAU--kn!ua`J-2B^NR|puWt0!wf1pO^l>6hiYLT%uh=BI(KGmX zbf6k{rl6GHo7ln~pLH+nsXU*HcP%sqa;?T-^#y@Rm3LY|5HW~11m<&R3f~Yi(aj2_6r7KEHkSzcJ002ovPDHLkV1gqS5(WSO literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_bubble_f.png b/dist/icon/drag/small/icon_bubble_f.png new file mode 100644 index 0000000000000000000000000000000000000000..6ece1da63107506497ffeeeb4252e51e55f3e0bd GIT binary patch literal 3257 zcmV;q3`X;bP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&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z27V6!uQbQ|IQj3T00000NkvXXu0mjf^0GTo literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_combine.png b/dist/icon/drag/small/icon_combine.png new file mode 100644 index 0000000000000000000000000000000000000000..8b9eccb7df0883501551408b4f97fae7e81feb73 GIT binary patch literal 3339 zcmV+m4fOJfP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@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lbua(`>RI+y?e7jKeZ#YO-C z0ys%TK~#9!#M3`$6JZzz@aMbllJ71}xDpc$rWi|2tk4=LO)0i^Dq>MYkO~%rE+uAA z2N6+GI;fkVi!NP6q@bWfmv(U~ivOU|Qv5@Lp{cfwsTb44%iVYPIXR@kDTB}SPCs~F z-j@g=&`cyW8Ts#!OeQAo6`1pwa+ZSh{uv_0JR4mCpqOWdpn z0Q3;S!Kn|N`alE+00!VHB@QZ_jT@X*L7ab8AO*KsMA^F!x|V>;(gA=17%g*UG_K{< z4lNIxD=L7a4S);_MeavhJqg369=Bv^x}`EMB&)(1Jk%_BbLyTHu4NI(WxpwM+gy{Z9N+#Hz_*f2U zeg52qXDjiY%T@pC`PlPowvf&(t?!);E2U{|E0Ea3M6_KV!n*fi*i+g?B>`17drwDR zF+xO4X(`0!^9fvBIPp_+S25ea1sFdlAF*q43Xc7HDm(D`%7>BRsl?+;Z#N=mRcf{# z3N6iCet&$zuqC(UY;U}SujSSqH}Yd(lKIqdWQ06?_#aPuP!Os9l0RZ{$&(t*VX8^Pk V-TCrdF<$@x002ovPDHLkV1k`OQhNXZ literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_combine_m.png b/dist/icon/drag/small/icon_combine_m.png new file mode 100644 index 0000000000000000000000000000000000000000..197bdc0f077766c79a3213803ff6d917c44b763d GIT binary patch literal 3341 zcmV+o4f67dP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}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vXXu0mjfNI7bA literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_complex.png b/dist/icon/drag/small/icon_complex.png new file mode 100644 index 0000000000000000000000000000000000000000..9be6fc6919ccaa9833f4070b9468bee1bbab2ad2 GIT binary patch literal 2999 zcmV;o3rO^dP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>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Z#YO-C z0OUzTK~#9!#FM>h0#Oi!zwus0Q858~3&qwKuuX4c;XCBbwD$o_8PM&w7W`>sg>0hh zq}W}Mc<(~8MW(u(fsZq1=8CFPrYe*yJ6mp7z!*5?q5#*-m=*AN>;P}}b@bf6697am=03zJdEhpjemqmzx5z~T$SNd4S<>v8rE+?RCNQ4{+MB4 z*ZbJn(Yrtkw-6jY%K=_`P4{d+Kwd!I5m2Jgs;2t+qL>03*432k7V<-?6an6Mu@jJF t03*d?*y!t)U()H9E9?M~{QGbG9sueJKQtCv;2{72002ovPDHLkV1n@3xWfPd literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_cross.png b/dist/icon/drag/small/icon_cross.png new file mode 100644 index 0000000000000000000000000000000000000000..ee8cdccaf4929f67a9f2c7e8832b061aedeaf00a GIT binary patch literal 3032 zcmV;}3n%o6P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH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ea=wq}VWrW=HC611cD3wYa930T^_a90r zpGmE?Q%XJA+uM7*zrRnhSVS9xN01?K0XzaB1XEK}G#U-Ix3?chQS`(Z<5UO%tu@2p z@bjIW9UnqitJmusEwmYXIb`PsZ?64R;xF2xm*F@ z^z?Ml>2!YY^?Hw@DEfby07gzi2tOSkA0MP?x?+sE{NI}!Ns??vQMC0k8Q|Xm0Q`S& UM(Jk-DgXcg07*qoM6N<$g2U6pEC2ui literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_detail.png b/dist/icon/drag/small/icon_detail.png new file mode 100644 index 0000000000000000000000000000000000000000..e23eea1ff7b500d8ddc4d4106ff449c399393b1b GIT binary patch literal 2977 zcmV;S3tsezP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rT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l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z0rE*iK~#9!#FIa0lTj4KfA4)?@+Bc@NSmN&#ZvGe1QC@|aIk_dZn{{MZaQ>vu#3<^ z+zR5Ps33wMLO~E66dXmWNUbQXf>s;^k<{3bkeI*kUYD;D37tB4;K6;5dk*)!cb-vI zHUi5A;RB3aEp(st1JiXEnaBp!!o88ZPx^!EWYa}%2jXTHqp{-kRGN$kGdrhxCO8PZ z11Q6hOcsk*~-TL^I;*b>(7 zfpfsT0*HJlc)_u2sdU~MGubCnQMlMW!7kuTm)KcgUR8-}8$_Sa#bUEHYmcWzP#6z6 ze<#RvQ8ERM#KK(y3gnwBqEN)-~hL(r+D#uFEP`? zB5N%k5bqW!0jptssMVCC>9i%8ZBs1|;XY1KU)`7Yg3s?jHst(c;f8a%l1kZ!L&MQMzHh#%@*2!5FIsul zZsewmUr&p4k~fWM-|5ML2;Y6*?B2RPC>Uc-w%cle5nvRxffuPzFAwL-KaO0oetj9V zCkI$d3Ao}!o5pY=3>Ux(mJ00000NkvXXu0mjf DY*;px literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_funnel.png b/dist/icon/drag/small/icon_funnel.png new file mode 100644 index 0000000000000000000000000000000000000000..1fd250b83510e240bf0dc95aa0ac35c3a1fa8a72 GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xws^WYhE&{2N|4Anz@hY}I!=W_lU3-eokfJw#s=0?jG61y zFE+Rd9AtT_qj2~u_X9SDxt|z3aupmuv#pS0n;|YS<*KC`)5>lase%UzQw}z%R4{g2 zXWq!bcvillg2_wgfWxI{{EQA-^BWk2pa0~_IgrJ`5pw6v!RKB4vaeJdPcZ33h&1lG z-ha5kX$>c5w>H;?9ZV^|Sr+jyG|DeuB{e}PT)90mn)#$AYeoknhcQnUgFpg9Yo4Cq U<#Sq}f$nGUboFyt=akR{0JH&IrvLx| literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_funnel_not_continue.png b/dist/icon/drag/small/icon_funnel_not_continue.png new file mode 100644 index 0000000000000000000000000000000000000000..7e3e9e25934a0fd54be2cbed98cf13db42ed8790 GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XHhQ`^hE&{2N|4Anz@hY}I!=W_lU3-eokfJw#s=17jE{b* zNIl?Cn&H55VF|OtstGJ-TLWwb^basx&{han5xB62VTGljD$fMROV9Xuf0Ug6Eb1^Z z{h*jd#UW+EY@LKc))UenGY)Y#Zqs)N?>@`Qlay7w!F46mxsnDRt-Nnvm^GPY;&xnE z7#GxWxj}yUstuO1vN}%;vZEUk8A6OVc4`Wyad6L)m+mxiXiU7o(7?dVu;ztMe_QmT R2SCR&c)I$ztaD0e0sz9;T{Qpz literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_gis.png b/dist/icon/drag/small/icon_gis.png new file mode 100644 index 0000000000000000000000000000000000000000..b1363f9ffd906d600b85ccf551312756221935e1 GIT binary patch literal 3033 zcmV;~3nui5P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY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mE{`ly3)1N^`o1+o7}D0ZPeY&J;i;i`%NyJ8_8Y6J?}yE@b_5a zam?eLr<8@mESk|3$_SkmS{wQ>%qC18))9_|&j{ZT zes8AvOzF(F2#DZEY>2oYX&IRp`F#{ADl)1r>QS^)ba8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z0R~A#K~#9!q|>2GLs1mR@y{D7h%mFwpcXY~GEPJ+`xk7k+5Hoiv?yW}%+n$RK}E0_ zHj7bR(3G4pSN?Uk~a~l`QJ=IDJ zT;nGCeoXjnXhTimZ~!|Qc8s%lMJHh$Jcm|Vpcz)zahmWm)Iw_(eSt9=JE*u@++!^uP>^pe*JpZJd0Jsf4D{*4tQ buAcz_Qr0(-n>r8^00000NkvXXu0mjfzK_8t literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_group.png b/dist/icon/drag/small/icon_group.png new file mode 100644 index 0000000000000000000000000000000000000000..4d8f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e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z0MAK8K~#9!?9-u3Lje#5@ZS>^gbhRxn+VGL4;F_(!GBe^iKyt+(HNIm|+s+N4(=Z?*_N1;2PUl!)Elx zI7TVco&4pr>r3CzO!OYD0e_z15kp+8SZ{(r&G Y0Iv=!*A)lA7ytkO07*qoM6N<$f}J&|VgLXD literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_multi_pie.png b/dist/icon/drag/small/icon_multi_pie.png new file mode 100644 index 0000000000000000000000000000000000000000..922e66ffe2dcf57c306dd3c00c7a35effd8422a0 GIT binary patch literal 474 zcmV<00VV#4P)RCwBAV4x*9dgq4$5DVZ_!-z$b z0+6Z);sg+1mG{*FVYaUhK;{A<1Ffbgr$;vwa+Lt?ULs*autA}Zx4b=Gj z<6p4g7t!|&f8X9_`1JM3hDQpX3hWFF22iz$=w1i_yX5XqxMmpm!pO9toBhASjj#6% zkkz6a01oZ@Z~mZYzVt)nU=N=F$jJsTf4)IcixG(EfSHAH!wpUo{eOSiaYiMw0Utnw zq6iCIvw||a!oRf0TN&!%?hlqBN#Ne zR30F!MM+4|Xgtrz$Z&v(ol)W9t3L)$Km7yCN%Ju=7>Khlu(SMsz{d6b0R!XTL@geO zVT|ahkei38A32oK0LbZv1`=!!a35n1!#0003702}Fy)%-xj QtN;K207*qoM6N<$f}JzWIsgCw literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_multi_select.png b/dist/icon/drag/small/icon_multi_select.png new file mode 100644 index 0000000000000000000000000000000000000000..92c8c62d35213b66d73869fe24daac46ebeebccc GIT binary patch literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X)_S@)hE&{2+VZ~g;sFN<8HPvP4mk~a2bqq1bl5YY(ZWE! zLv#W!o8*TF37ss4>k=4tnF)HlZ7;HCC{*H}^rX(FN}NeIlHmw@!z(q0pR5jdIG)%i zBr3?7G;u6=#+l&FdBf*~_wR{&Kgg$930x7r#8bkktRpsIZdpS}xPf5+$As8`{^nk8 zlLZnCpM^K6c<* M)78&qol`;+0Ix$?rvLx| literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_multi_tree.png b/dist/icon/drag/small/icon_multi_tree.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba37d1e38c14a1ab08cb189877c22d11ae424a6 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XR(QHNhE&{2N?0IZ(8Te3p7>vfQw+ZE4jmNgbdq3Sk!CwV z$RRlR1XF5*iM7Cn97Tck?vL~tq6!*2BbGCX<}(EK8eDJ8VKLmPp?w~0ssbEGm_^u?mc}{wvOi%_IvU6?kiej;YJAsC;L~oPn;AS^{an^L HB{Ts5#>Z8D literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_number_interval.png b/dist/icon/drag/small/icon_number_interval.png new file mode 100644 index 0000000000000000000000000000000000000000..414fe793071a82ccf50c224e163dc9d4573c7e6f GIT binary patch literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xu6VjQhE&{2N|4Anz>$38`<@JjAa=fK9x@J(4l_i^XiQ^B z(RMg0$8c24z)|!&^U5lPGKWXU51(Os^fTb>UyrtL%|{{@n6WBYb7vGOPS9$R+9sc( zeZov(FT;uQhDa7B1@VSCb2`q}2TZqcxGKQY{NG`fU`8PQ0y+>Xmr295OG4;HD3Af0#*h_HU^cn%*PwA+8+S=kHOQ`&t;ucLK6Tf C%5Td6 literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_pie.png b/dist/icon/drag/small/icon_pie.png new file mode 100644 index 0000000000000000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--git a/dist/icon/drag/small/icon_scatter.png b/dist/icon/drag/small/icon_scatter.png new file mode 100644 index 0000000000000000000000000000000000000000..798a0cfbc133a3be9af0b80b5aab19858b555b50 GIT binary patch literal 2901 zcmV-b3##;qP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)E2AN zsU20jsWz_8Qg>31P|s0cq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uu>mYFhC}a5V)cYEFfhzNP%O?(t_wafFfiOAXy6ExHXu3-&_D$mKZ#TWcA)V+aERkHU>=&y9i$q74s3`? zNavB9nuO->FHnrv05t{%20l^~1>?}qOn?CZL;M&gcDx6900000NkvXXu0mjf4GDbm literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_single_slider.png b/dist/icon/drag/small/icon_single_slider.png new file mode 100644 index 0000000000000000000000000000000000000000..a510bc55fcef9000dd874f2b62101b2b9db69678 GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XPI|gHhE&{2N|4Anz>$38`<@JjAa=fK9x@J(4l_i^XiQ^B z(RMg0$8c24z)|!&^U5lPGKWXU51(Os^fTb>UyrtL%|{{@n6WBYb7vGOPS9$R+9sc( zeZov(FT;uQhDa7B1@VSCb2`q}2TZqcxGKQY{NG`fU`8PQ0y+>R1`wBcvP+8Km}qtT@x) rdXrV*UxV8A37H4>8hl_-IKXhdGwxi8=Sxwbrx-k4{an^LB{Ts5Ko@Kr literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_string_label.png b/dist/icon/drag/small/icon_string_label.png new file mode 100644 index 0000000000000000000000000000000000000000..0c2a79494f4b5ed7c7e6cd3fe9b718ff0cf83b8a GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XiacE$Ln>}1ZFygL@qhzk0@I@kt}n-p8DclgkGZR`*M~=h zNlfMPht{Kw&8kA|AEX#qzOv{X&S$v5=2n#4xGRyN#FKf#T!s`a1kTu;pQc8oN;r<1DMTMt^qZd5{I1Cu>p4W_8w&>v&pzREvu6{1-oD!M< D)>=e9 literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_string_list.png b/dist/icon/drag/small/icon_string_list.png new file mode 100644 index 0000000000000000000000000000000000000000..0fc2e0f5810e9f584843496a84260ee878c7cc89 GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X$~;{hLn>}1ZFygL@qhzk0@I@kt}n-p8DclgkGZR`SLcL` zO_sQv&cuj@)7&DAJGdLnEP_%PE^z;E3{jpE?eC#{!O2a8dBH6H3BtWsIGIh-uM02S z&S)zjc~RAq*CoIzg2O+th56#dWiJyLJ=p>#$!oANFtRah)mGf+>KgGB=mG{$S3j3^ HP6vfQw+ZE4jmNgbaGkkZ>w(sbrn38O~B1Rn1OwnvOAss`VfSE;Eu z#U(g&xk*SrnZ&BIV@|(V2mggRbq#B#bn!Bjre literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_tree_list.png b/dist/icon/drag/small/icon_tree_list.png new file mode 100644 index 0000000000000000000000000000000000000000..d00c4041387f5bc457e07b65e4b47fe42c371cb3 GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XYCT;XLn>}1B`gpyXyW)iPyDaLDF)wnhYkvLIytdzaLAmH z#$FV2z-6U)g5HjXCzH4{l8!JZM7&Yg7P!b`(V-&3e}t>zi+PX?n@DwIYeVCWOYBAw zC!7w5Dx77i04hjiF!*YzBstANL4ZF%S8?KN)+;3rehNV{Ul|zL7=)CRL{Ao58~{3m N!PC{xWt~$(69CV8MqK~^ literal 0 HcmV?d00001 diff --git a/dist/icon/drag/small/icon_web.png b/dist/icon/drag/small/icon_web.png new file mode 100644 index 0000000000000000000000000000000000000000..a92c2475379cf92234908be41023b62274e501dc GIT binary patch literal 3058 zcmVKLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008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diff --git a/dist/icon/drag_helper.png b/dist/icon/drag_helper.png new file mode 100644 index 0000000000000000000000000000000000000000..1552192b675d63a2e2b4ecab4808195194ae4777 GIT binary patch literal 3585 zcmeHJXHXMb7QQqIAVpdz(uJqen-8OOk)YH70Ys!puR?f`fFjSQN560k#iVSk>C19A|Ri zrmc}f^zhucnf&v3C-p~hx8hB2E3FEQm%IrLBCV|Kf8DQN%vn6>L-#X>pJ5eCUMO@0 zml4rdVIu-b2JqIdhHy#__!PAu%L1XriKY#JH7ayq7^+hBfZ~-GpakASQs-DZrjMiQ z48_cVU^18zW?f{Uz#u@Ulu0K$=;Q*G#;@Qd#)3^q++t-Yi1a0<{&NbAkGIVjJLPy56Zu(38ZBQ(?EUZr6R zy};r~Hz%BvkuAaoU!>CQI}HHO?!bp5B~{Gg!rb(N0g0JTqICy$a<0&MUFb6 z?;j>!7?@G0x-G%+Xx;oF-cVSt1N{z>d`+k;ZH9H}zTCP%`XOCP03*P~7&Pm@rF}zi zZw_0fpp0iSAM^)mVVjbVc^Hxbi<5#JnhZcn({7TQI0fj7L8ML;b-X!xYE_RO`2gN)Nd-Oc=FF= zO|#T|kX2$_oMOElLG*^6vf;{W;i`|JqgL;Pu-OX1;?CG5jtKWbpqYu(!nSaQC*j3{ zOL6Q*!fl;C#gteL*JLZW$cCg3`{jh&YI~TmPC>ax2aoEtWm6-nji|m*`l-Du72tW) zp6@$=Qed_UPcL*E;HlwP4u4x%GH~;U9}0v%O0*9jkY#dw{LS|E<5(@5hvqzD9h~;_ z=8DK9MSDK;Km9p)oAYc*kaLvr;cUy0I}cb|+#@jo~DhA%3Ae(K~-Iv010U&oOm9nbW5i62-{rFzC3!$KaC1 z#>FawEG{{^VnmEb*Y`O{bvRBiBe@pCj4^n!-}P~>mL1j>H=|2ecn(pV%6dc5L3N(` z`7=3<%=|K=UToeMNLd{0*)1K9e1Ah}<5(=4f?t+sZ#JhUp;)qL=u?)9lMC5ddI?oW zHxb3JmGLQK(Cr89(&AFoR={b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c;~gK2lPNJLkZ zm;3murlx8-55%PeemKl~K0DlNGrhNG%gfI_ue`oH7nw3! zaegD5yEeZsCRwf3dv6Jo?Z!lFZr!C(&zhouFXTfUw?g-vU-MYAhj>^)_RIfoW+aQ zZU6G$S%C)7uj-Cl1tkT(I%pg{{7JjV{PTXzQI$ip$J8&IW}E(x7R)3jy4bv<)Z@>w z(}UVQ+Cw7OMG}&71q65*c^WqE_N7dhRF|;zcZVU5(L~>ui<5^l`#1Z|4@TA)cH{e- zD$v+XAJR+gD_Dm}hd_NFT6z7&L3!U;C<#xho9t*1$UJ|bc4W9YuxH;<^2va#vKVr7 zAWeR-xi32SO#Wor6tssU^Z*DF1t2^MfZgL0TmryP27sS70KlFC0QGue-F6)SDk+_7 z>L!5{fS+pmfa3W0g!-Ei5fSkh^Pd9B-_-mE?f=66u;lNJ{{?fX|J6o+|N1vq)F-^( jZ`Oai^uKnM;^e_&bu2{4ixze=SOcJ=rGKqL!zS_{D+5vi literal 0 HcmV?d00001 diff --git a/dist/icon/example.png b/dist/icon/example.png new file mode 100644 index 0000000000000000000000000000000000000000..9de26c690d55174a656a1461f9391328e99de0ed GIT binary patch literal 190645 zcmV)QK(xP!P)|O*+uMEbd-KiAZ)U#vX4pILyek@wilXTIo*;+}!?>=?^E{le_&+(w zzvO?$XPDBTI-j(km;O-vO*aaWNTg6Ga2zKH0$e$t&%>4AoGpE^(~0MKOivu8YwmSO ziqzWL8jFPCc?=y#<=VEYs)8uNAVoP~*_Q2bk|^4qFH5p-=el)$-}ifJ{4f!LK)|-` zR4NsZ$LXuC>%Dqko^#;7oLdPOT*u*L*DwrU$^-&I%ZMY-c=>M8 zr>mp8SggLWsj9N7U^$j$F`Q^SwxXyW zP=n)g`Ft!K0wx!E4&GrozE}ANo;RINmzS3V9fH9i$QN)3yxCnj>gv8c-(Im6^CD=L#|0~pu>0kdsEbcsU1?{Xeq zhx7584!Qn+&p&X4LZSNldYBy;3`n$TnxNKznR}J~oTDp>Qg9g4w4xQ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eknW$@&H_9X7v9HFaW;F#$6})&Sd}q002ovPDHLkV1l$+hO__x literal 0 HcmV?d00001 diff --git a/dist/icon/half_selected.png b/dist/icon/half_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..298dd91a64573983b1217cd9cf2414db90fed104 GIT binary patch literal 2881 zcmV-H3%>M;P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E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bua(`>RI+y?e7jKeZ#YO-C z0B%V{K~#9!V*LOAKLaIziGf1E0%P2~|8UcvKYx9R(!|2NSzS@ykAZ=Kf#LuE{|x{C z|7W;z>+XMI0aPu+|NsA~=mliJIR7bD#s3qfsUL`=2H=PVY@tni7qGA}Z@zl_9??k| fo@NF-Hv$F#S3ptGhq)F>00000NkvXXu0mjfaae%Q literal 0 HcmV?d00001 diff --git a/dist/icon/icon_down_arrow.png b/dist/icon/icon_down_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..b77c3309045e2e000764e46990b449f20bd344da GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xay?xfLn>}1r5s@X_y4~>!xEl`AI!?ik6GD*7%woi{}HcqhOkJsw3 ysZ0=Bz?d=X{A6M6-xGNX7N|rOx=A}UFfs(aex_siB#8-VF@vY8pUXO@geCxO{XCFT1cO%%jO7g6imZE7S8Hr~V8DF1zDtII z>Hpa~CpOLbctvlICC?OZx621sFuTbD)dsTnSS4IxY+mf>wBjq*s_U807@Xdg1$4KC xo&9#v#NZXfqUfVXzI;5v+QWR;mYu_ZA>xVr+$>|6-9UFSc)I$ztaD0e0sv~~T}S`` literal 0 HcmV?d00001 diff --git a/dist/icon/left-join.png b/dist/icon/left-join.png new file mode 100644 index 0000000000000000000000000000000000000000..40f3a324ac620181b46557a585cdff1d1e811f48 GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DWNC@5Lt z8c`CQpH@ym+MOSnzI+Rf$Ow2?nnk7|R*BO@)N)3cmdK_+P}bVNwiJ z(VoV6a(+L#r|b1DYYb%Xu}ZkYxR_6(^uP*cHqYjkfW^(1+&JUd1+um`N16PP5?!1L qRA7=n?QqokElfSkcWv1@3>fx0DHr~U^EUuGiNVv=&t;ucLK6VxMpiZe literal 0 HcmV?d00001 diff --git a/dist/icon/loading.gif b/dist/icon/loading.gif index e8c289293b11c889703d83dce6631fce90da4630..d04fdd21277e90469d8ef930254c69b23dc75bea 100644 GIT binary patch literal 1810 zcmZ?wbhEHblw*)%Sj58c|Ns9pXU@!=IWsLS4ajDI0mc8^ey$r5%(GQ`zk9!uLS~AsQn;zFfp39xYDT6>~zjAN>wn`Gt*5rFf&&$x70Hx^| z#0uTKVr7^KE~&-IMVSR9nfZANAQKal@=Hr>m4GgVcpix%w4} z1^R}12Ku?VAb){X7ncO3BAkI$b#X{#L8^XGYH@yPQF1C!xiU;MFzoPK1X2iejg@~< zCNNSGb6oP1OLJ56N<3X`m4GsODVZr&mKG+)X~yQ3x@jqC#=0iPX34siNr_3i=H^Cb zCP@a#$wr1IFmtf!H?=f&GO%zmHM2A~GcP;hnz$GU=sZ(?$09!O9V z6j2a=yQCInmZhe+73JqDfJ53U6N@W|3jv7!6mmmQALuB3P;x;^J}@C*nglW7nE}Xw zXQ$LWU>+(0W){Z(|Nj2@{p;tC@87({PcxqRv3h4bgmo;iK$# zu35cm<%;FYmM&SmXyJnS^XAT(J!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhN zn(C^`it@73lH#Jmg8aPPob0U3jP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D z4|g|L7iT9&2YWkP8*5;4GdD9eF*Y(Z(AU$|(bm$`P*+n`QC3n^ke8E{k(QE_5El~_ z5f%~@;OFDz;pXDxU}s}xVP*mrIf_47SUDJ27<53T5~#ppV9xf~b?2YKDbLk=!#I47 zKj2|7iBk@1Fw=XgG%tA7rum-^ZB$z`t2Ta9@5`f}tTHYWiYhO@RB2ox^5~80lHg@! z-92UD2O1vSn9!ujP?+#kb;;uA9#uSfyU%7=9IlIB{HP|cP@*xqHKwDptCJI9KMMmZ zgBXJ#(0(J2T{?#hoYY^}@J72%m$+rtm?TiUFvZPLYu|>gTANw!RK&Vl$o+Si_jYSA zL&rhaz$r-HU}a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A_ms76BOQWg0Le^W#?SMIT$jE7 zyw1!lG*$#k#iqZyl9~L_CjIwBb}$%9+e2Vw!1@$nfpvj1y2o4hJabo7^;(V}>++Tz z{|NtdydBeFpKnv*Vg9BTu3P)+)3J?9`*6t|c{b*k>-L!PvY`#5^i1^XCnxh zky})0T&rp6 zJFwUVv-;Dzt2_z1)}rtpHBQH#<-`N0%%UP1TF^VNx2@~Zh_4nbMMxj7zeHTrB&q)a Dl)1NK literal 0 HcmV?d00001 diff --git a/dist/icon/no_auth.png b/dist/icon/no_auth.png new file mode 100644 index 0000000000000000000000000000000000000000..757eee805169713df38c523fb16f2c9b53e2bf84 GIT binary patch literal 1864 zcmV-O2ePbXFRCwC#oqtl|NEF9AA)pBEV2$M; z`@?Z>pa-zT6X>2`^aQRaaOVW$oM80?>IoK4uvE+b0K3 zc`SfnNZP`Xq_e7z#9%EHgmcPa>}Zx5M~I1 z0TBMssGm^LzpRQ#_=W%&8<;P~T{c!>d&+vO0dOSz#dJUhv+gL0>+=1 zm~a8~gYfY1z;14C*zN7DyYF;5x_}8a&0>UrQH(-Z7KnU4@4|qeqp00(v#YBsUBIjk zn~*eyz$jqeSWxvBWV2b8%jE`wXgLPYPE8FQr`2k)%gamGgA}UbY)gaki8W+^9aS&@ z!1VOA>lM7Nudi9N(QrTY*VpZ5?}JbVaPs+S*QC{opiQ?Udx*+V1uzPQ z0<$cu#|!H9nhPSV0KnU~v+TP!Z+dc!ZQJbb?oOqrEcGje2LS;XMHOc|Gc(hLaesf$ z>a`j>JNxf>b(P7ml$l~y`tf(~Ztqy| z)zCoj%8&yUX9{5k!ixvv@2_8bLK7G@o1J1AUnukI#tCh$)|ETPra!BHy{`vN; z2SzTJj|>Ae=~iiZgxqn*^}Gf=F=`ntP({qsLp$~ND$Z_lakZ6bR7C zdtRbYMVzqh>mf?K!O0)b#xzMUs|9AB;Ek8d$AAg_Z zB$8OaSpNL^bEFFu!s_JYMEIDqv$Je@c{xt=*k+tZgG+E^z>p>I+(x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vt$zE8cMA+sWZJ79q z&EQ=9DuyLe4HgU?KNlX7Z>(VU_*1{=3-cT{22*KwJOlSXt*FPlo_4Ox2+>M!QDkLoFvEad971M-3c8@)+Pk!C4uYcdQ;`OYy zmL-i3_p0-GZVK>vyK2>~4c5JL1eB%+z3Vl+T`DvG_MVLR#_n()^?5;6Vr@@;)=k#$ zZpzE_T54$d*|1wima*j7qsuBBUu?QMtjp$XRNfV{{>urY4xP1=#aVB^xD$S-Va{Pm zi4Erj3e#`A)6VN|V7x7bFGZab}U}AQSd?IosC*Pzr!0CUt1iQ2Vw?4 z;NgjIXXt0CKDO$Y%NwbK4YL0gdp}M2|H<5rRf1tj;c|g@g)W)E5Mc0h^>bP0l+XkK DB?pu~ literal 0 HcmV?d00001 diff --git a/dist/icon/radio-disable2.png b/dist/icon/radio-disable2.png new file mode 100644 index 0000000000000000000000000000000000000000..f5a71f34cabc811841e5490eeaaf17598a26c3a6 GIT binary patch literal 319 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP*AeO zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkDP|+Dr7srr_TSsWZRl)t zI?$w7@a0D#tHM==Ba9Ab_(lJ59FcZ-bZy!+{s~u&m8uz6++^^Ob-2{Q=fGykz`L^{ zk>ScS?g|rS=_H0?&LRmDfrT>}S1n_VmS9m>J!$gP)Cp53GH#Z)uRQeO#m8i}oUEA_ zeA<|2q?MTMit1WCkyE$e0mGA=oSc%aClVRDo>xe)KS?*KH(szZ^?(?+d}qN|_a_kz z(hR-f>`ZM3gf20!Y2@%tTySNFz}W@;0fx*^LOLc+VOKF{Vv%5A5_35a;VCi;=r0CO LS3j3^P6%09yO+j=Ip2zSOJw~&J0!4G*P z5@eZdgr4-QX!G#tIly53*Ll_x&HqpHYd8!TX1!c4yeMq_E}-ujJYD@<);T3K0RY*+ Bi*o<~ literal 0 HcmV?d00001 diff --git a/dist/icon/real_time.png b/dist/icon/real_time.png new file mode 100644 index 0000000000000000000000000000000000000000..0a27475b563af9b4b34c2ae87acd634c0c288c08 GIT binary patch literal 4802 zcmV;z5KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)E2AN zsU20jsWz_8Qg>31P|s0cqrPALg8E|(vWA65poU1JRAaZs8I2(p#xiB`SVGovRs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001 diff --git a/dist/icon/right-join.png b/dist/icon/right-join.png new file mode 100644 index 0000000000000000000000000000000000000000..27540b6fbc152c7b1c94dc736cf048f07dfc9592 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DWNC@5Lt z8c`CQpH@CFT1cO%%jO7g6imZE7S8Hreyx99+#FByK z-|U?eQ_UZ*jIH?E^u+!0ffdYdvOtxA>^)WqR~VZYJ36iS%C%~H<}(JTw`Bp{ZFksC sW=KhtGK9{0y5$^e5A$7Hb`ArE&n}AGYumqm1Gun zRwfsqvvcbr5RQS``at2*k+GQW$pAQoeod}j87Bn#pp<&bvaAw9Jo?sIYyIAJovNzp zjl9&jCIk%SJy}0n=yRUuFGW$XG)=u5-1j|enufJ)d$I6Wd+F2qbuK%1^jJWqp-?b5 z2j?LUY1e4n^6 literal 0 HcmV?d00001 diff --git a/dist/icon/slider-normal.png b/dist/icon/slider-normal.png new file mode 100644 index 0000000000000000000000000000000000000000..8a611ffc9c6dcac5b568adfaeb1bfbc25466fb87 GIT binary patch literal 425 zcmV;a0apHrP)+h#?>6;X#}R{`i=y~Qk|bA3UH8seYyI8#eUaz+ z7hBY9RH`sdgDGW?Xkj6vn&&7nhKY|I;=+>wq1gQ zXCD@h*A+_PcAF&sPUOb#-$b zZJI{7!m$qPQHOYHSh6IO5sL%(>Kifk;{u`uZzKbrB!;ac43NWf literal 0 HcmV?d00001 diff --git a/dist/icon/table_style_1.png b/dist/icon/table_style_1.png new file mode 100644 index 0000000000000000000000000000000000000000..6fb6e2cda1d372854d25030f3599b623a8272c7f GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6Jlq6AMD$B>F!Nq_$Tw`bO66lU&a zJgb|)D41Cte?etVnx(e^-(Ll(Ut$JMpBdL0F)Le$+Wz@7J45!-e$=3JZn}IIl0)eMVNs_g5g`DhU!1rUHw427(8A5T-G@yGywqb CYeX6V literal 0 HcmV?d00001 diff --git a/dist/icon/table_style_2.png b/dist/icon/table_style_2.png new file mode 100644 index 0000000000000000000000000000000000000000..0c216d52cf14b2a4e71ddb8221a285ff0fc9ada6 GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6Jlq6AMD$B>F!Nq_$Tw`bO66lU&a zJgb|)D41Cte?etVnx(e^-(LkOwTU$!uPRGP>K{D7a4I7_@9y7z?f?yQsgunInA`$f zV)oYdtGTvrTP5^3Lrconb;@$3V;8;V3ovjPFhp#=)Wwm&I1OkQgQu&X%Q~loCIF1P BL3scG literal 0 HcmV?d00001 diff --git a/dist/icon/table_style_3.png b/dist/icon/table_style_3.png new file mode 100644 index 0000000000000000000000000000000000000000..8bd26632929e3530177355b86fbc752907c25431 GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-g=C3q zL`iUdT1k0gQ7VIDN`6wRf@f}GdTLN=VoGJ<$y6JlqKTd^jv*DdlK%YvZ_ljDD9qf; zcvd%oQE+|y{$o;p>+NdN1cV zFrDPQC`s~~PIOPOvEt8PzpC6eu*UDNJDPQ{IbB~;WXX|2DF=^vvuDpPG@0b?pq0cB z`9Yq2N73td^)(F>Y)-tn=pm<>dND)h0W$+58$(Lia)Wz4%Xoo~WAJqKb6Mw<&;$S% Ckz7;& literal 0 HcmV?d00001 diff --git a/dist/icon/test_fail.png b/dist/icon/test_fail.png new file mode 100644 index 0000000000000000000000000000000000000000..0e4b1917eba3f27019aefe1833d661c18c1d18c3 GIT binary patch literal 3724 zcmaJ^c{r5o-=C5t>yfgCX=I5r##oZU$TFlcktK|S#>`kUi^gEA35m3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>FGk&`xmJ0`YkLu$>E zy}E}@u2tS$JO(gpi4n>X@L7N7{;U@j+uXskDtAXUCuu*y^IM)BSI)dVKLH$|v^wq04yotK#mj5}|_ z6<7*oHm4O7PnzU{+*2;E@lGNY zm&^z3=~6`Th+p1NK%G>HV;#+3hIhuD?9dq>VI(cY%u#1+^wxTdkR94mh9bsM)qF2c zz+*(Hap=h2s~=|9bQkvb@SRian|gI4Be#ZhS-jw?hE~Ts_4Hw5jL=h)YmfhGH+~%6 z7nu@!zBPe$4jFRuVWzaif^-jS#(kpO`({>~kjcQoRS)Bw29bkjKNw_1WnT4KNPS~< zAFT8vdA?jK?4s!>E!WCbt3>22NjxG;vDdv_vqGQTa$geu$Z_gPnwA@>U)Ei$ZVisg zaQP^RE2M0tRv)3W2A{Y_c-fa!fN449EeWC5ghlRab z&5qOg-n4`&rZQ!&$I>nGp2ojvJ*s#M-gV+Wt~=dtXwz8M#4ak(Pl2|#IZL}) zD6b#-0Qx;IrvHkBgu6Q>?#2|dMzZ#%(cHe)YOr;@-Xr)_y2-cG95jRV#<7-NhSnXKq< zb0c=|#U>5=c-K-PS<%dN3`M9BToYN7K+twSBqvTlv>h{kXMdilZE>FkiU6o|zGu}C qhL^5Jk0xb*%QjM8e7Gfj7Vvb7y0ZIRFMa3#&=zsZs?y?Y-2VW-m$?%F literal 0 HcmV?d00001 diff --git a/dist/icon/test_success.png b/dist/icon/test_success.png new file mode 100644 index 0000000000000000000000000000000000000000..0c6ff57918222e186cbbaf4f5517e1026456ac92 GIT binary patch literal 1201 zcmV;i1Wx;jP)gBfpJH;|IxOC)$$f?#6Zpf1BEI8Pr5wAgsmQ%EI2#V(w!g z8@;LXea$_+sjld;K=b4kfSi83raF!pJZQ@PT7 z5lo4A2FTv+Emw*&W%!;A55t3K|6lU=Fdkbh_Tfg!OoBT1pRnhXJEp zFb$)CPi2dbX=-zBWj||4bD9PWkd#bI^aXJ+VF4&T#cIOmNp;2|okvPY}T(?F^BW^4W^752F0-penuT5Rq( z1O6oqlYvU{a-`#ChzhHGiXk(jYM9H08}U?i?-dx!X=s(k{E(r!C6iHMf??6?a__~t z;?$Uu@3?ONzqf8QYp2xwwRD~lRPqE zm|H4LwGQzRpu4eMQS#C2c=||BU6P?iac%u(d{!7snPSi9V6|kXEbK0MJ_E9mvx8g! zs0PA_o&}}<3R6+)glQlZL!QyYe$cbROV=QbG#QvU%dRG;YK5^VFw0aiopbMhQOx!ziw8UBW@FovOF z;e@gi8%QGAkr5+dL)hmSUz=u6hPlZsE-Te=EoBoAP@G~qNRoY`v2Fezj@@eakg|4< zbUhC&6SZ&vPO_T&Tp&*bYU|^Q-3viS#Gj&!F0{5j+_}$WWBtteM}PqUx9?KPQZDiC P00000NkvXXu0mjfa&<8E literal 0 HcmV?d00001 diff --git a/dist/icon/union.png b/dist/icon/union.png new file mode 100644 index 0000000000000000000000000000000000000000..0085abc0e294196395910cf68740830127ee075f GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DWNC@5Lt z8c`CQpH@pEvgCvu_FKH?+Ul2>upRsE(BHqTF_68- z3amz=^uP+{h=i+;8Y~~YpX|Q)>?fd9nsY&xjK+Z<|Nl39J15D&#KX{IBG#*T!ipPc OHG`+CpUXO@geCy~rB3(& literal 0 HcmV?d00001 From c407eb91cac2b8cffbd24fb279f6a86f862cafb3 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 15:46:21 +0800 Subject: [PATCH 10/19] add --- demo.html | 2 + src/css/base/segment/segment.css | 1 + .../base/single/editor/editor.textarea.css | 1 + src/css/base/single/text.css | 1 + src/css/lib/animate.css | 4 +- src/css/utils/overflow.css | 1 + .../toolbar/toolbar.progress.processor.css | 1 + .../dynamicnumber.sequencetable.css | 1 + .../listnumber.sequencetable.css | 1 + .../treenumber.sequencetable.css | 1 + src/less/typographic.less | 3 + src/less/visual.less | 175 +++++++++++++++--- 12 files changed, 169 insertions(+), 23 deletions(-) diff --git a/demo.html b/demo.html index 20808e0f08..42110f141e 100644 --- a/demo.html +++ b/demo.html @@ -8,6 +8,8 @@ href="./dist/core.css"/> + diff --git a/src/css/base/segment/segment.css b/src/css/base/segment/segment.css index f00f80ed63..11ddb87d90 100644 --- a/src/css/base/segment/segment.css +++ b/src/css/base/segment/segment.css @@ -2,6 +2,7 @@ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-segment > .center-element { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; background: #ffffff; diff --git a/src/css/base/single/editor/editor.textarea.css b/src/css/base/single/editor/editor.textarea.css index 8544a6b47b..150d4a224d 100644 --- a/src/css/base/single/editor/editor.textarea.css +++ b/src/css/base/single/editor/editor.textarea.css @@ -2,6 +2,7 @@ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-textarea-editor { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; } diff --git a/src/css/base/single/text.css b/src/css/base/single/text.css index 0128c7c7c3..34613e8aa1 100644 --- a/src/css/base/single/text.css +++ b/src/css/base/single/text.css @@ -4,6 +4,7 @@ .bi-text { text-overflow: ellipsis; overflow-x: hidden; + overflow-y: hidden; white-space: nowrap; word-break: break-all; } diff --git a/src/css/lib/animate.css b/src/css/lib/animate.css index 6f71778c12..05756ce92a 100644 --- a/src/css/lib/animate.css +++ b/src/css/lib/animate.css @@ -2201,14 +2201,14 @@ } } @-webkit-keyframes zoomInUp { - from { + from { opacity: 0; -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0); transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0); -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } - 60% { + 60% { opacity: 1; -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); diff --git a/src/css/utils/overflow.css b/src/css/utils/overflow.css index a8687e25fa..c7feb65503 100644 --- a/src/css/utils/overflow.css +++ b/src/css/utils/overflow.css @@ -36,5 +36,6 @@ .overflow-dot { text-overflow: ellipsis; overflow-x: hidden; + overflow-y: hidden; white-space: nowrap; } diff --git a/src/css/widget/base/toolbar/toolbar.progress.processor.css b/src/css/widget/base/toolbar/toolbar.progress.processor.css index 552b254766..85df881138 100644 --- a/src/css/widget/base/toolbar/toolbar.progress.processor.css +++ b/src/css/widget/base/toolbar/toolbar.progress.processor.css @@ -6,6 +6,7 @@ -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; + overflow: hidden; overflow-x: hidden; overflow-y: hidden; } diff --git a/src/css/widget/sequencetable/dynamicnumber.sequencetable.css b/src/css/widget/sequencetable/dynamicnumber.sequencetable.css index 059def484b..fed0aa1c3e 100644 --- a/src/css/widget/sequencetable/dynamicnumber.sequencetable.css +++ b/src/css/widget/sequencetable/dynamicnumber.sequencetable.css @@ -2,6 +2,7 @@ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-sequence-table-dynamic-number .sequence-table-title-cell { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; -webkit-box-sizing: border-box; diff --git a/src/css/widget/sequencetable/listnumber.sequencetable.css b/src/css/widget/sequencetable/listnumber.sequencetable.css index bd987fced5..dace5ccd17 100644 --- a/src/css/widget/sequencetable/listnumber.sequencetable.css +++ b/src/css/widget/sequencetable/listnumber.sequencetable.css @@ -2,6 +2,7 @@ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-sequence-table-list-number .sequence-table-title-cell { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; -webkit-box-sizing: border-box; diff --git a/src/css/widget/sequencetable/treenumber.sequencetable.css b/src/css/widget/sequencetable/treenumber.sequencetable.css index 616a45cfc2..be1c1be2a0 100644 --- a/src/css/widget/sequencetable/treenumber.sequencetable.css +++ b/src/css/widget/sequencetable/treenumber.sequencetable.css @@ -2,6 +2,7 @@ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-sequence-table-tree-number .sequence-table-title-cell { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; -webkit-box-sizing: border-box; diff --git a/src/less/typographic.less b/src/less/typographic.less index 4a2149c3f5..f2cb38f7e2 100644 --- a/src/less/typographic.less +++ b/src/less/typographic.less @@ -9,17 +9,20 @@ } .overflow-auto(){ + overflow: auto; overflow-x: auto; overflow-y: auto; } .overflow-hidden(){ + overflow: hidden; overflow-x: hidden; overflow-y: hidden; } .overflow-dot(){ text-overflow:ellipsis; overflow-x: hidden; + overflow-y: hidden; white-space:nowrap; } .user-select(@select){ diff --git a/src/less/visual.less b/src/less/visual.less index 0e943dc423..8865353bbe 100644 --- a/src/less/visual.less +++ b/src/less/visual.less @@ -1,37 +1,49 @@ -.text-shadow(none){ +.text-shadow(none) { text-shadow: none; -moz-text-shadow: none; -webkit-text-shadow: none; } -.text-shadow(@x, @y, @blur, @color) when not (@x = none){ + +.text-shadow(@x, @y, @blur, @color) when not (@x = none) { text-shadow: @arguments; -moz-text-shadow: @arguments; -webkit-text-shadow: @arguments; } -.box-shadow(none){ + +.box-shadow(none) { box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; } + .box-shadow(@style, @c) when (iscolor(@c)) { -webkit-box-shadow: @style @c; -moz-box-shadow: @style @c; box-shadow: @style @c; } + .box-shadow(@x, @y, @blur, @spreed: 0px, @color, @inset: outset) when (iscolor(@color)) and (isnumber(unit(@spreed))){ box-shadow: @arguments; -webkit-box-shadow: @arguments; -moz-box-shadow: @arguments; } -.opacity(@opa){ +.opacity(@opa) { opacity: @opa; - @opa-ie:@opa*100; + @opa-ie: @opa*100; filter: ~'alpha(opacity=@{opa-ie})'; } + +.transition(@transition) { + -webkit-transition: @transition; + -moz-transition: @transition; + -o-transition: @transition; + transition: @transition; +} + //渐变 -.gradient(@start, @end){ - background: @start; //不支持的用这个 +.gradient(@start, @end) { + background: @start; //不支持的用这个 background: -webkit-gradient(linear, 0 0, 0 100%, from(@start) to(@end)); /*old webkit*/ background: -webkit-linear-gradient(@start, @end); /*new webkit*/ background: -moz-linear-gradient(@start, @end); /*gecko*/ @@ -40,49 +52,170 @@ background: linear-gradient(@start, @end); /*future CSS3 browsers*/ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@{start}', endColorstr='@{end}', GradientType='0'); } -.border-radius(@radius: 5px){ + +.border-radius(@radius: 5px) { -webkit-border-radius: @radius; -moz-border-radius: @radius; border-radius: @radius; } -.border-corner-top-radius(@leftTop, @rightTop){ + +.border-corner-top-radius(@leftTop, @rightTop) { -moz-border-radius-topleft: @leftTop; -webkit-border-top-left-radius: @leftTop; -moz-border-radius-topright: @rightTop; -webkit-border-top-right-radius: @rightTop; - border-top-left-radius:@leftTop; - border-top-right-radius:@rightTop; + border-top-left-radius: @leftTop; + border-top-right-radius: @rightTop; } -.border-corner-bottom-radius(@leftBottom, @rightBottom){ + +.border-corner-bottom-radius(@leftBottom, @rightBottom) { -moz-border-radius-bottomleft: @rightBottom; -webkit-border-bottom-left-radius: @rightBottom; -moz-border-radius-bottomright: @leftBottom; -webkit-border-bottom-right-radius: @rightBottom; - border-bottom-right-radius:@rightBottom; - border-bottom-left-radius:@leftBottom; + border-bottom-right-radius: @rightBottom; + border-bottom-left-radius: @leftBottom; } -.border-corner-left-radius(@leftTop, @leftBottom){ + +.border-corner-left-radius(@leftTop, @leftBottom) { -moz-border-radius-topleft: @leftTop; -webkit-border-top-left-radius: @leftTop; -moz-border-radius-bottomleft: @leftBottom; -webkit-border-bottom-left-radius: @leftBottom; - border-top-left-radius:@leftTop; - border-bottom-left-radius:@leftBottom; + border-top-left-radius: @leftTop; + border-bottom-left-radius: @leftBottom; } -.border-corner-right-radius(@rightTop, @rightBottom){ + +.border-corner-right-radius(@rightTop, @rightBottom) { -moz-border-radius-topright: @rightTop; -webkit-border-top-right-radius: @rightTop; -moz-border-radius-bottomright: @rightBottom; -webkit-border-bottom-right-radius: @rightBottom; - border-top-right-radius:@rightTop; - border-bottom-right-radius:@rightBottom; + border-top-right-radius: @rightTop; + border-bottom-right-radius: @rightBottom; } -.border-corner-radius(@leftTop, @rightTop, @rightBottom, @leftBottom){ + +.border-corner-radius(@leftTop, @rightTop, @rightBottom, @leftBottom) { -webkit-border-radius: @arguments; -moz-border-radius: @arguments; border-radius: @arguments; +} + +@sideHeight: 6px; +@sideLength: 12px; +.solid-triangle-up(@color) { + width: 0; + height: 0; + border-left: (@sideLength/2) solid transparent; + border-right: (@sideLength/2) solid transparent; + border-bottom: @sideHeight solid @color; +} + +.solid-triangle-down(@color) { + width: 0; + height: 0; + border-left: (@sideLength/2) solid transparent; + border-right: (@sideLength/2) solid transparent; + border-top: @sideHeight solid @color; +} + +.solid-triangle-left(@color) { + width: 0; + height: 0; + border-top: (@sideLength/2) solid transparent; + border-right: @sideHeight solid @color; + border-bottom: (@sideLength/2) solid transparent; +} + +.solid-triangle-right(@color) { + width: 0; + height: 0; + border-top: (@sideLength/2) solid transparent; + border-left: @sideHeight solid @color; + border-bottom: (@sideLength/2) solid transparent; +} + +.solid-triangle-top-left(@color) { + width: 0; + height: 0; + border-top: @sideHeight solid @color; + border-right: @sideHeight solid transparent; +} + +.solid-triangle-top-right(@color) { + width: 0; + height: 0; + border-top: @sideHeight solid @color; + border-left: @sideHeight solid transparent; +} + +.solid-triangle-bottom-left(@color) { + width: 0; + height: 0; + border-bottom: @sideHeight solid @color; + border-right: @sideHeight solid transparent; +} + +.solid-triangle-bottom-right(@color) { + width: 0; + height: 0; + border-bottom: @sideHeight solid @color; + border-left: @sideHeight solid transparent; +} + +.triangle-top() { + 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 #f5f5f5; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + content: ""; + } +} + +.triangle-bottom() { + position: absolute; + width: 16px; + height: 10px; + border-top: 1px solid #f5f5f5; + + &:after { + position: absolute; + right: 1px; + top: -1px; + border-top: 9px solid #f5f5f5; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + content: ""; + } + &:before { + position: absolute; + border-top: 10px solid #cccccc; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + content: ""; + } + } \ No newline at end of file From e1ca98c4bb6bcf1f2e216ecab4fd7902abc0f0ae Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 15:47:39 +0800 Subject: [PATCH 11/19] add --- demo.html | 1 - dist/base.css | 34 ++++++++++++++++++++++++++++++++++ dist/core.css | 1 + dist/core.js | 4 ++-- dist/widget.css | 4 ++++ src/core/func/function.js | 4 ++-- 6 files changed, 43 insertions(+), 5 deletions(-) diff --git a/demo.html b/demo.html index 42110f141e..ffc2d3dfb5 100644 --- a/demo.html +++ b/demo.html @@ -21,7 +21,6 @@

      -
      diff --git a/dist/base.css b/dist/base.css index 867afd4676..534ea1ebe6 100644 --- a/dist/base.css +++ b/dist/base.css @@ -73,6 +73,37 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ +.bi-bubble-combo .bubble-combo-triangle-left { + width: 0; + height: 0; + border-top: 6px solid transparent; + border-left: 6px solid #009de3; + border-bottom: 6px solid transparent; +} +.bi-bubble-combo .bubble-combo-triangle-right { + width: 0; + height: 0; + border-top: 6px solid transparent; + border-right: 6px solid #009de3; + border-bottom: 6px solid transparent; +} +.bi-bubble-combo .bubble-combo-triangle-top { + width: 0; + height: 0; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid #009de3; +} +.bi-bubble-combo .bubble-combo-triangle-bottom { + width: 0; + height: 0; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #009de3; +} +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ .bi-bubble-popup-view { -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); @@ -736,6 +767,7 @@ li.CodeMirror-hint-active { /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-segment > .center-element { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; background: #ffffff; @@ -931,6 +963,7 @@ li.CodeMirror-hint-active { /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-textarea-editor { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; } @@ -982,6 +1015,7 @@ li.CodeMirror-hint-active { .bi-text { text-overflow: ellipsis; overflow-x: hidden; + overflow-y: hidden; white-space: nowrap; word-break: break-all; } diff --git a/dist/core.css b/dist/core.css index c533d6120e..30b90d3c5e 100644 --- a/dist/core.css +++ b/dist/core.css @@ -9745,6 +9745,7 @@ textarea::-webkit-scrollbar-thumb { .overflow-dot { text-overflow: ellipsis; overflow-x: hidden; + overflow-y: hidden; white-space: nowrap; } /****添加计算宽度的--运算符直接需要space****/ diff --git a/dist/core.js b/dist/core.js index 918dffeaba..eeff4ed0bb 100644 --- a/dist/core.js +++ b/dist/core.js @@ -22117,7 +22117,7 @@ $(function () { }, getTextSizeWidth: function (text, fontSize) { - var span = $("").addClass("text-width-span").appendTo($("#container")); + var span = $("").addClass("text-width-span").appendTo($("body")); if (fontSize == null) { fontSize = 12; @@ -22139,7 +22139,7 @@ $(function () { position: "absolute", top: "-9999px", overflow: "scroll" - }).appendTo($("#container")); + }).appendTo($("body")); this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth; ul.destroy(); } diff --git a/dist/widget.css b/dist/widget.css index e7217f5dcc..e8ed9dbd0c 100644 --- a/dist/widget.css +++ b/dist/widget.css @@ -205,6 +205,7 @@ -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; + overflow: hidden; overflow-x: hidden; overflow-y: hidden; } @@ -1324,6 +1325,7 @@ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-sequence-table-dynamic-number .sequence-table-title-cell { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; -webkit-box-sizing: border-box; @@ -1353,6 +1355,7 @@ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-sequence-table-list-number .sequence-table-title-cell { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; -webkit-box-sizing: border-box; @@ -1385,6 +1388,7 @@ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ .bi-sequence-table-tree-number .sequence-table-title-cell { + overflow: hidden; overflow-x: hidden; overflow-y: hidden; -webkit-box-sizing: border-box; diff --git a/src/core/func/function.js b/src/core/func/function.js index 6fbcfa0e3c..b59c8eb321 100644 --- a/src/core/func/function.js +++ b/src/core/func/function.js @@ -298,7 +298,7 @@ $(function () { }, getTextSizeWidth: function (text, fontSize) { - var span = $("").addClass("text-width-span").appendTo($("#container")); + var span = $("").addClass("text-width-span").appendTo($("body")); if (fontSize == null) { fontSize = 12; @@ -320,7 +320,7 @@ $(function () { position: "absolute", top: "-9999px", overflow: "scroll" - }).appendTo($("#container")); + }).appendTo($("body")); this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth; ul.destroy(); } From c223d6c178ac236832ac6cc8c8f565211e0d14f6 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 15:47:53 +0800 Subject: [PATCH 12/19] add --- src/css/base/combo/combo.bubble.css | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/css/base/combo/combo.bubble.css diff --git a/src/css/base/combo/combo.bubble.css b/src/css/base/combo/combo.bubble.css new file mode 100644 index 0000000000..0c7ee8d0ed --- /dev/null +++ b/src/css/base/combo/combo.bubble.css @@ -0,0 +1,31 @@ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +.bi-bubble-combo .bubble-combo-triangle-left { + width: 0; + height: 0; + border-top: 6px solid transparent; + border-left: 6px solid #009de3; + border-bottom: 6px solid transparent; +} +.bi-bubble-combo .bubble-combo-triangle-right { + width: 0; + height: 0; + border-top: 6px solid transparent; + border-right: 6px solid #009de3; + border-bottom: 6px solid transparent; +} +.bi-bubble-combo .bubble-combo-triangle-top { + width: 0; + height: 0; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid #009de3; +} +.bi-bubble-combo .bubble-combo-triangle-bottom { + width: 0; + height: 0; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #009de3; +} From d927eb54a6333f82818e2dafebfc10dd39880627 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 15:52:09 +0800 Subject: [PATCH 13/19] add --- dist/core.js | 127 ++-------------------------------------------- src/core/base.js | 28 +--------- src/core/cache.js | 98 ----------------------------------- 3 files changed, 5 insertions(+), 248 deletions(-) delete mode 100644 src/core/cache.js diff --git a/dist/core.js b/dist/core.js index eeff4ed0bb..859c9f544d 100644 --- a/dist/core.js +++ b/dist/core.js @@ -12883,7 +12883,7 @@ if (!window.BI) { ; !(function ($, undefined) { _.extend(BI, { - version: "4.0" + version: "2.0" }); var traverse = function (func, context) { return function (value, key, obj) { @@ -12906,7 +12906,7 @@ if (!window.BI) { //Utility _.extend(BI, { i18nText: function (key) { - var localeText = ""; + var localeText = (BI.i18n && BI.i18n[key]) || ""; if (!localeText) { localeText = key; } @@ -12954,30 +12954,6 @@ if (!window.BI) { return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View); }, - createWidget: function (item, options) { - var el; - options || (options = {}); - if (BI.isEmpty(item) && BI.isEmpty(options)) { - return BI.Plugin.getObject("bi.layout", BI.createWidget({ - type: "bi.layout" - })); - } - if (BI.isWidget(item)) { - return item; - } - if (item && (item.type || options.type)) { - el = BI.extend({}, options, item); - return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); - } - if (item && item.el && (item.el.type || options.type)) { - el = BI.extend({}, options, item.el); - return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); - } - if (item && BI.isWidget(item.el)) { - return item.el; - } - }, - createWidgets: function (items, options) { if (!BI.isArray(items)) { throw new Error("cannot create Widgets") @@ -19726,104 +19702,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, { } }) } -});/* - * 前端缓存 - */ -window.localStorage || (window.localStorage = { - items: {}, - setItem: function (k, v) { - BI.Cache.addCookie(k, v); - }, - getItem: function (k) { - return BI.Cache.getCookie(k); - }, - removeItem: function (k) { - BI.Cache.deleteCookie(k); - }, - key: function () { - - }, - clear: function () { - this.items = {}; - } -}); -BI.Cache = { - _prefix: "bi", - setUsername: function (username) { - localStorage.setItem(BI.Cache._prefix + ".username", (username + "" || "").toUpperCase()); - }, - getUsername: function () { - return localStorage.getItem(BI.Cache._prefix + ".username") || ""; - }, - _getKeyPrefix: function () { - return BI.Cache.getUsername() + "." + BI.Cache._prefix + "."; - }, - _generateKey: function (key) { - return BI.Cache._getKeyPrefix() + (key || ""); - }, - getItem: function (key) { - return localStorage.getItem(BI.Cache._generateKey(key)); - }, - setItem: function (key, value) { - localStorage.setItem(BI.Cache._generateKey(key), value); - }, - removeItem: function (key) { - localStorage.removeItem(BI.Cache._generateKey(key)); - }, - clear: function () { - for (var i = localStorage.length; i >= 0; i--) { - var key = localStorage.key(i); - if (key) { - if (key.indexOf(BI.Cache._getKeyPrefix()) === 0) { - localStorage.removeItem(key); - } - } - } - }, - keys: function () { - var result = []; - for (var i = localStorage.length; i >= 0; i--) { - var key = localStorage.key(i); - if (key) { - var prefix = BI.Cache._getKeyPrefix(); - if (key.indexOf(prefix) === 0) { - result[result.length] = key.substring(prefix.length); - } - } - } - return result; - }, - - addCookie: function (name, value, path, expiresHours) { - var cookieString = name + "=" + escape(value); - // 判断是否设置过期时间 - if (expiresHours && expiresHours > 0) { - var date = new Date(); - date.setTime(date.getTime() + expiresHours * 3600 * 1000); - cookieString = cookieString + "; expires=" + date.toGMTString(); - } - if (path) { - cookieString = cookieString + "; path=" + path; - } - document.cookie = cookieString; - }, - getCookie: function (name) { - var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); - if (arr = document.cookie.match(reg)) - return unescape(arr[2]); - else - return null; - }, - deleteCookie: function (name, path) { - var date = new Date(); - date.setTime(date.getTime() - 10000); - var cookieString = name + "=v; expires=" + date.toGMTString(); - if (path) { - cookieString = cookieString + "; path=" + path; - } - document.cookie = cookieString; - } -};/** +});/** * guy * 控制器 * Controller层超类 diff --git a/src/core/base.js b/src/core/base.js index aa33e64a39..3b0656e964 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -10,7 +10,7 @@ if (!window.BI) { ; !(function ($, undefined) { _.extend(BI, { - version: "4.0" + version: "2.0" }); var traverse = function (func, context) { return function (value, key, obj) { @@ -33,7 +33,7 @@ if (!window.BI) { //Utility _.extend(BI, { i18nText: function (key) { - var localeText = ""; + var localeText = (BI.i18n && BI.i18n[key]) || ""; if (!localeText) { localeText = key; } @@ -81,30 +81,6 @@ if (!window.BI) { return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View); }, - createWidget: function (item, options) { - var el; - options || (options = {}); - if (BI.isEmpty(item) && BI.isEmpty(options)) { - return BI.Plugin.getObject("bi.layout", BI.createWidget({ - type: "bi.layout" - })); - } - if (BI.isWidget(item)) { - return item; - } - if (item && (item.type || options.type)) { - el = BI.extend({}, options, item); - return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); - } - if (item && item.el && (item.el.type || options.type)) { - el = BI.extend({}, options, item.el); - return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); - } - if (item && BI.isWidget(item.el)) { - return item.el; - } - }, - createWidgets: function (items, options) { if (!BI.isArray(items)) { throw new Error("cannot create Widgets") diff --git a/src/core/cache.js b/src/core/cache.js deleted file mode 100644 index b529bfeeef..0000000000 --- a/src/core/cache.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 前端缓存 - */ -window.localStorage || (window.localStorage = { - items: {}, - setItem: function (k, v) { - BI.Cache.addCookie(k, v); - }, - getItem: function (k) { - return BI.Cache.getCookie(k); - }, - removeItem: function (k) { - BI.Cache.deleteCookie(k); - }, - key: function () { - - }, - clear: function () { - this.items = {}; - } -}); -BI.Cache = { - _prefix: "bi", - setUsername: function (username) { - localStorage.setItem(BI.Cache._prefix + ".username", (username + "" || "").toUpperCase()); - }, - getUsername: function () { - return localStorage.getItem(BI.Cache._prefix + ".username") || ""; - }, - _getKeyPrefix: function () { - return BI.Cache.getUsername() + "." + BI.Cache._prefix + "."; - }, - _generateKey: function (key) { - return BI.Cache._getKeyPrefix() + (key || ""); - }, - getItem: function (key) { - return localStorage.getItem(BI.Cache._generateKey(key)); - }, - setItem: function (key, value) { - localStorage.setItem(BI.Cache._generateKey(key), value); - }, - removeItem: function (key) { - localStorage.removeItem(BI.Cache._generateKey(key)); - }, - clear: function () { - for (var i = localStorage.length; i >= 0; i--) { - var key = localStorage.key(i); - if (key) { - if (key.indexOf(BI.Cache._getKeyPrefix()) === 0) { - localStorage.removeItem(key); - } - } - } - }, - keys: function () { - var result = []; - for (var i = localStorage.length; i >= 0; i--) { - var key = localStorage.key(i); - if (key) { - var prefix = BI.Cache._getKeyPrefix(); - if (key.indexOf(prefix) === 0) { - result[result.length] = key.substring(prefix.length); - } - } - } - return result; - }, - - addCookie: function (name, value, path, expiresHours) { - var cookieString = name + "=" + escape(value); - // 判断是否设置过期时间 - if (expiresHours && expiresHours > 0) { - var date = new Date(); - date.setTime(date.getTime() + expiresHours * 3600 * 1000); - cookieString = cookieString + "; expires=" + date.toGMTString(); - } - if (path) { - cookieString = cookieString + "; path=" + path; - } - document.cookie = cookieString; - }, - getCookie: function (name) { - var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); - if (arr = document.cookie.match(reg)) - return unescape(arr[2]); - else - return null; - }, - deleteCookie: function (name, path) { - var date = new Date(); - date.setTime(date.getTime() - 10000); - var cookieString = name + "=v; expires=" + date.toGMTString(); - if (path) { - cookieString = cookieString + "; path=" + path; - } - document.cookie = cookieString; - } -}; \ No newline at end of file From 208c832597ba594a325f34ac22d4d86c2964ee4b Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 16:06:48 +0800 Subject: [PATCH 14/19] add --- demo/js/widget/demo.multiselectcombo.js | 8 ++++++-- dist/core.js | 6 +++++- src/core/widget.js | 6 +++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/demo/js/widget/demo.multiselectcombo.js b/demo/js/widget/demo.multiselectcombo.js index f1441fa7b0..e725573e5a 100644 --- a/demo/js/widget/demo.multiselectcombo.js +++ b/demo/js/widget/demo.multiselectcombo.js @@ -45,10 +45,14 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, { _itemsCreator: function (options, callback) { var self = this; var items = ITEMS; + var keywords = (options.keywords || []).slice(); if (options.keyword) { - var search = BI.Func.getSearchResult(items, options.keyword); - items = search.matched.concat(search.finded); + keywords.push(options.keyword); } + BI.each(keywords, function (i, kw) { + var search = BI.Func.getSearchResult(items, kw); + items = search.matched.concat(search.finded); + }); if (options.selected_values) {//过滤 var filter = BI.makeObject(options.selected_values, true); items = BI.filter(items, function (i, ob) { diff --git a/dist/core.js b/dist/core.js index 859c9f544d..38b9bea063 100644 --- a/dist/core.js +++ b/dist/core.js @@ -14518,6 +14518,7 @@ BI.Widget = BI.inherit(BI.OB, { this.options.invisible = true; this.element.hide(); } + this.fireEvent(BI.Events.VIEW, visible); }, setValid: function (valid) { @@ -14663,7 +14664,10 @@ BI.Widget = BI.inherit(BI.OB, { }, destroy: function () { - this._unMount(); + this.empty(); + this._isMounted = false; + this._parent = null; + this.destroyed(); this.element.destroy(); this.fireEvent(BI.Events.DESTROY); } diff --git a/src/core/widget.js b/src/core/widget.js index 541c986998..54de57d748 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -220,6 +220,7 @@ BI.Widget = BI.inherit(BI.OB, { this.options.invisible = true; this.element.hide(); } + this.fireEvent(BI.Events.VIEW, visible); }, setValid: function (valid) { @@ -365,7 +366,10 @@ BI.Widget = BI.inherit(BI.OB, { }, destroy: function () { - this._unMount(); + this.empty(); + this._isMounted = false; + this._parent = null; + this.destroyed(); this.element.destroy(); this.fireEvent(BI.Events.DESTROY); } From fcafbde14c7785f5456941b1a43bdf2000f0f00a Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 22 Mar 2017 16:39:01 +0800 Subject: [PATCH 15/19] update --- Gruntfile.js | 3 +- demo/config.js | 2 +- demo/js/component/demo.treevaluechooser.js | 39 + demo/js/component/demo.valuechooser.js | 29 + demo/js/config/component.js | 15 + demo/js/widget/demo.multiselecttree.js | 14 - dist/base.css | 58 +- dist/base.js | 40 +- dist/case.js | 14 +- dist/core.js | 645 +++++++++++++++- .../base/third => dist}/farbtastic/marker.png | Bin .../base/third => dist}/farbtastic/mask.png | Bin .../base/third => dist}/farbtastic/wheel.png | Bin dist/widget.js | 728 +++++++++++++++++- .../third => dist}/ztree/img/line_conn.gif | Bin .../base/third => dist}/ztree/img/loading.gif | Bin .../ztree/img/zTreeStandard.gif | Bin .../ztree/img/zTreeStandard.png | Bin src/base/farbtastic/farbtastic.js | 4 +- src/base/foundation/bi.message.js | 2 +- src/base/single/input/file.js | 16 +- src/base/tree/synctree.js | 2 +- src/base/tree/treeview.js | 16 +- src/case/logintimeout/login.timeout.js | 10 +- src/case/zclip/zclip.js | 4 +- src/component/combo.treevaluechooser.js | 599 ++++++++++++++ src/component/combo.valuechooser.js | 127 +++ src/core/alias.js | 591 ++++++++++++++ src/core/base.js | 47 +- src/core/func/function.js | 2 +- src/core/model.js | 2 +- src/core/utils/load.js | 2 +- src/css/base/third/farbtastic/farbtastic.css | 6 +- src/css/base/third/ztree/zTreeStyle.css | 50 +- src/css/base/view/popupview.css | 2 +- .../base/third/farbtastic/farbtastic.less | 8 +- src/less/base/third/ztree/zTreeStyle.less | 46 +- src/less/base/view/popupview.less | 2 +- src/widget/image/uploadimage.js | 2 +- 39 files changed, 2891 insertions(+), 236 deletions(-) create mode 100644 demo/js/component/demo.treevaluechooser.js create mode 100644 demo/js/component/demo.valuechooser.js create mode 100644 demo/js/config/component.js delete mode 100644 demo/js/widget/demo.multiselecttree.js rename {src/less/base/third => dist}/farbtastic/marker.png (100%) rename {src/less/base/third => dist}/farbtastic/mask.png (100%) rename {src/less/base/third => dist}/farbtastic/wheel.png (100%) rename {src/less/base/third => dist}/ztree/img/line_conn.gif (100%) rename {src/less/base/third => dist}/ztree/img/loading.gif (100%) rename {src/less/base/third => dist}/ztree/img/zTreeStandard.gif (100%) rename {src/less/base/third => dist}/ztree/img/zTreeStandard.png (100%) create mode 100644 src/component/combo.treevaluechooser.js create mode 100644 src/component/combo.valuechooser.js create mode 100644 src/core/alias.js diff --git a/Gruntfile.js b/Gruntfile.js index 65acb4824d..9e758f4149 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -62,7 +62,8 @@ module.exports = function (grunt) { src: [ 'src/widget/paramsettingcombo/popup.param.js', 'src/widget/sequencetable/treenumber.sequencetable.js', - 'src/widget/**/*.js' + 'src/widget/**/*.js', + 'src/component/**/*.js' ], dest: "dist/widget.js" }, diff --git a/demo/config.js b/demo/config.js index ad42d66187..abd87a41e5 100644 --- a/demo/config.js +++ b/demo/config.js @@ -1 +1 @@ -Demo.CONFIG = Demo.LAYOUT_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG); \ No newline at end of file +Demo.CONFIG = Demo.LAYOUT_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG); \ No newline at end of file diff --git a/demo/js/component/demo.treevaluechooser.js b/demo/js/component/demo.treevaluechooser.js new file mode 100644 index 0000000000..eb3673a3c0 --- /dev/null +++ b/demo/js/component/demo.treevaluechooser.js @@ -0,0 +1,39 @@ +Demo.TreeValueChooser = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-tree-value-chooser" + }, + render: function () { + + var tree = []; + for (var i = 0; i < 21; i++) { + tree.push({ + value: i + "", + text: i + "", + id: i + "", + pId: null + }); + for (var j = 0; j < 9; j++) { + tree.push({ + value: i + "-" + j, + text: j + "", + id: i + "-" + j, + pId: i + "" + }) + } + } + var widget = BI.createWidget({ + type: "bi.tree_value_chooser_combo", + items: tree, + itemsCreator: function (op, callback) { + callback(tree); + } + }); + return { + type: "bi.vertical", + hgap: 200, + vgap: 10, + items: [widget] + }; + } +}); +$.shortcut("demo.tree_value_chooser", Demo.TreeValueChooser); diff --git a/demo/js/component/demo.valuechooser.js b/demo/js/component/demo.valuechooser.js new file mode 100644 index 0000000000..dbb36aa36e --- /dev/null +++ b/demo/js/component/demo.valuechooser.js @@ -0,0 +1,29 @@ +var _strings = " 柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂 柳州市积玉贸易有限公司 柳州市福运来贸易有限责任公司 柳州市钢义物资有限公司 柳州市洋力化工有限公司 柳州市悦盛贸易有限公司 柳州市雁城钢管物资有限公司 柳州市恒瑞钢材经营部 柳州市科拓电子有限公司 柳州市九方电子有限公司 柳州市桂龙汽车配件厂 柳州市制鞋工厂 柳州市炜力科贸有限公司 柳州市希翼贸易有限公司 柳州市兆金物资有限公司 柳州市和润电子科技有限责任公司 柳州市汇凯贸易有限公司 柳州市好机汇商贸有限公司 柳州市泛源商贸经营部 柳州市利汇达物资有限公司 广西全民药业有限责任公司 柳州超凡物资贸易有限责任公司 柳州市贵宏物资有限责任公司 柳州昊恒贸易有限责任公司 柳州市浦联物资有限公司 柳州市广通园林绿化工程有限责任公司 柳州市松发物资贸易有限责任公司 柳州市奥士达办公设备有限责任公司 柳州市海泰物资有限公司 柳州市金三环针织厂 柳州市钢贸物资有限公司 柳州市明阳纺织有限公司 柳州市世科科技发展有限公司 柳州市禄羊贸易有限公司 柳州市金兆阳商贸有限公司 柳州市汇昌物资经营部 柳州市林泰金属物资供应站 柳州市自来水管道材料设备公司 柳州市丹柳铝板有限公司 柳州市桂冶物资有限公司 柳州市宸业物资经营部 柳州市耀成贸易有限公司 柳州奥易自动化科技有限公司 柳州市萃丰科技有限责任公司 柳州市华储贸易有限责任公司 柳州市黄颜钢材有限责任公司 柳州市银盛物资有限责任公司 柳州市新仪化玻供应站 柳州市晶凯化工有限公司 广西柳州市柳江包装纸厂 柳州市志新物资有限责任公司 柳州市兆钢物资有限公司 柳州市友方科技发展有限责任公司 柳州市缝纫机台板家具总厂 柳州市晖海数码办公设备有限责任公司 柳州市富兰特服饰有限责任公司 柳州市柳北区富兴物资经营部 柳州市柳锌福利厂 柳州市海泉印刷有限责任公司 柳州市乾亨贸易有限公司 柳州市悦宁物资贸易有限公司 柳州市昊天贸易有限公司 广西惠字钢铁有限公司 柳州市名青物资有限公司 柳州市林郝物资有限公司 柳州市民政服装厂 柳州市多维劳保用品厂 柳州市轻工物资供应公司 柳州市程源物资有限责任公司 柳州市寿丰物资贸易有限责任公司 柳州市凯凡物资有限公司 柳州市利晖物资经营部 柳州市恒茂金属物资供应站 柳州市中储物资经营部 柳州市第二医疗器械厂 柳州市来鑫物资经营部 柳州市钢鑫物资贸易有限责任公司 柳州市双合袜业有限责任公司 柳州市茂松经贸有限责任公司 柳州市行行物资贸易有限公司 柳州市方一物资有限公司 柳州成异钢管销售有限公司 柳州广惠佳电脑有限公司 桂林市圣泽鑫物资有限公司柳州分公司 柳州市砼基建材贸易有限公司 柳州市海燕针织厂 上海浦光仪表厂柳州销售处 柳州市能电工贸有限责任公司 柳州市广贸物资有限公司 柳州市柳北区大昌电工灯饰经营部 柳州市金龙印务有限公司 柳州市奇缘婚典服务有限公司 柳州市盛博物资经营部 柳州市项元钢铁贸易有限公司 柳州市虞美人化妆品经营部 柳州市俊彦鞋厂 柳州市聚源特钢有限公司 柳州市迅龙科贸有限责任公司 柳州市恒飞电子有限责任公司 柳州市蓝正现代办公设备有限责任公司 柳州地区农业生产资料公司 柳州华菱钢管销售有限公司 柳州融通物资有限公司 柳州市可仁广告策划有限责任公司 柳州市鸟鑫物资有限责任公司 柳州市五丰钢材供应站 柳州市金江不锈钢有限公司 柳州市美日物资设备有限责任公司 柳州市鑫东物资贸易有限责任公司 柳州地区日用杂品公司 柳州市华纳物资贸易有限公司 柳州乾利金虹物资贸易有限责任公司 柳州市新迈计算机有限公司 柳州市富丽实业发展公司 柳州市石钢金属材料有限公司 柳州市力志传真机销售有限公司 广西宝森投资有限公司 柳州市嵘基商贸有限公司 柳州市景民商贸有限责任公司 柳州市银桥化玻有限责任公司 柳州市宏文糖烟店 柳州市科苑电脑网络有限公司 柳州市两面针旅游用品厂 柳州市立早室内装璜有限责任公司 柳州地化建材有限公司 柳州市涛达贸易有限公司 柳州市兰丰档案服务中心 柳州市惠贸物资有限责任公司 柳州市立文物资有限责任公司 柳州市致和商贸经营部 柳州市金色阳光信息咨询有限公司 柳州市赛利钢材经销部 柳州市日用化工厂 柳州市昆廷物资有限责任公司 柳州市邦盛贸易有限公司 柳州市济华贸易有限公司 柳州昕威橡塑化工经营部 柳州市联业贸易有限公司 柳州市兰钢贸易有限公司 柳州市子欣科技有限公司 柳州市狄龙机电设备有限公司 柳州市方真物资贸易有限公司 柳州市银鸥废旧回收中心 柳州市冠宝贸易有限公司 柳州市鑫盛德商务咨询有限责任公司 柳州市泰汇银通经贸有限公司 广西瀚维智测科技有限公司 柳州市钓鱼郎制衣有限责任公司 柳州溪水物资有限公司 柳州市融峰物资有限责任公司 广西新地科技有限责任公司 柳州市纺织装饰公司 柳州市粤翔冶金炉料有限公司 柳州市远腾贸易有限公司 柳州市东鸿城市改造有限公司 广西丛欣实业有限公司 柳州市服装厂 柳州市立安联合刀片有限公司 广西国扬投资有限责任公司 柳州市铭泰办公设备公司 柳州市桂钢物资供应站 柳州市昱升物资有限责任公司 柳州市鹰飞灿科贸有限公司 柳州市先导科贸有限公司 柳州市金秋建材物资经营部 柳州市童装厂 柳州市民泽物资有限公司 柳州市恒先物资贸易有限公司 柳州市银夏冷气工程有限责任公司 柳州粮食批发有限责任公司 柳州市金银华窗纱制造有限责任公司 柳州市三方贸易有限公司 柳州市丰涛商贸有限责任公司 柳州华智企业管理咨询有限责任公司 柳州市诚正建筑工程施工图审查有限公司 柳州市今科电讯设备营销中心 柳州市闽德电子有限公司 柳州市鑫虹针织厂 柳州市畅通通讯器材有限责任公司 柳州市正钢物资经营部 柳州市新柳饲料有限责任公司 柳州市黄村油库 柳州市天泰电力装饰工程有限公司 柳州市兆吉物资有限责任公司 柳州市八龙纸制品有限责任公司 柳州市巨佳电脑网络科技有限公司 "; +//各种通用数据 +var ITEMS = BI.map(_strings.match(/[^\s]+/g), function (i, v) { + return { + text: v, + value: v, + title: v + } +}); +Demo.ValueChooserCombo = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-value-chooser-combo" + }, + render: function () { + var widget = BI.createWidget({ + type: "bi.value_chooser_combo", + itemsCreator: function (op, callback) { + callback(BI.deepClone(ITEMS)); + } + }); + return { + type: "bi.vertical", + hgap: 200, + vgap: 10, + items: [widget] + }; + } +}); +$.shortcut("demo.value_chooser_combo", Demo.ValueChooserCombo); \ No newline at end of file diff --git a/demo/js/config/component.js b/demo/js/config/component.js new file mode 100644 index 0000000000..fe90fe9016 --- /dev/null +++ b/demo/js/config/component.js @@ -0,0 +1,15 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.COMPONENT_CONFIG = [{ + id: 15, + text: "部件" +}, { + pId: 15, + text: "bi.value_chooser_combo", + value: "demo.value_chooser_combo" +}, { + pId: 15, + text: "bi.tree_value_chooser_combo", + value: "demo.tree_value_chooser" +}]; \ No newline at end of file diff --git a/demo/js/widget/demo.multiselecttree.js b/demo/js/widget/demo.multiselecttree.js deleted file mode 100644 index 437f121622..0000000000 --- a/demo/js/widget/demo.multiselecttree.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Created by User on 2017/3/22. - */ -Demo.MultiSelectTree = BI.inherit(BI.Widget, { - props: { - baseCls: "demo-multi-select-tree" - }, - render: function () { - return { - type: "bi.vertical", - } - } -}); -$.shortcut("demo.multi_select_tree", Demo.MultiSelectTree); \ No newline at end of file diff --git a/dist/base.css b/dist/base.css index 867afd4676..0dd7e1c55e 100644 --- a/dist/base.css +++ b/dist/base.css @@ -1310,19 +1310,19 @@ li.CodeMirror-hint-active { height: 101px; } .farbtastic .wheel { - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/wheel.png) no-repeat; + background: url(farbtastic/wheel.png) no-repeat; width: 195px; height: 195px; } .farbtastic .overlay { - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/mask.png) no-repeat; + background: url(farbtastic/mask.png) no-repeat; } .farbtastic .marker { width: 17px; height: 17px; margin: -8px 0 0 -8px; overflow: hidden; - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/marker.png) no-repeat; + background: url(farbtastic/marker.png) no-repeat; } /* required styles */ .leaflet-pane, @@ -1846,7 +1846,7 @@ website: http://code.google.com/p/jquerytree/ padding: 0 0 0 18px; } .ztree li ul.line { - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-1.png) 0 0 repeat-y; + background: url(icon/tree-vertical-line-1.png) 0 0 repeat-y; } .ztree li a { padding: 1px 3px 0 0; @@ -1901,8 +1901,8 @@ website: http://code.google.com/p/jquerytree/ background-color: transparent; background-repeat: no-repeat; background-attachment: scroll; - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.png"); - *background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.gif"); + background-image: url("ztree/img/zTreeStandard.png"); + *background-image: url("ztree/img/zTreeStandard.gif"); } .ztree li span.button.chk { width: 16px; @@ -1911,31 +1911,31 @@ website: http://code.google.com/p/jquerytree/ cursor: auto; } .ztree li span.button.chk.checkbox_false_full { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); + background-image: url("icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_full_focus { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); + background-image: url("icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_part { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image: url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_part_focus { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image: url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_disable { background-position: 0 -56px; } .ztree li span.button.chk.checkbox_true_full { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); + background-image: url("icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_full_focus { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); + background-image: url("icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_part { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image: url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_part_focus { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image: url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_disable { background-position: -14px -56px; @@ -1975,28 +1975,28 @@ website: http://code.google.com/p/jquerytree/ height: 25px; } .ztree li span.button.root_open { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-1.png"); + background-image: url("icon/tree-expand-1.png"); } .ztree li span.button.root_close { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-1.png"); + background-image: url("icon/tree-collapse-1.png"); } .ztree li span.button.roots_open { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-2.png"); + background-image: url("icon/tree-expand-2.png"); } .ztree li span.button.roots_close { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-2.png"); + background-image: url("icon/tree-collapse-2.png"); } .ztree li span.button.center_open { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-3.png"); + background-image: url("icon/tree-expand-3.png"); } .ztree li span.button.center_close { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-3.png"); + background-image: url("icon/tree-collapse-3.png"); } .ztree li span.button.bottom_open { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-4.png"); + background-image: url("icon/tree-expand-4.png"); } .ztree li span.button.bottom_close { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-4.png"); + background-image: url("icon/tree-collapse-4.png"); } .ztree li span.button.noline_open { background-position: -92px -72px; @@ -2008,13 +2008,13 @@ website: http://code.google.com/p/jquerytree/ background: none; } .ztree li span.button.roots_docu { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); + background-image: url("icon/tree-vertical-line-2.png"); } .ztree li span.button.center_docu { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); + background-image: url("icon/tree-vertical-line-3.png"); } .ztree li span.button.bottom_docu { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); + background-image: url("icon/tree-vertical-line-4.png"); } .ztree li span.button.noline_docu { background: none; @@ -2052,7 +2052,7 @@ website: http://code.google.com/p/jquerytree/ .ztree li span.button.ico_loading { width: 0px; margin-right: 2px; - background: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif") no-repeat scroll 0 0 transparent; + background: url("ztree/img/loading.gif") no-repeat scroll 0 0 transparent; vertical-align: top; *vertical-align: middle; } @@ -2073,8 +2073,8 @@ span.tmpzTreeMove_arrow { background-repeat: no-repeat; background-attachment: scroll; background-position: -110px -80px; - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.png"); - *background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.gif"); + background-image: url("ztree/img/zTreeStandard.png"); + *background-image: url("ztree/img/zTreeStandard.gif"); } ul.ztree.zTreeDragUL { margin: 0; @@ -2226,7 +2226,7 @@ ul.ztree.zTreeDragUL { /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -/**********FR.BIListView*************/ +/**********BI.BIListView*************/ .bi-list-view { position: fixed !important; overflow-y: visible !important; diff --git a/dist/base.js b/dist/base.js index 5b491a7868..bbb5ca2a29 100644 --- a/dist/base.js +++ b/dist/base.js @@ -21851,9 +21851,9 @@ BI.TreeView = BI.inherit(BI.Pane, { }, _init: function () { BI.TreeView.superclass._init.apply(this, arguments); - FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.core-3.5.js', 'js'); - FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.excheck-3.5.js', 'js'); - FR.$defaultImport('/com/fr/bi/web/css/base/third/ztree/zTreeStyle.css', 'css'); + + + this._stop = false; this.container = BI.createWidget(); @@ -21908,7 +21908,7 @@ BI.TreeView = BI.inherit(BI.Pane, { enable: true, url: getUrl, autoParam: ["id", "name"], - otherParam: FR.cjkEncodeDO(paras) + otherParam: BI.cjkEncodeDO(paras) }, check: { enable: true @@ -21950,10 +21950,10 @@ BI.TreeView = BI.inherit(BI.Pane, { treeNode.times = treeNode.times || 1; var param = "id=" + treeNode.id + "×=" + (treeNode.times++) - + "&parent_values= " + window.encodeURIComponent(FR.jsonEncode(parentNode)) - + "&check_state=" + window.encodeURIComponent(FR.jsonEncode(treeNode.getCheckStatus())); + + "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + + "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); - return FR.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; + return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; } function beforeExpand(treeId, treeNode) { @@ -22002,7 +22002,7 @@ BI.TreeView = BI.inherit(BI.Pane, { function ajaxGetNodes(treeNode, reloadType) { var zTree = self.nodes; if (reloadType == "refresh") { - //treeNode.icon = FR.servletURL +"?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif"; + //treeNode.icon = BI.servletURL +"?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif"; zTree.updateNode(treeNode); } zTree.reAsyncChildNodes(treeNode, reloadType, true); @@ -22362,7 +22362,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { var setting = { async: { enable: false, - otherParam: FR.cjkEncodeDO(paras) + otherParam: BI.cjkEncodeDO(paras) }, check: { enable: true @@ -25091,8 +25091,8 @@ BI.Farbtastic = BI.inherit(BI.Widget, { _init: function () { BI.Farbtastic.superclass._init.apply(this, arguments); var self = this; - FR.$defaultImport('/com/fr/bi/web/js/third/farbtastic.js', 'js'); - FR.$defaultImport('/com/fr/bi/web/css/base/third/farbtastic/farbtastic.css', 'css'); + + this.farbtastic = $.farbtastic(this.element, function (v) { self.fireEvent(BI.Farbtastic.EVENT_CHANGE, self.getValue(), self); @@ -34693,7 +34693,7 @@ $.extend(BI, { this._show(true, title, message, callback); }, prompt: function (title, message, value, callback, min_width) { - FR.Msg.prompt(title, message, value, callback, min_width); + BI.Msg.prompt(title, message, value, callback, min_width); }, toast: function (message, level, context) { context = context || $("body"); @@ -38815,7 +38815,7 @@ $.shortcut("bi.checkbox", BI.Checkbox);/** var multipart = function (boundary, name, file) { return "--".concat( boundary, CRLF, - 'Content-Disposition: form-data; name="', name, '"; filename="', FR.cjkEncode(file.fileName), '"', CRLF, + 'Content-Disposition: form-data; name="', name, '"; filename="', BI.cjkEncode(file.fileName), '"', CRLF, "Content-Type: application/octet-stream", CRLF, CRLF, file.getAsBinary(), CRLF, @@ -38884,7 +38884,7 @@ $.shortcut("bi.checkbox", BI.Checkbox);/** }, false ); - xhr.open("post", handler.url + '&filename=' + FR.cjkEncode(handler.file.fileName), true); + xhr.open("post", handler.url + '&filename=' + BI.cjkEncode(handler.file.fileName), true); if (!xhr.upload) { var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true}; rpe.interval = setInterval(function () { @@ -38915,8 +38915,8 @@ $.shortcut("bi.checkbox", BI.Checkbox);/** upload.onprogress(rpe); if (199 < xhr.status && xhr.status < 400) { upload["onload"]({}); - var attachO = FR.jsonDecode(xhr.responseText); - attachO.filename = FR.cjkDecode(handler.file.fileName); + var attachO = BI.jsonDecode(xhr.responseText); + attachO.filename = BI.cjkDecode(handler.file.fileName); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } @@ -38932,7 +38932,7 @@ $.shortcut("bi.checkbox", BI.Checkbox);/** xhr.onreadystatechange = function () { switch (xhr.readyState) { case 4: - var attachO = FR.jsonDecode(xhr.responseText); + var attachO = BI.jsonDecode(xhr.responseText); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } @@ -38982,13 +38982,13 @@ $.shortcut("bi.checkbox", BI.Checkbox);/** //rpe.loaded = rpe.total; try { var responseText = (iframe.contentWindow.document || iframe.contentWindow.contentDocument).body.innerHTML; - var attachO = FR.jsonDecode(responseText); + var attachO = BI.jsonDecode(responseText); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } //attachO.fileSize = responseText.length; - attachO.filename = FR.cjkDecode(handler.file.fileName); + attachO.filename = BI.cjkDecode(handler.file.fileName); if (handler.maxlength == 1) { handler.attach_array[0] = attachO; } else { @@ -39205,7 +39205,7 @@ $.shortcut("bi.checkbox", BI.Checkbox);/** // enable again the submit button/element }, 1000); }; - _wrap.url = o.url ? o.url : FR.servletURL + _wrap.url = o.url ? o.url : BI.servletURL + '?op=fr_attach&cmd=ah_upload'; _wrap.fileType = o.accept; //文件类型限制 _wrap.attach_array = []; diff --git a/dist/case.js b/dist/case.js index 94545560f5..8b80badc99 100644 --- a/dist/case.js +++ b/dist/case.js @@ -5622,9 +5622,9 @@ BI.LoginTimeOut = BI.inherit(BI.BarPopoverSection, { } //反正是登录直接用FR的登录了 - FR.ajax({ - url: FR.servletURL + '?op=fs_load&cmd=login', - data: FR.cjkEncodeDO({ + BI.ajax({ + url: BI.servletURL + '?op=fs_load&cmd=login', + data: BI.cjkEncodeDO({ fr_username: encodeURIComponent(userNameInput.getValue()), fr_password: encodeURIComponent(passwordInput.getValue()), fr_remember: self.keepLoginState.isSelected() @@ -5639,7 +5639,7 @@ BI.LoginTimeOut = BI.inherit(BI.BarPopoverSection, { self._showMes(userNameMask, BI.i18nText("BI-Authentication_Failed")); return; } - var signResult = FR.jsonDecode(res.responseText); + var signResult = BI.jsonDecode(res.responseText); if (signResult.fail) { //用户名和密码不匹配 self._showMes(userNameMask, BI.i18nText("BI-Username_Password_Not_Correct")); @@ -5663,7 +5663,7 @@ BI.LoginTimeOut = BI.inherit(BI.BarPopoverSection, { type: "bi.center_adapt", items: [{ type: "bi.img", - src: FR.servletURL + (logo ? + src: BI.servletURL + (logo ? '?op=fr_attach&cmd=ah_image&id=' + logo + '&isAdjust=false' : '?op=resource&resource=/com/fr/bi/web/images/login/bi_logo.png'), width: 120, @@ -9322,10 +9322,10 @@ BI.ZeroClip = BI.inherit(BI.BasicButton, { _init: function () { BI.ZeroClip.superclass._init.apply(this, arguments); var self = this, o = this.options; - FR.$defaultImport('/com/fr/bi/web/js/third/jquery.zclip.js', 'js'); + BI.nextTick(function () { self.element.zclip({ - path: FR.servletURL + "?op=resource&resource=/com/fr/bi/web/resources/ZeroClipboard.swf", + path: BI.servletURL + "?op=resource&resource=/com/fr/bi/web/resources/ZeroClipboard.swf", copy: o.copy, beforeCopy: o.beforeCopy, afterCopy: o.afterCopy diff --git a/dist/core.js b/dist/core.js index 918dffeaba..04bfb6cd43 100644 --- a/dist/core.js +++ b/dist/core.js @@ -12954,30 +12954,6 @@ if (!window.BI) { return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View); }, - createWidget: function (item, options) { - var el; - options || (options = {}); - if (BI.isEmpty(item) && BI.isEmpty(options)) { - return BI.Plugin.getObject("bi.layout", BI.createWidget({ - type: "bi.layout" - })); - } - if (BI.isWidget(item)) { - return item; - } - if (item && (item.type || options.type)) { - el = BI.extend({}, options, item); - return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); - } - if (item && item.el && (item.el.type || options.type)) { - el = BI.extend({}, options, item.el); - return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); - } - if (item && BI.isWidget(item.el)) { - return item.el; - } - }, - createWidgets: function (items, options) { if (!BI.isArray(items)) { throw new Error("cannot create Widgets") @@ -13802,10 +13778,6 @@ if (!window.BI) { return BI.isString(str) && BI.isEmpty(str); }, - contentFormat: function () { - return FR.contentFormat.apply(FR, arguments); - }, - /** * 对字符串进行加密 {@link #decrypt} * @static @@ -13999,7 +13971,12 @@ if (!window.BI) { } timeoutToast.addReq(option); - FR.ajax({ + + option.data = BI.cjkEncodeDO(option.data); + + + + $.ajax({ url: option.url, type: "POST", data: option.data, @@ -14054,10 +14031,10 @@ if (!window.BI) { loading.showError(); } else if (status === "success" && BI.isFunction(option.success)) { - option.success(FR.jsonDecode(res.responseText)); + option.success(BI.jsonDecode(res.responseText)); } if (BI.isFunction(option.complete)) { - option.complete(FR.jsonDecode(res.responseText), status); + option.complete(BI.jsonDecode(res.responseText), status); } } }); @@ -14069,7 +14046,7 @@ if (!window.BI) { function encodeBIParam(data) { for (var key in data) { if (_.isObject(data[key])) { - data[key] = window.encodeURIComponent(FR.jsonEncode(data[key])); + data[key] = window.encodeURIComponent(BI.jsonEncode(data[key])); } else { data[key] = window.encodeURIComponent(data[key]); } @@ -14080,7 +14057,7 @@ if (!window.BI) { for (var key in data) { data[key] = window.decodeURIComponent(data[key]); if (_.isObject(data[key])) { - data[key] = FR.jsonDecode(data[key]); + data[key] = BI.jsonDecode(data[key]); } } } @@ -14103,7 +14080,7 @@ if (!window.BI) { if (op === "fr_bi_dezi" || op === "fr_bi_configure") { data.sessionID = Data.SharingPool.get("sessionID"); } - var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); + var url = BI.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); return (BI.ajax)({ url: url, type: 'POST', @@ -14139,7 +14116,7 @@ if (!window.BI) { if (op === "fr_bi_dezi") { data.sessionID = Data.SharingPool.get("sessionID"); } - var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); + var url = BI.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); var result = {}; (BI.ajax)({ url: url, @@ -15070,7 +15047,7 @@ BI.Widget = BI.inherit(BI.OB, { }, urlRoot: function () { - return FR.servletURL; + return BI.servletURL; }, parse: function (data) { @@ -17500,7 +17477,7 @@ $.extend(BI, { type: null, must: false }, options); - config.url = FR.servletURL + '?op=' + config.op + '&resource=' + config.path; + config.url = BI.servletURL + '?op=' + config.op + '&resource=' + config.path; this.$import(config.url, config.type,config.must); }, $import: function () { @@ -19660,7 +19637,597 @@ BI.PopoverSection = BI.inherit(BI.Widget, { } }); -BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";/** +BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";BI.cjkEncode = function (text) { + // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) + if (typeof text !== 'string') { + return text; + } + + var newText = ""; + for (var i = 0; i < text.length; i++) { + var code = text.charCodeAt(i); + if (code >= 128 || code === 91 || code === 93) {//91 is "[", 93 is "]". + newText += "[" + code.toString(16) + "]"; + } else { + newText += text.charAt(i); + } + } + + return newText +}; + +BI.cjkEncodeDO = function (o) { + if (BI.isPlainObject(o)) { + var result = {}; + $.each(o, function (k, v) { + if (!(typeof v == "string")) { + v = BI.jsonEncode(v); + } + //wei:bug 43338,如果key是中文,cjkencode后o的长度就加了1,ie9以下版本死循环,所以新建对象result。 + k = BI.cjkEncode(k); + result[k] = BI.cjkEncode(v); + }); + return result; + } + return o; +}; + +BI.jsonEncode = function (o) { + //james:这个Encode是抄的EXT的 + var useHasOwn = {}.hasOwnProperty ? true : false; + + // crashes Safari in some instances + //var validRE = /^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/; + + var m = { + "\b": '\\b', + "\t": '\\t', + "\n": '\\n', + "\f": '\\f', + "\r": '\\r', + '"': '\\"', + "\\": '\\\\' + }; + + var encodeString = function (s) { + if (/["\\\x00-\x1f]/.test(s)) { + return '"' + s.replace(/([\x00-\x1f\\"])/g, function (a, b) { + var c = m[b]; + if (c) { + return c; + } + c = b.charCodeAt(); + return "\\u00" + + Math.floor(c / 16).toString(16) + + (c % 16).toString(16); + }) + '"'; + } + return '"' + s + '"'; + }; + + var encodeArray = function (o) { + var a = ["["], b, i, l = o.length, v; + for (i = 0; i < l; i += 1) { + v = o[i]; + switch (typeof v) { + case "undefined": + case "function": + case "unknown": + break; + default: + if (b) { + a.push(','); + } + a.push(v === null ? "null" : BI.jsonEncode(v)); + b = true; + } + } + a.push("]"); + return a.join(""); + }; + + if (typeof o == "undefined" || o === null) { + return "null"; + } else if (BI.isArray(o)) { + return encodeArray(o); + } else if (o instanceof Date) { + /* + * alex:原来只是把年月日时分秒简单地拼成一个String,无法decode + * 现在这么处理就可以decode了,但是JS.jsonDecode和Java.JSONObject也要跟着改一下 + */ + return BI.jsonEncode({ + __time__: o.getTime() + }) + } else if (typeof o == "string") { + return encodeString(o); + } else if (typeof o == "number") { + return isFinite(o) ? String(o) : "null"; + } else if (typeof o == "boolean") { + return String(o); + } else if (BI.isFunction(o)) { + return String(o); + } else { + var a = ["{"], b, i, v; + for (i in o) { + if (!useHasOwn || o.hasOwnProperty(i)) { + v = o[i]; + switch (typeof v) { + case "undefined": + case "unknown": + break; + default: + if (b) { + a.push(','); + } + a.push(BI.jsonEncode(i), ":", + v === null ? "null" : BI.jsonEncode(v)); + b = true; + } + } + } + a.push("}"); + return a.join(""); + } +}; + +BI.contentFormat = function (cv, fmt) { + if (BI.isEmpty(cv)) { + //原值为空,返回空字符 + return ''; + } + var text = cv.toString(); + if (BI.isEmpty(fmt)) { + //格式为空,返回原字符 + return text; + } + if (fmt.match(/^T/)) { + //T - 文本格式 + return text; + } else if (fmt.match(/^D/)) { + //D - 日期(时间)格式 + if (!(cv instanceof Date)) { + if (typeof cv === 'number') { + //毫秒数类型 + cv = new Date(cv); + } else { + //字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构 + cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long); + } + } + if (!BI.isNull(cv)) { + var needTrim = fmt.match(/^DT/); + text = BI.date2Str(cv, fmt.substring(needTrim ? 2 : 1)); + } + } else if (fmt.match(/E/)) { + //科学计数格式 + text = BI._eFormat(text, fmt); + } else { + //数字格式 + text = BI._numberFormat(text, fmt); + } + //¤ - 货币格式 + text = text.replace(/¤/g, '¥'); + return text; +}; + +/** + * 把日期对象按照指定格式转化成字符串 + * + * @example + * var date = new Date('Thu Dec 12 2013 00:00:00 GMT+0800'); + * var result = BI.date2Str(date, 'yyyy-MM-dd');//2013-12-12 + * + * @class BI.date2Str + * @param date 日期 + * @param format 日期格式 + * @returns {String} + */ +date2Str = function (date, format) { + if (!date) { + return ''; + } + // O(len(format)) + var len = format.length, result = ''; + if (len > 0) { + var flagch = format.charAt(0), start = 0, str = flagch; + for (var i = 1; i < len; i++) { + var ch = format.charAt(i); + if (flagch !== ch) { + result += compileJFmt({ + 'char': flagch, + 'str': str, + 'len': i - start + }, date); + flagch = ch; + start = i; + str = flagch; + } else { + str += ch; + } + } + result += compileJFmt({ + 'char': flagch, + 'str': str, + 'len': len - start + }, date); + } + return result; + + function compileJFmt(jfmt, date) { + var str = jfmt.str, len = jfmt.len, ch = jfmt['char']; + switch (ch) { + case 'E': //星期 + str = Date._DN[date.getDay()]; + break; + case 'y': //年 + if (len <= 3) { + str = (date.getFullYear() + '').slice(2, 4); + } else { + str = date.getFullYear(); + } + break; + case 'M': //月 + if (len > 2) { + str = Date._MN[date.getMonth()]; + } else if (len < 2) { + str = date.getMonth() + 1; + } else { + str = String.leftPad(date.getMonth() + 1 + '', 2, '0'); + } + break; + case 'd': //日 + if (len > 1) { + str = String.leftPad(date.getDate() + '', 2, '0'); + } else { + str = date.getDate(); + } + break; + case 'h': //时(12) + var hour = date.getHours() % 12; + if (hour === 0) { + hour = 12; + } + if (len > 1) { + str = String.leftPad(hour + '', 2, '0'); + } else { + str = hour; + } + break; + case 'H': //时(24) + if (len > 1) { + str = String.leftPad(date.getHours() + '', 2, '0'); + } else { + str = date.getHours(); + } + break; + case 'm': + if (len > 1) { + str = String.leftPad(date.getMinutes() + '', 2, '0'); + } else { + str = date.getMinutes(); + } + break; + case 's': + if (len > 1) { + str = String.leftPad(date.getSeconds() + '', 2, '0'); + } else { + str = date.getSeconds(); + } + break; + case 'a': + str = date.getHours() < 12 ? 'am' : 'pm'; + break; + case 'z': + str = date.getTimezone(); + break; + default: + str = jfmt.str; + break; + } + return str; + } +}; + +/** + * 数字格式 + */ +BI._numberFormat = function (text, format) { + var text = text + ''; + //数字格式,区分正负数 + var numMod = format.indexOf(';'); + if (numMod > -1) { + if (text >= 0) { + return BI._numberFormat(text + "", format.substring(0, numMod)); + } else { + return BI._numberFormat((-text) + "", format.substr(numMod + 1)); + } + } + var tp = text.split('.'), fp = format.split('.'), + tleft = tp[0] || '', fleft = fp[0] || '', + tright = tp[1] || '', fright = fp[1] || ''; + //百分比,千分比的小数点移位处理 + if (/[%‰]$/.test(format)) { + var paddingZero = /[%]$/.test(format) ? '00' : '000'; + tright += paddingZero; + tleft += tright.substr(0, paddingZero.length); + tleft = tleft.replace(/^0+/gi, ''); + tright = tright.substr(paddingZero.length).replace(/0+$/gi, ''); + } + var right = BI._dealWithRight(tright, fright); + if (right.leftPlus) { + //小数点后有进位 + tleft = parseInt(tleft) + 1 + ''; + + tleft = isNaN(tleft) ? '1' : tleft; + } + right = right.num; + var left = BI._dealWithLeft(tleft, fleft); + if (!(/[0-9]/.test(left))) { + left = left + '0'; + } + if (!(/[0-9]/.test(right))) { + return left + right; + } else { + return left + '.' + right; + } +}; +/** + * 处理小数点右边小数部分 + * @param tright 右边内容 + * @param fright 右边格式 + * @returns {JSON} 返回处理结果和整数部分是否需要进位 + * @private + */ +BI._dealWithRight = function (tright, fright) { + var right = '', j = 0, i = 0; + for (var len = fright.length; i < len; i++) { + var ch = fright.charAt(i); + var c = tright.charAt(j); + switch (ch) { + case '0': + if (BI.isEmpty(c)) { + c = '0'; + } + right += c; + j++; + break; + case '#': + right += c; + j++; + break; + default : + right += ch; + break; + } + } + var rll = tright.substr(j); + var result = {}; + if (!BI.isEmpty(rll) && rll.charAt(0) > 4) { + //有多余字符,需要四舍五入 + result.leftPlus = true; + var numReg = right.match(/^[0-9]+/); + if (numReg) { + var num = numReg[0]; + var orilen = num.length; + var newnum = BI.parseINT(num) + 1 + ''; + //进位到整数部分 + if (newnum.length > orilen) { + newnum = newnum.substr(1); + } else { + newnum = BI.leftPad(newnum, orilen, '0'); + result.leftPlus = false; + } + right = right.replace(/^[0-9]+/, newnum); + } + } + result.num = right; + return result; +}; + +BI.parseINT = function (str) { + return parseInt(str, 10); +}; + +BI.leftPad = function (val, size, ch) { + var result = String(val); + if (!ch) { + ch = " "; + } + while (result.length < size) { + result = ch + result; + } + return result.toString(); +}; + +/** + * 处理小数点左边整数部分 + * @param tleft 左边内容 + * @param fleft 左边格式 + * @returns {string} 返回处理结果 + * @private + */ +BI._dealWithLeft = function (tleft, fleft) { + var left = ''; + var j = tleft.length - 1; + var combo = -1, last = -1; + var i = fleft.length - 1; + for (; i >= 0; i--) { + var ch = fleft.charAt(i); + var c = tleft.charAt(j); + switch (ch) { + case '0': + if (BI.isEmpty(c)) { + c = '0'; + } + last = -1; + left = c + left; + j--; + break; + case '#': + last = i; + left = c + left; + j--; + break; + case ',': + if (!BI.isEmpty(c)) { + //计算一个,分隔区间的长度 + var com = fleft.match(/,[#0]+/); + if (com) { + combo = com[0].length - 1; + } + left = ',' + left; + } + break; + default : + left = ch + left; + break; + } + } + if (last > -1) { + //处理剩余字符 + var tll = tleft.substr(0, j + 1); + left = left.substr(0, last) + tll + left.substr(last); + } + if (combo > 0) { + //处理,分隔区间 + var res = left.match(/[0-9]+,/); + if (res) { + res = res[0]; + var newstr = '', n = res.length - 1 - combo; + for (; n >= 0; n = n - combo) { + newstr = res.substr(n, combo) + ',' + newstr; + } + var lres = res.substr(0, n + combo); + if (!BI.isEmpty(lres)) { + newstr = lres + ',' + newstr; + } + } + left = left.replace(/[0-9]+,/, newstr); + } + return left; +}; + +BI.object2Number = function (value) { + if (value == null) { + return 0; + } + if (typeof value == 'number') { + return value; + } else { + var str = value + ""; + if (str.indexOf(".") === -1) { + return parseInt(str); + } else { + return parseFloat(str); + } + } +}; + +BI.object2Date = function (obj) { + if (obj == null) { + return new Date(); + } + if (obj instanceof Date) { + return obj; + } else if (typeof obj == 'number') { + return new Date(obj); + } else { + var str = obj + ""; + str = str.replace(/-/g, '/'); + var dt = new Date(str); + if (!BI.isInvalidDate(dt)) { + return dt; + } + + return new Date(); + } +}; + +BI.isArray = function (a) { + return Object.prototype.toString.call(a) == '[object Array]'; +}; + +BI.object2Time = function (obj) { + if (obj == null) { + return new Date(); + } + if (obj instanceof Date) { + return obj; + } else { + var str = obj + ""; + str = str.replace(/-/g, '/'); + var dt = new Date(str); + if (!BI.isInvalidDate(dt)) { + return dt; + } + if (str.indexOf('/') === -1 && str.indexOf(':') !== -1) { + dt = new Date("1970/01/01 " + str); + if (!BI.isInvalidDate(dt)) { + return dt; + } + } + dt = BI.str2Date(str, "HH:mm:ss"); + if (!BI.isInvalidDate(dt)) { + return dt; + } + return new Date(); + } +}; + +// 判断是否是无效的日期 +BI.isInvalidDate = function (date) { + return date == "Invalid Date" || date == "NaN"; +}; + + +/** + * 科学计数格式 + */ +BI._eFormat = function (text, fmt) { + var e = fmt.indexOf("E"); + var eleft = fmt.substr(0, e), eright = fmt.substr(e + 1); + if (/^[0\.-]+$/.test(text)) { + text = BI._numberFormat(0.0, eleft) + 'E' + BI._numberFormat(0, eright) + } else { + var isNegative = text < 0; + if (isNegative) { + text = text.substr(1); + } + var elvl = (eleft.split('.')[0] || '').length; + var point = text.indexOf("."); + if (point < 0) { + point = text.length; + } + var i = 0; //第一个不为0的数的位置 + text = text.replace('.', ''); + for (var len = text.length; i < len; i++) { + var ech = text.charAt(i); + if (ech <= '9' && ech >= '1') { + break; + } + } + var right = point - i - elvl; + var left = text.substr(i, elvl); + var dis = i + elvl - text.length; + if (dis > 0) { + //末位补全0 + for (var k = 0; k < dis; k++) { + left += '0'; + } + } else { + left += '.' + text.substr(i + elvl); + } + left = left.replace(/^[0]+/, ''); + if (right < 0 && eright.indexOf('-') < 0) { + eright += ';-' + eright; + } + text = BI._numberFormat(left, eleft) + 'E' + BI._numberFormat(right, eright); + if (isNegative) { + text = '-' + text; + } + } + return text; +};/** * guy * * @class BI.HighlightBehavior @@ -21940,7 +22507,7 @@ $(function () { }, getCompleteImageUrl: function (url) { - return FR.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + url; + return BI.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + url; } }); diff --git a/src/less/base/third/farbtastic/marker.png b/dist/farbtastic/marker.png similarity index 100% rename from src/less/base/third/farbtastic/marker.png rename to dist/farbtastic/marker.png diff --git a/src/less/base/third/farbtastic/mask.png b/dist/farbtastic/mask.png similarity index 100% rename from src/less/base/third/farbtastic/mask.png rename to dist/farbtastic/mask.png diff --git a/src/less/base/third/farbtastic/wheel.png b/dist/farbtastic/wheel.png similarity index 100% rename from src/less/base/third/farbtastic/wheel.png rename to dist/farbtastic/wheel.png diff --git a/dist/widget.js b/dist/widget.js index 057bfed2b4..d3839ccaa7 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -12981,7 +12981,7 @@ BI.UploadImage = BI.inherit(BI.Widget, { BI.extend(BI.UploadImage, { getImageSrc: function (src) { - return FR.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + src; + return BI.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + src; } }); @@ -30143,4 +30143,728 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, { } }); BI.YearQuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; -$.shortcut('bi.year_quarter_combo', BI.YearQuarterCombo); \ No newline at end of file +$.shortcut('bi.year_quarter_combo', BI.YearQuarterCombo);/** + * 简单的复选下拉树控件, 适用于数据量少的情况 + * + * Created by GUY on 2015/10/29. + * @class BI.TreeValueChooserCombo + * @extends BI.Widget + */ +BI.TreeValueChooserCombo = BI.inherit(BI.Widget, { + + _const: { + perPage: 10 + }, + + _defaultConfig: function () { + return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-tree-value-chooser-combo", + width: 200, + height: 30, + items: null, + itemsCreator: BI.emptyFn + }); + }, + + _init: function () { + BI.TreeValueChooserCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this._initData(o.items); + } + this.combo = BI.createWidget({ + type: 'bi.multi_tree_combo', + element: this.element, + itemsCreator: BI.bind(this._itemsCreator, this), + width: o.width, + height: o.height + }); + + this.combo.on(BI.MultiTreeCombo.EVENT_CONFIRM, function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM); + }); + }, + + _initData: function (items) { + this.items = items; + var nodes = BI.Tree.transformToTreeFormat(items); + this.tree = new BI.Tree(); + this.tree.initTree(nodes); + this._initMap(); + this._initFloors(); + }, + + _initMap: function () { + var map = this.map = {}; + BI.each(this.items, function (i, item) { + map[item.value] = item; + }); + }, + + _initFloors: function () { + this.floors = -1; + var root = this.tree.getRoot(); + while (root) { + this.floors++; + root = root.getChildren()[0]; + } + }, + + _itemsCreator: function (options, callback) { + var self = this, o = this.options; + if (!this.items) { + o.itemsCreator({}, function (items) { + self._initData(items); + call(); + }); + } else { + call(); + } + function call() { + switch (options.type) { + case BI.TreeView.REQ_TYPE_INIT_DATA: + self._reqInitTreeNode(options, callback); + break; + case BI.TreeView.REQ_TYPE_ADJUST_DATA: + self._reqAdjustTreeNode(options, callback); + break; + case BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA: + self._reqSelectedTreeNode(options, callback); + break; + case BI.TreeView.REQ_TYPE_SELECTED_DATA: + self._reqDisplayTreeNode(options, callback); + break; + default : + self._reqTreeNode(options, callback); + break; + } + } + }, + + _reqDisplayTreeNode: function (op, callback) { + var self = this; + var result = []; + var selected_values = op.selected_values; + + if (selected_values == null || BI.isEmpty(selected_values)) { + callback({}); + return; + } + + doCheck(0, [], selected_values); + + callback({ + items: result + }); + + function doCheck(floor, parent_values, selected) { + if (floor >= self.floors) { + return; + } + if (selected == null || BI.isEmpty(selected)) { + var children = self._getChildren(parent_values); + BI.each(children, function (i, child) { + var newParents = BI.clone(parent_values); + newParents.push(child.value); + var llen = self._getChildCount(newParents); + createOneJson(child, llen); + doCheck(floor + 1, newParents, {}); + }); + return; + } + BI.each(selected, function (k) { + var node = self._getNode(k); + var newParents = BI.clone(parent_values); + newParents.push(node.value); + createOneJson(node, getCount(selected[k], newParents)); + doCheck(floor + 1, newParents, selected[k]); + }) + } + + function getCount(jo, parent_values) { + if (jo == null) { + return 0; + } + if (BI.isEmpty(jo)) { + return self._getChildCount(parent_values); + } + + return BI.size(jo); + } + + function createOneJson(node, llen) { + result.push({ + id: node.id, + pId: node.pId, + text: node.text + (llen > 0 ? ("(" + BI.i18nText("BI-Basic_Altogether") + llen + BI.i18nText("BI-Basic_Count") + ")") : ""), + value: node.value, + open: true + }); + } + }, + + _reqSelectedTreeNode: function (op, callback) { + var self = this; + var selected_values = op.selected_values; + var not_selected_value = op.not_selected_value || {}; + var keyword = op.keyword || ""; + var parent_values = op.parent_values || []; + + if (selected_values == null || BI.isEmpty(selected_values)) { + callback({}); + return; + } + + dealWithSelectedValues(selected_values); + callback(selected_values); + + + function dealWithSelectedValues(selected_values) { + var p = BI.clone(parent_values); + p.push(not_selected_value); + + if (isChild(selected_values, p)) { + var result = []; + var finded = search(parent_values.length + 1, parent_values, not_selected_value, result); + + if (finded === true) { + var next = selected_values; + BI.each(p, function (i, v) { + var t = next[v]; + if (t == null) { + if (BI.isEmpty(next)) { + var split = p.slice(0, i); + var expanded = self._getChildren(split); + BI.each(expanded, function (m, child) { + if (i === p.length - 1 && child.value === not_selected_value) { + return true; + } + next[child.value] = {}; + }); + next = next[v]; + } else { + next = {}; + next[v] = {}; + } + } else { + next = t; + } + }); + + if (result.length > 0) { + BI.each(result, function (i, strs) { + self._buildTree(selected_values, strs); + }) + } + } + } + + } + + function search(deep, parents, current, result) { + var newParents = BI.clone(parents); + newParents.push(current); + if (self._isMatch(current, keyword)) { + return true; + } + if (deep >= self.floors) { + return false; + } + + var children = self._getChildren(newParents); + + var notSearch = []; + var can = false; + + BI.each(children, function (i, child) { + if (search(deep + 1, newParents, child.value, result)) { + can = true; + } else { + notSearch.push(child.value); + } + }); + if (can === true) { + BI.each(notSearch, function (i, v) { + var next = BI.clone(newParents); + next.push(v); + result.push(next); + }); + } + return can; + } + + function isChild(selected_values, parents) { + var t = selected_values; + for (var i = 0; i < parents.length; i++) { + var v = parents[i]; + if (!BI.has(t, v)) { + return false; + } + t = t[v]; + if (t == null || BI.isEmpty(t)) { + return true; + } + } + return true; + } + }, + + _reqAdjustTreeNode: function (op, callback) { + var self = this; + var result = []; + var selected_values = op.selected_values; + if (selected_values == null || BI.isEmpty(selected_values)) { + callback({}); + return; + } + BI.each(selected_values, function (k, v) { + result.push([k]); + }); + + dealWithSelectedValues(selected_values, []); + + var jo = {}; + BI.each(result, function (i, strs) { + self._buildTree(jo, strs); + }); + callback(jo); + + function dealWithSelectedValues(selected, parents) { + if (selected == null || BI.isEmpty(selected)) { + return true; + } + var can = true; + BI.each(selected, function (k, v) { + var p = BI.clone(parents); + p.push(k); + if (!dealWithSelectedValues(selected[k], p)) { + BI.each(selected[k], function (nk, nv) { + var t = BI.clone(p); + t.push(nk); + result.push(t); + }); + can = false; + } + }); + return can && isAllSelected(selected, parents); + } + + function isAllSelected(selected, parents) { + return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); + } + }, + + _reqInitTreeNode: function (op, callback) { + var self = this; + var result = []; + var keyword = op.keyword || ""; + var selected_values = op.selected_values; + var last_search_value = op.last_search_value || ""; + var output = search(); + BI.nextTick(function () { + callback({ + hasNext: output.length > self._const.perPage, + items: result, + last_search_value: BI.last(output) + }) + }); + + function search() { + var children = self._getChildren([]); + var start = children.length; + if (last_search_value !== "") { + for (var j = 0, len = start; j < len; j++) { + if (children[j].value === last_search_value) { + start = j + 1; + break; + } + } + } else { + start = 0; + } + var output = []; + for (var i = start, len = children.length; i < len; i++) { + if (output.length < self._const.perPage) { + var find = nodeSearch(1, [], children[i].value, false, result); + } else if (output.length === self._const.perPage) { + var find = nodeSearch(1, [], children[i].value, false, []); + } + if (find[0] === true) { + output.push(children[i].value); + } + if (output.length > self._const.perPage) { + break; + } + } + return output; + } + + function nodeSearch(deep, parent_values, current, isAllSelect, result) { + if (self._isMatch(current, keyword)) { + var checked = isAllSelect || isSelected(parent_values, current); + createOneJson(parent_values, current, false, checked, !isAllSelect && isHalf(parent_values, current), true, result); + return [true, checked]; + } + if (deep >= self.floors) { + return [false, false]; + } + var newParents = BI.clone(parent_values); + newParents.push(current); + var children = self._getChildren(newParents); + + var can = false, checked = false; + + var isCurAllSelected = isAllSelect || isAllSelected(parent_values, current); + BI.each(children, function (i, child) { + var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result); + if (state[1] === true) { + checked = true; + } + if (state[0] === true) { + can = true; + } + }); + if (can === true) { + checked = isCurAllSelected || (isSelected(parent_values, current) && checked); + createOneJson(parent_values, current, true, checked, false, false, result); + } + return [can, checked]; + } + + function createOneJson(parent_values, value, isOpen, checked, half, flag, result) { + var node = self.map[value]; + result.push({ + id: node.id, + pId: node.pId, + text: node.text, + value: node.value, + title: node.title, + isParent: parent_values.length + 1 < self.floors, + open: isOpen, + checked: checked, + halfCheck: half, + flag: flag + }); + } + + function isHalf(parent_values, value) { + var find = findSelectedObj(parent_values); + if (find == null) { + return null; + } + return BI.any(find, function (v, ob) { + if (v === value) { + if (ob != null && !BI.isEmpty(ob)) { + return true; + } + } + }); + } + + function isAllSelected(parent_values, value) { + var find = findSelectedObj(parent_values); + if (find == null) { + return null; + } + return BI.any(find, function (v, ob) { + if (v === value) { + if (ob != null && BI.isEmpty(ob)) { + return true; + } + } + }); + } + + function isSelected(parent_values, value) { + var find = findSelectedObj(parent_values); + if (find == null) { + return false; + } + return BI.any(find, function (v) { + if (v === value) { + return true; + } + }); + } + + function findSelectedObj(parent_values) { + var find = selected_values; + if (find == null) { + return null; + } + BI.every(parent_values, function (i, v) { + find = find[v]; + if (find == null) { + return false; + } + return true; + }); + return find; + } + }, + + _reqTreeNode: function (op, callback) { + var self = this; + var result = []; + var times = op.times; + var check_state = op.check_state || {}; + var parent_values = op.parent_values || []; + var selected_values = op.selected_values; + var valueMap = {}; + if (judgeState(parent_values, selected_values, check_state)) { + valueMap = dealWidthSelectedValue(parent_values, selected_values); + } + var nodes = this._getChildren(parent_values); + for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) { + var state = getCheckState(nodes[i].value, parent_values, valueMap, check_state); + result.push({ + id: nodes[i].id, + pId: nodes[i].pId, + value: nodes[i].value, + text: nodes[i].text, + times: 1, + isParent: parent_values.length + 1 < this.floors, + checked: state[0], + halfCheck: state[1] + }) + } + BI.nextTick(function () { + callback({ + items: result, + hasNext: nodes.length > times * self._const.perPage + }); + }); + + function judgeState(parent_values, selected_value, check_state) { + var checked = check_state.checked, half = check_state.half; + if (parent_values.length > 0 && !checked) { + return false; + } + return (parent_values.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); + } + + function dealWidthSelectedValue(parent_values, selected_values) { + var valueMap = {}; + BI.each(parent_values, function (i, v) { + selected_values = selected_values[v]; + }); + BI.each(selected_values, function (value, obj) { + if (BI.isNull(obj)) { + valueMap[value] = [0, 0]; + return; + } + if (BI.isEmpty(obj)) { + valueMap[value] = [2, 0]; + return; + } + var nextNames = {}; + BI.each(obj, function (t, o) { + if (BI.isNull(o) || BI.isEmpty(o)) { + nextNames[t] = true; + } + }); + valueMap[value] = [1, BI.size(nextNames)]; + }); + return valueMap; + } + + function getCheckState(current, parent_values, valueMap, check_state) { + var checked = check_state.checked, half = check_state.half; + var hasChild = parent_values.length + 1 < self.floors; + var tempCheck = false, halfCheck = false; + if (BI.has(valueMap, current)) { + //可能是半选 + if (valueMap[current][0] === 1) { + var values = BI.clone(parent_values); + values.push(current); + if (hasChild && self._getChildCount(values) != valueMap[current][1]) { + halfCheck = true; + } + } else if (valueMap[current][0] === 2) { + tempCheck = true; + } + } + var check; + if (!checked && !halfCheck && !tempCheck) { + check = BI.has(valueMap, current); + } else { + check = ((tempCheck || checked) && !half) || BI.has(valueMap, current); + } + return [check, halfCheck]; + } + }, + + + _buildTree: function (jo, values) { + var t = jo; + BI.each(values, function (i, v) { + if (!BI.has(t, v)) { + t[v] = {}; + } + t = t[v]; + }); + }, + + _isMatch: function (value, keyword) { + var finded = BI.Func.getSearchResult([value], keyword); + return finded.finded.length > 0 || finded.matched.length > 0; + }, + + _getNode: function (v) { + return this.tree.search(v, "value"); + }, + + _getChildren: function (parent_values) { + if (parent_values.length > 0) { + var value = BI.last(parent_values); + var parent = this.tree.search(value, "value"); + } else { + var parent = this.tree.getRoot(); + } + return parent.getChildren(); + }, + + _getChildCount: function (parent_values) { + return this._getChildren(parent_values).length; + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + return this.combo.getValue(); + }, + + populate: function () { + this.combo.populate.apply(this, arguments); + } +}); +BI.TreeValueChooserCombo.EVENT_CONFIRM = "TreeValueChooserCombo.EVENT_CONFIRM"; +$.shortcut('bi.tree_value_chooser_combo', BI.TreeValueChooserCombo);/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserCombo + * @extends BI.Widget + */ +BI.ValueChooserCombo = BI.inherit(BI.Widget, { + + _const: { + perPage: 10 + }, + _defaultConfig: function () { + return BI.extend(BI.ValueChooserCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-combo", + width: 200, + height: 30, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: 'bi.multi_select_combo', + element: this.element, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: function (v) { + var text = v; + if (BI.isNotNull(self.items)) { + BI.some(self.items, function (i, item) { + if (item.value === v) { + text = item.text; + return true; + } + }); + } + return text; + }, + width: o.width, + height: o.height + }); + + this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () { + self.fireEvent(BI.ValueChooserCombo.EVENT_CONFIRM); + }); + }, + + _getItemsByTimes: function (items, times) { + var res = []; + for (var i = (times - 1) * this._const.perPage; items[i] && i < times * this._const.perPage; i++) { + res.push(items[i]); + } + return res; + }, + + _hasNextByTimes: function (items, times) { + return times * this._const.perPage < items.length; + }, + + _itemsCreator: function (options, callback) { + var self = this, o = this.options; + if (!o.cache || !this.items) { + o.itemsCreator({}, function (items) { + self.items = items; + call(items); + }); + } else { + call(this.items); + } + function call(items) { + var keywords = (options.keywords || []).slice(); + if (options.keyword) { + keywords.push(options.keyword); + } + BI.each(keywords, function (i, kw) { + var search = BI.Func.getSearchResult(items, kw); + items = search.matched.concat(search.finded); + }); + if (options.selected_values) {//过滤 + var filter = BI.makeObject(options.selected_values, true); + items = BI.filter(items, function (i, ob) { + return !filter[ob.value]; + }); + } + if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) { + callback({ + items: items + }); + return; + } + if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { + callback({count: items.length}); + return; + } + callback({ + items: self._getItemsByTimes(items, options.times), + hasNext: self._hasNextByTimes(items, options.times) + }); + } + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + } + }, + + populate: function () { + this.combo.populate.apply(this, arguments); + } +}); +BI.ValueChooserCombo.EVENT_CONFIRM = "ValueChooserCombo.EVENT_CONFIRM"; +$.shortcut('bi.value_chooser_combo', BI.ValueChooserCombo); \ No newline at end of file diff --git a/src/less/base/third/ztree/img/line_conn.gif b/dist/ztree/img/line_conn.gif similarity index 100% rename from src/less/base/third/ztree/img/line_conn.gif rename to dist/ztree/img/line_conn.gif diff --git a/src/less/base/third/ztree/img/loading.gif b/dist/ztree/img/loading.gif similarity index 100% rename from src/less/base/third/ztree/img/loading.gif rename to dist/ztree/img/loading.gif diff --git a/src/less/base/third/ztree/img/zTreeStandard.gif b/dist/ztree/img/zTreeStandard.gif similarity index 100% rename from src/less/base/third/ztree/img/zTreeStandard.gif rename to dist/ztree/img/zTreeStandard.gif diff --git a/src/less/base/third/ztree/img/zTreeStandard.png b/dist/ztree/img/zTreeStandard.png similarity index 100% rename from src/less/base/third/ztree/img/zTreeStandard.png rename to dist/ztree/img/zTreeStandard.png diff --git a/src/base/farbtastic/farbtastic.js b/src/base/farbtastic/farbtastic.js index a243d31ee3..ad49b54393 100644 --- a/src/base/farbtastic/farbtastic.js +++ b/src/base/farbtastic/farbtastic.js @@ -18,8 +18,8 @@ BI.Farbtastic = BI.inherit(BI.Widget, { _init: function () { BI.Farbtastic.superclass._init.apply(this, arguments); var self = this; - FR.$defaultImport('/com/fr/bi/web/js/third/farbtastic.js', 'js'); - FR.$defaultImport('/com/fr/bi/web/css/base/third/farbtastic/farbtastic.css', 'css'); + + this.farbtastic = $.farbtastic(this.element, function (v) { self.fireEvent(BI.Farbtastic.EVENT_CHANGE, self.getValue(), self); diff --git a/src/base/foundation/bi.message.js b/src/base/foundation/bi.message.js index e79e1bae77..1c17c2e1ec 100644 --- a/src/base/foundation/bi.message.js +++ b/src/base/foundation/bi.message.js @@ -16,7 +16,7 @@ $.extend(BI, { this._show(true, title, message, callback); }, prompt: function (title, message, value, callback, min_width) { - FR.Msg.prompt(title, message, value, callback, min_width); + BI.Msg.prompt(title, message, value, callback, min_width); }, toast: function (message, level, context) { context = context || $("body"); diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index 2aa47b8781..d1faf94d03 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -84,7 +84,7 @@ var multipart = function (boundary, name, file) { return "--".concat( boundary, CRLF, - 'Content-Disposition: form-data; name="', name, '"; filename="', FR.cjkEncode(file.fileName), '"', CRLF, + 'Content-Disposition: form-data; name="', name, '"; filename="', BI.cjkEncode(file.fileName), '"', CRLF, "Content-Type: application/octet-stream", CRLF, CRLF, file.getAsBinary(), CRLF, @@ -153,7 +153,7 @@ }, false ); - xhr.open("post", handler.url + '&filename=' + FR.cjkEncode(handler.file.fileName), true); + xhr.open("post", handler.url + '&filename=' + BI.cjkEncode(handler.file.fileName), true); if (!xhr.upload) { var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true}; rpe.interval = setInterval(function () { @@ -184,8 +184,8 @@ upload.onprogress(rpe); if (199 < xhr.status && xhr.status < 400) { upload["onload"]({}); - var attachO = FR.jsonDecode(xhr.responseText); - attachO.filename = FR.cjkDecode(handler.file.fileName); + var attachO = BI.jsonDecode(xhr.responseText); + attachO.filename = BI.cjkDecode(handler.file.fileName); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } @@ -201,7 +201,7 @@ xhr.onreadystatechange = function () { switch (xhr.readyState) { case 4: - var attachO = FR.jsonDecode(xhr.responseText); + var attachO = BI.jsonDecode(xhr.responseText); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } @@ -251,13 +251,13 @@ //rpe.loaded = rpe.total; try { var responseText = (iframe.contentWindow.document || iframe.contentWindow.contentDocument).body.innerHTML; - var attachO = FR.jsonDecode(responseText); + var attachO = BI.jsonDecode(responseText); if (handler.file.type.indexOf('image') != -1) { attachO.attach_type = "image"; } //attachO.fileSize = responseText.length; - attachO.filename = FR.cjkDecode(handler.file.fileName); + attachO.filename = BI.cjkDecode(handler.file.fileName); if (handler.maxlength == 1) { handler.attach_array[0] = attachO; } else { @@ -474,7 +474,7 @@ // enable again the submit button/element }, 1000); }; - _wrap.url = o.url ? o.url : FR.servletURL + _wrap.url = o.url ? o.url : BI.servletURL + '?op=fr_attach&cmd=ah_upload'; _wrap.fileType = o.accept; //文件类型限制 _wrap.attach_array = []; diff --git a/src/base/tree/synctree.js b/src/base/tree/synctree.js index 52486fa838..a0d04cfc39 100644 --- a/src/base/tree/synctree.js +++ b/src/base/tree/synctree.js @@ -19,7 +19,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, { var setting = { async: { enable: false, - otherParam: FR.cjkEncodeDO(paras) + otherParam: BI.cjkEncodeDO(paras) }, check: { enable: true diff --git a/src/base/tree/treeview.js b/src/base/tree/treeview.js index c65c5e7303..f39a22c70b 100644 --- a/src/base/tree/treeview.js +++ b/src/base/tree/treeview.js @@ -14,9 +14,9 @@ BI.TreeView = BI.inherit(BI.Pane, { }, _init: function () { BI.TreeView.superclass._init.apply(this, arguments); - FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.core-3.5.js', 'js'); - FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.excheck-3.5.js', 'js'); - FR.$defaultImport('/com/fr/bi/web/css/base/third/ztree/zTreeStyle.css', 'css'); + + + this._stop = false; this.container = BI.createWidget(); @@ -71,7 +71,7 @@ BI.TreeView = BI.inherit(BI.Pane, { enable: true, url: getUrl, autoParam: ["id", "name"], - otherParam: FR.cjkEncodeDO(paras) + otherParam: BI.cjkEncodeDO(paras) }, check: { enable: true @@ -113,10 +113,10 @@ BI.TreeView = BI.inherit(BI.Pane, { treeNode.times = treeNode.times || 1; var param = "id=" + treeNode.id + "×=" + (treeNode.times++) - + "&parent_values= " + window.encodeURIComponent(FR.jsonEncode(parentNode)) - + "&check_state=" + window.encodeURIComponent(FR.jsonEncode(treeNode.getCheckStatus())); + + "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + + "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); - return FR.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; + return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param; } function beforeExpand(treeId, treeNode) { @@ -165,7 +165,7 @@ BI.TreeView = BI.inherit(BI.Pane, { function ajaxGetNodes(treeNode, reloadType) { var zTree = self.nodes; if (reloadType == "refresh") { - //treeNode.icon = FR.servletURL +"?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif"; + //treeNode.icon = BI.servletURL +"?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif"; zTree.updateNode(treeNode); } zTree.reAsyncChildNodes(treeNode, reloadType, true); diff --git a/src/case/logintimeout/login.timeout.js b/src/case/logintimeout/login.timeout.js index 17dbafd015..075d5c7401 100644 --- a/src/case/logintimeout/login.timeout.js +++ b/src/case/logintimeout/login.timeout.js @@ -130,9 +130,9 @@ BI.LoginTimeOut = BI.inherit(BI.BarPopoverSection, { } //反正是登录直接用FR的登录了 - FR.ajax({ - url: FR.servletURL + '?op=fs_load&cmd=login', - data: FR.cjkEncodeDO({ + BI.ajax({ + url: BI.servletURL + '?op=fs_load&cmd=login', + data: BI.cjkEncodeDO({ fr_username: encodeURIComponent(userNameInput.getValue()), fr_password: encodeURIComponent(passwordInput.getValue()), fr_remember: self.keepLoginState.isSelected() @@ -147,7 +147,7 @@ BI.LoginTimeOut = BI.inherit(BI.BarPopoverSection, { self._showMes(userNameMask, BI.i18nText("BI-Authentication_Failed")); return; } - var signResult = FR.jsonDecode(res.responseText); + var signResult = BI.jsonDecode(res.responseText); if (signResult.fail) { //用户名和密码不匹配 self._showMes(userNameMask, BI.i18nText("BI-Username_Password_Not_Correct")); @@ -171,7 +171,7 @@ BI.LoginTimeOut = BI.inherit(BI.BarPopoverSection, { type: "bi.center_adapt", items: [{ type: "bi.img", - src: FR.servletURL + (logo ? + src: BI.servletURL + (logo ? '?op=fr_attach&cmd=ah_image&id=' + logo + '&isAdjust=false' : '?op=resource&resource=/com/fr/bi/web/images/login/bi_logo.png'), width: 120, diff --git a/src/case/zclip/zclip.js b/src/case/zclip/zclip.js index ee4b724f2c..c2c527f034 100644 --- a/src/case/zclip/zclip.js +++ b/src/case/zclip/zclip.js @@ -16,10 +16,10 @@ BI.ZeroClip = BI.inherit(BI.BasicButton, { _init: function () { BI.ZeroClip.superclass._init.apply(this, arguments); var self = this, o = this.options; - FR.$defaultImport('/com/fr/bi/web/js/third/jquery.zclip.js', 'js'); + BI.nextTick(function () { self.element.zclip({ - path: FR.servletURL + "?op=resource&resource=/com/fr/bi/web/resources/ZeroClipboard.swf", + path: BI.servletURL + "?op=resource&resource=/com/fr/bi/web/resources/ZeroClipboard.swf", copy: o.copy, beforeCopy: o.beforeCopy, afterCopy: o.afterCopy diff --git a/src/component/combo.treevaluechooser.js b/src/component/combo.treevaluechooser.js new file mode 100644 index 0000000000..e0011cbf7c --- /dev/null +++ b/src/component/combo.treevaluechooser.js @@ -0,0 +1,599 @@ +/** + * 简单的复选下拉树控件, 适用于数据量少的情况 + * + * Created by GUY on 2015/10/29. + * @class BI.TreeValueChooserCombo + * @extends BI.Widget + */ +BI.TreeValueChooserCombo = BI.inherit(BI.Widget, { + + _const: { + perPage: 10 + }, + + _defaultConfig: function () { + return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-tree-value-chooser-combo", + width: 200, + height: 30, + items: null, + itemsCreator: BI.emptyFn + }); + }, + + _init: function () { + BI.TreeValueChooserCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this._initData(o.items); + } + this.combo = BI.createWidget({ + type: 'bi.multi_tree_combo', + element: this.element, + itemsCreator: BI.bind(this._itemsCreator, this), + width: o.width, + height: o.height + }); + + this.combo.on(BI.MultiTreeCombo.EVENT_CONFIRM, function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM); + }); + }, + + _initData: function (items) { + this.items = items; + var nodes = BI.Tree.transformToTreeFormat(items); + this.tree = new BI.Tree(); + this.tree.initTree(nodes); + this._initMap(); + this._initFloors(); + }, + + _initMap: function () { + var map = this.map = {}; + BI.each(this.items, function (i, item) { + map[item.value] = item; + }); + }, + + _initFloors: function () { + this.floors = -1; + var root = this.tree.getRoot(); + while (root) { + this.floors++; + root = root.getChildren()[0]; + } + }, + + _itemsCreator: function (options, callback) { + var self = this, o = this.options; + if (!this.items) { + o.itemsCreator({}, function (items) { + self._initData(items); + call(); + }); + } else { + call(); + } + function call() { + switch (options.type) { + case BI.TreeView.REQ_TYPE_INIT_DATA: + self._reqInitTreeNode(options, callback); + break; + case BI.TreeView.REQ_TYPE_ADJUST_DATA: + self._reqAdjustTreeNode(options, callback); + break; + case BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA: + self._reqSelectedTreeNode(options, callback); + break; + case BI.TreeView.REQ_TYPE_SELECTED_DATA: + self._reqDisplayTreeNode(options, callback); + break; + default : + self._reqTreeNode(options, callback); + break; + } + } + }, + + _reqDisplayTreeNode: function (op, callback) { + var self = this; + var result = []; + var selected_values = op.selected_values; + + if (selected_values == null || BI.isEmpty(selected_values)) { + callback({}); + return; + } + + doCheck(0, [], selected_values); + + callback({ + items: result + }); + + function doCheck(floor, parent_values, selected) { + if (floor >= self.floors) { + return; + } + if (selected == null || BI.isEmpty(selected)) { + var children = self._getChildren(parent_values); + BI.each(children, function (i, child) { + var newParents = BI.clone(parent_values); + newParents.push(child.value); + var llen = self._getChildCount(newParents); + createOneJson(child, llen); + doCheck(floor + 1, newParents, {}); + }); + return; + } + BI.each(selected, function (k) { + var node = self._getNode(k); + var newParents = BI.clone(parent_values); + newParents.push(node.value); + createOneJson(node, getCount(selected[k], newParents)); + doCheck(floor + 1, newParents, selected[k]); + }) + } + + function getCount(jo, parent_values) { + if (jo == null) { + return 0; + } + if (BI.isEmpty(jo)) { + return self._getChildCount(parent_values); + } + + return BI.size(jo); + } + + function createOneJson(node, llen) { + result.push({ + id: node.id, + pId: node.pId, + text: node.text + (llen > 0 ? ("(" + BI.i18nText("BI-Basic_Altogether") + llen + BI.i18nText("BI-Basic_Count") + ")") : ""), + value: node.value, + open: true + }); + } + }, + + _reqSelectedTreeNode: function (op, callback) { + var self = this; + var selected_values = op.selected_values; + var not_selected_value = op.not_selected_value || {}; + var keyword = op.keyword || ""; + var parent_values = op.parent_values || []; + + if (selected_values == null || BI.isEmpty(selected_values)) { + callback({}); + return; + } + + dealWithSelectedValues(selected_values); + callback(selected_values); + + + function dealWithSelectedValues(selected_values) { + var p = BI.clone(parent_values); + p.push(not_selected_value); + + if (isChild(selected_values, p)) { + var result = []; + var finded = search(parent_values.length + 1, parent_values, not_selected_value, result); + + if (finded === true) { + var next = selected_values; + BI.each(p, function (i, v) { + var t = next[v]; + if (t == null) { + if (BI.isEmpty(next)) { + var split = p.slice(0, i); + var expanded = self._getChildren(split); + BI.each(expanded, function (m, child) { + if (i === p.length - 1 && child.value === not_selected_value) { + return true; + } + next[child.value] = {}; + }); + next = next[v]; + } else { + next = {}; + next[v] = {}; + } + } else { + next = t; + } + }); + + if (result.length > 0) { + BI.each(result, function (i, strs) { + self._buildTree(selected_values, strs); + }) + } + } + } + + } + + function search(deep, parents, current, result) { + var newParents = BI.clone(parents); + newParents.push(current); + if (self._isMatch(current, keyword)) { + return true; + } + if (deep >= self.floors) { + return false; + } + + var children = self._getChildren(newParents); + + var notSearch = []; + var can = false; + + BI.each(children, function (i, child) { + if (search(deep + 1, newParents, child.value, result)) { + can = true; + } else { + notSearch.push(child.value); + } + }); + if (can === true) { + BI.each(notSearch, function (i, v) { + var next = BI.clone(newParents); + next.push(v); + result.push(next); + }); + } + return can; + } + + function isChild(selected_values, parents) { + var t = selected_values; + for (var i = 0; i < parents.length; i++) { + var v = parents[i]; + if (!BI.has(t, v)) { + return false; + } + t = t[v]; + if (t == null || BI.isEmpty(t)) { + return true; + } + } + return true; + } + }, + + _reqAdjustTreeNode: function (op, callback) { + var self = this; + var result = []; + var selected_values = op.selected_values; + if (selected_values == null || BI.isEmpty(selected_values)) { + callback({}); + return; + } + BI.each(selected_values, function (k, v) { + result.push([k]); + }); + + dealWithSelectedValues(selected_values, []); + + var jo = {}; + BI.each(result, function (i, strs) { + self._buildTree(jo, strs); + }); + callback(jo); + + function dealWithSelectedValues(selected, parents) { + if (selected == null || BI.isEmpty(selected)) { + return true; + } + var can = true; + BI.each(selected, function (k, v) { + var p = BI.clone(parents); + p.push(k); + if (!dealWithSelectedValues(selected[k], p)) { + BI.each(selected[k], function (nk, nv) { + var t = BI.clone(p); + t.push(nk); + result.push(t); + }); + can = false; + } + }); + return can && isAllSelected(selected, parents); + } + + function isAllSelected(selected, parents) { + return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); + } + }, + + _reqInitTreeNode: function (op, callback) { + var self = this; + var result = []; + var keyword = op.keyword || ""; + var selected_values = op.selected_values; + var last_search_value = op.last_search_value || ""; + var output = search(); + BI.nextTick(function () { + callback({ + hasNext: output.length > self._const.perPage, + items: result, + last_search_value: BI.last(output) + }) + }); + + function search() { + var children = self._getChildren([]); + var start = children.length; + if (last_search_value !== "") { + for (var j = 0, len = start; j < len; j++) { + if (children[j].value === last_search_value) { + start = j + 1; + break; + } + } + } else { + start = 0; + } + var output = []; + for (var i = start, len = children.length; i < len; i++) { + if (output.length < self._const.perPage) { + var find = nodeSearch(1, [], children[i].value, false, result); + } else if (output.length === self._const.perPage) { + var find = nodeSearch(1, [], children[i].value, false, []); + } + if (find[0] === true) { + output.push(children[i].value); + } + if (output.length > self._const.perPage) { + break; + } + } + return output; + } + + function nodeSearch(deep, parent_values, current, isAllSelect, result) { + if (self._isMatch(current, keyword)) { + var checked = isAllSelect || isSelected(parent_values, current); + createOneJson(parent_values, current, false, checked, !isAllSelect && isHalf(parent_values, current), true, result); + return [true, checked]; + } + if (deep >= self.floors) { + return [false, false]; + } + var newParents = BI.clone(parent_values); + newParents.push(current); + var children = self._getChildren(newParents); + + var can = false, checked = false; + + var isCurAllSelected = isAllSelect || isAllSelected(parent_values, current); + BI.each(children, function (i, child) { + var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result); + if (state[1] === true) { + checked = true; + } + if (state[0] === true) { + can = true; + } + }); + if (can === true) { + checked = isCurAllSelected || (isSelected(parent_values, current) && checked); + createOneJson(parent_values, current, true, checked, false, false, result); + } + return [can, checked]; + } + + function createOneJson(parent_values, value, isOpen, checked, half, flag, result) { + var node = self.map[value]; + result.push({ + id: node.id, + pId: node.pId, + text: node.text, + value: node.value, + title: node.title, + isParent: parent_values.length + 1 < self.floors, + open: isOpen, + checked: checked, + halfCheck: half, + flag: flag + }); + } + + function isHalf(parent_values, value) { + var find = findSelectedObj(parent_values); + if (find == null) { + return null; + } + return BI.any(find, function (v, ob) { + if (v === value) { + if (ob != null && !BI.isEmpty(ob)) { + return true; + } + } + }); + } + + function isAllSelected(parent_values, value) { + var find = findSelectedObj(parent_values); + if (find == null) { + return null; + } + return BI.any(find, function (v, ob) { + if (v === value) { + if (ob != null && BI.isEmpty(ob)) { + return true; + } + } + }); + } + + function isSelected(parent_values, value) { + var find = findSelectedObj(parent_values); + if (find == null) { + return false; + } + return BI.any(find, function (v) { + if (v === value) { + return true; + } + }); + } + + function findSelectedObj(parent_values) { + var find = selected_values; + if (find == null) { + return null; + } + BI.every(parent_values, function (i, v) { + find = find[v]; + if (find == null) { + return false; + } + return true; + }); + return find; + } + }, + + _reqTreeNode: function (op, callback) { + var self = this; + var result = []; + var times = op.times; + var check_state = op.check_state || {}; + var parent_values = op.parent_values || []; + var selected_values = op.selected_values; + var valueMap = {}; + if (judgeState(parent_values, selected_values, check_state)) { + valueMap = dealWidthSelectedValue(parent_values, selected_values); + } + var nodes = this._getChildren(parent_values); + for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) { + var state = getCheckState(nodes[i].value, parent_values, valueMap, check_state); + result.push({ + id: nodes[i].id, + pId: nodes[i].pId, + value: nodes[i].value, + text: nodes[i].text, + times: 1, + isParent: parent_values.length + 1 < this.floors, + checked: state[0], + halfCheck: state[1] + }) + } + BI.nextTick(function () { + callback({ + items: result, + hasNext: nodes.length > times * self._const.perPage + }); + }); + + function judgeState(parent_values, selected_value, check_state) { + var checked = check_state.checked, half = check_state.half; + if (parent_values.length > 0 && !checked) { + return false; + } + return (parent_values.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); + } + + function dealWidthSelectedValue(parent_values, selected_values) { + var valueMap = {}; + BI.each(parent_values, function (i, v) { + selected_values = selected_values[v]; + }); + BI.each(selected_values, function (value, obj) { + if (BI.isNull(obj)) { + valueMap[value] = [0, 0]; + return; + } + if (BI.isEmpty(obj)) { + valueMap[value] = [2, 0]; + return; + } + var nextNames = {}; + BI.each(obj, function (t, o) { + if (BI.isNull(o) || BI.isEmpty(o)) { + nextNames[t] = true; + } + }); + valueMap[value] = [1, BI.size(nextNames)]; + }); + return valueMap; + } + + function getCheckState(current, parent_values, valueMap, check_state) { + var checked = check_state.checked, half = check_state.half; + var hasChild = parent_values.length + 1 < self.floors; + var tempCheck = false, halfCheck = false; + if (BI.has(valueMap, current)) { + //可能是半选 + if (valueMap[current][0] === 1) { + var values = BI.clone(parent_values); + values.push(current); + if (hasChild && self._getChildCount(values) != valueMap[current][1]) { + halfCheck = true; + } + } else if (valueMap[current][0] === 2) { + tempCheck = true; + } + } + var check; + if (!checked && !halfCheck && !tempCheck) { + check = BI.has(valueMap, current); + } else { + check = ((tempCheck || checked) && !half) || BI.has(valueMap, current); + } + return [check, halfCheck]; + } + }, + + + _buildTree: function (jo, values) { + var t = jo; + BI.each(values, function (i, v) { + if (!BI.has(t, v)) { + t[v] = {}; + } + t = t[v]; + }); + }, + + _isMatch: function (value, keyword) { + var finded = BI.Func.getSearchResult([value], keyword); + return finded.finded.length > 0 || finded.matched.length > 0; + }, + + _getNode: function (v) { + return this.tree.search(v, "value"); + }, + + _getChildren: function (parent_values) { + if (parent_values.length > 0) { + var value = BI.last(parent_values); + var parent = this.tree.search(value, "value"); + } else { + var parent = this.tree.getRoot(); + } + return parent.getChildren(); + }, + + _getChildCount: function (parent_values) { + return this._getChildren(parent_values).length; + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + return this.combo.getValue(); + }, + + populate: function () { + this.combo.populate.apply(this, arguments); + } +}); +BI.TreeValueChooserCombo.EVENT_CONFIRM = "TreeValueChooserCombo.EVENT_CONFIRM"; +$.shortcut('bi.tree_value_chooser_combo', BI.TreeValueChooserCombo); \ No newline at end of file diff --git a/src/component/combo.valuechooser.js b/src/component/combo.valuechooser.js new file mode 100644 index 0000000000..30ffa1a026 --- /dev/null +++ b/src/component/combo.valuechooser.js @@ -0,0 +1,127 @@ +/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserCombo + * @extends BI.Widget + */ +BI.ValueChooserCombo = BI.inherit(BI.Widget, { + + _const: { + perPage: 10 + }, + _defaultConfig: function () { + return BI.extend(BI.ValueChooserCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-combo", + width: 200, + height: 30, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: 'bi.multi_select_combo', + element: this.element, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: function (v) { + var text = v; + if (BI.isNotNull(self.items)) { + BI.some(self.items, function (i, item) { + if (item.value === v) { + text = item.text; + return true; + } + }); + } + return text; + }, + width: o.width, + height: o.height + }); + + this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () { + self.fireEvent(BI.ValueChooserCombo.EVENT_CONFIRM); + }); + }, + + _getItemsByTimes: function (items, times) { + var res = []; + for (var i = (times - 1) * this._const.perPage; items[i] && i < times * this._const.perPage; i++) { + res.push(items[i]); + } + return res; + }, + + _hasNextByTimes: function (items, times) { + return times * this._const.perPage < items.length; + }, + + _itemsCreator: function (options, callback) { + var self = this, o = this.options; + if (!o.cache || !this.items) { + o.itemsCreator({}, function (items) { + self.items = items; + call(items); + }); + } else { + call(this.items); + } + function call(items) { + var keywords = (options.keywords || []).slice(); + if (options.keyword) { + keywords.push(options.keyword); + } + BI.each(keywords, function (i, kw) { + var search = BI.Func.getSearchResult(items, kw); + items = search.matched.concat(search.finded); + }); + if (options.selected_values) {//过滤 + var filter = BI.makeObject(options.selected_values, true); + items = BI.filter(items, function (i, ob) { + return !filter[ob.value]; + }); + } + if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) { + callback({ + items: items + }); + return; + } + if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { + callback({count: items.length}); + return; + } + callback({ + items: self._getItemsByTimes(items, options.times), + hasNext: self._hasNextByTimes(items, options.times) + }); + } + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + } + }, + + populate: function () { + this.combo.populate.apply(this, arguments); + } +}); +BI.ValueChooserCombo.EVENT_CONFIRM = "ValueChooserCombo.EVENT_CONFIRM"; +$.shortcut('bi.value_chooser_combo', BI.ValueChooserCombo); \ No newline at end of file diff --git a/src/core/alias.js b/src/core/alias.js new file mode 100644 index 0000000000..5ec5cd1c6f --- /dev/null +++ b/src/core/alias.js @@ -0,0 +1,591 @@ +BI.cjkEncode = function (text) { + // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) + if (typeof text !== 'string') { + return text; + } + + var newText = ""; + for (var i = 0; i < text.length; i++) { + var code = text.charCodeAt(i); + if (code >= 128 || code === 91 || code === 93) {//91 is "[", 93 is "]". + newText += "[" + code.toString(16) + "]"; + } else { + newText += text.charAt(i); + } + } + + return newText +}; + +BI.cjkEncodeDO = function (o) { + if (BI.isPlainObject(o)) { + var result = {}; + $.each(o, function (k, v) { + if (!(typeof v == "string")) { + v = BI.jsonEncode(v); + } + //wei:bug 43338,如果key是中文,cjkencode后o的长度就加了1,ie9以下版本死循环,所以新建对象result。 + k = BI.cjkEncode(k); + result[k] = BI.cjkEncode(v); + }); + return result; + } + return o; +}; + +BI.jsonEncode = function (o) { + //james:这个Encode是抄的EXT的 + var useHasOwn = {}.hasOwnProperty ? true : false; + + // crashes Safari in some instances + //var validRE = /^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/; + + var m = { + "\b": '\\b', + "\t": '\\t', + "\n": '\\n', + "\f": '\\f', + "\r": '\\r', + '"': '\\"', + "\\": '\\\\' + }; + + var encodeString = function (s) { + if (/["\\\x00-\x1f]/.test(s)) { + return '"' + s.replace(/([\x00-\x1f\\"])/g, function (a, b) { + var c = m[b]; + if (c) { + return c; + } + c = b.charCodeAt(); + return "\\u00" + + Math.floor(c / 16).toString(16) + + (c % 16).toString(16); + }) + '"'; + } + return '"' + s + '"'; + }; + + var encodeArray = function (o) { + var a = ["["], b, i, l = o.length, v; + for (i = 0; i < l; i += 1) { + v = o[i]; + switch (typeof v) { + case "undefined": + case "function": + case "unknown": + break; + default: + if (b) { + a.push(','); + } + a.push(v === null ? "null" : BI.jsonEncode(v)); + b = true; + } + } + a.push("]"); + return a.join(""); + }; + + if (typeof o == "undefined" || o === null) { + return "null"; + } else if (BI.isArray(o)) { + return encodeArray(o); + } else if (o instanceof Date) { + /* + * alex:原来只是把年月日时分秒简单地拼成一个String,无法decode + * 现在这么处理就可以decode了,但是JS.jsonDecode和Java.JSONObject也要跟着改一下 + */ + return BI.jsonEncode({ + __time__: o.getTime() + }) + } else if (typeof o == "string") { + return encodeString(o); + } else if (typeof o == "number") { + return isFinite(o) ? String(o) : "null"; + } else if (typeof o == "boolean") { + return String(o); + } else if (BI.isFunction(o)) { + return String(o); + } else { + var a = ["{"], b, i, v; + for (i in o) { + if (!useHasOwn || o.hasOwnProperty(i)) { + v = o[i]; + switch (typeof v) { + case "undefined": + case "unknown": + break; + default: + if (b) { + a.push(','); + } + a.push(BI.jsonEncode(i), ":", + v === null ? "null" : BI.jsonEncode(v)); + b = true; + } + } + } + a.push("}"); + return a.join(""); + } +}; + +BI.contentFormat = function (cv, fmt) { + if (BI.isEmpty(cv)) { + //原值为空,返回空字符 + return ''; + } + var text = cv.toString(); + if (BI.isEmpty(fmt)) { + //格式为空,返回原字符 + return text; + } + if (fmt.match(/^T/)) { + //T - 文本格式 + return text; + } else if (fmt.match(/^D/)) { + //D - 日期(时间)格式 + if (!(cv instanceof Date)) { + if (typeof cv === 'number') { + //毫秒数类型 + cv = new Date(cv); + } else { + //字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构 + cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long); + } + } + if (!BI.isNull(cv)) { + var needTrim = fmt.match(/^DT/); + text = BI.date2Str(cv, fmt.substring(needTrim ? 2 : 1)); + } + } else if (fmt.match(/E/)) { + //科学计数格式 + text = BI._eFormat(text, fmt); + } else { + //数字格式 + text = BI._numberFormat(text, fmt); + } + //¤ - 货币格式 + text = text.replace(/¤/g, '¥'); + return text; +}; + +/** + * 把日期对象按照指定格式转化成字符串 + * + * @example + * var date = new Date('Thu Dec 12 2013 00:00:00 GMT+0800'); + * var result = BI.date2Str(date, 'yyyy-MM-dd');//2013-12-12 + * + * @class BI.date2Str + * @param date 日期 + * @param format 日期格式 + * @returns {String} + */ +date2Str = function (date, format) { + if (!date) { + return ''; + } + // O(len(format)) + var len = format.length, result = ''; + if (len > 0) { + var flagch = format.charAt(0), start = 0, str = flagch; + for (var i = 1; i < len; i++) { + var ch = format.charAt(i); + if (flagch !== ch) { + result += compileJFmt({ + 'char': flagch, + 'str': str, + 'len': i - start + }, date); + flagch = ch; + start = i; + str = flagch; + } else { + str += ch; + } + } + result += compileJFmt({ + 'char': flagch, + 'str': str, + 'len': len - start + }, date); + } + return result; + + function compileJFmt(jfmt, date) { + var str = jfmt.str, len = jfmt.len, ch = jfmt['char']; + switch (ch) { + case 'E': //星期 + str = Date._DN[date.getDay()]; + break; + case 'y': //年 + if (len <= 3) { + str = (date.getFullYear() + '').slice(2, 4); + } else { + str = date.getFullYear(); + } + break; + case 'M': //月 + if (len > 2) { + str = Date._MN[date.getMonth()]; + } else if (len < 2) { + str = date.getMonth() + 1; + } else { + str = String.leftPad(date.getMonth() + 1 + '', 2, '0'); + } + break; + case 'd': //日 + if (len > 1) { + str = String.leftPad(date.getDate() + '', 2, '0'); + } else { + str = date.getDate(); + } + break; + case 'h': //时(12) + var hour = date.getHours() % 12; + if (hour === 0) { + hour = 12; + } + if (len > 1) { + str = String.leftPad(hour + '', 2, '0'); + } else { + str = hour; + } + break; + case 'H': //时(24) + if (len > 1) { + str = String.leftPad(date.getHours() + '', 2, '0'); + } else { + str = date.getHours(); + } + break; + case 'm': + if (len > 1) { + str = String.leftPad(date.getMinutes() + '', 2, '0'); + } else { + str = date.getMinutes(); + } + break; + case 's': + if (len > 1) { + str = String.leftPad(date.getSeconds() + '', 2, '0'); + } else { + str = date.getSeconds(); + } + break; + case 'a': + str = date.getHours() < 12 ? 'am' : 'pm'; + break; + case 'z': + str = date.getTimezone(); + break; + default: + str = jfmt.str; + break; + } + return str; + } +}; + +/** + * 数字格式 + */ +BI._numberFormat = function (text, format) { + var text = text + ''; + //数字格式,区分正负数 + var numMod = format.indexOf(';'); + if (numMod > -1) { + if (text >= 0) { + return BI._numberFormat(text + "", format.substring(0, numMod)); + } else { + return BI._numberFormat((-text) + "", format.substr(numMod + 1)); + } + } + var tp = text.split('.'), fp = format.split('.'), + tleft = tp[0] || '', fleft = fp[0] || '', + tright = tp[1] || '', fright = fp[1] || ''; + //百分比,千分比的小数点移位处理 + if (/[%‰]$/.test(format)) { + var paddingZero = /[%]$/.test(format) ? '00' : '000'; + tright += paddingZero; + tleft += tright.substr(0, paddingZero.length); + tleft = tleft.replace(/^0+/gi, ''); + tright = tright.substr(paddingZero.length).replace(/0+$/gi, ''); + } + var right = BI._dealWithRight(tright, fright); + if (right.leftPlus) { + //小数点后有进位 + tleft = parseInt(tleft) + 1 + ''; + + tleft = isNaN(tleft) ? '1' : tleft; + } + right = right.num; + var left = BI._dealWithLeft(tleft, fleft); + if (!(/[0-9]/.test(left))) { + left = left + '0'; + } + if (!(/[0-9]/.test(right))) { + return left + right; + } else { + return left + '.' + right; + } +}; +/** + * 处理小数点右边小数部分 + * @param tright 右边内容 + * @param fright 右边格式 + * @returns {JSON} 返回处理结果和整数部分是否需要进位 + * @private + */ +BI._dealWithRight = function (tright, fright) { + var right = '', j = 0, i = 0; + for (var len = fright.length; i < len; i++) { + var ch = fright.charAt(i); + var c = tright.charAt(j); + switch (ch) { + case '0': + if (BI.isEmpty(c)) { + c = '0'; + } + right += c; + j++; + break; + case '#': + right += c; + j++; + break; + default : + right += ch; + break; + } + } + var rll = tright.substr(j); + var result = {}; + if (!BI.isEmpty(rll) && rll.charAt(0) > 4) { + //有多余字符,需要四舍五入 + result.leftPlus = true; + var numReg = right.match(/^[0-9]+/); + if (numReg) { + var num = numReg[0]; + var orilen = num.length; + var newnum = BI.parseINT(num) + 1 + ''; + //进位到整数部分 + if (newnum.length > orilen) { + newnum = newnum.substr(1); + } else { + newnum = BI.leftPad(newnum, orilen, '0'); + result.leftPlus = false; + } + right = right.replace(/^[0-9]+/, newnum); + } + } + result.num = right; + return result; +}; + +BI.parseINT = function (str) { + return parseInt(str, 10); +}; + +BI.leftPad = function (val, size, ch) { + var result = String(val); + if (!ch) { + ch = " "; + } + while (result.length < size) { + result = ch + result; + } + return result.toString(); +}; + +/** + * 处理小数点左边整数部分 + * @param tleft 左边内容 + * @param fleft 左边格式 + * @returns {string} 返回处理结果 + * @private + */ +BI._dealWithLeft = function (tleft, fleft) { + var left = ''; + var j = tleft.length - 1; + var combo = -1, last = -1; + var i = fleft.length - 1; + for (; i >= 0; i--) { + var ch = fleft.charAt(i); + var c = tleft.charAt(j); + switch (ch) { + case '0': + if (BI.isEmpty(c)) { + c = '0'; + } + last = -1; + left = c + left; + j--; + break; + case '#': + last = i; + left = c + left; + j--; + break; + case ',': + if (!BI.isEmpty(c)) { + //计算一个,分隔区间的长度 + var com = fleft.match(/,[#0]+/); + if (com) { + combo = com[0].length - 1; + } + left = ',' + left; + } + break; + default : + left = ch + left; + break; + } + } + if (last > -1) { + //处理剩余字符 + var tll = tleft.substr(0, j + 1); + left = left.substr(0, last) + tll + left.substr(last); + } + if (combo > 0) { + //处理,分隔区间 + var res = left.match(/[0-9]+,/); + if (res) { + res = res[0]; + var newstr = '', n = res.length - 1 - combo; + for (; n >= 0; n = n - combo) { + newstr = res.substr(n, combo) + ',' + newstr; + } + var lres = res.substr(0, n + combo); + if (!BI.isEmpty(lres)) { + newstr = lres + ',' + newstr; + } + } + left = left.replace(/[0-9]+,/, newstr); + } + return left; +}; + +BI.object2Number = function (value) { + if (value == null) { + return 0; + } + if (typeof value == 'number') { + return value; + } else { + var str = value + ""; + if (str.indexOf(".") === -1) { + return parseInt(str); + } else { + return parseFloat(str); + } + } +}; + +BI.object2Date = function (obj) { + if (obj == null) { + return new Date(); + } + if (obj instanceof Date) { + return obj; + } else if (typeof obj == 'number') { + return new Date(obj); + } else { + var str = obj + ""; + str = str.replace(/-/g, '/'); + var dt = new Date(str); + if (!BI.isInvalidDate(dt)) { + return dt; + } + + return new Date(); + } +}; + +BI.isArray = function (a) { + return Object.prototype.toString.call(a) == '[object Array]'; +}; + +BI.object2Time = function (obj) { + if (obj == null) { + return new Date(); + } + if (obj instanceof Date) { + return obj; + } else { + var str = obj + ""; + str = str.replace(/-/g, '/'); + var dt = new Date(str); + if (!BI.isInvalidDate(dt)) { + return dt; + } + if (str.indexOf('/') === -1 && str.indexOf(':') !== -1) { + dt = new Date("1970/01/01 " + str); + if (!BI.isInvalidDate(dt)) { + return dt; + } + } + dt = BI.str2Date(str, "HH:mm:ss"); + if (!BI.isInvalidDate(dt)) { + return dt; + } + return new Date(); + } +}; + +// 判断是否是无效的日期 +BI.isInvalidDate = function (date) { + return date == "Invalid Date" || date == "NaN"; +}; + + +/** + * 科学计数格式 + */ +BI._eFormat = function (text, fmt) { + var e = fmt.indexOf("E"); + var eleft = fmt.substr(0, e), eright = fmt.substr(e + 1); + if (/^[0\.-]+$/.test(text)) { + text = BI._numberFormat(0.0, eleft) + 'E' + BI._numberFormat(0, eright) + } else { + var isNegative = text < 0; + if (isNegative) { + text = text.substr(1); + } + var elvl = (eleft.split('.')[0] || '').length; + var point = text.indexOf("."); + if (point < 0) { + point = text.length; + } + var i = 0; //第一个不为0的数的位置 + text = text.replace('.', ''); + for (var len = text.length; i < len; i++) { + var ech = text.charAt(i); + if (ech <= '9' && ech >= '1') { + break; + } + } + var right = point - i - elvl; + var left = text.substr(i, elvl); + var dis = i + elvl - text.length; + if (dis > 0) { + //末位补全0 + for (var k = 0; k < dis; k++) { + left += '0'; + } + } else { + left += '.' + text.substr(i + elvl); + } + left = left.replace(/^[0]+/, ''); + if (right < 0 && eright.indexOf('-') < 0) { + eright += ';-' + eright; + } + text = BI._numberFormat(left, eleft) + 'E' + BI._numberFormat(right, eright); + if (isNegative) { + text = '-' + text; + } + } + return text; +}; \ No newline at end of file diff --git a/src/core/base.js b/src/core/base.js index aa33e64a39..b337e5e674 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -81,30 +81,6 @@ if (!window.BI) { return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View); }, - createWidget: function (item, options) { - var el; - options || (options = {}); - if (BI.isEmpty(item) && BI.isEmpty(options)) { - return BI.Plugin.getObject("bi.layout", BI.createWidget({ - type: "bi.layout" - })); - } - if (BI.isWidget(item)) { - return item; - } - if (item && (item.type || options.type)) { - el = BI.extend({}, options, item); - return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); - } - if (item && item.el && (item.el.type || options.type)) { - el = BI.extend({}, options, item.el); - return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true)); - } - if (item && BI.isWidget(item.el)) { - return item.el; - } - }, - createWidgets: function (items, options) { if (!BI.isArray(items)) { throw new Error("cannot create Widgets") @@ -929,10 +905,6 @@ if (!window.BI) { return BI.isString(str) && BI.isEmpty(str); }, - contentFormat: function () { - return FR.contentFormat.apply(FR, arguments); - }, - /** * 对字符串进行加密 {@link #decrypt} * @static @@ -1126,7 +1098,12 @@ if (!window.BI) { } timeoutToast.addReq(option); - FR.ajax({ + + option.data = BI.cjkEncodeDO(option.data); + + + + $.ajax({ url: option.url, type: "POST", data: option.data, @@ -1181,10 +1158,10 @@ if (!window.BI) { loading.showError(); } else if (status === "success" && BI.isFunction(option.success)) { - option.success(FR.jsonDecode(res.responseText)); + option.success(BI.jsonDecode(res.responseText)); } if (BI.isFunction(option.complete)) { - option.complete(FR.jsonDecode(res.responseText), status); + option.complete(BI.jsonDecode(res.responseText), status); } } }); @@ -1196,7 +1173,7 @@ if (!window.BI) { function encodeBIParam(data) { for (var key in data) { if (_.isObject(data[key])) { - data[key] = window.encodeURIComponent(FR.jsonEncode(data[key])); + data[key] = window.encodeURIComponent(BI.jsonEncode(data[key])); } else { data[key] = window.encodeURIComponent(data[key]); } @@ -1207,7 +1184,7 @@ if (!window.BI) { for (var key in data) { data[key] = window.decodeURIComponent(data[key]); if (_.isObject(data[key])) { - data[key] = FR.jsonDecode(data[key]); + data[key] = BI.jsonDecode(data[key]); } } } @@ -1230,7 +1207,7 @@ if (!window.BI) { if (op === "fr_bi_dezi" || op === "fr_bi_configure") { data.sessionID = Data.SharingPool.get("sessionID"); } - var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); + var url = BI.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); return (BI.ajax)({ url: url, type: 'POST', @@ -1266,7 +1243,7 @@ if (!window.BI) { if (op === "fr_bi_dezi") { data.sessionID = Data.SharingPool.get("sessionID"); } - var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); + var url = BI.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random(); var result = {}; (BI.ajax)({ url: url, diff --git a/src/core/func/function.js b/src/core/func/function.js index 6fbcfa0e3c..b7e5d248a2 100644 --- a/src/core/func/function.js +++ b/src/core/func/function.js @@ -121,7 +121,7 @@ $(function () { }, getCompleteImageUrl: function (url) { - return FR.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + url; + return BI.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + url; } }); diff --git a/src/core/model.js b/src/core/model.js index 3eb7195376..3c8554895e 100644 --- a/src/core/model.js +++ b/src/core/model.js @@ -377,7 +377,7 @@ BI.Model = BI.inherit(BI.M, { }, urlRoot: function () { - return FR.servletURL; + return BI.servletURL; }, parse: function (data) { diff --git a/src/core/utils/load.js b/src/core/utils/load.js index 0821a48fba..a036152f7e 100644 --- a/src/core/utils/load.js +++ b/src/core/utils/load.js @@ -8,7 +8,7 @@ $.extend(BI, { type: null, must: false }, options); - config.url = FR.servletURL + '?op=' + config.op + '&resource=' + config.path; + config.url = BI.servletURL + '?op=' + config.op + '&resource=' + config.path; this.$import(config.url, config.type,config.must); }, $import: function () { diff --git a/src/css/base/third/farbtastic/farbtastic.css b/src/css/base/third/farbtastic/farbtastic.css index 2c4306d8f3..76e8942fa8 100644 --- a/src/css/base/third/farbtastic/farbtastic.css +++ b/src/css/base/third/farbtastic/farbtastic.css @@ -36,17 +36,17 @@ height: 101px; } .farbtastic .wheel { - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/wheel.png) no-repeat; + background: url(farbtastic/wheel.png) no-repeat; width: 195px; height: 195px; } .farbtastic .overlay { - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/mask.png) no-repeat; + background: url(farbtastic/mask.png) no-repeat; } .farbtastic .marker { width: 17px; height: 17px; margin: -8px 0 0 -8px; overflow: hidden; - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/marker.png) no-repeat; + background: url(farbtastic/marker.png) no-repeat; } diff --git a/src/css/base/third/ztree/zTreeStyle.css b/src/css/base/third/ztree/zTreeStyle.css index 1ac2cf043f..ec763cae5e 100644 --- a/src/css/base/third/ztree/zTreeStyle.css +++ b/src/css/base/third/ztree/zTreeStyle.css @@ -29,7 +29,7 @@ website: http://code.google.com/p/jquerytree/ padding: 0 0 0 18px; } .ztree li ul.line { - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-1.png) 0 0 repeat-y; + background: url(icon/tree-vertical-line-1.png) 0 0 repeat-y; } .ztree li a { padding: 1px 3px 0 0; @@ -84,8 +84,8 @@ website: http://code.google.com/p/jquerytree/ background-color: transparent; background-repeat: no-repeat; background-attachment: scroll; - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.png"); - *background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.gif"); + background-image: url("ztree/img/zTreeStandard.png"); + *background-image: url("ztree/img/zTreeStandard.gif"); } .ztree li span.button.chk { width: 16px; @@ -94,31 +94,31 @@ website: http://code.google.com/p/jquerytree/ cursor: auto; } .ztree li span.button.chk.checkbox_false_full { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); + background-image: url("icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_full_focus { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); + background-image: url("icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_part { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image: url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_part_focus { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image: url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_disable { background-position: 0 -56px; } .ztree li span.button.chk.checkbox_true_full { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); + background-image: url("icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_full_focus { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); + background-image: url("icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_part { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image: url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_part_focus { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image: url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_disable { background-position: -14px -56px; @@ -158,28 +158,28 @@ website: http://code.google.com/p/jquerytree/ height: 25px; } .ztree li span.button.root_open { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-1.png"); + background-image: url("icon/tree-expand-1.png"); } .ztree li span.button.root_close { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-1.png"); + background-image: url("icon/tree-collapse-1.png"); } .ztree li span.button.roots_open { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-2.png"); + background-image: url("icon/tree-expand-2.png"); } .ztree li span.button.roots_close { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-2.png"); + background-image: url("icon/tree-collapse-2.png"); } .ztree li span.button.center_open { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-3.png"); + background-image: url("icon/tree-expand-3.png"); } .ztree li span.button.center_close { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-3.png"); + background-image: url("icon/tree-collapse-3.png"); } .ztree li span.button.bottom_open { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-4.png"); + background-image: url("icon/tree-expand-4.png"); } .ztree li span.button.bottom_close { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-4.png"); + background-image: url("icon/tree-collapse-4.png"); } .ztree li span.button.noline_open { background-position: -92px -72px; @@ -191,13 +191,13 @@ website: http://code.google.com/p/jquerytree/ background: none; } .ztree li span.button.roots_docu { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); + background-image: url("icon/tree-vertical-line-2.png"); } .ztree li span.button.center_docu { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); + background-image: url("icon/tree-vertical-line-3.png"); } .ztree li span.button.bottom_docu { - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); + background-image: url("icon/tree-vertical-line-4.png"); } .ztree li span.button.noline_docu { background: none; @@ -235,7 +235,7 @@ website: http://code.google.com/p/jquerytree/ .ztree li span.button.ico_loading { width: 0px; margin-right: 2px; - background: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif") no-repeat scroll 0 0 transparent; + background: url("ztree/img/loading.gif") no-repeat scroll 0 0 transparent; vertical-align: top; *vertical-align: middle; } @@ -256,8 +256,8 @@ span.tmpzTreeMove_arrow { background-repeat: no-repeat; background-attachment: scroll; background-position: -110px -80px; - background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.png"); - *background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.gif"); + background-image: url("ztree/img/zTreeStandard.png"); + *background-image: url("ztree/img/zTreeStandard.gif"); } ul.ztree.zTreeDragUL { margin: 0; diff --git a/src/css/base/view/popupview.css b/src/css/base/view/popupview.css index 0294fa968d..79efbe2ddd 100644 --- a/src/css/base/view/popupview.css +++ b/src/css/base/view/popupview.css @@ -1,7 +1,7 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -/**********FR.BIListView*************/ +/**********BI.BIListView*************/ .bi-list-view { position: fixed !important; overflow-y: visible !important; diff --git a/src/less/base/third/farbtastic/farbtastic.less b/src/less/base/third/farbtastic/farbtastic.less index 739bf6f023..a41494966a 100644 --- a/src/less/base/third/farbtastic/farbtastic.less +++ b/src/less/base/third/farbtastic/farbtastic.less @@ -34,18 +34,18 @@ height: 101px; } .farbtastic .wheel { - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/wheel.png) no-repeat; + background: url(farbtastic/wheel.png) no-repeat; width: 195px; height: 195px; } .farbtastic .overlay { - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/mask.png) no-repeat; + background: url(farbtastic/mask.png) no-repeat; } .farbtastic .marker { width: 17px; height: 17px; margin: -8px 0 0 -8px; - overflow: hidden; - background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/farbtastic/marker.png) no-repeat; + overflow: hidden; + background: url(farbtastic/marker.png) no-repeat; } diff --git a/src/less/base/third/ztree/zTreeStyle.less b/src/less/base/third/ztree/zTreeStyle.less index 5a94e02301..6e625f2ac1 100644 --- a/src/less/base/third/ztree/zTreeStyle.less +++ b/src/less/base/third/ztree/zTreeStyle.less @@ -12,7 +12,7 @@ website: http://code.google.com/p/jquerytree/ .ztree {margin:0; padding:5px; } .ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} .ztree li ul{ margin:0; padding:0 0 0 18px} -.ztree li ul.line{ background:url(${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-1.png) 0 0 repeat-y;} +.ztree li ul.line{ background:url(icon/tree-vertical-line-1.png) 0 0 repeat-y;} .ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:24px; background-color: transparent; text-decoration:none; vertical-align:top; display: inline-block} @@ -28,33 +28,33 @@ website: http://code.google.com/p/jquerytree/ .ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; border:0 none; cursor: pointer;outline:none; background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.png"); *background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.gif")} + background-image:url("ztree/img/zTreeStandard.png"); *background-image:url("ztree/img/zTreeStandard.gif")} .ztree li span.button.chk {width:16px; height:16px; margin:0 3px 0 0; cursor: auto} .ztree li span.button.chk.checkbox_false_full { - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); + background-image:url("icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_full_focus { - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png"); + background-image:url("icon/check-box-normal.png"); } .ztree li span.button.chk.checkbox_false_part { - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image:url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_part_focus { - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image:url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} .ztree li span.button.chk.checkbox_true_full { - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); + background-image:url("icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_full_focus { - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png"); + background-image:url("icon/check-box-active.png"); } .ztree li span.button.chk.checkbox_true_part { - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image:url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_part_focus { - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png"); + background-image:url("icon/half_selected.png"); } .ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} .ztree li span.button.chk.radio_false_full {background-position:-28px 0} @@ -70,40 +70,40 @@ website: http://code.google.com/p/jquerytree/ .ztree li span.button.switch {width:25px; height:25px} .ztree li span.button.root_open{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-1.png"); + background-image:url("icon/tree-expand-1.png"); } .ztree li span.button.root_close{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-1.png"); + background-image:url("icon/tree-collapse-1.png"); } .ztree li span.button.roots_open{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-2.png"); + background-image:url("icon/tree-expand-2.png"); } .ztree li span.button.roots_close{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-2.png"); + background-image:url("icon/tree-collapse-2.png"); } .ztree li span.button.center_open{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-3.png"); + background-image:url("icon/tree-expand-3.png"); } .ztree li span.button.center_close{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-3.png"); + background-image:url("icon/tree-collapse-3.png"); } .ztree li span.button.bottom_open{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-4.png"); + background-image:url("icon/tree-expand-4.png"); } .ztree li span.button.bottom_close{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-4.png"); + background-image:url("icon/tree-collapse-4.png"); } .ztree li span.button.noline_open{background-position:-92px -72px} .ztree li span.button.noline_close{background-position:-74px -72px} .ztree li span.button.root_docu{ background:none;} .ztree li span.button.roots_docu{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); + background-image:url("icon/tree-vertical-line-2.png"); } .ztree li span.button.center_docu{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); + background-image:url("icon/tree-vertical-line-3.png"); } .ztree li span.button.bottom_docu{ - background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); + background-image:url("icon/tree-vertical-line-4.png"); } .ztree li span.button.noline_docu{ background:none;} @@ -113,13 +113,13 @@ website: http://code.google.com/p/jquerytree/ .ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} .ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} -.ztree li span.button.ico_loading{width: 0px;margin-right:2px; background:url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/loading.gif") no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} +.ztree li span.button.ico_loading{width: 0px;margin-right:2px; background:url("ztree/img/loading.gif") no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; - background-position:-110px -80px; background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.png"); *background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/css/base/third/ztree/img/zTreeStandard.gif")} + background-position:-110px -80px; background-image:url("ztree/img/zTreeStandard.png"); *background-image:url("ztree/img/zTreeStandard.gif")} ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} .zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index 79bc39e2e5..74b58045b0 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -1,7 +1,7 @@ @import "../../bibase"; -/**********FR.BIListView*************/ +/**********BI.BIListView*************/ .bi-list-view { position: fixed !important; overflow-y: visible !important; diff --git a/src/widget/image/uploadimage.js b/src/widget/image/uploadimage.js index c9ca032319..7d30adc087 100644 --- a/src/widget/image/uploadimage.js +++ b/src/widget/image/uploadimage.js @@ -268,7 +268,7 @@ BI.UploadImage = BI.inherit(BI.Widget, { BI.extend(BI.UploadImage, { getImageSrc: function (src) { - return FR.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + src; + return BI.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + src; } }); From 828d4b04fcdea047f396210eb65961c1905b012f Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 18:09:47 +0800 Subject: [PATCH 16/19] add --- demo.html | 2 -- dist/base.js | 11 ++++++++--- dist/core.js | 16 ++++++++-------- src/base/combination/tab.js | 10 +++++++--- src/base/single/bar/bar.loading.js | 1 + src/core/controller/controller.layer.js | 1 + src/core/widget.js | 5 +++-- src/core/wrapper/layout/layout.card.js | 10 ++++------ 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/demo.html b/demo.html index ffc2d3dfb5..b58f30610c 100644 --- a/demo.html +++ b/demo.html @@ -22,7 +22,5 @@
      - \ No newline at end of file diff --git a/dist/base.js b/dist/base.js index bbb5ca2a29..23d126675e 100644 --- a/dist/base.js +++ b/dist/base.js @@ -24962,9 +24962,6 @@ BI.Tab = BI.inherit(BI.Widget, { listener.on(BI.ShowListener.EVENT_CHANGE, function (value) { self.fireEvent(BI.Tab.EVENT_CHANGE, value, self); }); - if (o.defaultShowIndex !== false) { - this.setSelect(o.defaultShowIndex); - } }, _assertCard: function (v) { @@ -24975,6 +24972,13 @@ BI.Tab = BI.inherit(BI.Widget, { } }, + mounted: function () { + var o = this.options; + if (o.defaultShowIndex !== false) { + this.setSelect(o.defaultShowIndex); + } + }, + setSelect: function (v) { this.tab && this.tab.setValue(v); this._assertCard(v); @@ -36274,6 +36278,7 @@ BI.LoadingBar = BI.inherit(BI.Single, { this.loading = BI.createWidget({ type: "bi.layout", + width: this.options.height, height:this.options.height, cls: "loading-background cursor-default" }) diff --git a/dist/core.js b/dist/core.js index fc0061fc5d..a3529c3a3a 100644 --- a/dist/core.js +++ b/dist/core.js @@ -14434,7 +14434,7 @@ BI.Widget = BI.inherit(BI.OB, { }) }) } - if (this._isRoot === true) { + if (this._isRoot === true || (!(this instanceof BI.Layout) && (this._parent && this._parent._isMounted))) { this._mount(); } }, @@ -14446,7 +14446,7 @@ BI.Widget = BI.inherit(BI.OB, { _mount: function () { var self = this; var isMounted = this._isMounted; - if (isMounted) { + if (isMounted || !this.isVisible()) { return; } if (this._isRoot === true) { @@ -14515,6 +14515,7 @@ BI.Widget = BI.inherit(BI.OB, { if (visible === true) { this.options.invisible = false; this.element.show(); + this._mount(); } else if (visible === false) { this.options.invisible = true; this.element.hide(); @@ -20831,6 +20832,7 @@ BI.LayerController = BI.inherit(BI.Controller, { return this; } this._getLayout(name).visible(); + this._getLayout(name)._mount(); this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__"); return this; }, @@ -26629,7 +26631,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { return widget; }, - showCardByName: function (name, action, callback) { + showCardByName: function (name, action) { var self = this; //name不存在的时候全部隐藏 var exist = this.hasWidget(this._getCardName(name)); @@ -26641,12 +26643,9 @@ BI.CardLayout = BI.inherit(BI.Layout, { BI.each(this._children, function (i, el) { if (self._getCardName(name) != i) { //动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了 - !flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.element.hide(); + !flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.invisible(); } else { - (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, function () { - el._mount(); - callback && callback(); - }); + (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), el._mount()) } }); }, @@ -26659,6 +26658,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { el.element.hide(); } else { el.element.show(); + el._mount(); } }) }, diff --git a/src/base/combination/tab.js b/src/base/combination/tab.js index f12d3a1505..68fe75c1a7 100644 --- a/src/base/combination/tab.js +++ b/src/base/combination/tab.js @@ -53,9 +53,6 @@ BI.Tab = BI.inherit(BI.Widget, { listener.on(BI.ShowListener.EVENT_CHANGE, function (value) { self.fireEvent(BI.Tab.EVENT_CHANGE, value, self); }); - if (o.defaultShowIndex !== false) { - this.setSelect(o.defaultShowIndex); - } }, _assertCard: function (v) { @@ -66,6 +63,13 @@ BI.Tab = BI.inherit(BI.Widget, { } }, + mounted: function () { + var o = this.options; + if (o.defaultShowIndex !== false) { + this.setSelect(o.defaultShowIndex); + } + }, + setSelect: function (v) { this.tab && this.tab.setValue(v); this._assertCard(v); diff --git a/src/base/single/bar/bar.loading.js b/src/base/single/bar/bar.loading.js index a02c8665e9..ae88b834e5 100644 --- a/src/base/single/bar/bar.loading.js +++ b/src/base/single/bar/bar.loading.js @@ -32,6 +32,7 @@ BI.LoadingBar = BI.inherit(BI.Single, { this.loading = BI.createWidget({ type: "bi.layout", + width: this.options.height, height:this.options.height, cls: "loading-background cursor-default" }) diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js index ae798aca93..c1625653c6 100644 --- a/src/core/controller/controller.layer.js +++ b/src/core/controller/controller.layer.js @@ -127,6 +127,7 @@ BI.LayerController = BI.inherit(BI.Controller, { return this; } this._getLayout(name).visible(); + this._getLayout(name)._mount(); this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__"); return this; }, diff --git a/src/core/widget.js b/src/core/widget.js index 54de57d748..859e21e1ef 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -135,7 +135,7 @@ BI.Widget = BI.inherit(BI.OB, { }) }) } - if (this._isRoot === true) { + if (this._isRoot === true || (!(this instanceof BI.Layout) && (this._parent && this._parent._isMounted))) { this._mount(); } }, @@ -147,7 +147,7 @@ BI.Widget = BI.inherit(BI.OB, { _mount: function () { var self = this; var isMounted = this._isMounted; - if (isMounted) { + if (isMounted || !this.isVisible()) { return; } if (this._isRoot === true) { @@ -216,6 +216,7 @@ BI.Widget = BI.inherit(BI.OB, { if (visible === true) { this.options.invisible = false; this.element.show(); + this._mount(); } else if (visible === false) { this.options.invisible = true; this.element.hide(); diff --git a/src/core/wrapper/layout/layout.card.js b/src/core/wrapper/layout/layout.card.js index 910866da10..aa9db36c32 100644 --- a/src/core/wrapper/layout/layout.card.js +++ b/src/core/wrapper/layout/layout.card.js @@ -86,7 +86,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { return widget; }, - showCardByName: function (name, action, callback) { + showCardByName: function (name, action) { var self = this; //name不存在的时候全部隐藏 var exist = this.hasWidget(this._getCardName(name)); @@ -98,12 +98,9 @@ BI.CardLayout = BI.inherit(BI.Layout, { BI.each(this._children, function (i, el) { if (self._getCardName(name) != i) { //动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了 - !flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.element.hide(); + !flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.invisible(); } else { - (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, function () { - el._mount(); - callback && callback(); - }); + (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), el._mount()) } }); }, @@ -116,6 +113,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { el.element.hide(); } else { el.element.show(); + el._mount(); } }) }, From 2f3104fa9882a9d697202e6bb498fd451fbec470 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 20:03:10 +0800 Subject: [PATCH 17/19] add --- dist/core.js | 2 +- dist/widget.js | 2 +- src/core/widget.js | 2 +- src/widget/multitree/multi.tree.popup.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/core.js b/dist/core.js index a3529c3a3a..3287c4acec 100644 --- a/dist/core.js +++ b/dist/core.js @@ -14434,7 +14434,7 @@ BI.Widget = BI.inherit(BI.OB, { }) }) } - if (this._isRoot === true || (!(this instanceof BI.Layout) && (this._parent && this._parent._isMounted))) { + if (this._isRoot === true || !(this instanceof BI.Layout)) { this._mount(); } }, diff --git a/dist/widget.js b/dist/widget.js index d3839ccaa7..4452fe23e3 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -19927,7 +19927,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, { baseCls: 'bi-multi-tree-popup', maxWidth: 'auto', minWidth: 100, - maxHeight: 250, + maxHeight: 400, onLoaded: BI.emptyFn }); }, diff --git a/src/core/widget.js b/src/core/widget.js index 859e21e1ef..d894fcef54 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -135,7 +135,7 @@ BI.Widget = BI.inherit(BI.OB, { }) }) } - if (this._isRoot === true || (!(this instanceof BI.Layout) && (this._parent && this._parent._isMounted))) { + if (this._isRoot === true || !(this instanceof BI.Layout)) { this._mount(); } }, diff --git a/src/widget/multitree/multi.tree.popup.js b/src/widget/multitree/multi.tree.popup.js index 0cda736edc..35c4f4f5f8 100644 --- a/src/widget/multitree/multi.tree.popup.js +++ b/src/widget/multitree/multi.tree.popup.js @@ -10,7 +10,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, { baseCls: 'bi-multi-tree-popup', maxWidth: 'auto', minWidth: 100, - maxHeight: 250, + maxHeight: 400, onLoaded: BI.emptyFn }); }, From effedd3064409c46f1d43fd0c081447cd3e060dd Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 20:03:45 +0800 Subject: [PATCH 18/19] add --- dist/core.js | 1 - src/core/controller/controller.layer.js | 1 - 2 files changed, 2 deletions(-) diff --git a/dist/core.js b/dist/core.js index 3287c4acec..41fda0c121 100644 --- a/dist/core.js +++ b/dist/core.js @@ -20832,7 +20832,6 @@ BI.LayerController = BI.inherit(BI.Controller, { return this; } this._getLayout(name).visible(); - this._getLayout(name)._mount(); this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__"); return this; }, diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js index c1625653c6..ae798aca93 100644 --- a/src/core/controller/controller.layer.js +++ b/src/core/controller/controller.layer.js @@ -127,7 +127,6 @@ BI.LayerController = BI.inherit(BI.Controller, { return this; } this._getLayout(name).visible(); - this._getLayout(name)._mount(); this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__"); return this; }, From 06ac37382222577f40712c66d11150d0d05ff84c Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 22 Mar 2017 20:39:05 +0800 Subject: [PATCH 19/19] add --- dist/base.js | 8 ++++---- dist/core.js | 26 ++++++++++++++++++-------- src/base/combination/group.button.js | 8 ++++---- src/core/wrapper/layout.js | 15 +++++++++++++++ src/core/wrapper/layout/layout.card.js | 11 +++-------- 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/dist/base.js b/dist/base.js index 23d126675e..9eebd0e852 100644 --- a/dist/base.js +++ b/dist/base.js @@ -21353,8 +21353,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { return; } - var items = this._packageItems(items, this._packageBtns(btns)); - BI.createWidget(BI.extend(this._packageLayout(items))).element.children().prependTo(this.element); + items = this._packageItems(items, this._packageBtns(btns)); + this.layouts.prependItems(this._packageLayout(items).items); }, addItems: function (items) { @@ -21369,8 +21369,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { return; } - var items = this._packageItems(items, this._packageBtns(btns)); - BI.createWidget(BI.extend(this._packageLayout(items))).element.children().appendTo(this.element); + items = this._packageItems(items, this._packageBtns(btns)); + this.layouts.addItems(this._packageLayout(items).items); }, removeItemAt: function (indexes) { diff --git a/dist/core.js b/dist/core.js index 41fda0c121..d86dd053a7 100644 --- a/dist/core.js +++ b/dist/core.js @@ -19363,6 +19363,14 @@ BI.Layout = BI.inherit(BI.Widget, { return w; }, + prependItem: function (item) { + var w = this._addElement(this.options.items.length, item); + w._mount(); + this.options.items.unshift(item); + w.element.prependTo(this.element); + return w; + }, + addItems: function (items) { var self = this; BI.each(items, function (i, item) { @@ -19370,6 +19378,13 @@ BI.Layout = BI.inherit(BI.Widget, { }) }, + prependItems: function (items) { + var self = this; + BI.each(items, function (i, item) { + self.prependItem(item); + }) + }, + getValue: function () { var value = []; BI.each(this._children, function (i, wi) { @@ -26630,7 +26645,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { return widget; }, - showCardByName: function (name, action) { + showCardByName: function (name, action, callback) { var self = this; //name不存在的时候全部隐藏 var exist = this.hasWidget(this._getCardName(name)); @@ -26644,7 +26659,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { //动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了 !flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.invisible(); } else { - (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), el._mount()) + (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), callback && callback()) } }); }, @@ -26653,12 +26668,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { var self = this; this.showIndex = this.lastShowIndex; BI.each(this._children, function (i, el) { - if (self.showIndex != i) { - el.element.hide(); - } else { - el.element.show(); - el._mount(); - } + el.setVisible(self.showIndex == i); }) }, diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index a1f36155ed..b6ef3be0be 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -126,8 +126,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { return; } - var items = this._packageItems(items, this._packageBtns(btns)); - BI.createWidget(BI.extend(this._packageLayout(items))).element.children().prependTo(this.element); + items = this._packageItems(items, this._packageBtns(btns)); + this.layouts.prependItems(this._packageLayout(items).items); }, addItems: function (items) { @@ -142,8 +142,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { return; } - var items = this._packageItems(items, this._packageBtns(btns)); - BI.createWidget(BI.extend(this._packageLayout(items))).element.children().appendTo(this.element); + items = this._packageItems(items, this._packageBtns(btns)); + this.layouts.addItems(this._packageLayout(items).items); }, removeItemAt: function (indexes) { diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 76b9db1275..5c19c92b5b 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -106,6 +106,14 @@ BI.Layout = BI.inherit(BI.Widget, { return w; }, + prependItem: function (item) { + var w = this._addElement(this.options.items.length, item); + w._mount(); + this.options.items.unshift(item); + w.element.prependTo(this.element); + return w; + }, + addItems: function (items) { var self = this; BI.each(items, function (i, item) { @@ -113,6 +121,13 @@ BI.Layout = BI.inherit(BI.Widget, { }) }, + prependItems: function (items) { + var self = this; + BI.each(items, function (i, item) { + self.prependItem(item); + }) + }, + getValue: function () { var value = []; BI.each(this._children, function (i, wi) { diff --git a/src/core/wrapper/layout/layout.card.js b/src/core/wrapper/layout/layout.card.js index aa9db36c32..08869e4ab7 100644 --- a/src/core/wrapper/layout/layout.card.js +++ b/src/core/wrapper/layout/layout.card.js @@ -86,7 +86,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { return widget; }, - showCardByName: function (name, action) { + showCardByName: function (name, action, callback) { var self = this; //name不存在的时候全部隐藏 var exist = this.hasWidget(this._getCardName(name)); @@ -100,7 +100,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { //动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了 !flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.invisible(); } else { - (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), el._mount()) + (BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), callback && callback()) } }); }, @@ -109,12 +109,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { var self = this; this.showIndex = this.lastShowIndex; BI.each(this._children, function (i, el) { - if (self.showIndex != i) { - el.element.hide(); - } else { - el.element.show(); - el._mount(); - } + el.setVisible(self.showIndex == i); }) },

      lLbnIirIo+d2kDm0}B)^4gEixek3~>0s@!Ym;+poFi znu-c-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