Skip to content
Browse files

Update to jQuery 1.7.2 and jQ-UI 1.8.18

Sumh <42424861@qq.com>
  • Loading branch information...
1 parent 1ce44c8 commit f20c3fa1c214f4442e373a674fe2f1bd7ad070d6 Sumh committed
Showing with 14 additions and 6 deletions.
  1. +14 −6 classes/controller/jqdoc.php
  2. BIN jQuery-UI-Reference-1.7.chm
View
20 classes/controller/jqdoc.php
@@ -18,8 +18,7 @@ public function before()
$config = Kohana::config('jqdoc.default');
echo '<ol><li>Loading jQuery API raw xml</li>';
-
- $xml = file_get_contents($config['raw-xml-uri']);
+ $xml = static::get($config['raw-xml-uri']);
echo '<li>API raw xml has been loaded</li>';
@@ -51,7 +50,7 @@ public function before()
if( ! is_file($config['doc-dir'].'jquery.min.js'))
{
- $jquery = file_get_contents('https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
+ $jquery = static::get('https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
file_put_contents($config['doc-dir'].'jquery.min.js', $jquery);
}
@@ -65,7 +64,7 @@ public function before()
is_dir($this->docroot.'ui') OR mkdir($this->docroot.'ui', 0600, TRUE);
echo '<li>Loading jQuery Types</li>';
- $types = file_get_contents('http://docs.jquery.com/action/render/Types');
+ $types = static::get('http://docs.jquery.com/action/render/Types');
$types = str_replace('<pre>', '<pre class="sunlight-highlight-javascript">', $types);
file_put_contents($this->docroot.'Types.htm', strtr($this->template, array(
'{{path}}' => '',
@@ -591,7 +590,7 @@ protected function load_ui($path, array $components)
is_dir($path.$name) OR mkdir($path.$name, 0600, TRUE);
foreach($component as $c)
{
- $ui = file_get_contents("$uri/$c");
+ $ui = static::get("$uri/$c");
$ui = str_replace(array(
'<pre>&lt;!DOCTYPE',
'<pre><code>',
@@ -613,7 +612,7 @@ protected function load_ui($path, array $components)
}
if($name === 'Effects')
{
- $ui = file_get_contents("$uri");
+ $ui = static::get("$uri");
file_put_contents("{$path}{$name}.htm", strtr($this->template, array(
'{{path}}' => '../',
'{{title}}' => $name,
@@ -625,4 +624,13 @@ protected function load_ui($path, array $components)
}
}
+ public static function get($url)
+ {
+ $ch = curl_init();
+ curl_setopt ($ch, CURLOPT_URL, $url);
+ curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT,10);
+ return curl_exec($ch);
+ }
+
} // End Jqdoc
View
BIN jQuery-UI-Reference-1.7.chm
Binary file not shown.

0 comments on commit f20c3fa

Please sign in to comment.
Something went wrong with that request. Please try again.