Initializes views within a specific DOM element.
@param {string} selector element CSS selector
@param {Object<string, *>} args view options
@param {Function} cb optional callback function to call when the view is loaded.
332957
function (selector, args, cb) {
            selector = selector || document;
            args = args || {};
            
            var self = this;
            
            $(selector).find('*[data-view]').each(function () {
                var viewArgs = _.extend({}, args);
                viewArgs.el = this;
                self.getComponent('viewManager').createView($(this).data('view'), viewArgs)
                    .then(cb);
            });
        }
1073287
public static void show(Map<String, Object> args, IInputCallback callback) {
        Window dialog = (Window) PageUtil
                .createPage(DialogConstants.RESOURCE_PREFIX + "inputDialog.fsp", ExecutionContext.getPage(), args).get(0);

        dialog.modal(callback == null ? null : (event) -> {
            callback.onComplete(dialog.getAttribute("result", String.class));
        }
45981
function initViewerHTML() {
        // create viewer HTML
        $el.html(Crocodoc.viewerTemplate);
        if (config.useWindowAsViewport) {
            config.$viewport = $(window);
            $el.addClass(CSS_CLASS_WINDOW_AS_VIEWPORT);
        } else {
            config.$viewport = $el.find('.' + CSS_CLASS_VIEWPORT);
        }
        config.$doc = $el.find('.' + CSS_CLASS_DOC);
    }
302650
function(view, config, widget) {

		this.Element$init(view, config, widget);

		var self = this;

		this._IE_click_callback = function() {
			if (self._events['compatible_changed']) {
				Lava.view_manager.dispatchEvent(self._view, 'compatible_changed', null, self._events['compatible_changed']);
			}
		};

	}
923691
function querySelector(selector) {
    init();
    if (!selector) {
      return tokens;
    }
    var match = selector.match(
      /^\s*([\w_-]*)((\s*\[[\w_-]+\s*=\s*("([^\\"]*(\\.)*)*"|'([^\\']*(\\.)*)*'|[^\[\]]*)\])*)\s*(\*?)$/
    );
    if (!match) {
      console.warn(colors.blue('Invalid selector expressions %j.'), selector);
      return;
    }
    var tag = match[1];
    var attributes = [];
    var all = match[9] === '*';
    match[2].replace(/\s*\[([\w_-]+)\s*=\s*("([^\\"]*(\\.)*)*"|'([^\\']*(\\.)*)*'|[^\[\]]*)\]/g,
      function (match, name, value) {
        if (/^['"]/.test(value)) {
          /*jslint evil: true */
          value = new Function('return (' + value + ');')();
        }
        attributes.push({
          name: name,
          value: value
        });
      }
    );
    function check(node) {
      if (!node || !node.attrs) {
        return;
      }
      var flag;
      if (!tag || node.tag === tag) {
        flag = true;
        attributes.every(function (item) {
          if (item.value !== node.attrs[item.name]) {
            flag = false;
          }
          return flag;
        });
      }
      return flag;
    }
    var items;
    function scan(node) {
      if (check(node)) {
        if (items) {
          items.push(node);
        }
        return node;
      }
      var result;
      if (node.nodes) {
        node.nodes.every(function (item) {
          result = scan(item);
          return items || !result;
        });
      }
      return result;
    }
    if (all) {
      items = [];
      scan(tokens);
      return items;
    }
    else {
      return scan(tokens);
    }
  }
269524
function Viewer(element) {
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    classCallCheck(this, Viewer);

    if (!element || element.nodeType !== 1) {
      throw new Error('The first argument is required and must be an element.');
    }

    this.element = element;
    this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
    this.action = false;
    this.fading = false;
    this.fulled = false;
    this.hiding = false;
    this.index = 0;
    this.isImg = false;
    this.length = 0;
    this.played = false;
    this.playing = false;
    this.pointers = {};
    this.ready = false;
    this.showing = false;
    this.timeout = false;
    this.tooltipping = false;
    this.viewed = false;
    this.viewing = false;
    this.isShown = false;
    this.wheeling = false;
    this.init();
  }
386831
function initAssets (args) {
    // default to empty strings
    this.css = ''
    this.js = ''
    // if client has css use it
    if (defined(args.css)) {
        // require css to be a string
        this.assert(typeof args.css === 'string', 117)
        // set component css
        this.css = args.css
    }
    // if client has js set use it
    if (defined(args.js)) {
        // require js to be string
        this.assert(typeof args.js === 'string', 114)
        // set component js
        this.js = args.js
    }
}
1348754
function (method, view, locals/*, cb*/) {
    if (view.options.handled.indexOf(method) === -1) {
      this.handle.apply(this, arguments);
    }
    this.emit(method, view, locals);
  }
858771
function (args, cb) {

            this.setData(args.dataModel);
            var itemsInfo = args.itemsInfo;

            var res = this._mergeItemsAndSelectionInfo(itemsInfo.items, itemsInfo.selectedValues, itemsInfo.selectedIndex);
            this._setItems(res.items);

            this.json.setValue(this._data, "selectedIndex", res.selectedIndex);
            this.json.setValue(this._data, "selectedCount", res.selectedCount);
            // this.json.setValue(this._data, "selectedValues", res.selectedValues);

            if (itemsInfo.selectedValues == null) {
                this.setSelectedIndex(itemsInfo.selectedIndex);
            }
            var itemsView = new ariaTemplatesView(this._data.items);
            this.json.setValue(this._data, "itemsView", itemsView);

            if (this._data.activateSort) {
                itemsView.setSort(itemsView.SORT_ASCENDING, "sortByLabel", this._sortByLabel);
            }

            this.$callback(cb);

        }
244870
public static void apply(String selector, Functions.Func callback) {
        apply($(selector).asElement(), 100, callback);
    }
884939
private static Object jsConstructor(Context cx, Scriptable scope,
                                        Object[] args)
    {
        if (args.length == 0)
            return new NativeArray(0);

        // Only use 1 arg as first element for version 1.2; for
        // any other version (including 1.3) follow ECMA and use it as
        // a length.
        if (cx.getLanguageVersion() == Context.VERSION_1_2) {
            return new NativeArray(args);
        }
        Object arg0 = args[0];
        if (args.length > 1 || !(arg0 instanceof Number)) {
            return new NativeArray(args);
        }
        long len = ScriptRuntime.toUint32(arg0);
        if (len != ((Number)arg0).doubleValue()) {
            String msg = ScriptRuntime.getMessage0("msg.arraylength.bad");
            throw ScriptRuntime.constructError("RangeError", msg);
        }
        return new NativeArray(len);
    }
1357116
function initHandlebars (args) {
    // do not initialize handlebars if no template defined
    if (!defined(args.template)) {
        return
    }
    // require template string
    this.assert(typeof args.template === 'string', 111)
    // create handlebars object that will contain everything needed to
    // render template
    this.handlebars = {
        clientPartials: {},
        serverPartials: {},
        helpers: {},
    }
    // compile main template for client
    this.handlebars.clientTemplate = handlebars.precompile(args.template)
    // compile main template for server
    this.handlebars.serverTemplate = handlebars.compile(args.template)
    // compile any partials
    _.each(args.partials, (partial, name) => {
        // compile partial for client
        this.handlebars.clientPartials[name] = handlebars.precompile(partial)
        // compile partial for server
        this.handlebars.serverPartials[name] = handlebars.compile(partial)
    })
    // add any helpers
    _.each(args.helpers, (helper, name) => {
        // require helper to be function
        this.assert(typeof helper === 'function', 112)
        // add to helpers
        this.handlebars.helpers[name] = helper
    })
}
96438
function () {
    var draw = this.el.components.draw;
    var selector = this.data.asset;
    var width = draw.data.width;
    var height = draw.data.height;

    if (this.rendering) {
      return;
    }

    this.rendering = true;

    var node = document.querySelector(selector);

    if (!node) {
      console.error('Could not find html element with selector "' + selector + '"');
      return;
    }

    if (!this.observer) {
      this.observer = new MutationObserver(function (mutations) {
        queueRender(node, width, height, function (canvas) {
          renderedCanvas = canvas;
          draw.render();
        });
      });

      var config = { attributes: true, childList: true, characterData: true, subtree: true };
      this.observer.observe(node, config);
    }

    queueRender(node, width, height, function (canvas) {
      renderedCanvas = canvas;
      draw.render();
    });
  }
819494
function initViews (args) {
    // create views register for model indexed by view name - these names
    // are not required to be the same as global view names
    this.views = {}
    // validate each defined view, get view model if needed
    _.each(args.views, (spec, name) => {
        // get list of model views
        var views = Array.isArray(spec) ? spec : [spec]
        // validate that all model views can be loaded
        _.each(views, view => requireValidModelView(view, args.views, true))
        // add to views
        this.views[name] = views
    })
}
794299
function(element, args) {
        if(!args)
            args = {};
        var eventName = args.eventName ? args.eventName : 'onElementHeight';
        var refreshDelay = args.refreshDelay ? args.refreshDelay : 500;
        var elmHeight;

        if(element)
            elmHeight = element.height();
        if(elmHeight && elmHeight > 0) {
            var e = jQuery.Event(eventName, {elementHeight: elmHeight});
            element.trigger(e);
        } else {
            setTimeout(function () {
                eventElementHeight(element, args);
            }, refreshDelay);
        }
    }
783928
function (args) {
        var div = args.cfg.tplDiv;

        if (div) {
            aria.utils.Dom.replaceHTML(div, "#TEMPLATE ERROR#");
        }
        this.$callback(args.cb, {
            success : false
        });
    }
548703
function(view, config, widget) {

		this.Element$init(view, config, widget);

		var self = this;

		this._OldIE_refresh_callback = function() {
			self._sendRefreshValue();
		};
		this._OldIE_property_change_callback = function(e) {
			if (e.propertyName == "value") {
				self._sendRefreshValue();
			}
		};

	}