Closed #16
This commit is contained in:
parent
078b95fc8e
commit
f71a4c6bbe
6 changed files with 55 additions and 25 deletions
52
init.php
52
init.php
|
@ -1,27 +1,53 @@
|
||||||
<?php
|
<?php
|
||||||
require_once 'src/core.php';
|
require_once 'src/core.php';
|
||||||
|
$config = configFactory();
|
||||||
|
$fontsPath = $config->main->mediaPath . DS . 'fonts' . DS;
|
||||||
|
$libPath = $config->main->mediaPath . DS . 'lib' . DS;
|
||||||
|
|
||||||
function download($source, $destination)
|
|
||||||
|
|
||||||
|
function download($source, $destination = null)
|
||||||
{
|
{
|
||||||
|
echo 'Downloading: ' . $source . '...' . PHP_EOL;
|
||||||
|
flush();
|
||||||
|
|
||||||
|
if ($destination !== null and file_exists($destination))
|
||||||
|
return file_get_contents($destination);
|
||||||
|
|
||||||
$content = file_get_contents($source);
|
$content = file_get_contents($source);
|
||||||
if (substr($destination, -1, 1) == '/')
|
if ($destination !== null)
|
||||||
$destination .= basename($source);
|
{
|
||||||
file_put_contents($destination, $content);
|
$dir = dirname($destination);
|
||||||
|
if (!file_exists($dir))
|
||||||
|
mkdir($dir, 0755, true);
|
||||||
|
|
||||||
|
file_put_contents($destination, $content);
|
||||||
|
}
|
||||||
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = configFactory();
|
|
||||||
$cssPath = $config->main->mediaPath . DS . 'css' . DS;
|
|
||||||
$jsPath = $config->main->mediaPath . DS . 'js' . DS;
|
|
||||||
$fontsPath = $config->main->mediaPath . DS . 'fonts' . DS;
|
|
||||||
|
|
||||||
//jQuery
|
//jQuery
|
||||||
download('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', $jsPath . 'jquery.min.js');
|
download('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', $libPath . 'jquery' . DS . 'jquery.min.js');
|
||||||
download('http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', $jsPath . 'jquery-ui.min.js');
|
|
||||||
download('http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/flick/jquery-ui.css', $cssPath . 'jquery-ui.css');
|
//jQuery UI
|
||||||
|
download('http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', $libPath . 'jquery-ui' . DS . 'jquery-ui.min.js');
|
||||||
|
$manifest = download('http://ajax.googleapis.com/ajax/libs/jqueryui/1/MANIFEST');
|
||||||
|
$lines = explode("\n", str_replace("\r", '', $manifest));
|
||||||
|
foreach ($lines as $line)
|
||||||
|
{
|
||||||
|
if (preg_match('/themes\/flick\/(.*?) /', $line, $matches))
|
||||||
|
{
|
||||||
|
$srcUrl = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1/' . $matches[0];
|
||||||
|
$dstUrl = $libPath . 'jquery-ui' . DS . $matches[1];
|
||||||
|
download($srcUrl, $dstUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//jQuery Tag-it!
|
//jQuery Tag-it!
|
||||||
download('http://raw.github.com/aehlke/tag-it/master/css/jquery.tagit.css', $cssPath . 'jquery.tagit.css');
|
download('http://raw.github.com/aehlke/tag-it/master/css/jquery.tagit.css', $libPath . 'tagit' . DS . 'jquery.tagit.css');
|
||||||
download('http://raw.github.com/aehlke/tag-it/master/js/tag-it.min.js', $jsPath . 'jquery.tagit.js');
|
download('http://raw.github.com/aehlke/tag-it/master/js/tag-it.min.js', $libPath . 'tagit' . DS . 'jquery.tagit.js');
|
||||||
|
|
||||||
//fonts
|
//fonts
|
||||||
download('http://googlefontdirectory.googlecode.com/hg/apache/droidsans/DroidSans.ttf', $fontsPath . 'DroidSans.ttf');
|
download('http://googlefontdirectory.googlecode.com/hg/apache/droidsans/DroidSans.ttf', $fontsPath . 'DroidSans.ttf');
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit b5876a672d107e4d6599cec52b9fa36e5558c16b
|
Subproject commit 898973195c1c6db2905cf2a52c80b0a8ba142058
|
7
public_html/media/.gitignore
vendored
7
public_html/media/.gitignore
vendored
|
@ -1,7 +0,0 @@
|
||||||
js/jquery.tagit.js
|
|
||||||
css/jquery.tagit.css
|
|
||||||
js/jquery.min.js
|
|
||||||
js/jquery-ui.min.js
|
|
||||||
css/jquery-ui.css
|
|
||||||
fonts/DroidSans-Bold.ttf
|
|
||||||
fonts/DroidSans.ttf
|
|
2
public_html/media/lib/.gitignore
vendored
Normal file
2
public_html/media/lib/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
*
|
||||||
|
!.gitignore
|
|
@ -28,8 +28,17 @@ class Bootstrap
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
$this->context->title = $this->config->main->title;
|
$this->context->title = $this->config->main->title;
|
||||||
$this->context->stylesheets = ['core.css', 'jquery-ui.css'];
|
$this->context->stylesheets =
|
||||||
$this->context->scripts = ['core.js','jquery.min.js','jquery-ui.min.js'];
|
[
|
||||||
|
'core.css',
|
||||||
|
'../lib/jquery-ui/jquery-ui.css'
|
||||||
|
];
|
||||||
|
$this->context->scripts =
|
||||||
|
[
|
||||||
|
'core.js',
|
||||||
|
'../lib/jquery/jquery.min.js',
|
||||||
|
'../lib/jquery-ui/jquery-ui.min.js'
|
||||||
|
];
|
||||||
|
|
||||||
$this->context->layoutName = isset($_GET['json'])
|
$this->context->layoutName = isset($_GET['json'])
|
||||||
? 'layout-json'
|
? 'layout-json'
|
||||||
|
|
|
@ -3,8 +3,8 @@ class PostController
|
||||||
{
|
{
|
||||||
public function workWrapper($callback)
|
public function workWrapper($callback)
|
||||||
{
|
{
|
||||||
$this->context->stylesheets []= 'jquery.tagit.css';
|
$this->context->stylesheets []= '../lib/tagit/jquery.tagit.css';
|
||||||
$this->context->scripts []= 'jquery.tagit.js';
|
$this->context->scripts []= '../lib/tagit/jquery.tagit.js';
|
||||||
$callback();
|
$callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue