Lines Matching refs:node

590             foreach($source as $node)
591 $return[] = $this->document->importNode($node, true);
626 foreach($nodes as $node)
627 $fake->root->appendChild($node);
713 foreach($nodes as $i => $node)
714 if ($node->isSameNode($this->root)) {
717 + phpQuery::DOMNodeListToArray($node->childNodes)
724 foreach($nodes as $node)
725 $markup .= $this->document->saveXML($node);
729 foreach($nodes as $node) {
730 if ($node->childNodes)
731 foreach($node->childNodes as $child)
734 $loop[] = $node;
827 public static function trigger($document, $type, $data = array(), $node = null) { argument
835 if (! $node) {
846 $event->target = $node;
851 'target' => $node,
856 while($node) {
860 $event->currentTarget = $node;
861 $eventNode = self::getNode($documentID, $node);
889 $node = $node->parentNode;
907 public static function add($document, $node, $type, $data, $callback = null) { argument
914 $eventNode = self::getNode($documentID, $node);
916 $eventNode = self::setNode($documentID, $node);
934 public static function remove($document, $node, $type = null, $callback = null) { argument
936 $eventNode = self::getNode($documentID, $node);
947 protected static function getNode($documentID, $node) { argument
949 if ($node->isSameNode($eventNode))
953 protected static function setNode($documentID, $node) { argument
954 phpQuery::$documents[$documentID]->eventsNodes[] = $node;
1248 protected function isRoot( $node) { argument
1250 return $node instanceof DOMDOCUMENT
1251 || ($node instanceof DOMELEMENT && $node->tagName == 'html')
1252 || $this->root->isSameNode($node);
1687 * @param unknown_type $node
1691 protected function matchClasses($class, $node) { argument
1696 $nodeClasses = explode(' ', $node->getAttribute('class') );
1714 explode(' ', $node->getAttribute('class') )
1759 foreach($nodes as $node) {
1763 … $this->debug("Found: ".$this->whois( $node ).", comparing with {$compare}()")
1768 if (call_user_func_array(array($this, $compare), array($selector, $node)))
1776 $debug[] = $this->whois( $node );
1777 $stack[] = $node;
1905 foreach($subElements as $node) {
1907 $test = $node->nextSibling;
1946 foreach($this->elements as $node)
1947 if (! $this->elementsContainsNode($node, $stack))
1948 $stack[] = $node;
1969 foreach($this->elements as $i => $node) {
1971 $stack[] = $node;
1973 $stack[] = $node;
2008 foreach($this->elements as $node) {
2009 if (mb_stripos($node->textContent, $text) === false)
2011 $stack[] = $node;
2076 function ($node) {
2077 return $node instanceof DOMELEMENT && $node->childNodes->length
2078 ? $node : null;
2084 function ($node) {
2085 return $node instanceof DOMELEMENT && $node->childNodes->length
2086 ? null : $node;
2100 function ($node) {
2101 return pq($node)->not(":disabled") ? $node : null;
2107 function ($node) {
2108 $isHeader = isset($node->tagName) && in_array($node->tagName, array(
2112 ? $node
2131 function ($node) {
2132 return pq($node)->siblings()->size() == 0 ? $node : null;
2138 function ($node) {
2139 return pq($node)->prevAll()->size() == 0 ? $node : null;
2145 function ($node) {
2146 return pq($node)->nextAll()->size() == 0 ? $node : null;
2160 function ($node, $param) {
2161 $index = pq($node)->prevAll()->size() + 1;
2163 return $node;
2165 return $node;
2173 function ($node, $param) {
2174 $prevs = pq($node)->prevAll()->size();
2184 ? $node
2188 ? $node
2192 ? $node
2197 ? $node
2214 function ($node, $index) {
2215 $prevs = pq($node)->prevAll()->size();
2217 return $node;
2219 return $node;
2276 foreach($this->elements as $index => $node) {
2277 $result = phpQuery::callbackRun($callback, array($index, $node));
2279 $newStack[] = $node;
2311 foreach($this->stack() as $node) {
2314 if (!($node instanceof DOMELEMENT)) {
2320 if ($attr == 'nodeType' && $node->nodeType != $val)
2329 if ( $node->getAttribute('id') != substr($s, 1) )
2333 if (! $this->matchClasses( $s, $node ) )
2343 if ($val != $node->nodeType)
2366 ? mb_ereg_match($pattern, $node->getAttribute($attr))
2367 : preg_match("@{$pattern}@", $node->getAttribute($attr));
2370 } else if ($node->getAttribute($attr) != $val)
2372 } else if (! $node->hasAttribute($attr))
2381 if (isset($node->tagName)) {
2382 if ($node->tagName != $s)
2384 } else if ($s == 'html' && ! $this->isRoot($node))
2398 $stack[] = $node;
2407 foreach($this->elements as $node)
2410 $finalStack[] = $node;
2475 foreach($this->stack(1) as $node) {
2476 phpQuery::pq($node, $this->getDocumentID())
2515 foreach($this->elements as $node)
2516 phpQueryEvents::trigger($this->getDocumentID(), $type, $data, $node);
2547 foreach($this->elements as $node)
2548 phpQueryEvents::add($this->getDocumentID(), $node, $type, $data, $callback);
2561 foreach($this->elements as $node)
2562 phpQueryEvents::remove($this->getDocumentID(), $node, $type, $callback);
2634 public function ___wrapAllCallback($node) { argument
2635 $deepest = $node;
2663 foreach($this->stack() as $node)
2664 phpQuery::pq($node, $this->getDocumentID())->wrapAll($wrapper);
2674 foreach($this->stack() as $node)
2675 phpQuery::pq($node, $this->getDocumentID())->wrapAllPHP($codeBefore, $codeAfter);
2685 foreach($this->stack() as $node)
2686 phpQuery::pq($node, $this->getDocumentID())->contents()->wrapAll($wrapper);
2696 foreach($this->stack(1) as $node)
2697 phpQuery::pq($node, $this->getDocumentID())->contents()
2713 foreach($el->childNodes as $node) {
2714 $stack[] = $node;
2727 foreach($this->stack(1) as $node) {
2728 if (! $node->parentNode )
2732 foreach($node->childNodes as $chNode )
2736 $node->parentNode->insertBefore($chNode, $node);
2737 $node->parentNode->removeChild($node);
2749 foreach($this->stack(1) as $node) {
2750 pq($node)
2816 foreach($this->elements as $node) {
2817 $newStack[] = $node->cloneNode(true);
2848 foreach(phpQuery::pq($selector, $this->getDocumentID()) as $node)
2849 phpQuery::pq($node, $this->getDocumentID())
2863 foreach($loop as $node) {
2864 if (! $node->parentNode )
2866 if (isset($node->tagName))
2867 $this->debug("Removing '{$node->tagName}'");
2868 $node->parentNode->removeChild($node);
2871 'target' => $node,
2875 $event->type, array($event), $node
2880 protected function markupEvents($newMarkup, $oldMarkup, $node) { argument
2881 if ($node->tagName == 'textarea' && $newMarkup != $oldMarkup) {
2883 'target' => $node,
2887 $event->type, array($event), $node
2930 foreach($this->stack(1) as $alreadyAdded => $node) {
2932 if (($this->isXHTML() || $this->isHTML()) && $node->tagName == 'textarea')
2933 $oldHtml = pq($node, $this->getDocumentID())->markup();
2935 $node->appendChild($alreadyAdded
2941 if (($this->isXHTML() || $this->isHTML()) && $node->tagName == 'textarea')
2942 $this->markupEvents($html, $oldHtml, $node);
3023 foreach($this->stack(1) as $node) {
3025 foreach($node->childNodes as $newNode) {
3323 foreach($this->newInstance() as $k => $node) {
3324 if ($node->isSameNode($subject))
3373 foreach($this->elements as $node) {
3374 $text = $node->textContent;
3493 foreach($this->stack() as $node) {
3494 $test = $node;
3523 foreach($siblings as $node) {
3524 if (! $this->elementsContainsNode($node, $stack))
3525 $stack[] = $node;
3541 foreach($this->stack() as $node) {
3545 if ($notNode->isSameNode($node))
3549 $stack[] = $node;
3551 if (! $selector->isSameNode($node))
3552 $stack[] = $node;
3555 $stack[] = $node;
3568 foreach($orgStack as $node)
3569 if (! $this->elementsContainsNode($node, $matched))
3570 $stack[] = $node;
3606 foreach($loop as $node) {
3607 if ( $node->isSameNode( $nodeToCheck ) )
3619 foreach($this->elements as $node )
3620 if ( $node->parentNode && ! $this->elementsContainsNode($node->parentNode, $stack) )
3621 $stack[] = $node->parentNode;
3637 foreach($this->elements as $node) {
3638 $test = $node;
3666 foreach($this->elements as $node) {
3667 if (in_array($node->nodeType, $nodeTypes))
3668 $return[] = $node;
3673 protected function attrEvents($attr, $oldAttr, $oldValue, $node) { argument
3679 $isInputValue = $node->tagName == 'input'
3681 in_array($node->getAttribute('type'),
3683 || !$node->getAttribute('type')
3685 $isRadio = $node->tagName == 'input'
3686 && $node->getAttribute('type') == 'radio';
3687 $isCheckbox = $node->tagName == 'input'
3688 && $node->getAttribute('type') == 'checkbox';
3689 $isOption = $node->tagName == 'option';
3690 if ($isInputValue && $attr == 'value' && $oldValue != $node->getAttribute($attr)) {
3692 'target' => $node,
3697 (! $oldAttr && $node->hasAttribute($attr))
3699 || (! $node->hasAttribute($attr) && $oldAttr)
3702 'target' => $node,
3705 } else if ($isOption && $node->parentNode && $attr == 'selected' && (
3707 (! $oldAttr && $node->hasAttribute($attr))
3709 || (! $node->hasAttribute($attr) && $oldAttr)
3712 'target' => $node->parentNode,
3718 $event->type, array($event), $node
3723 foreach($this->stack(1) as $node) {
3726 ? $this->getNodeAttrs($node)
3729 $oldValue = $node->getAttribute($a);
3730 $oldAttr = $node->hasAttribute($a);
3733 @$node->setAttribute($a, $value);
3734 $this->attrEvents($a, $oldAttr, $oldValue, $node);
3739 foreach($node->attributes as $n => $v)
3743 return $node->hasAttribute($attr)
3744 ? $node->getAttribute($attr)
3753 protected function getNodeAttrs($node) { argument
3755 foreach($node->attributes as $n => $o)
3773 foreach($this->stack(1) as $node) {
3776 $node->setAttribute($attr, $value);
3782 foreach($node->attributes as $n => $v)
3786 return $node->getAttribute($attr);
3796 foreach($this->stack(1) as $node) {
3798 ? $this->getNodeAttrs($node)
3801 $oldValue = $node->getAttribute($a);
3802 $node->removeAttribute($a);
3803 $this->attrEvents($a, $oldValue, null, $node);
3827 foreach($this->stack(1) as $node) {
3828 $node = pq($node, $this->getDocumentID());
3829 if (is_array($val) && in_array($node->attr('type'), array('checkbox', 'radio'))) {
3830 $isChecked = in_array($node->attr('value'), $val)
3831 || in_array($node->attr('name'), $val);
3833 $node->attr('checked', 'checked');
3835 $node->removeAttr('checked');
3836 } else if ($node->get(0)->tagName == 'select') {
3845 foreach($node['option']->stack(1) as $option) {
3866 } else if ($node->get(0)->tagName == 'textarea')
3867 $node->markup($val);
3869 $node->attr('value', $val);
3892 foreach($this->stack(1) as $node) {
3893 if (! $this->is(".$className", $node))
3894 $node->setAttribute(
3896 trim($node->getAttribute('class').' '.$className)
3907 foreach($this->stack(1) as $node) {
3908 $classes = $node->getAttribute('class');
3912 $node->setAttribute('class', $newValue);
3923 foreach($this->stack(1) as $node) {
3924 if ( $this->is(".$className", $node))
3935 foreach($this->stack(1) as $node) {
3936 $classes = explode( ' ', $node->getAttribute('class'));
3940 $node->setAttribute('class', implode(' ', $classes));
3942 $node->removeAttribute('class');
3953 foreach($this->stack(1) as $node) {
3954 if ( $this->is( $node, '.'.$className ))
3979 foreach($this->stack(1) as $node) {
3981 $node->nodeValue = '';
4048 foreach($this as $node)
4049 phpQuery::data($node, $key, $value, $this->getDocumentID());
4059 foreach($this as $node)
4060 phpQuery::removeData($node, $key, $this->getDocumentID());
4168 foreach($loop as $node) {
4169 if ($node instanceof DOMDOCUMENT) {
4174 while(! ($node instanceof DOMDOCUMENT)) {
4176 $sibling = $node;
4180 if ($isElement && $sibling->tagName == $node->tagName)
4184 ? "*[local-name()='{$node->tagName}'][{$i}]"
4185 : "{$node->tagName}[{$i}]";
4186 $node = $node->parentNode;
4201 foreach($loop as $node) {
4202 if (isset($node->tagName)) {
4203 $tag = in_array($node->tagName, array('php', 'js'))
4204 ? strtoupper($node->tagName)
4205 : $node->tagName;
4207 .($node->getAttribute('id')
4208 ? '#'.$node->getAttribute('id'):'')
4209 .($node->getAttribute('class')
4210 ? '.'.join('.', explode(' ', $node->getAttribute('class'))):'')
4211 .($node->getAttribute('name')
4212 ? '[name="'.$node->getAttribute('name').'"]':'')
4213 … .($node->getAttribute('value') && strpos($node->getAttribute('value'), '<'.'?php') === false
4214 … ? '[value="'.substr(str_replace("\n", '', $node->getAttribute('value')), 0, 15).'"]':'')
4215 … .($node->getAttribute('value') && strpos($node->getAttribute('value'), '<'.'?php') !== false
4217 .($node->getAttribute('selected')
4219 .($node->getAttribute('checked')
4222 } else if ($node instanceof DOMTEXT) {
4223 if (trim($node->textContent))
4224 $return[] = 'Text:'.substr(str_replace("\n", ' ', $node->textContent), 0, 15);
4270 foreach($this->stack() as $node)
4271 $output .= $this->dumpTreeInternal($node);
4278 private function dumpTreeInternal($node, $intend = 0) { argument
4279 $whois = $this->whois($node);
4283 if (isset($node->childNodes))
4284 foreach($node->childNodes as $chNode)
4547 foreach($arg1->elements as $node)
4548 $phpQuery->elements[] = $phpQuery->document->importNode($node, true);
4559 foreach($arg1 as $node) {
4560 $sameDocument = $node->ownerDocument instanceof DOMDOCUMENT
4561 && ! $node->ownerDocument->isSameNode($phpQuery->document);
4563 ? $phpQuery->document->importNode($node, true)
4564 : $node;
4587 foreach($context as $node)
4588 $phpQuery->elements[] = $node;
4997 foreach($DOMNodeList as $node)
4998 $array[] = $node;
5467 foreach($two->elements as $node) {
5470 if ($node2->isSameNode($node))
5474 $elements[] = $node;
5591 protected static function dataSetupNode($node, $documentID) { argument
5594 if ($node->isSameNode($dataNode))
5598 phpQuery::$documents[$documentID]->dataNodes[] = $node;
5599 return $node;
5601 protected static function dataRemoveNode($node, $documentID) { argument
5604 if ($node->isSameNode($dataNode)) {
5610 public static function data($node, $name, $data, $documentID = null) { argument
5613 $documentID = self::getDocumentID($node);
5615 $node = self::dataSetupNode($node, $documentID);
5616 if (! isset($node->dataID))
5617 $node->dataID = ++phpQuery::$documents[$documentID]->uuid;
5618 $id = $node->dataID;
5629 public static function removeData($node, $name, $documentID) { argument
5632 $documentID = self::getDocumentID($node);
5634 $node = self::dataSetupNode($node, $documentID);
5635 $id = $node->dataID;
5643 self::removeData($node, $name, $documentID);
5645 self::dataRemoveNode($node, $documentID);