Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cecb97a

Browse files
author
tobiasz.cudnik
committed
1 parent 1162021 commit cecb97a

File tree

150 files changed

+8174
-33354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+8174
-33354
lines changed

Docs/api-docs.xml

Lines changed: 3780 additions & 0 deletions
Large diffs are not rendered by default.

Docs/docs-import.php

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<?php
2+
require_once('./phpQuery/phpQuery.php');
3+
//phpQuery::$debug = true;
4+
//die(file_get_contents('http://google.com/search?hl=pl&q=phpQuery&btnG=Szukaj+w+Google&lr='));
5+
//phpQuery::extend('WebBrowser');
6+
//phpQuery::$ajaxAllowedHosts[] = 'http://jquery-api-browser.googlecode.com';
7+
//
8+
//phpQuery::$plugins->browserGet('http://jquery-api-browser.googlecode.com/svn/trunk/api-docs.xml', 'success');
9+
phpQuery::browserGet('http://jquery-api-browser.googlecode.com/svn/trunk/api-docs.xml', 'success');
10+
/**
11+
* @param phpQueryObject $pq
12+
*/
13+
function success($pq) {
14+
switch($_GET['page']) {
15+
case 'selectors':
16+
case 1:
17+
$categories = $pq->find('cat[value=Selectors] subcat');
18+
$content = array();
19+
// $content[] = "==Selectors==";
20+
$content[] = "In *phpQuery*, as in *jQuery*, supported are following *CSS3* selectors.";
21+
foreach($categories as $subcat) {
22+
$content[] = '===='.pq($subcat)->attr('value')."====";
23+
foreach(pq($subcat)->find('selector') as $selector)
24+
$content[] = '&nbsp;*&nbsp;*`'.pq('sample', $selector)->text().'`* '.pq('> desc', $selector)->text();
25+
}
26+
$content[] = '';
27+
$content[] = "Read more at [http://docs.jquery.com/Selectors Selectors section] on [http://docs.jquery.com/ jQuery Documentation Site].";
28+
break;
29+
case 'Attribues':
30+
case 2:
31+
$categories = $pq->find('cat[value=Attributes] subcat');
32+
$content = array();
33+
// $content[] = "==Attributes==";
34+
$content[] = "Attributes related methods.";
35+
foreach($categories as $subcat) {
36+
$content[] = '===='.pq($subcat)->attr('value')."====";
37+
foreach(pq($subcat)->find('function') as $function) {
38+
$tmp = '&nbsp;*&nbsp;*`'.pq($function)->attr('name').'(';
39+
foreach(pq($function)->find('params') as $params) {
40+
$tmp .= '$'.pq($params)->attr('name');
41+
if (pq($params)->nextAll('params')->length)
42+
$tmp .= ', ';
43+
}
44+
$tmp .= ')`* '.pq('> desc', $function)->text();
45+
$content[] = $tmp;
46+
}
47+
}
48+
$content[] = '';
49+
$content[] = "Read more at [http://docs.jquery.com/Attributes Attributes section] on [http://docs.jquery.com/ jQuery Documentation Site].";
50+
break;
51+
case 'Traversing':
52+
case 3:
53+
$categories = $pq->find('cat[value=Traversing] subcat');
54+
$content = array();
55+
// $content[] = "==Attributes==";
56+
$content[] = "Traversing related methods.";
57+
foreach($categories as $subcat) {
58+
$content[] = '===='.pq($subcat)->attr('value')."====";
59+
foreach(pq($subcat)->find('function') as $function) {
60+
$tmp = '&nbsp;*&nbsp;*`'.pq($function)->attr('name').'(';
61+
foreach(pq($function)->find('params') as $params) {
62+
$tmp .= '$'.pq($params)->attr('name');
63+
if (pq($params)->nextAll('params')->length)
64+
$tmp .= ', ';
65+
}
66+
$tmp .= ')`* '.pq('> desc', $function)->text();
67+
$content[] = $tmp;
68+
}
69+
}
70+
$content[] = '';
71+
$content[] = "Read more at [http://docs.jquery.com/Traversing Traversing section] on [http://docs.jquery.com/ jQuery Documentation Site].";
72+
break;
73+
case 'Manipulation':
74+
case 4:
75+
$categories = $pq->find('cat[value=Manipulation] subcat');
76+
$content = array();
77+
// $content[] = "==Attributes==";
78+
$content[] = "Manipulatin related methods.";
79+
foreach($categories as $subcat) {
80+
$content[] = '===='.pq($subcat)->attr('value')."====";
81+
foreach(pq($subcat)->find('function') as $function) {
82+
$tmp = '&nbsp;*&nbsp;*`'.pq($function)->attr('name').'(';
83+
foreach(pq($function)->find('params') as $params) {
84+
$tmp .= '$'.pq($params)->attr('name');
85+
if (pq($params)->nextAll('params')->length)
86+
$tmp .= ', ';
87+
}
88+
$tmp .= ')`* '.pq('> desc', $function)->text();
89+
$content[] = $tmp;
90+
}
91+
}
92+
$content[] = '';
93+
$content[] = "Read more at [http://docs.jquery.com/Manipulation Manipulation section] on [http://docs.jquery.com/ jQuery Documentation Site].";
94+
break;
95+
case 'Events':
96+
case 5:
97+
$categories = $pq->find('cat[value=Events] subcat');
98+
$content = array();
99+
// $content[] = "==Attributes==";
100+
$content[] = "Events related methods.";
101+
foreach($categories as $subcat) {
102+
$content[] = '===='.pq($subcat)->attr('value')."====";
103+
foreach(pq($subcat)->find('function') as $function) {
104+
$tmp = '&nbsp;*&nbsp;*`'.pq($function)->attr('name').'(';
105+
foreach(pq($function)->find('params') as $params) {
106+
$tmp .= '$'.pq($params)->attr('name');
107+
if (pq($params)->nextAll('params')->length)
108+
$tmp .= ', ';
109+
}
110+
$tmp .= ')`* '.pq('> desc', $function)->text();
111+
$content[] = $tmp;
112+
}
113+
}
114+
$content[] = '';
115+
$content[] = "Read more at [http://docs.jquery.com/Events Events section] on [http://docs.jquery.com/ jQuery Documentation Site].";
116+
break;
117+
case 'Ajax':
118+
case 6:
119+
$categories = $pq->find('cat[value=Ajax] subcat');
120+
$content = array();
121+
// $content[] = "==Attributes==";
122+
$content[] = "Ajax related methods.";
123+
foreach($categories as $subcat) {
124+
$content[] = '===='.pq($subcat)->attr('value')."====";
125+
foreach(pq($subcat)->find('function') as $function) {
126+
$tmp = '&nbsp;*&nbsp;*`'.str_replace('jQuery.', 'phpQuery::', pq($function)->attr('name')).'(';
127+
foreach(pq($function)->find('params') as $params) {
128+
$tmp .= '$'.pq($params)->attr('name');
129+
if (pq($params)->nextAll('params')->length)
130+
$tmp .= ', ';
131+
}
132+
$tmp .= ')`* '.pq('> desc', $function)->text();
133+
$content[] = $tmp;
134+
}
135+
}
136+
$content[] = '====Options====';
137+
foreach($pq->find('cat[value=Ajax] subcat:first function:first option') as $option) {
138+
$content[] = '&nbsp;*&nbsp;*`'.pq($option)->attr('name').'`* `'.pq($option)->attr('type').'`';
139+
}
140+
$content[] = '';
141+
$content[] = "Read more at [http://docs.jquery.com/Ajax Ajax section] on [http://docs.jquery.com/ jQuery Documentation Site].";
142+
break;
143+
case 'Utilities':
144+
case 7:
145+
$categories = $pq->find('cat[value=Utilities] subcat');
146+
$content = array();
147+
// $content[] = "==Attributes==";
148+
$content[] = "Some handy functions.";
149+
foreach($categories as $subcat) {
150+
$content[] = '===='.pq($subcat)->attr('value')."====";
151+
foreach(pq($subcat)->find('function') as $function) {
152+
$tmp = '&nbsp;*&nbsp;*`'.str_replace('jQuery.', 'phpQuery::', pq($function)->attr('name')).'(';
153+
foreach(pq($function)->find('params') as $params) {
154+
$tmp .= '$'.pq($params)->attr('name');
155+
if (pq($params)->nextAll('params')->length)
156+
$tmp .= ', ';
157+
}
158+
$tmp .= ')`* '.pq('> desc', $function)->text();
159+
$content[] = $tmp;
160+
}
161+
}
162+
$content[] = '';
163+
$content[] = "Read more at [http://docs.jquery.com/Utilities Utilities section] on [http://docs.jquery.com/ jQuery Documentation Site].";
164+
break;
165+
}
166+
print implode("<br />\n", $content);
167+
}
168+
?>

SlickSpeed/run.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
include('../phpQuery/phpQuery.php');
3+
$selectors = array(
4+
'*','div div','div > div','div + div','div ~ div','div[class^=dia][class$=log]','body','body div','div','div div div','div, div, div','div, a, span','.dialog','div.dialog','div .dialog','div.character, div.dialog','#speech5','div#speech5','div #speech5','div.scene div.dialog','div#scene1 div.dialog div','#scene1 #speech1','div[%class]','div[%class=dialog]','div[%class^=dia]','div[%class$=log]','div[%class*=sce]','div[%class|=dialog]','div[%class!=madeup]','div[%class~=dialog]','div:only-child','div:contains(CELIA)','div:nth-child(even)','div:nth-child(2n)','div:nth-child(odd)','div:nth-child(2n+1)','div:nth-child(n)','div:last-child','div:first-child'
5+
);
6+
phpQuery('source_test.html');
7+
foreach($selectors as $query) {
8+
$query = str_replace('[%', '[', $query);
9+
$start = explode(' ', microtime());
10+
$result = phpQuery($query);
11+
$end = explode(' ', microtime());
12+
$time = ($end[1]-$start[1]) + ($end[0]-$start[0]);
13+
print "<p><strong>{$query}</strong>: {$time} | ".$result->length()." found</p>\n";
14+
flush();
15+
}
16+
?>

0 commit comments

Comments
 (0)