Example #1
0
    getItemCfg : function(point,index){
      var _self = this,
        item = _self.get('item'),
        cfg = point.obj,
        rst = {};

      BUI.mix(rst,item);
      if(cfg && cfg.attrs){
        BUI.mix(rst,cfg.attrs);
      }
      return rst;
    },
Example #2
0
 _setResultTpl: function(item, status){
   var _self = this,
     resultTpl = _self.get('resultTpl'),
     itemTpl = resultTpl[status] || resultTpl['default'],
     tplData = BUI.mix({}, item.attr, item.result);
   item.resultTpl = BUI.substitute(itemTpl, tplData);
 },
Example #3
0
    _getSeriesCfg : function(type,item,index){
      var _self = this,
        seriesCfg = _self.get('seriesOptions'),
        colors = _self.get('colors'),
        data = _self.get('data'),
        fields = _self.get('fields'),
        symbols = _self.get('symbols');

      item = BUI.mix(true,{},seriesCfg[type + 'Cfg'],item);

      //颜色
      if(!item.color && colors.length){
        item.color = colors[index % (colors.length)];
      }
      //marker的形状
      if(item.markers && item.markers.marker && !item.markers.marker.symbol){
        item.markers.marker.symbol = symbols[index % symbols.length];
      }
      if(data && !item.data){
        if(fields){
          item.data = _self._getSeriesData(item.name,index);
        }else{
          item.data = data;
        }

      }

      return item;
    },
Example #4
0
File: tab.js Project: 858888/bui
 addTab: function(config, reload) {
   var _self = this,
     id = config.id || BUI.guid('tab-item'),
     forceFit = _self.get('forceFit'),
     item = _self.getItemById(id);
   if (item) {
     var hrefChage = false;
     if (config.href && item.get('href') != config.href) {
       item.set('href', config.href);
       hrefChage = true;
     }
     _self._setItemActived(item);
     if (reload && !hrefChage) {
       item.reload();
     }
   } else {
     config = BUI.mix({
       id: id,
       visible: false,
       actived: true,
       xclass: 'nav-tab-item'
     }, config);
     item = _self.addChild(config);
     if (forceFit) {
       _self.forceFit();
     }
     item.show();
     _self._resetItemList();
   }
   return item;
 },
Example #5
0
    _initMenuCfg : function(item){
      var _self = this,
        items = item.items,
        subItems = [],
        cfg = {
          selectable: false,
          children : [{
            xclass : 'menu',
            children : subItems
          }]
        };

      BUI.mix(cfg,{
        xclass : 'menu-item',
        elCls : 'menu-second'
      },item);

      BUI.each(items,function(subItem){
        var subItemCfg = _self._initSubMenuCfg(subItem);
        subItems.push(subItemCfg);
      });

      return cfg;

    },
Example #6
0
    _renderTicks : function(){
      var _self = this,
          tickItems = _self.get('tickItems'),
          lineAttrs = _self.get('tickLine'),
          path = '',
          cfg = BUI.mix({},lineAttrs);
      if(tickItems){
          BUI.each(tickItems,function(item){
              var subPath = BUI.substitute('M{x1} {y1}L{x2} {y2}',item);
              path += subPath;
          });
          
          delete cfg.value;
          cfg.path = path;

          var tickShape =  _self.addShape({
              type : 'path',
              elCls : CLS_AXIS + '-ticks',
              attrs : cfg
          });
          _self.set('tickShape',tickShape);
          
          
      }
    },
Example #7
0
File: line.js Project: 2zyun/bui
 BUI.each(points,function(point){
   var item = BUI.mix({
     value : baseValue
   },center);
   initPoints.push(item);
   _self._drawPoint(item);
 });
Example #8
0
      uploaderType.on('complete', function(ev){
        var curUploadItem = _self.get('curUploadItem'),
          result = ev.result,
          isSuccess= _self.get('isSuccess'),
          successFn = _self.get('success'),
          errorFn = _self.get('error'),
          completeFn = _self.get('complete');

        // BUI.mix(curUploadItem.result, result);
        curUploadItem.result = result;

        if(isSuccess.call(_self, result)){
          //为了兼容原来只设置了itemTpl的情况
          BUI.mix(curUploadItem, result);
          queue.updateFileStatus(curUploadItem, 'success');
          successFn && BUI.isFunction(successFn) && successFn.call(_self, result);
          _self.fire('success', {item: curUploadItem, result: result});
        }
        else{
          queue.updateFileStatus(curUploadItem, 'error');
          errorFn && BUI.isFunction(errorFn) && errorFn.call(_self, result);
          _self.fire('error', {item: curUploadItem, result: result});
        }

        completeFn && BUI.isFunction(completeFn) && completeFn.call(_self, result);
        _self.fire('complete', {item: curUploadItem, result: result});
        _self.set('curUploadItem', null);

        //重新上传其他等待的文件
        _self.uploadFiles();
      });
Example #9
0
 initializer: function() {
   var _self = this,
     el = _self.get('el'),
     children = _self.get('children');
   // 根据viewContent的配置项,生成viewContent
   var viewContent = new ViewContent(BUI.mix(_self.get('viewContent'), {
     elCls: "ui-img-view-content"
   }));
   // 生成底下的toolBar
   var toolBar = new Toolbar.Bar({
     elCls: "ui-img-view-toolbar",
     children: _self.get('commands'),
     itemTpl: '<a data-cmd="{cmd}" href="javascript:;">{text}</a>'
   });
   // 生成右边的previewList
   var previewList = new PreviewList({
     elCls: "ui-img-view-mini-wrap"
   })
   children.push(viewContent);
   children.push(previewList);
   children.push(toolBar);
   _self.set('toolBar', toolBar);
   _self.set('viewContent', viewContent);
   _self.set('previewList', previewList);
 },
Example #10
0
    saveRecord : function(record){
      var _self = this,
        grid = _self.get('grid'),
        editType = _self.get('editType'),
        curIndex = _self.get('curIndex'),
        store = grid.get('store'),
        curRecord = _self.get('record');

      BUI.mix(curRecord,record);

      if(editType == TYPE_ADD){
        if(curIndex != null){
          store.addAt(curRecord,curIndex);
        }else{
          store.add(curRecord);
        }
      }else{
        store.update(curRecord);
        /*if(store.contains(curRecord)){
          
        }else{
          store.add(curRecord);
        }*/
      }
    },
Example #11
0
    getPoint : function(x,y){
      var _self = this,
        xAxis = _self.get('xAxis'),
        yAxis = _self.get('yAxis'),
        yValue = _self.parseYValue(y),
        point = {};

      if(xAxis.get('type') == 'time'){
        x = date2number(x);
      }
      //圆形坐标轴,一般用于雷达图
      if(_self.isInCircle()){
        
        point = yAxis.getPointByAngle(x,yValue);
      }else{
        point.x = xAxis.getOffset(x);
        point.y = yAxis.getOffset(yValue);
      }

      BUI.mix(point,{
        yValue : yValue,
        xValue : x,
        value : y
      });

      return point;
    },
Example #12
0
File: slider.js Project: 858888/bui
define("bui/slider", ["bui/common", "jquery"], function(require, exports, module) {
  var BUI = require("bui/common");
  var Slider = BUI.namespace('Slider');
  BUI.mix(Slider, {
    Slider: require("bui/slider/slider")
  });
  module.exports = Slider;
});
Example #13
0
File: data.js Project: haodw/bui
    _initParams : function(){
      var _self = this,
        lastParams = _self.get('lastParams'),
        params = _self.get('params');

      //初始化 参数
      BUI.mix(lastParams,params);
    },
Example #14
0
File: line.js Project: 2zyun/bui
 _createLine : function(path){
   var _self = this,
     lineAttrs = _self.get('line'),
     cfg = BUI.mix({},lineAttrs);
   cfg.path = path;
   lineShape = _self.addShape('path',cfg);
   _self.set('lineShape',lineShape);
   return lineShape;
 },
Example #15
0
 _initSubMenuCfg : function(subItem){
   var _self = this,
     cfg = {
       xclass : 'menu-item',
       elCls : 'menu-leaf',
       tpl : '<a href="{href}"><em>{text}</em></a>'
     };
   return BUI.mix(cfg,subItem);
 }
Example #16
0
 _initSubMenuCfg : function(subItem){
   var _self = this,
     cfg = {
       xclass : 'menu-item',
       elCls : 'menu-leaf',
       tpl : _self.get('subMenuItemTpl')
     };
   return BUI.mix(cfg,subItem);
 }
Example #17
0
define('bui/slider',['bui/slider/slider'],function (require) {
  var Slider = BUI.namespace('Slider');

  BUI.mix(Slider,{
    Slider : require('bui/slider/slider')
  });

  return Slider;
});/**
Example #18
0
define('bui/list',['bui/common',BASE + 'list',BASE + 'listitem',BASE + 'simplelist',BASE + 'listbox'],function (r) {
  var BUI = r('bui/common'),
    List = BUI.namespace('List');

  BUI.mix(List,{
    List : r(BASE + 'list'),
    ListItem : r(BASE + 'listitem'),
    SimpleList : r(BASE + 'simplelist'),
    Listbox : r(BASE + 'listbox')
  });

  BUI.mix(List,{
    ListItemView : List.ListItem.View,
    SimpleListView : List.SimpleList.View
  });

  return List;
});  
Example #19
0
 imgObj.drag(function(dx, dy) {
   if (_self.get('drag')) {
     // move
     var dragEnd = _self._getOverflowSize(bbox, dragStartX, dragStartY, dx, dy, width, height, overflowSize);
     imgObj.attr(BUI.mix(dragEnd, {
       transform: imgObj.attr('transform') //在vml下,必须把transform之后的值重置回来,不然图片会丢失。
     }));
   }
 }, function() {
Example #20
0
 BUI.each(theme, function(value, name){
   if(attrVals[name] === undefined){
     _self.set(name, value);
   }
   else if($.isPlainObject(value)){
     BUI.mix(value, attrVals[name]);
     _self.set(name, value);
   }
 });
Example #21
0
 BUI.each(theme, function(value, name){
   //uploader里面没有定义该配置,但是主题里面有定义
   if(attrVals[name] === undefined){
     _self.set(name, value);
   }
   else if($.isPlainObject(value)){
     BUI.mix(value, attrVals[name]);
     _self.set(name, value);
   }
 });
Example #22
0
File: base.js Project: alexmiao/bui
define('bui/list',function (require) {
  var BUI = require('bui/common'),
    List = BUI.namespace('List');

  BUI.mix(List,{
    List : require('bui/list/list'),
    ListItem : require('bui/list/listitem'),
    SimpleList : require('bui/list/simplelist'),
    Listbox : require('bui/list/listbox'),
    Picker : require('bui/list/listpicker')
  });

  BUI.mix(List,{
    ListItemView : List.ListItem.View,
    SimpleListView : List.SimpleList.View
  });

  return List;
});
Example #23
0
define('bui/overlay',['bui/common','bui/overlay/overlay','bui/overlay/dialog','bui/overlay/message'],function (require) {
  var BUI = require('bui/common'),
    Overlay = BUI.namespace('Overlay');

  BUI.mix(Overlay,{
    Overlay : require('bui/overlay/overlay'),
    Dialog : require('bui/overlay/dialog'),
    Message : require('bui/overlay/message')
  });

  BUI.mix(Overlay,{
    OverlayView : Overlay.Overlay.View,
    DialogView : Overlay.Dialog.View
  });

  BUI.Message = BUI.Overlay.Message;
  return Overlay;

});/**
Example #24
0
define('bui/tree',['bui/common','bui/tree/treemixin','bui/tree/treelist'],function (require) {
  var BUI = require('bui/common'),
    Tree = BUI.namespace('Tree');

  BUI.mix(Tree,{
    TreeList : require('bui/tree/treelist'),
    Mixin : require('bui/tree/treemixin')
  });
  return Tree;
});
Example #25
0
define('bui/progressbar',['bui/common','bui/progressbar/base','bui/progressbar/load'],function (require) {
  var BUI = require('bui/common'),
    ProgressBar = BUI.namespace('ProgressBar');
  BUI.mix(ProgressBar,{
    Base : require('bui/progressbar/base'),
    Load : require('bui/progressbar/load')
  });

  return ProgressBar;
});/**
Example #26
0
File: list.js Project: 858888/bui
define("bui/list", ["jquery", "bui/common", "bui/list/list", "bui/list/listitem", "bui/list/simplelist", "bui/list/listbox", "bui/list/domlist", "bui/list/keynav", "bui/list/sortable", "bui/data"], function(require, exports, module) {
  /**
   * @fileOverview 列表模块入口文件
   * @ignore
   */
  var BUI = require("bui/common"),
    List = BUI.namespace('List');
  BUI.mix(List, {
    List: require("bui/list/list"),
    ListItem: require("bui/list/listitem"),
    SimpleList: require("bui/list/simplelist"),
    Listbox: require("bui/list/listbox")
  });
  BUI.mix(List, {
    ListItemView: List.ListItem.View,
    SimpleListView: List.SimpleList.View
  });
  module.exports = List;
});
Example #27
0
 swfUploader.on('uploadProgress', function(ev){
     BUI.mix(ev, {
         //已经读取的文件字节数
         loaded:ev.bytesLoaded,
         //文件总共字节数
         total : ev.bytesTotal
     });
     BUI.log(LOG_PREFIX + '已经上传字节数为:' + ev.bytesLoaded);
     _self.fire(FlashType.event.PROGRESS, { 'loaded':ev.loaded, 'total':ev.total });
 });
Example #28
0
    getItemCfg : function(point,index){
      var _self = this,
        item = _self.get('item'),
        cfg = point.obj,
        rst = {};

      BUI.mix(rst,item);
      if(cfg && cfg.attrs){
        BUI.mix(rst,cfg.attrs);
      }
      if(!rst.fill){
        rst.fill = _self._getColor(index);
        point.color = rst.fill;
      }
      if(_self.get('allowSelect')){
        rst.cursor = 'pointer';
      }
      return rst;
    },
Example #29
0
File: grid.js Project: habins/WebDS
		_drawLine : function(item,lineCfg,cls){
			var _self = this,
				cfg = BUI.mix(lineCfg,item);

			_self.addShape({
				elCls : cls,
				type : 'line',
				attrs : lineCfg
			});
		},
Example #30
0
File: legend.js Project: 2zyun/bui
    _addItem : function(item,index){
      var _self = this,
        itemsGroup = _self.get('itemsGroup'),
        x = _self._getNextX(),
        y = _self._getNextY(),
        cfg = BUI.mix({x : x,y : y},item);

      cfg.legend = _self;
      itemsGroup.addGroup(Item,cfg);
    },