load new nodes by ajax
966903
function (rel, url, $edge) {
      var that = this;
      var opts = this.options;
      $.ajax({ 'url': url, 'dataType': 'json' })
      .done(function (data) {
        if (that.$chart.data('inAjax')) {
          if (rel === 'parent') {
            if (!$.isEmptyObject(data)) {
              that.addParent($edge.parent(), data);
            }
          } else if (rel === 'children') {
            if (data.children.length) {
              that.addChildren($edge.parent(), data[rel]);
            }
          } else {
            that.addSiblings($edge.parent(), data.siblings ? data.siblings : data);
          }
        }
      })
      .fail(function () {
        console.log('Failed to get ' + rel + ' data');
      })
      .always(function () {
        that.endLoading($edge);
      });
    }
194546
function _onChildNodeCountUpdated(event, res) {
        // res = {nodeId, childNodeCount}
        if (res.nodeId > 0) {
            Inspector.DOM.requestChildNodes(res.nodeId);
        }
    }
821193
function(newnode, oldnode, ids) {
		var updates = [];
		var news = this._assistant.index(newnode.childNodes);
		var olds = this._assistant.index(oldnode.childNodes);
		/*
		 * Add elements?
		 */
		var child = newnode.lastElementChild,
			topid = this._assistant.id(oldnode),
			oldid = null,
			newid = null;
		while (child) {
			newid = this._assistant.id(child);
			if (!olds[newid]) {
				if (oldid) {
					updates.push(
						new edbml.InsertUpdate(this._doc).setup(oldid, child)
					);
				} else {
					updates.push(
						new edbml.AppendUpdate(this._doc).setup(topid, child)
					);
				}
			} else {
				oldid = newid;
			}
			child = child.previousElementSibling;
		}
		/*
		 * Remove elements?
		 */
		Object.keys(olds).forEach(function(id) {
			if (!news[id]) {
				updates.push(
					new edbml.RemoveUpdate(this._doc).setup(id)
				);
				updates.push(
					new edbml.FunctionUpdate(this._doc).setup(id)
				);
			} else { // note that crawling continues here...
				var n1 = news[id];
				var n2 = olds[id];
				this._scan(n1, n2, n1, id, ids);
			}
		}, this);
		/*
		 * Register updates
		 */
		updates.reverse().forEach(function(update) {
			this._updates.collect(update, ids);
		}, this);
	}
707574
protected function load()
    {
        $decoder = new JsonDecoder();

        $this->json = file_exists($this->path)
            ? (array) $decoder->decodeFile($this->path, $this->schemaPath)
            : array();

        if (isset($this->json['_order'])) {
            $this->json['_order'] = (array) $this->json['_order'];

            foreach ($this->json['_order'] as $path => $entries) {
                foreach ($entries as $key => $entry) {
                    $this->json['_order'][$path][$key] = (array) $entry;
                }
            }
        }

        // The root node always exists
        if (!isset($this->json['/'])) {
            $this->json['/'] = null;
        }

        // Make sure the JSON is sorted in reverse order
        krsort($this->json);
    }
185473
function(node) {
            var instance = this,
                mojitselectionCont = Y.one('.mojitselection'),
                mojitselectionButtons = mojitselectionCont.all('button'),
                containerselectionCont = Y.one('.containerselection'),
                containerselectionButtons = containerselectionCont.all('button');

            mojitselectionCont.delegate(
                'click',
                function(e) {
                    var btn = e.currentTarget;
                    mojitselectionButtons.removeClass(PURE_BUTTON_ACTIVE);
                    btn.addClass(PURE_BUTTON_ACTIVE);
                    instance.mojitname = btn.getAttribute('data-loadmojit');
                    instance.refreshCodedescription();
                },
                'button'
            );

            containerselectionCont.delegate(
                'click',
                function(e) {
                    var btn = e.currentTarget;
                    containerselectionButtons.removeClass(PURE_BUTTON_ACTIVE);
                    btn.addClass(PURE_BUTTON_ACTIVE);
                    instance.containername = btn.getAttribute('data-loadcontainer');
                    instance.refreshCodedescription();
                },
                'button'
            );

            Y.one('button.execute').on(
                'click',
                function() {
                    var node = Y.one(instance.containername);
                    node && node.loadMojit(instance.mojitname);
                }
            );

        }
603378
function () {
        var self = this;

        // Render any new items
        self.items().each(function (ctrl, index) {
          var containerElm;

          ctrl.parent(self);

          if (!ctrl.state.get('rendered')) {
            containerElm = self.getEl('body');

            // Insert or append the item
            if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
              $(containerElm.childNodes[index]).before(ctrl.renderHtml());
            } else {
              $(containerElm).append(ctrl.renderHtml());
            }

            ctrl.postRender();
            ReflowQueue.add(ctrl);
          }
        });

        self._layout.applyClasses(self.items().filter(':visible'));
        self._lastRect = null;

        return self;
      }
1104512
function loadJS(src, callback, attrs, timeout, fail, complete) {
    if ($.isObject(src)) {
        callback = src.callback;
        attrs = src.attrs;
        timeout = src.timeout;
        fail = src.fail;
        complete = src.complete;
        src = src.src;
        return loadJS(src, callback, attrs, timeout, fail, complete);
    }
    var script = document.createElement('script');
    var done = false;
    if ($.isObject(attrs)) {
        for (var i in attrs) {
            script.setAttribute(i, attrs[i]);
        }
    }
    var urls = getPath(src);
    src = script.src = urls[0];
    script.async = true;
    script.type = 'text/javascript';
    script.charset = defaultConfig.charset;
    complete = $.isFunction(complete) ? complete : emptyFn;
    script.onload = script.onreadystatechange = function(e) {
        e = e || cleanObj
        if (!done && (e.type === 'load' || /loaded|complete|undefined/.test(script.readyState))) {
            done = true;
            removeNode(script);
            mapLoaded[src] = 'loaded';
            $.isFunction(callback) && callback();
            complete('load');
        }
    };
    script.onerror = function() {
        done = true;
        mapLoaded[src] = 'error';
        $.isFunction(fail) && fail();
        complete('error');
    };
    timeout = $.isNumber(timeout) ? timeout : defaultConfig.timeout;
    if (timeout) {
        setTimeout(function() {
            if (!done) {
                done = true;
                mapLoaded[src] = 'timeout';
                complete('timeout');
            }
        }, timeout);
    }
    mapLoaded[src] = 'pending';
    head.insertBefore(script, base);
    return _;
}
442640
def _load_isense(self, tag):
        """"""
        isense = {}
        for child in tag:
            if child.tag in isense:
                isense[child.tag].update(child.attrib)
            else:
                isense[child.tag] = child.attrib

        self._vardict["isense"] = isense
545868
public void loadNewElementInfo(final AsyncCallback<Void> callback) {

        CmsRpcAction<List<CmsNewResourceInfo>> newResourceInfoAction = new CmsRpcAction<List<CmsNewResourceInfo>>() {

            @Override
            public void execute() {

                start(200, true);

                getService().getNewElementInfo(m_data.getRoot().getSitePath(), this);
            }

            @Override
            protected void onResponse(List<CmsNewResourceInfo> result) {

                stop(false);

                m_data.setNewElementInfos(result);
                if (callback != null) {
                    callback.onSuccess(null);
                }
            }

        };
        newResourceInfoAction.execute();
    }
363976
function loadJs(url, ignoreDuplicate, cb) {
        if (ignoreDuplicate && loadedRes[url]) {
            cb && cb();
            return;
        }
        if (ignoreDuplicate && loadingRes[url]) {
            loadingRes[url].push(cb);
            return;
        }
        loadingRes[url] = loadingRes[url] || [];
        var script = d.createElement('script');
        var loaded = false;
        var wrap = function () {
            if (loaded) {
                return;
            }
            loaded = true;
            loadedRes[url] = true;
            if (ignoreDuplicate) {
                for (var i = 0; i < loadingRes[url].length; i++) {
                    loadingRes[url][i] && loadingRes[url][i]();
                }
                loadingRes[url] = null;
            }
            cb && cb();
        };
        script.setAttribute('src', url);
        script.setAttribute('type', 'text/javascript');
        script.onload = script.onerror = wrap;
        script.onreadystatechange = wrap;
        head.appendChild(script);
    }
848836
async def addNodes(self, nodes):
        '''
        

        '''

        # First check that that user may add each form

        done = {}
        for node in nodes:

            formname = node[0][0]
            if done.get(formname):
                continue

            self._reqUserAllowed('node:add', formname)
            done[formname] = True

        async with await self.cell.snap(user=self.user) as snap:
            with s_provenance.claim('coreapi', meth='node:add', user=snap.user.iden):

                snap.strict = False

                async for node in snap.addNodes(nodes):

                    if node is not None:
                        node = node.pack()

                    yield node
1181536
function load() {
  if (!loaded) {
    var addons = [], skipped = [];

    // load addon modules
    api.require.forEach(['socketstream-*','socketstream.*'],function(mod,id) {
      if (typeof mod === 'function') {
        try {
          mod(api);
          addons.push(id);
        } catch(ex) {
          debug('Failed to load '+id+'. ',ex);
        }
      } else {
        skipped.push(id);
      }
    });
    debug('Addons: '+
      addons.length? addons.join(' + ') + ' Loaded. ':' None. '+
      skipped.length? skipped.join(' + ') + ' Skipped. ':'');

    // load assets in cache
    http.load();

    // Load Client Asset Manager
    client.load();

    // Load internal and project responders
    api.server.responders = exports.responders.load();

    api.server.eventTransport = publish.transport.load();

    // Extend the internal API with a publish object you can call from your own server-side code
    api.publish = publish.api(api.server.eventTransport);

    // Bind responders to websocket
    ws.load(api.server.responders, api.server.eventTransport);

    debug('API loaded.');
  }
  loaded = true;
}
468786
function(n){
    if(this.busy) return;
    this.busy = true;
    
    var that = this,
        config = this.config,
        graph = this.graph,
        clickedNode = n,
        previousClickedNode = this.clickedNode;

    var callback = {
      onComplete: function() {
        //ensure that nodes are shown for that level
        if(config.levelsToShow > 0) {
          that.geom.setRightLevelToShow(n);
        }
        //compute positions of newly inserted nodes
        if(config.request) that.compute();
        if(config.animate) {
          //fade nodes
          graph.nodeList.setDataset(['current', 'end'], {
            'alpha': [1, 0]
          });
          n.eachSubgraph(function(n) {
            n.setData('alpha', 1, 'end');
          }, "ignore");
          that.fx.animate({
            duration: 500,
            modes:['node-property:alpha'],
            onComplete: function() {
              //compute end positions
              that.clickedNode = clickedNode;
              that.compute('end');
              //animate positions
              //TODO(nico) commenting this line didn't seem to throw errors...
              that.clickedNode = previousClickedNode;
              that.fx.animate({
                modes:['linear', 'node-property:width:height'],
                duration: 1000,
                onComplete: function() { 
                  that.busy = false;
                  //TODO(nico) check comment above
                  that.clickedNode = clickedNode;
                }
              });
            }
          });
        } else {
          that.busy = false;
          that.clickedNode = n;
          that.refresh();
        }
      }
    };
    if(config.request) {
      this.requestNodes(clickedNode, callback);
    } else {
      callback.onComplete();
    }
  }
1000104
function loadChildNodes(parentNode){
    if (gNodesWithChildren[parentNode._id]){
        var children = [];
        for (var i = 0; i < gNodesWithChildren[parentNode._id].length; ++i){
            var currentNode = gNodesWithChildren[parentNode._id][i];
            children.push({
                _id : currentNode._id, //todo : id instead of name?
                node : currentNode,
                parent : parentNode._id, //todo id instead of name?
                childNodes : loadChildNodes(currentNode)
            });
        }
        return children;
    }
}
550110
public function loadJSON(string $jsonString):void {
		$json = json_decode($jsonString);

		foreach($json as $key => $value) {
			$node = $this->createElement($key, $value);
			$this->appendChild($node);
		}
	}
162325
def add(n)
      n[:name] = "#{n[:name]}(#{n[:attr]})" if n[:attr] && n[:name] != n[:attr]

      @nodes[n[:name]] = RailsApiDoc::Controller::Response::Param.new(n[:name], n[:attr], n[:nested])
    end
757431
function load(req, res, source) {
  this.spawn();
  this.reply(req, res);
  this.ps.send({event: 'load', source: source});
}