Base class for views

@constructs
@param {Object} options Options object
@param {DOM Element|jQuery} options.element A DOM element that will be a root element of the view
@param {Array} options.scope Array of model instances to be used by the view
976454
function(options)
	{
		options = options || {};

		this._modelBindersMap = null;
		this._collectionBinder = null;
		this._bindingIndex = null;
		this._itemAlias = null;

		this._subviewsStruct = null;
		this._explicitSubviewsStruct = null;
		this._pendingRefresh = false;
		this._pendingRefreshRoot = false;
		this._subviewsArgs = null;
		this._isRunning = false;
		this._isSuspended = false;
		this._template = null;
		this._isolated = false;
		this.subviews = null;

		if(options.isolated)
		{
			this._isolated = true;
		}

		if(options.parentView)
		{
			this.scope = options.scope || null;
			this._setParentView(options.parentView);
		}
		else if(options.scope) this.scope = mixin({}, options.scope);
		else this.scope = {};

		options.scope = null;

		if(options.events)
		{
			this.domEvents = options.events.slice();
		}
		else this.domEvents = [];

		if(options.dispatcher)
		{
			this.dispatcher = options.dispatcher;
		}
		else this.dispatcher = null;

		if(options.actions)
		{
			this.actions = mixin({
				set: actionSet
			}, options.actions);
		}
		else if((this.parentView == null || this._isolated )&& !options._clone)
		{
			this.actions = {
				set: actionSet
			};
		}
		else this.actions = null;

		if(options.env)
		{
			this.env = options.env;
		}
		else this.env = { document: document, window: window };

		if(options.element)
		{
			this.element = options.element
			options.element = null;
		}
		else this.element = this.env.document.body;

		this.options = options;
	}
1051891
function Fragments(options) {
  if (!options || !options.observations) {
    throw new TypeError('Must provide an observations instance to Fragments in options.');
  }

  this.compiling = false;
  this.observations = options.observations;
  this.globals = options.observations.globals;
  this.formatters = options.observations.formatters;
  this.animations = {};
  this.animateAttribute = 'animate';

  this.binders = {
    element: { _wildcards: [] },
    attribute: { _wildcards: [], _expr: /{{\s*(.*?)\s*}}(?!})/g, _delimitersOnlyInDefault: false },
    text: { _wildcards: [], _expr: /{{\s*(.*?)\s*}}(?!})/g }
  };

  // Text binder for text nodes with expressions in them
  this.registerText('__default__', registerTextDefault);

  function registerTextDefault(value) {
    this.element.textContent = (value != null) ? value : '';
  }

  // Text binder for text nodes with expressions in them to be converted to HTML
  this.registerText('{*}', function(value) {
    if (this.content) {
      this.content.remove();
      this.content = null;
    }

    if (typeof value === 'string' && value || value instanceof Node) {
      this.content = View.makeInstanceOf(toFragment(value));
      this.element.parentNode.insertBefore(this.content, this.element.nextSibling);
    }
  });

  // Catchall attribute binder for regular attributes with expressions in them
  this.registerAttribute('__default__', function(value) {
    if (value != null) {
      this.element.setAttribute(this.name, value);
    } else {
      this.element.removeAttribute(this.name);
    }
  });

  this.addOptions(options);
}
1256529
function(element, options) {
        var that = this;
        that.name = NAME;
        that.$ = $(element);

        options = that.options = $.extend({}, $ComponentName$.DEFAULTS, this.$.data(), options);

        // Initialize here
    }
133684
function view(options) {
			var name = options.name,
				locals = options.locals,
				callback = options.callback;

			this.render(path.join(this._viewRoot, '/views/' + name), locals, callback);
		}
1217629
def ng_model(model, opt = {})
    opt[:root_selector] ||= ng_root_selector
    row = ng.row(opt)
    ng_models(model, opt)[row]
  end
315168
function (element, options) {
    this.element = element;
    this.options = options;

    $(this.element).addClass(ClassName.tree);

    $(Selector.treeview + Selector.active, this.element).addClass(ClassName.open);

    this._setUpListeners();
  }
551767
function(options) {
		this.DelOptions = $.extend({}, defaults, this.DelOptions, options);
		this.dName = this.DelOptions.dName || this._name;
		this.selector = this.selector || '.' + this.dName;
		this.namespace = this.DelOptions.namespace || this.dName;
		this.initEl();
	}
1254218
function( options ) {
			var out = {},
				items,
				classItems,
				x,
				i;

			this.init();
			options = (options)? options : {};
			this.getDOMContext( options );

			// if we do not have any context create error
			if(!this.rootNode || !this.document){
				return {'errors': [this.noContentErr]};
			}else{

				items = this.findRootNodes( this.rootNode, true );
				i = items.length;
				while(i--) {
					classItems = modules.domUtils.getAttributeList(items[i], 'class');
					x = classItems.length;
					while(x--) {
						// find v2 names
						if(modules.utils.startWith( classItems[x], 'h-' )){
							this.appendCount(classItems[x], 1, out);
						}
						// find v1 names
						for(var key in modules.maps) {
							// dont double count if v1 and v2 roots are present
							if(modules.maps[key].root === classItems[x] && classItems.indexOf(key) === -1) {
								this.appendCount(key, 1, out);
							}
						}
					}
				}
				var relCount = this.countRels( this.rootNode );
				if(relCount > 0){
					out.rels = relCount;
				}

				return out;
			}
		}
1310569
function (element, options) {
  this.internalID = randomID()
  this.element = element
  this.width = element.offsetWidth
  this.height = element.offsetHeight
  this.element = element
  this.parent = this.element.parentNode
  this.options = Object.assign({}, Blur.DEFAULTS, options)
  this.overlayEl = this.createOverlay()
  this.blurredImage = null
  this.attachListeners()
  this.generateBlurredImage(this.options.url)
}
490235
function (model, options) {
        this._index(model);
        if (!model.collection) model.collection = this;
        if (model.on) model.on('all', this._onModelEvent, this);
    }
1156534
function (options) {
        return {
          options: options,
          render: function ($scope, $elem) {
            var _this = this, expression = $elem.find('tbody').html(),
              // Find the resources from the comment <!-- ngRepeat: item in items --> displayed by angular in the DOM
              // This regexp is inspired by the one used in the "ngRepeat" directive
              match = expression.match(/^\s*.+\s+in\s+(\w*)\s*/), ngRepeatAttr = match[1];
            if (!match) {
              throw new Error('Expected expression in form of "_item_ in _collection_[ track by _id_]" but got "{0}".', expression);
            }
            var oTable, firstCall = true, alreadyRendered = false, parentScope = $scope.$parent;
            parentScope.$watch(ngRepeatAttr, function () {
              if (oTable && alreadyRendered && !_isDTOldVersion(oTable)) {
                oTable.ngDestroy();
              }
              // This condition handles the case the array is empty
              if (firstCall) {
                firstCall = false;
                $timeout(function () {
                  if (!alreadyRendered) {
                    oTable = _doRenderDataTable($elem, _this.options, $scope);
                    alreadyRendered = true;
                  }
                }, 1000, false);  // Hack I'm not proud of... Don't know how to do it otherwise...
              } else {
                $timeout(function () {
                  oTable = _doRenderDataTable($elem, _this.options, $scope);
                  alreadyRendered = true;
                }, 0, false);
              }
            }, true);
          }
        };
      }
1333628
function view(template, options = {}) {

	if(!template) {
		throw new Exception('Please pass a template!');
	}

	return Class => {

		let renderedFlag = !(options.renderedFlag === false);

		initCoreMap(storage, Class);
		initViewMap(storage, Class);

		let map = storage.get(Class);

		/**
		 * Its required when we use @style multiple times!
		 * Only once registration!
		 */
		if(map.get('@view').get('callbacksDefined')){
			return;
		}

		map.get('@callbacks').get('created').push((domNode, createVars = {}) => {

			// get and merge dom view var attributes
			let domViewAttributes = extractDomProperties(
				domNode, /^@view\.bind\.(\S+)$/i, true
			);

			// get the restof regular attributes
			let regularDomAttributes = extractDomProperties(domNode);

			let viewBinds = {};
			let entries = map.get('@view').get('bind');
			entries.forEach(([key, value]) => viewBinds[key] = value);

			let viewVars = Object.assign({},
				viewBinds,
				domViewAttributes,
				createVars,
				regularDomAttributes
			);

			// initialize view
			let $view = new View({
				prerenderer: HandlebarsRuntime.template,
				rootNode: domNode,
				vars: viewVars,
				template: template,
			});

			view.helper.registerSetGet(
				domNode,
				Object.assign({}, viewBinds, domViewAttributes)
			);

			// render view
			$view.render(null, {
				renderedFlag: renderedFlag,
			});

			domNode.$view = $view;
		});

		map.get('@callbacks').get('attached').push(domNode => {

			if(domNode.$view.initialized()){
				return;
			}

			/**
			 * Using the same instance is 30% faster in
			 * (Chrome, Opera) and no difference in Firefox
			 * @see: https://jsperf.com/new-class-vs-singleton
			 */
			domNode.$view.reinit({
				rootNode: domNode,
				prerenderer: HandlebarsRuntime.template,
			});
		});

		map.get('@callbacks').get('detached').push(domNode => {
			domNode.$view.destroy();
		});

		map.get('@view').set('callbacksDefined', true);
	}
}
602517
function(options){
                            // set options
                            if (!arguments.length) {
                                options = scope.options;
                            } else {
                                scope.options = options;

                                // return if options $watch is enabled
                                if (scope._config.deepWatchOptions && !scope._config.disabled) return;
                            }

                            // Clearing
                            scope.api.clearElement();

                            // Exit if options are not yet bound
                            if (angular.isDefined(options) === false) return;

                            // Exit if chart is hidden
                            if (!scope._config.visible) return;

                            // Initialize chart with specific type
                            scope.chart = nv.models[options.chart.type]();

                            // Generate random chart ID
                            scope.chart.id = Math.random().toString(36).substr(2, 15);

                            angular.forEach(scope.chart, function(value, key){
                                if (key[0] === '_');
                                else if ([
                                        'clearHighlights',
                                        'highlightPoint',
                                        'id',
                                        'options',
                                        'resizeHandler',
                                        'state',
                                        'open',
                                        'close',
                                        'tooltipContent'
                                    ].indexOf(key) >= 0);

                                else if (key === 'dispatch') {
                                    if (options.chart[key] === undefined || options.chart[key] === null) {
                                        if (scope._config.extended) options.chart[key] = {};
                                    }
                                    configureEvents(scope.chart[key], options.chart[key]);
                                }

                                else if ([
                                        'bars',
                                        'bars1',
                                        'bars2',
                                        'boxplot',
                                        'bullet',
                                        'controls',
                                        'discretebar',
                                        'distX',
                                        'distY',
                                        'focus',
                                        'interactiveLayer',
                                        'legend',
                                        'lines',
                                        'lines1',
                                        'lines2',
                                        'multibar',
                                        'pie',
                                        'scatter',
                                        'scatters1',
                                        'scatters2',
                                        'sparkline',
                                        'stack1',
                                        'stack2',
                                        'sunburst',
                                        'tooltip',
                                        'x2Axis',
                                        'xAxis',
                                        'y1Axis',
                                        'y2Axis',
                                        'y3Axis',
                                        'y4Axis',
                                        'yAxis',
                                        'yAxis1',
                                        'yAxis2'
                                    ].indexOf(key) >= 0 ||
                                        // stacked is a component for stackedAreaChart, but a boolean for multiBarChart and multiBarHorizontalChart
                                    (key === 'stacked' && options.chart.type === 'stackedAreaChart')) {
                                    if (options.chart[key] === undefined || options.chart[key] === null) {
                                        if (scope._config.extended) options.chart[key] = {};
                                    }
                                    configure(scope.chart[key], options.chart[key], options.chart.type);
                                }

                                //TODO: need to fix bug in nvd3
                                else if ((key === 'focusHeight') && options.chart.type === 'lineChart');
                                else if ((key === 'focusHeight') && options.chart.type === 'lineWithFocusChart');
                                else if ((key === 'xTickFormat' || key === 'yTickFormat') && options.chart.type === 'lineWithFocusChart');
                                else if ((key === 'tooltips') && options.chart.type === 'boxPlotChart');
                                else if ((key === 'tooltipXContent' || key === 'tooltipYContent') && options.chart.type === 'scatterChart');
                                else if ((key === 'x' || key === 'y') && options.chart.type === 'forceDirectedGraph');

                                else if (options.chart[key] === undefined || options.chart[key] === null){
                                    if (scope._config.extended) {
                                        if (key==='barColor')
                                            options.chart[key] = value()();
                                        else
                                            options.chart[key] = value();
                                    }
                                }

                                else scope.chart[key](options.chart[key]);
                            });

                            // Update with data
                            scope.api.updateWithData();

                            // Configure wrappers
                            if (options['title'] || scope._config.extended) configureWrapper('title');
                            if (options['subtitle'] || scope._config.extended) configureWrapper('subtitle');
                            if (options['caption'] || scope._config.extended) configureWrapper('caption');


                            // Configure styles
                            if (options['styles'] || scope._config.extended) configureStyles();

                            nv.addGraph(function() {
                                if (!scope.chart) return;

                                // Remove resize handler. Due to async execution should be placed here, not in the clearElement
                                if (scope.chart.resizeHandler) scope.chart.resizeHandler.clear();

                                // Update the chart when window resizes
                                scope.chart.resizeHandler = nv.utils.windowResize(function() {
                                    scope.chart && scope.chart.update && scope.chart.update();
                                });

                                /// Zoom feature
                                if (options.chart.zoom !== undefined && [
                                        'scatterChart',
                                        'lineChart',
                                        'candlestickBarChart',
                                        'cumulativeLineChart',
                                        'historicalBarChart',
                                        'ohlcBarChart',
                                        'stackedAreaChart'
                                    ].indexOf(options.chart.type) > -1) {
                                    nvd3Utils.zoom(scope, options);
                                }

                                return scope.chart;
                            }, options.chart['callback']);
                        }
91110
function View() {
        Element.apply(this, arguments);

        /** @member {Model} */
        this.model = null;

        /** @member {Array.<View>} */
        this.subViews = [];

        /** @member {View} */
        this.containerView = null;

        /** @member {Array.<View>} */
        this.containedViews = [];

        /** @member {boolean} */
        this.visible = true;

        /** @member {boolean} */
        this.enabled = true;

        /** @member {boolean} */
        this.selected = false;

        /** @member {number} */
        this.selectable = SK_YES;

        /** @member {string} */
        this.lineColor = PreferenceManager.get("view.lineColor", "#000000");

        /** @member {string} */
        this.fillColor = PreferenceManager.get("view.fillColor", "#ffffff");

        /** @member {string} */
        this.fontColor = PreferenceManager.get("view.fontColor", "#000000");

        /** @member {Font} */
        this.font = new Font(
            PreferenceManager.get("view.font", "Arial"),
            PreferenceManager.get("view.fontSize", 13),
            Graphics.FS_NORMAL
        );

        /** @member {boolean} */
        this.parentStyle = false;

        /** @member {boolean} */
        this.showShadow = PreferenceManager.get("view.showShadow", true);

        /** @member {boolean} */
        this.containerChangeable = false;

        /** @member {boolean} */
        this.containerExtending = false;

        /** @member {number} */
        this.zIndex = 0;
    }
820696
function (element, options) {
    this.$element = $(element)
    this.options = $.extend({}, $.fn.collapse.defaults, options)

    if (this.options.parent) {
      this.$parent = $(this.options.parent)
    }

    this.options.toggle && this.toggle()
  }
1023661
function(attrs, options) {

            // begin lazo specific overrides
            var modelName = null;
            if (this.modelName) {
                if (_.isFunction(this.modelName)) {
                    modelName = this.modelName(attrs, options);
                }
                else {
                    modelName = this.modelName;
                }
            }
            // end lazo specific overrides

            if (attrs instanceof Backbone.Model) {
                if (!attrs.collection) attrs.collection = this;
                if (!attrs.name && modelName) attrs.name = modelName; // lazo specific
                return attrs;
            }
            options || (options = {});
            options.collection = this;

            // begin lazo specific overrides
            if (modelName) {
                options.name = modelName;
            }

            options.ctx = this.ctx;
            // end lazo specific overrides

            var model = new this.model(attrs, options);
            if (!model._validate(attrs, options)) {
                this.trigger('invalid', this, attrs, options);
                return false;
            }
            return model;
        }
1318963
function(element, options) {
        var that = this;
        that.name = NAME;
        that.$ = $(element);

        options = that.options = $.extend({}, Pager.DEFAULTS, this.$.data(), options);

        var lang   = options.lang || $.zui.clientLang();
        that.lang  = $.isPlainObject(lang) ? ($.extend(true, {}, LANG[lang.lang || $.zui.clientLang()], lang)) : LANG[lang];

        that.state = {};

        that.set(options.page, options.recTotal, options.recPerPage, true);

        that.$.on('click', '.pager-goto-btn', function() {
            var $goto = $(this).closest('.pager-goto');
            var page = parseInt($goto.find('.pager-goto-input').val());
            if (page !== NaN) {
                that.set(page);
            }
        }).on('click', '.pager-item', function() {
            var page = $(this).data('page');
            if (typeof page === 'number' && page > 0) {
                that.set(page);
            }
        }).on('click', '.pager-size-menu [data-size]', function() {
            var size = $(this).data('size');
            if (typeof size === 'number' && size > 0) {
                that.set(-1, -1, size);
            }
        });
    }