Creates the host element if it doesn't exist
@method _createHostElement
@protected
971562
function () {
            var el = document.createElement('div');

            if (this.CSS.BASE) {
                el.className = this.CSS.BASE;
            }
            
            return el;
        }
869353
function (transaction, hostParent, hostContainerInfo, context) {
	    if (false) {
	      var parentInfo;
	      if (hostParent != null) {
	        parentInfo = hostParent._ancestorInfo;
	      } else if (hostContainerInfo != null) {
	        parentInfo = hostContainerInfo._ancestorInfo;
	      }
	      if (parentInfo) {
	        // parentInfo should always be present except for the top-level
	        // component when server rendering
	        validateDOMNesting(null, this._stringText, this, parentInfo);
	      }
	    }
	
	    var domID = hostContainerInfo._idCounter++;
	    var openingValue = ' react-text: ' + domID + ' ';
	    var closingValue = ' /react-text ';
	    this._domID = domID;
	    this._hostParent = hostParent;
	    if (transaction.useCreateElement) {
	      var ownerDocument = hostContainerInfo._ownerDocument;
	      var openingComment = ownerDocument.createComment(openingValue);
	      var closingComment = ownerDocument.createComment(closingValue);
	      var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
	      DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
	      if (this._stringText) {
	        DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
	      }
	      DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
	      ReactDOMComponentTree.precacheNode(this, openingComment);
	      this._closingComment = closingComment;
	      return lazyTree;
	    } else {
	      var escapedText = escapeTextContentForBrowser(this._stringText);
	
	      if (transaction.renderToStaticMarkup) {
	        // Normally we'd wrap this between comment nodes for the reasons stated
	        // above, but since this is a situation where React won't take over
	        // (static pages), we can simply return the text as it is.
	        return escapedText;
	      }
	
	      return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
	    }
	  }
1277161
function(key) {
    var attr = this.__attrs[key];

    if (!attr) {
      return;
    }

    var value = attr.value = attr._origin;
    var setup = attr.type.setup;

    if (setup) {
      setup.call(this.host, value, key, this);
    }
  }
664688
def create_host(resource_root, host_id, name, ipaddr, rack_id=None):
  
  apihost = ApiHost(resource_root, host_id, name, ipaddr, rack_id)
  return call(resource_root.post, HOSTS_PATH, ApiHost, True, data=[apihost])[0]
901189
public function setUpElement()
    {
        parent::setUpElement();
        $path = "/";
        if(isset($_SERVER["HTTP_REFERER"]) && ($url = parse_url($_SERVER["HTTP_REFERER"])) &&
            $url["host"] == $_SERVER["HTTP_HOST"]){
            $path = $url["path"];
        }
        $currentUser = $this->container->getUserLibraryInstance()->getUserLoggedIn();

        if ($currentUser == null) {
            HTTPHeaderHelper::redirectToLocation("/");
            return;
        }

        $site = $this->container->getSiteInstance();
        $vars = $currentUser->getUserVariables();
        $lastRun = $vars->getValue("last-file-lib-cleanup");
        $lastRun = $lastRun == null ? 0 : $lastRun;

        $fileLib = $this->container->getFileLibraryInstance();
        $contentLibraries = array();
        /** @var Page $page */
        foreach ($this->container->getPageOrderInstance()->listPages() as $page) {
            if ($page->lastModified() < $lastRun) {
                continue;
            }
            $contentLibraries[] = $page->getContentLibrary();

        }
        if($site->lastModified() >= $lastRun){
            $contentLibraries[] = $site->getContentLibrary();
        }
        $fileList = array();
        /** @var File $file */
        foreach ($fileLib->getFileList($currentUser) as $file) {
            if ($fileLib->whitelistContainsFile($file)) {
                continue;
            }
            /** @var $contentLib ContentLibrary */
            foreach ($contentLibraries as $contentLib) {
                if (!count($contentLib->searchLibrary($file->getBasename(), $lastRun))) {
                    continue;
                }
                $fileLib->addToWhitelist($file);
                break;
            }
            $fileList[] = $file;
        }
        $fileLib->cleanLibrary($currentUser);
        $vars->setValue("last-file-lib-cleanup", time());
        $currentUser->logout();

        HTTPHeaderHelper::redirectToLocation($path);
    }
269936
function queueHostBindingForCheck(dirIndex) {
    // Must subtract the header offset because hostBindings functions are generated with
    // instructions that expect element indices that are NOT adjusted (e.g. elementProperty).
    ngDevMode &&
        assertEqual(firstTemplatePass, true, 'Should only be called in first template pass.');
    (tView.hostBindings || (tView.hostBindings = [])).push(dirIndex, viewData.length - 1 - HEADER_OFFSET);
}
489606
function precacheNode(inst, node) {
  var hostInst = getRenderedHostOrTextFromComponent(inst);
  hostInst._hostNode = node;
  node[internalInstanceKey] = hostInst;
}
1035616
function(context) {
    if (context._wysihtml5_supportsHTML5Tags) {
      return;
    }
    for (var i=0, length=HTML5_ELEMENTS.length; i<length; i++) {
      context.createElement(HTML5_ELEMENTS[i]);
    }
    context._wysihtml5_supportsHTML5Tags = true;
  }
650924
function createHiddenElement() {
    // -------------------------------------------------------------- properties

    var element = document.createElement('div');

    var style = element.style;
    style.width = 0;
    style.height = 0;

    element.setAttribute('aria-hidden', 'true');

    // ------------------------------------------------------------------ return

    return element;
}
406108
def create
      @element = Humpyard::config.element_types[params[:type]].new params[:element]
            
      unless can? :create, @element.element
        render :json => {
          :status => :failed
        }, :status => 403
        return
      end      
            
      if @element.save
        @prev = Humpyard::Element.find_by_id(params[:prev_id])
        @next = Humpyard::Element.find_by_id(params[:next_id])
        
        do_move(@element, @prev, @next)
      
        insert_options = {
          :element => "hy-id-#{@element.element.id}",
          :url => humpyard_element_path(@element.element),
          :parent => @element.container ? "hy-id-#{@element.container.id}" : "hy-content-#{@element.page_yield_name}"
        }
        
        insert_options[:before] = "hy-id-#{@next.id}" if @next
        insert_options[:after] = "hy-id-#{@prev.id}" if not @next and @prev
      
        render :json => {
          :status => :ok,
          :dialog => :close,
          :insert => [insert_options]
        }
      else
        render :json => {
          :status => :failed, 
          :errors => @element.errors
        }
      end
    end
673025
@Override
    public final synchronized boolean addHost(Host host, boolean refresh) {
        // Already exists
        if (hosts.containsKey(host)) {
            // Check to see if we are adding token ranges or if the token ranges changed
            // which will force a rebuild of the token topology
            Host existingHost = hosts.get(host).getHost();
            if (existingHost.getTokenRanges().size() != host.getTokenRanges().size()) {
                existingHost.setTokenRanges(host.getTokenRanges());
                return true;
            }
            
            ArrayList<TokenRange> currentTokens = Lists.newArrayList(existingHost.getTokenRanges());
            ArrayList<TokenRange> newTokens     = Lists.newArrayList(host.getTokenRanges());
            Collections.sort(currentTokens, compareByStartToken);
            Collections.sort(newTokens,     compareByStartToken);
            for (int i = 0; i < currentTokens.size(); i++) {
                if (!currentTokens.get(i).getStartToken().equals(newTokens.get(i).getStartToken()) ||
                    !currentTokens.get(i).getEndToken().equals(newTokens.get(i).getEndToken())) {
                    return false;
                }
            }
            
            existingHost.setTokenRanges(host.getTokenRanges());
            return true;
        }
        else {
            HostConnectionPool<CL> pool = newHostConnectionPool(host, factory, config);
            if (null == hosts.putIfAbsent(host, pool)) {
                try {
                    monitor.onHostAdded(host, pool);
                    if (refresh) {
                        topology.addPool(pool);
                        rebuildPartitions();
                    }
                    pool.primeConnections(config.getInitConnsPerHost());
                }
                catch (Exception e) {
                    // Ignore, pool will have been marked down internally
                }
                return true;
            }
            else {
                return false;
            }
        }
    }
1358921
private function addHost()
    {
        $parsed = parse_url($this->encode_url($this->current_word));
        if (isset($this->host) || $parsed === false) {
            return;
        }
        $host = isset($parsed['host']) ? $parsed['host'] : $parsed['path'];
        if (!$this->isValidHostName($host)) {
            return;
        } elseif (isset($parsed['scheme']) && !$this->isValidScheme($parsed['scheme'])) {
            return;
        }
        $scheme = isset($parsed['scheme']) ? $parsed['scheme'] . '://' : '';
        $port = isset($parsed['port']) ? ':' . $parsed['port'] : '';
        if ($this->current_word == $scheme . $host . $port) {
            $this->host = $this->current_word;
        }
    }
895443
function isEditingHost(node) {
        return node &&
            ((node.nodeType == 9 && node.designMode == "on") ||
            (isEditableElement(node) && !isEditableElement(node.parentNode)));
    }
406134
function() {

            // creating template
            // <div class="gina-popins">
            //     <div class="gina-popins-overlay gina-popin-is-active"></div>
            // </div>
            var $container = document.createElement('div');
            $container.id = instance.id;
            $container.setAttribute('id', instance.id);
            $container.setAttribute('class', 'gina-popins');

            var $overlay = document.createElement('div');
            $overlay.setAttribute('id', 'gina-popins-overlay');
            $overlay.setAttribute('class', 'gina-popins-overlay');


            $container.appendChild( $overlay );

            // adding to DOM
            document.body.appendChild($container);

            instance.target     = $container;
            instance.on         = on;

            gina.popinContainer  = instance.id;
            gina.hasPopinHandler = true;
        }
1122610
function constructHostEntry(xmlElement) {
  var host = {
      scheme: DEFAULT_SCHEME,
      name: '',
      paths: []
    };
  var hostProperties = xmlElement['$'];

  if (hostProperties == null || hostProperties.length == 0) {
    return null;
  }

  // read host name
  host.name = hostProperties.name;

  // read scheme if defined
  if (hostProperties['scheme'] != null) {
    host.scheme = hostProperties.scheme;
  }

  // construct paths list, defined for the given host
  host.paths = constructPaths(xmlElement);

  return host;
}
758704
function getOrCreateContainerRef(di) {
    if (!di.viewContainerRef) {
        var vcRefHost = di.node;
        ngDevMode && assertNodeOfPossibleTypes(vcRefHost, 0 /* Container */, 3 /* Element */);
        var hostParent = getParentLNode(vcRefHost);
        var lContainer = createLContainer(hostParent, vcRefHost.view, true);
        var comment = vcRefHost.view[RENDERER].createComment(ngDevMode ? 'container' : '');
        var lContainerNode = createLNodeObject(0 /* Container */, vcRefHost.view, hostParent, comment, lContainer, null);
        appendChild(hostParent, comment, vcRefHost.view);
        if (vcRefHost.queries) {
            lContainerNode.queries = vcRefHost.queries.container();
        }
        var hostTNode = vcRefHost.tNode;
        if (!hostTNode.dynamicContainerNode) {
            hostTNode.dynamicContainerNode =
                createTNode(0 /* Container */, -1, null, null, hostTNode, null);
        }
        lContainerNode.tNode = hostTNode.dynamicContainerNode;
        vcRefHost.dynamicLContainerNode = lContainerNode;
        addToViewTree(vcRefHost.view, hostTNode.index, lContainer);
        di.viewContainerRef = new ViewContainerRef$1(lContainerNode);
    }
    return di.viewContainerRef;
}
233406
def _create_element(name, element_type, data, server=None):
    '''
    
    '''
    # Define property and id from name and properties + remove SaltStack parameters
    if 'properties' in data:
        data['property'] = ''
        for key, value in data['properties'].items():
            if not data['property']:
                data['property'] += '{0}={1}'.format(key, value.replace(':', '\\:'))
            else:
                data['property'] += ':{0}={1}'.format(key, value.replace(':', '\\:'))
        del data['properties']

    # Send request
    _api_post(element_type, _clean_data(data), server)
    return unquote(name)