/* Set up the widget, Called on first $().fancytree()
359523
function() {
		this.tree = new Fancytree(this);

		this.$source = this.source || this.element.data("type") === "json" ? this.element
			: this.element.find(">ul:first");
		// Subclass Fancytree instance with all enabled extensions
		var extension, extName, i,
			extensions = this.options.extensions,
			base = this.tree;

		for(i=0; i<extensions.length; i++){
			extName = extensions[i];
			extension = $.ui.fancytree._extensions[extName];
			if(!extension){
				$.error("Could not apply extension '" + extName + "' (it is not registered, did you forget to include it?)");
			}
			// Add extension options as tree.options.EXTENSION
//			_assert(!this.tree.options[extName], "Extension name must not exist as option name: " + extName);
			this.tree.options[extName] = $.extend(true, {}, extension.options, this.tree.options[extName]);
			// Add a namespace tree.ext.EXTENSION, to hold instance data
			_assert(this.tree.ext[extName] === undefined, "Extension name must not exist as Fancytree.ext attribute: '" + extName + "'");
//			this.tree[extName] = extension;
			this.tree.ext[extName] = {};
			// Subclass Fancytree methods using proxies.
			_subclassObject(this.tree, base, extension, extName);
			// current extension becomes base for the next extension
			base = extension;
		}
		//
		this.tree._callHook("treeCreate", this.tree);
		// Note: 'fancytreecreate' event is fired by widget base class
//        this.tree._triggerTreeEvent("create");
	}
977747
public function init()
    {
        $this->attachBehavior('TbWidget', new TbWidget);
        $this->copyId();
        TbHtml::addCssClass('collapse', $this->htmlOptions);
        if (isset($this->parent)) {
            TbArray::defaultValue('data-parent', $this->parent, $this->htmlOptions);
        }
        if (isset($this->toggle) && $this->toggle) {
            TbHtml::addCssClass('in', $this->htmlOptions);
        }
        if (isset($this->view)) {
            $controller = $this->getController();
            if (isset($controller) && $controller->getViewFile($this->view) !== false) {
                $this->content = $this->controller->renderPartial($this->view, $this->viewData, true);
            }
        }
        echo TbHtml::openTag($this->tagName, $this->htmlOptions);
        echo $this->content;
    }
992420
private void setUpUtilBar() {
		utilBar.setLayout(new ListLayout(ListLayout.Type.FLAT, ListLayout.Alignment.RIGHT, ListLayout.Separator.NONE, false));
		WTextField selectOther = new WTextField();
		selectOther.setToolTip("Enter text.");
		utilBar.add(selectOther);
		utilBar.add(new WButton("Go"));
		utilBar.add(new WButton("A"));
		utilBar.add(new WButton("B"));
		utilBar.add(new WButton("C"));
		utilBar.setVisible(false);
	}
470085
public function init()
    {
        $this->attachBehavior('TbWidget', new TbWidget);
        $this->copyId();
        $this->htmlOptions['data-spy'] = 'affix';
        if (isset($this->offset)) {
            if (is_string($this->offset)) {
                $this->offset = array('top', $this->offset);
            }

            if (is_array($this->offset) && count($this->offset) === 2) {
                list($position, $offset) = $this->offset;
                $this->htmlOptions['data-offset-' . $position] = $offset;
            }
        }
        echo TbHtml::openTag($this->tagName, $this->htmlOptions);
    }
656488
def init_widget(self):
        
        super(UiKitEditText, self).init_widget()

        #: Init font properties etc...
        self.init_text()

        d = self.declaration
        if d.placeholder:
            self.set_placeholder(d.placeholder)
        if d.input_type != 'text':
            self.set_input_type(d.input_type)
        if d.style:
            self.set_style(d.style)

        #: A really ugly way to add the target
        #: would be nice if we could just pass the block pointer here :)
        self.get_app().bridge.addTarget(
            self.widget,
            forControlEvents=UITextField.UIControlEventEditingChanged,
            andCallback=self.widget.getId(),
            usingMethod="onValueChanged",
            withValues=["text"]#,"selected"]
        )

        self.widget.onValueChanged.connect(self.on_value_changed)
732822
function()
		{
			var startNode = this.startContainer,
				endNode = this.endContainer;

			if ( startNode.is && startNode.is( 'span' )
				&& startNode.data( 'cke-bookmark' ) )
				this.setStartAt( startNode, CKEDITOR.POSITION_BEFORE_START );
			if ( endNode && endNode.is && endNode.is( 'span' )
				&& endNode.data( 'cke-bookmark' ) )
				this.setEndAt( endNode,  CKEDITOR.POSITION_AFTER_END );
		}
602886
function () {
            if (!this.props.visible) {
                return;
            }

            var node = Preact.findDOMNode(this),
                selectedNode = $(node.parentNode).find(this.props.selectedClassName),
                selectionViewInfo = this.props.selectionViewInfo;

            if (selectedNode.length === 0) {
                return;
            }

            node.style.top = selectedNode.offset().top - selectionViewInfo.get("offsetTop") + selectionViewInfo.get("scrollTop") - selectedNode.position().top + "px";
        }
192507
function(children) {
			_assert(
				children && (!this.children || this.children.length === 0),
				"only init supported"
			);
			this.children = [];
			for (var i = 0, l = children.length; i < l; i++) {
				this.children.push(new FancytreeNode(this, children[i]));
			}
		}
975647
function () {
                this.$InputElement.initWidget.call(this);

                var bindings = this._cfg.bind;
                if (bindings.value) {
                    var newValue = this._transform(bindings.value.transform, bindings.value.inside[bindings.value.to], "toWidget");
                    if (newValue != null) {
                        this._domElt.value = newValue;
                    }
                } else {
                    this.$logWarn(this.BINDING_NEEDED, [this.$class, "value"]);
                }
                this._setPlaceholder();
            }
162839
function(setting) {
		var o = setting.treeObj,
		c = consts.event;
		o.bind(c.CHECK, function (event, srcEvent, treeId, node) {
			event.srcEvent = srcEvent;
			tools.apply(setting.callback.onCheck, [event, treeId, node]);
		});
	}
456020
function(ctx, force, deep, collapsed, _recursive) {
			var children,
				firstTr,
				i,
				l,
				newRow,
				prevNode,
				prevTr,
				subCtx,
				tree = ctx.tree,
				node = ctx.node,
				opts = ctx.options,
				isRootNode = !node.parent;

			if (tree._enableUpdate === false) {
				// $.ui.fancytree.debug("*** nodeRender _enableUpdate: false");
				return;
			}
			if (!_recursive) {
				ctx.hasCollapsedParents = node.parent && !node.parent.expanded;
			}
			// $.ui.fancytree.debug("*** nodeRender " + node + ", isRoot=" + isRootNode, "tr=" + node.tr, "hcp=" + ctx.hasCollapsedParents, "parent.tr=" + (node.parent && node.parent.tr));
			if (!isRootNode) {
				if (node.tr && force) {
					this.nodeRemoveMarkup(ctx);
				}
				if (!node.tr) {
					if (ctx.hasCollapsedParents && !deep) {
						// #166: we assume that the parent will be (recursively) rendered
						// later anyway.
						// node.debug("nodeRender ignored due to unrendered parent");
						return;
					}
					// Create new <tr> after previous row
					// if( node.isStatusNode() ) {
					// 	newRow = tree.statusRowFragment.firstChild.cloneNode(true);
					// } else {
					newRow = tree.rowFragment.firstChild.cloneNode(true);
					// }
					prevNode = findPrevRowNode(node);
					// $.ui.fancytree.debug("*** nodeRender " + node + ": prev: " + prevNode.key);
					_assert(prevNode);
					if (collapsed === true && _recursive) {
						// hide all child rows, so we can use an animation to show it later
						newRow.style.display = "none";
					} else if (deep && ctx.hasCollapsedParents) {
						// also hide this row if deep === true but any parent is collapsed
						newRow.style.display = "none";
						//					newRow.style.color = "red";
					}
					if (!prevNode.tr) {
						_assert(
							!prevNode.parent,
							"prev. row must have a tr, or be system root"
						);
						// tree.tbody.appendChild(newRow);
						insertFirstChild(tree.tbody, newRow); // #675
					} else {
						insertSiblingAfter(prevNode.tr, newRow);
					}
					node.tr = newRow;
					if (node.key && opts.generateIds) {
						node.tr.id = opts.idPrefix + node.key;
					}
					node.tr.ftnode = node;
					// if(opts.aria){
					// 	$(node.tr).attr("aria-labelledby", "ftal_" + opts.idPrefix + node.key);
					// }
					node.span = $("span.fancytree-node", node.tr).get(0);
					// Set icon, link, and title (normally this is only required on initial render)
					this.nodeRenderTitle(ctx);
					// Allow tweaking, binding, after node was created for the first time
					//				tree._triggerNodeEvent("createNode", ctx);
					if (opts.createNode) {
						opts.createNode.call(tree, { type: "createNode" }, ctx);
					}
				} else {
					if (force) {
						// Set icon, link, and title (normally this is only required on initial render)
						this.nodeRenderTitle(ctx); // triggers renderColumns()
					} else {
						// Update element classes according to node state
						this.nodeRenderStatus(ctx);
					}
				}
			}
			// Allow tweaking after node state was rendered
			//		tree._triggerNodeEvent("renderNode", ctx);
			if (opts.renderNode) {
				opts.renderNode.call(tree, { type: "renderNode" }, ctx);
			}
			// Visit child nodes
			// Add child markup
			children = node.children;
			if (children && (isRootNode || deep || node.expanded)) {
				for (i = 0, l = children.length; i < l; i++) {
					subCtx = $.extend({}, ctx, { node: children[i] });
					subCtx.hasCollapsedParents =
						subCtx.hasCollapsedParents || !node.expanded;
					this.nodeRender(subCtx, force, deep, collapsed, true);
				}
			}
			// Make sure, that <tr> order matches node.children order.
			if (children && !_recursive) {
				// we only have to do it once, for the root branch
				prevTr = node.tr || null;
				firstTr = tree.tbody.firstChild;
				// Iterate over all descendants
				node.visit(function(n) {
					if (n.tr) {
						if (
							!n.parent.expanded &&
							n.tr.style.display !== "none"
						) {
							// fix after a node was dropped over a collapsed
							n.tr.style.display = "none";
							setChildRowVisibility(n, false);
						}
						if (n.tr.previousSibling !== prevTr) {
							node.debug("_fixOrder: mismatch at node: " + n);
							var nextTr = prevTr ? prevTr.nextSibling : firstTr;
							tree.tbody.insertBefore(n.tr, nextTr);
						}
						prevTr = n.tr;
					}
				});
			}
			// Update element classes according to node state
			// if(!isRootNode){
			// 	this.nodeRenderStatus(ctx);
			// }
		}
188556
function () {
        var self = this, settings = self.settings, elm, box, parent, name, parentEventsRoot;

        self.$el = $(self.getEl());
        self.state.set('rendered', true);

        // Bind on<event> settings
        for (name in settings) {
          if (name.indexOf("on") === 0) {
            self.on(name.substr(2), settings[name]);
          }
        }

        if (self._eventsRoot) {
          for (parent = self.parent(); !parentEventsRoot && parent; parent = parent.parent()) {
            parentEventsRoot = parent._eventsRoot;
          }

          if (parentEventsRoot) {
            for (name in parentEventsRoot._nativeEvents) {
              self._nativeEvents[name] = true;
            }
          }
        }

        bindPendingEvents(self);

        if (settings.style) {
          elm = self.getEl();
          if (elm) {
            elm.setAttribute('style', settings.style);
            elm.style.cssText = settings.style;
          }
        }

        if (self.settings.border) {
          box = self.borderBox;
          self.$el.css({
            'border-top-width': box.top,
            'border-right-width': box.right,
            'border-bottom-width': box.bottom,
            'border-left-width': box.left
          });
        }

        // Add instance to lookup
        var root = self.getRoot();
        if (!root.controlIdLookup) {
          root.controlIdLookup = {};
        }

        root.controlIdLookup[self._id] = self;

        for (var key in self._aria) {
          self.aria(key, self._aria[key]);
        }

        if (self.state.get('visible') === false) {
          self.getEl().style.display = 'none';
        }

        self.bindStates();

        self.state.on('change:visible', function (e) {
          var state = e.value, parentCtrl;

          if (self.state.get('rendered')) {
            self.getEl().style.display = state === false ? 'none' : '';

            // Need to force a reflow here on IE 8
            self.getEl().getBoundingClientRect();
          }

          // Parent container needs to reflow
          parentCtrl = self.parent();
          if (parentCtrl) {
            parentCtrl._lastRect = null;
          }

          self.fire(state ? 'show' : 'hide');

          ReflowQueue.add(self);
        });

        self.fire('postrender', {}, false);
      }
894731
public function fancybox()
    {
        $this->Html->css([
            '/vendor/fancybox/jquery.fancybox',
            '/vendor/fancybox/helpers/jquery.fancybox-buttons',
            '/vendor/fancybox/helpers/jquery.fancybox-thumbs',
        ], ['block' => 'css_bottom']);

        $scripts = [
            '/vendor/fancybox/jquery.fancybox.pack',
            '/vendor/fancybox/helpers/jquery.fancybox-buttons',
            '/vendor/fancybox/helpers/jquery.fancybox-thumbs',
        ];

        //Checks for `APP/webroot/js/`
        if (is_readable(WWW_ROOT . 'js' . DS . 'fancybox_init.js')) {
            $scripts[] = 'fancybox_init';
        //Else, uses `APP/plugin/MeTools/webroot/fancybox/`
        } else {
            $scripts[] = 'MeTools./fancybox/fancybox_init';
        }

        $this->Asset->script($scripts, ['block' => 'script_bottom']);
    }
922140
private void initTopicTree(HelpTopicNode htnParent, TreeNode ttnParent) {
        
        for (int i = 0; i < ttnParent.getChildCount(); i++) {
            TreeNode ttnChild = ttnParent.getChildAt(i);
            HelpTopic ht = getTopic(ttnChild);
            HelpTopicNode htnChild = new HelpTopicNode(ht);
            htnParent.addChild(htnChild);
            initTopicTree(htnChild, ttnChild);
        }
        
    }
931132
def init_widget(self):
        
        super(AndroidListView, self).init_widget()
        d = self.declaration
        self.set_arrangement(d.arrangement)
841704
public function setup(): void
    {
        parent::setup();

        // Setting up the correct dimensions if Portrait (default) or Landscape
        if ($this->orientation === 'landscape') {
            $tmpw              = $this->page_width;
            $this->page_width  = $this->page_height;
            $this->page_height = $tmpw;
        }
        // Store the pagewidth without margins
        $this->noMarginWidth = $this->page_width - $this->left_margin - $this->right_margin;
        // If RTL
        if ($this->rtl) {
            $this->alignRTL  = 'right';
            $this->entityRTL = '&rlm;';
        }
        // Change the default HTML font name
        $this->default_font = 'Arial';

        if ($this->show_generated_by) {
            // The default style name for Generated by.... is 'genby'
            $element = new ReportHtmlCell(0, 10, 0, 'C', '', 'genby', 1, ReportBaseElement::CURRENT_POSITION, ReportBaseElement::CURRENT_POSITION, 0, 0, '', '', true);
            $element->addText($this->generated_by);
            $element->setUrl(Webtrees::VERSION);
            $this->footerElements[] = $element;
        }
    }
196927
public void setSummaryColumnStyleAndScope(HtmlTree thTree) {
        thTree.addStyle(HtmlStyle.colSecond);
        thTree.addAttr(HtmlAttr.SCOPE, "row");
    }