Init ci
|
@ -0,0 +1,8 @@
|
|||
Options +Indexes +FollowSymLinks
|
||||
RewriteEngine On
|
||||
|
||||
# Susanna's proxy
|
||||
RewriteRule ^(Artist|album|loadtrack)/$ http://susanna:3000/$1/ [P]
|
||||
RewriteRule ^(Artist|album|loadtrack)/([a-z]+)/$ http://susanna:3000/$1/$2/ [P]
|
||||
RewriteRule ^(Artist|album|loadtrack)/([a-z]+)/([a-z0-9-\+]+)(/|\.html)?$ http://susanna:3000/$1/$2/$3/ [P]
|
||||
RewriteRule ^$ http://susanna:3000/ [P]
|
|
@ -0,0 +1,5 @@
|
|||
D
|
||||
RewriteRule ^(artist|album|loadtrack)/([a-z]+)/$ ror_proxy.php?controller=$1&action=$2
|
||||
RewriteRule ^(artist|album|loadtrack)/([a-z]+)/([a-z0-9-\+]+)(/|\.html)?$ ror_proxy.php?controller=$1&action=$2&id=$3
|
||||
|
||||
RewriteRule ^$ ror_proxy.php
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
class Musicbrainz_ArtistModel extends Model {
|
||||
|
||||
public function getId($name) {
|
||||
$artist_info = $this->db->getRows($this->db->q('SELECT * FROM musicbrainz.bh_artist WHERE name = \''. $name .'\''));
|
||||
if ($artist_info) {
|
||||
$ids = array();
|
||||
foreach ($artist_info as $item) {
|
||||
if ($item['id'] == $artist_info[0]['id']) {
|
||||
$ids[] = $item['credit_id'];
|
||||
}
|
||||
return $ids;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
class Musicbrainz_ReleaseModel extends Model {
|
||||
|
||||
public function getReleases($release_groups, $group_by_release = false, $only_official = false) {
|
||||
if (!is_array($release_groups)) {
|
||||
$release_groups = array($release_groups);
|
||||
}
|
||||
|
||||
$releases = $this->db->getRows(
|
||||
$this->db->q('
|
||||
SELECT *
|
||||
FROM musicbrainz.bh_release
|
||||
WHERE
|
||||
release_group IN (\''. implode('\',\'', $release_groups) .'\')
|
||||
'. ($only_official ? 'AND type = 1' : 'AND type IS NOT NULL') .'
|
||||
ORDER BY
|
||||
date ASC,
|
||||
id ASC
|
||||
'),
|
||||
'id'
|
||||
);
|
||||
|
||||
if ($group_by_release) {
|
||||
$g_releases = array();
|
||||
foreach ($releases as $release) {
|
||||
if (!isset($g_releases[$release['release_group']])) {
|
||||
$g_releases[$release['release_group']] = array();
|
||||
}
|
||||
$g_releases[$release['release_group']][$release['id']] = $release;
|
||||
}
|
||||
return $g_releases;
|
||||
} else {
|
||||
return $releases;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
class Musicbrainz_ReleaseGroupModel extends Model {
|
||||
|
||||
public function getArtistAlbums($artist_ids) {
|
||||
return $this->db->getRows(
|
||||
$this->db->q('
|
||||
SELECT *
|
||||
FROM musicbrainz.bh_release_group
|
||||
WHERE
|
||||
artist_id IN (\''. implode('\',\'', $artist_ids) .'\') AND
|
||||
type = 1
|
||||
ORDER BY
|
||||
year ASC,
|
||||
id ASC
|
||||
'),
|
||||
'id'
|
||||
);
|
||||
}
|
||||
|
||||
public function getArtistAlbumsIds($artist_id) {
|
||||
return array_keys($this->db->getRows(
|
||||
$this->db->q('
|
||||
SELECT id
|
||||
FROM musicbrainz.bh_release_group
|
||||
WHERE
|
||||
artist_id = \''. $artist_id .'\' AND
|
||||
type = 1
|
||||
ORDER BY
|
||||
year ASC,
|
||||
id ASC
|
||||
'),
|
||||
'id'
|
||||
));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
class Musicbrainz_TrackModel extends Model {
|
||||
|
||||
private $_bad_track_names = array(
|
||||
'[silence]'
|
||||
);
|
||||
|
||||
public function getReleaseTracks($releases_ids, $group_by_release = false) {
|
||||
if (!is_array($releases_ids)) {
|
||||
$releases_ids = array($releases_ids);
|
||||
}
|
||||
|
||||
$tracks = $this->db->getRows(
|
||||
$this->db->q('
|
||||
SELECT *
|
||||
FROM musicbrainz.bh_track
|
||||
WHERE
|
||||
release_id IN (\''. implode('\',\'', $releases_ids) .'\')
|
||||
ORDER BY
|
||||
release_id ASC,
|
||||
position ASC
|
||||
'),
|
||||
'id'
|
||||
);
|
||||
|
||||
foreach ($tracks as $track_id => $track_info) {
|
||||
// Конвертируем миллисекунды в секунды
|
||||
$tracks[$track_id]['length'] = round($track_info['length'] / 1000);
|
||||
}
|
||||
|
||||
if ($group_by_release) {
|
||||
$g_tracks = array();
|
||||
foreach ($tracks as $track) {
|
||||
if (!isset($g_tracks[$track['release_id']])) {
|
||||
$g_tracks[$track['release_id']] = array();
|
||||
}
|
||||
$g_tracks[$track['release_id']][$track['id']] = $track;
|
||||
}
|
||||
return $g_tracks;
|
||||
} else {
|
||||
return $tracks;
|
||||
}
|
||||
}
|
||||
|
||||
public function getUniqueReleaseTracks($releases_ids) {
|
||||
$tracks = $this->getReleaseTracks($releases_ids, true);
|
||||
|
||||
$track_list_unique = array();
|
||||
$album_list = array();
|
||||
$bonus_list = array();
|
||||
|
||||
$first_release = current($tracks);
|
||||
|
||||
// Заносим треки из первого релиза в массив основных
|
||||
foreach ($first_release as $track_id => $track_info) {
|
||||
if (!in_array($track_info['name'], $this->_bad_track_names)) {
|
||||
$album_list[$track_id] = $track_info;
|
||||
$track_list_unique[] = $this->clearTrackName($track_info['name']);
|
||||
}
|
||||
}
|
||||
|
||||
// Все треки, которые не встречаются на первом релизе заносим в бонусы
|
||||
foreach ($tracks as $release_id => $release_tracks) {
|
||||
foreach ($release_tracks as $track_id => $track_info) {
|
||||
if (
|
||||
!in_array($track_info['name'], $this->_bad_track_names) &&
|
||||
!in_array($this->clearTrackName($track_info['name']), $track_list_unique)
|
||||
) {
|
||||
$bonus_list[$track_id] = $track_info;
|
||||
$track_list_unique[] = $this->clearTrackName($track_info['name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'tracks' => $album_list,
|
||||
'bonus' => $bonus_list
|
||||
);
|
||||
}
|
||||
|
||||
private function clearTrackName($name) {
|
||||
$name = str_replace('&', 'and', $name);
|
||||
preg_match_all('/[a-z0-9]/Ui', $name, $m);
|
||||
return strtolower(implode($m[0]));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
class IndexController extends Controller {
|
||||
|
||||
public function _index() {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>BeatHaven</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="i/photo/css/mongolia.css"/>
|
||||
<script language="Javascript" type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAtTfYi3z4NZufrURIGtKiFBSWhNKm65XHrrnKYNa_vsGlMR_1zxS0TVV85GdXTp11zzc4HoT1DFQA6g"></script>
|
||||
<script language="Javascript" type="text/javascript" src="i/photo/js/mongolia.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<div id="logo" class="blue-shadow">BeatHaven</div>
|
||||
<ul id="navigation">
|
||||
<li class="active"><a href="#">Home</a></li>
|
||||
<li><a href="#">Parse Stats</a></li>
|
||||
</ul>
|
||||
<div id="tagline">Gimme fuel, gimme fire, gimme that which I desire!</div>
|
||||
<div id="data-container">
|
||||
<?= $this->_block ?>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
<pre><? var_dump($this->_data); ?></pre>
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
require_once ROOT_DIR .'/core/classes/patterns/Singleton.class.php';
|
||||
|
||||
require_once ROOT_DIR .'/core/classes/db/drivers/iDbDriver.class.php';
|
||||
require_once ROOT_DIR .'/core/classes/db/drivers/Pgsql.class.php';
|
||||
require_once ROOT_DIR .'/core/classes/db/Db.class.php';
|
||||
require_once ROOT_DIR .'/core/classes/db/BeatDB.class.php';
|
||||
|
||||
require_once ROOT_DIR .'/core/classes/mvc/Controller.class.php';
|
||||
require_once ROOT_DIR .'/core/classes/mvc/Model.class.php';
|
||||
require_once ROOT_DIR .'/core/classes/mvc/View.class.php';
|
||||
|
||||
//require_once ROOT_DIR .'/core/classes/files/Cloud.class.php';
|
||||
require_once ROOT_DIR .'/core/classes/files/RemoteFile.class.php';
|
||||
|
||||
require_once ROOT_DIR .'/core/classes/Config.class.php';
|
||||
|
||||
require_once ROOT_DIR .'/core/classes/TrackWeight.class.php';
|
||||
require_once ROOT_DIR .'/core/classes/Vkontakte.class.php';
|
||||
require_once ROOT_DIR .'/core/classes/VkontakteMP3.class.php';
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
define('ROOT_DIR', getcwd());
|
||||
|
||||
require_once ROOT_DIR .'/autoload.php';
|
|
@ -0,0 +1,10 @@
|
|||
[App]
|
||||
default_app = photo
|
||||
|
||||
[DB]
|
||||
engine = pgsql
|
||||
host = localhost
|
||||
port = 5432
|
||||
dbname = beathaven
|
||||
login = postgres
|
||||
pass = password
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
class Config {
|
||||
|
||||
private static $_config = array();
|
||||
|
||||
public static function loadFile($config_name, $file_path) {
|
||||
self::$_config[$config_name] = parse_ini_file($file_path, true);
|
||||
}
|
||||
|
||||
public static function get($str) {
|
||||
$path = explode(':', $str);
|
||||
$res = self::$_config;
|
||||
for ($i = 0; $i < count($path); $i++) {
|
||||
$res = $res[$path[$i]];
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
|
||||
/*****************************************************************
|
||||
Пример использования:
|
||||
|
||||
$weight_calc = new TrackWeight();
|
||||
$weight_calc->setTrackData('Blondie', 'Call Me', 210);
|
||||
$weight_calc->setFiles($files); // Файлы, полученные от парсера
|
||||
$weight_calc->calculateWeight();
|
||||
$files = $weight_calc->getFiles();
|
||||
*****************************************************************/
|
||||
|
||||
/**
|
||||
* Класс посчета веса файла (коэфициента, определяющего релевантность)
|
||||
*
|
||||
* @package classes
|
||||
* @author chez
|
||||
**/
|
||||
class TrackWeight {
|
||||
|
||||
private $_artist; // Имя исполнителя
|
||||
private $_track; // Название трека
|
||||
private $_duration; // Длительность трека в секундах
|
||||
|
||||
private $_files; // Массив файлов для сравнения
|
||||
|
||||
/**
|
||||
* Задает параметры оригинального трека
|
||||
*
|
||||
* @param string $artist Имя исполнителя
|
||||
* @param string $track Запрос
|
||||
* @param int $duration Длительность трека в секундах
|
||||
* @return void
|
||||
* @author chez
|
||||
**/
|
||||
public function setTrackData($artist, $track, $duration) {
|
||||
$this->_artist = $artist;
|
||||
$this->_track = $track;
|
||||
$this->_duration = $duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Задает массив файлов для сравнения
|
||||
*
|
||||
* @param array $files Массив файлов для сравнения
|
||||
* @return void
|
||||
* @author chez
|
||||
**/
|
||||
public function setFiles($files) {
|
||||
$this->_files = $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает файлы с проставленным весом
|
||||
*
|
||||
* @return array $files Массив файлов
|
||||
* @author chez
|
||||
**/
|
||||
public function getFiles() {
|
||||
return $this->_files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Рассчитывает вес для каждого файла
|
||||
*
|
||||
* @return void
|
||||
* @author chez
|
||||
**/
|
||||
public function calculateWeight() {
|
||||
foreach ($this->_files as $i => $file) {
|
||||
$weight = 0;
|
||||
|
||||
if ($file['artist'] == $this->_artist) {
|
||||
$weight += 10;
|
||||
} elseif (strpos($file['artist'], $this->_artist) !== false) {
|
||||
$weight += 5;
|
||||
} elseif (strpos($file['track'], $this->_artist) !== false) {
|
||||
$weight += 4;
|
||||
}
|
||||
|
||||
if ($file['track'] == $this->_track) {
|
||||
$weight += 10;
|
||||
} elseif (strpos($file['track'], $this->_track) !== false) {
|
||||
$weight += 5;
|
||||
}
|
||||
|
||||
if ($file['duration'] == $this->_duration) {
|
||||
$weight += 10;
|
||||
} else {
|
||||
$delta = abs($file['duration'] - $this->_duration);
|
||||
if ($delta < 5) {
|
||||
$weight += (5 - $delta);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_files[$i]['weight'] = $weight;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
<?php
|
||||
|
||||
/*****************************************************************
|
||||
Пример использования:
|
||||
|
||||
$vk_parser = new Vkontakte();
|
||||
$vk_parser->parse('Blondie - Call Me');
|
||||
$files = $weight_calc->getFiles();
|
||||
*****************************************************************/
|
||||
|
||||
/**
|
||||
* Класс парсинга вконтактика
|
||||
*
|
||||
* @package classes
|
||||
* @author chez
|
||||
**/
|
||||
class Vkontakte {
|
||||
|
||||
private $_cookies; // Куки, ассоциативный массив
|
||||
private $_query; // Запрос, plain text
|
||||
|
||||
private $_html; // HTML, полученый от вконтактика
|
||||
private $_files; // Распарсеные массивы с информацией о файле
|
||||
|
||||
/**
|
||||
* Оболочка парсера
|
||||
*
|
||||
* @param string $q Запрос
|
||||
* @return array Массив с файлами
|
||||
* @author chez
|
||||
**/
|
||||
public function parse($q) {
|
||||
$this->_query = $q;
|
||||
$this->auth();
|
||||
$cookie = array();
|
||||
foreach ($this->_cookies as $key => $val) {
|
||||
$cookie[] = $key .'='. $val;
|
||||
}
|
||||
RemoteFile::setHeaders(array(
|
||||
'Cookie: '. implode('; ', $cookie),
|
||||
'Referer: http://vkontakte.ru/audio?album_id=0',
|
||||
'X-Requested-With: XMLHttpRequest',
|
||||
'Origin: http://vkontakte.ru',
|
||||
'Content-Type: application/x-www-form-urlencoded',
|
||||
'User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 Safari/534.16',
|
||||
'Connection: close'
|
||||
));
|
||||
$this->setHtml(RemoteFile::getData('http://vkontakte.ru/audio', array(
|
||||
'act' =>'search',
|
||||
'al' =>'1',
|
||||
'gid' =>'0',
|
||||
'id' =>'5728795',
|
||||
'offset' =>'0',
|
||||
'q' => urlencode($this->_query),
|
||||
'sort' =>'2'
|
||||
)));
|
||||
$this->parseHtml();
|
||||
return $this->_files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Пишет полученый html в член объекта
|
||||
*
|
||||
* @param string $html HTML
|
||||
* @return void
|
||||
* @author chez
|
||||
**/
|
||||
public function setHtml($html) {
|
||||
$this->_html = $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает хранимый html
|
||||
*
|
||||
* @return string HTML
|
||||
* @author chez
|
||||
**/
|
||||
public function getHtml() {
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает хранимый массив файлов
|
||||
*
|
||||
* @return array Список файлов
|
||||
* @author chez
|
||||
**/
|
||||
public function getFiles() {
|
||||
return $this->_files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проводит авторизацию на вконтактике и получает куки
|
||||
* Пока костыль, потом нужно будет переписать
|
||||
*
|
||||
* @return array Ассоциативный массив с куками
|
||||
* @author chez
|
||||
**/
|
||||
private function auth() {
|
||||
$this->_cookies = array(
|
||||
'remixchk' => 5,
|
||||
'remixsid' => 'c68c4362f62f218a25802bae87201d1bc46fadd0b5c64f71678430c9b63b'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Разбирает HTML, полученый от вконтактика
|
||||
*
|
||||
* @return array Список файлов
|
||||
* @author chez
|
||||
**/
|
||||
public function parseHtml() {
|
||||
preg_match_all('/<tr>(.*)<\/tr>/Usi', $this->_html, $m);
|
||||
$files = array();
|
||||
if (count($m) > 0) foreach ($m[0] as $res) {
|
||||
$m1 = array();
|
||||
preg_match('/<input.*value=\"(.*)\,(\d{2,4})\".*<div\sclass=\"duration.*>(.*)<\/div>.*<a.*>(.*)<\/a>.*\s-\s(.*)<\/div>/Usi', $res, $m1);
|
||||
if (count($m1) > 0) {
|
||||
$duration = explode(':', $m1[3]);
|
||||
$files[] = array(
|
||||
'url' => $m1[1],
|
||||
'duration' => $duration[0] * 60 + $duration[1],
|
||||
'artist' => strip_tags($m1[4]),
|
||||
'track' => strip_tags($m1[5])
|
||||
);
|
||||
}
|
||||
}
|
||||
$this->_files = $files;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
/*****************************************************************
|
||||
Пример использования:
|
||||
|
||||
$files = VkontakteMP3::check($files);
|
||||
*****************************************************************/
|
||||
|
||||
/**
|
||||
* Класс для постобработки массива треков от контакта
|
||||
* Проверяет файлы, рассчитывает битрейт и релевантность
|
||||
*
|
||||
* @package classes
|
||||
* @author chez
|
||||
**/
|
||||
class VkontakteMP3 {
|
||||
|
||||
private static $_bitrates = array( // Массив стандартных битрейтов
|
||||
8, 16, 24, 32, 40, 48, 56,
|
||||
64, 80, 96, 112, 128, 144,
|
||||
160, 192, 224, 256, 320
|
||||
);
|
||||
|
||||
/**
|
||||
* Рассчитывает средний битрейт файла
|
||||
* Приводит полученый битрейт к одному из стандартных
|
||||
*
|
||||
* @param int $size Размер файла в байтах
|
||||
* @param int $length Длина трека в секундах
|
||||
* @return int Битрейт в килобитах в секунду
|
||||
* @author chez
|
||||
**/
|
||||
public static function calculateBitrate($size, $length) {
|
||||
$br = round($size * 8 / 1024 / $length);
|
||||
$found_br = 0;
|
||||
for ($i = 1; $i < count(self::$_bitrates); $i++) {
|
||||
if (self::$_bitrates[$i] > $br && ! $found_br) {
|
||||
$delta = self::$_bitrates[$i] - $br;
|
||||
$br_delta = self::$_bitrates[$i] - self::$_bitrates[$i-1];
|
||||
if (round($br_delta / 3) > $delta) {
|
||||
$found_br = self::$_bitrates[$i];
|
||||
} else {
|
||||
$found_br = self::$_bitrates[$i-1];
|
||||
}
|
||||
} elseif ($i == count(self::$_bitrates) - 1 && self::$_bitrates[$i] < $br && ! $found_br) {
|
||||
$delta = $br - self::$_bitrates[$i];
|
||||
if ($delta < 32) {
|
||||
$found_br = self::$_bitrates[$i];
|
||||
} else {
|
||||
$found_br = $br;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $found_br;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверяет файлы, рассчитывает битрейт и релевантность
|
||||
*
|
||||
* @param array $files Массив файлов для обработки
|
||||
* @return array Обработанный массив файлов
|
||||
* @author chez
|
||||
**/
|
||||
public static function check($files, $artist_name, $track_name, $track_length) {
|
||||
foreach ($files as $i => $file) {
|
||||
$headers = RemoteFile::getHeaders($file['url']);
|
||||
if ($headers === false || $headers['http'] != 200) {
|
||||
unset($files[$i]);
|
||||
} else {
|
||||
$files[$i]['size'] = trim($headers['content_length']);
|
||||
}
|
||||
}
|
||||
$m = new TrackWeight();
|
||||
$m->setTrackData($artist_name, $track_name, $track_length);
|
||||
$m->setFiles($files);
|
||||
$m->calculateWeight();
|
||||
$files = $m->getFiles();
|
||||
|
||||
uasort($files, function($a, $b){
|
||||
return $a['weight'] < $b['weight'];
|
||||
});
|
||||
|
||||
foreach ($files as $i => $file) {
|
||||
$files[$i]['bitrate'] = self::calculateBitrate($file['size'], $files[$i]['duration']);
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Чистит строку для максимально точного сравнения
|
||||
*
|
||||
* @param string $str Необработанная строка
|
||||
* @return string Чистая строка
|
||||
* @author chez
|
||||
**/
|
||||
public static function prepareQuery($str) {
|
||||
$str = trim($str);
|
||||
while(strpos($str, ' ') !== false) {
|
||||
$str = str_replace(' ', ' ', $str);
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Преобразует длину из формата мм:сс в ссс
|
||||
*
|
||||
* @param string $duration Читабельная длина
|
||||
* @return int Длина в секундах
|
||||
* @author chez
|
||||
**/
|
||||
public static function convertDuration($duration) {
|
||||
$tmp = explode(':', $duration);
|
||||
return ($tmp[0] * 60 + $tmp[1]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
|
||||
// 123456 --> /www/beatdb/1/2/3/4/5/123456.json
|
||||
|
||||
class BeatDB {
|
||||
|
||||
private static $_db_root = '/www/beatdb/';
|
||||
|
||||
public static function get($key) {
|
||||
if (self::exists($key)) {
|
||||
return json_decode(
|
||||
file_get_contents(
|
||||
self::$_db_root . implode('/', self::getFilePathByKey($key))
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function set($key, $data) {
|
||||
$path = self::getFilePathByKey($key);
|
||||
$part = self::$_db_root;
|
||||
for ($i = 0; $i < count($path) - 1; $i++) {
|
||||
$part .= $path[$i] .'/';
|
||||
}
|
||||
if (!file_exists($part)) {
|
||||
if (!mkdir($part, 0777, true)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return (bool) file_put_contents($part . $path[$i], json_encode($data));
|
||||
}
|
||||
|
||||
public static function delete($key) {
|
||||
$path = self::getFilePathByKey($key);
|
||||
$ret = array();
|
||||
for ($i = count($path) - 1; $i >= 0; $i--) {
|
||||
$part = self::$_db_root . implode('/', $path);
|
||||
unset($path[$i]);
|
||||
if (is_file($part)) {
|
||||
unlink($part);
|
||||
} elseif (count(scandir($part)) == 2) {
|
||||
rmdir($part);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function exists($key) {
|
||||
return file_exists(self::$_db_root . implode('/', self::getFilePathByKey($key)));
|
||||
}
|
||||
|
||||
private static function getFilePathByKey($key) {
|
||||
$key = strval($key);
|
||||
$path = array();
|
||||
for ($i = 0; $i < strlen($key) - 1; $i++) {
|
||||
$path[] = substr($key, $i, 1);
|
||||
}
|
||||
$path[] = $key .'.json';
|
||||
return $path;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
class Db extends Singleton {
|
||||
|
||||
private $_driver;
|
||||
|
||||
public function init() {
|
||||
$params = Config::get('app:DB');
|
||||
$driver = $params['engine'];
|
||||
unset($params['engine']);
|
||||
switch ($driver) {
|
||||
case 'pgsql' : default :
|
||||
$this->_driver = new Pgsql(); break;
|
||||
}
|
||||
call_user_func_array(array($this->_driver, 'connect'), $params);
|
||||
}
|
||||
|
||||
public function q($q, $params = array()) {
|
||||
if (! $this->_driver) {
|
||||
$this->init();
|
||||
}
|
||||
return $this->_driver->q($q);
|
||||
}
|
||||
|
||||
public function getRows($result, $key = false) {
|
||||
if (! $this->_driver) {
|
||||
$this->init();
|
||||
}
|
||||
return $this->_driver->getRows($result, $key);
|
||||
}
|
||||
|
||||
public function getRow($result) {
|
||||
if (! $this->_driver) {
|
||||
$this->init();
|
||||
}
|
||||
return $this->_driver->getRow($result);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
class Pgsql implements iDbDriver {
|
||||
|
||||
private $_connection = false;
|
||||
|
||||
public function connect($host, $port, $dbname, $login, $pass) {
|
||||
$this->connection = pg_connect('host='. $host .' port='. $port .' dbname='. $dbname .' user='. $login .' password='. $pass);
|
||||
}
|
||||
|
||||
public function q($q) {
|
||||
return pg_query($q);
|
||||
}
|
||||
|
||||
public function getRows($r, $key = false) {
|
||||
$rows = array();
|
||||
while($row = pg_fetch_assoc($r)) {
|
||||
if (!$key) {
|
||||
$rows[] = $row;
|
||||
} else {
|
||||
$rows[$row[$key]] = $row;
|
||||
}
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function getRow($r) {
|
||||
return pg_fetch_assoc($r);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
interface iDbDriver {
|
||||
|
||||
public function connect($host, $port, $dbname, $login, $pass);
|
||||
|
||||
public function q($q);
|
||||
|
||||
public function getRows($r, $key);
|
||||
|
||||
public function getRow($r);
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
class Cloud {
|
||||
|
||||
private $_wrapper;
|
||||
|
||||
public function __construct() {
|
||||
$params = Config::get('app:CloudApp');
|
||||
$this->_wrapper = new Cloud_API($params['login'], $params['pass']);
|
||||
}
|
||||
|
||||
public function getFiles() {
|
||||
$files = $this->_wrapper->getItems();
|
||||
var_dump($files);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
|
||||
/*****************************************************************
|
||||
Пример использования:
|
||||
|
||||
RemoteFile::setHeaders(array(
|
||||
'X-Requested-With: XMLHttpRequest',
|
||||
'Origin: http://vkontakte.ru',
|
||||
'Content-Type: application/x-www-form-urlencoded'
|
||||
));
|
||||
$headers = RemoteFile::getHeaders('http://cs4603.vkontakte.ru/u50132690/audio/432e2b109b94.mp3');
|
||||
$html = RemoteFile::getData('http://vkontakte.ru/audio', array(
|
||||
'act' =>'search',
|
||||
'q' => urlencode($this->_query)
|
||||
))
|
||||
*****************************************************************/
|
||||
|
||||
/**
|
||||
* Класс для работы с удаленными файлами
|
||||
* Реализован через библиотеку cURL
|
||||
*
|
||||
* @package classes
|
||||
* @author chez
|
||||
**/
|
||||
class RemoteFile {
|
||||
|
||||
private static $_timeout = 5; // Таймаут ответа от сервера
|
||||
private static $_headers = array(); // Заголовки для отправки на сервер
|
||||
|
||||
/**
|
||||
* Отправка запроса и получение ответа от сервера
|
||||
* Умеет возвращать текст ответа или заголовки
|
||||
*
|
||||
* @param string $url URL запроса
|
||||
* @param bool $headers Флаг: возвращать заголовки, а не текст
|
||||
* @param array $post_params Массив POST-параметров, если установлен, то метод меняется на POST
|
||||
* @return string Ответ от сервера
|
||||
* @author chez
|
||||
**/
|
||||
private static function _exec($url, $headers = false, $post_params = array()) {
|
||||
if (count($post_params) > 0) {
|
||||
$p = '';
|
||||
foreach ($post_params as $key => $val) {
|
||||
$p .= '&'. $key .'='. $val;
|
||||
}
|
||||
$post_params = substr($p, 1);
|
||||
}
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, self::$_headers);
|
||||
if ($headers) {
|
||||
curl_setopt($ch, CURLOPT_HEADER, 1);
|
||||
curl_setopt($ch, CURLOPT_NOBODY, 1);
|
||||
}
|
||||
if (is_string($post_params)) {
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, self::$_timeout);
|
||||
$result = curl_exec($ch);
|
||||
if (curl_errno($ch) !== 0) {
|
||||
curl_close($ch);
|
||||
return false;
|
||||
}
|
||||
curl_close($ch);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получение HTTP-заголовков ответа от сервера
|
||||
*
|
||||
* @param string $url URL запроса
|
||||
* @param array $post_params Массив POST-параметров, если установлен, то метод меняется на POST
|
||||
* @return array Распарсеный массив заголовков
|
||||
* @author chez
|
||||
**/
|
||||
public static function getHeaders($url, $post_params = array()) {
|
||||
$headers = self::_exec($url, true);
|
||||
if ($headers === false) {
|
||||
return false;
|
||||
}
|
||||
$headers = explode("\r\n", $headers);
|
||||
$headers_array = array();
|
||||
|
||||
while(list($i, $header) = each($headers)) {
|
||||
if (substr($header, 0, 5) == 'HTTP/') {
|
||||
$header = explode(' ', $header);
|
||||
$headers_array['http'] = $header[1];
|
||||
} elseif ($header != '') {
|
||||
preg_match('/^([a-z0-9\-]*):\s(.*)$/Ui', $header, $m);
|
||||
$headers_array[strtolower(str_replace('-', '_', $m[1]))] = $m[2];
|
||||
}
|
||||
}
|
||||
|
||||
return $headers_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получение ответа от сервера
|
||||
*
|
||||
* @param string $url URL запроса
|
||||
* @param array $post_params Массив POST-параметров, если установлен, то метод меняется на POST
|
||||
* @return string Тело ответа от сервера
|
||||
* @author chez
|
||||
**/
|
||||
public static function getData($url, $post_params = array()) {
|
||||
return self::_exec($url, false, $post_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Запись заголовков, которые будет отправлены вместе с запросом
|
||||
*
|
||||
* @param array $headers Индексный массив заголовков
|
||||
* @return void
|
||||
* @author chez
|
||||
**/
|
||||
public static function setHeaders($headers) {
|
||||
self::$_headers = $headers;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
class Controller {
|
||||
|
||||
public function loadPage() {
|
||||
$app = Config::get('app:App:default_app');
|
||||
|
||||
require_once 'app/'. $app .'/controllers/Index.class.php';
|
||||
$c = new IndexController();
|
||||
$data = $c->_index();
|
||||
|
||||
$v = new View();
|
||||
$v->setTemplate('app/'. $app .'/templates/main.php');
|
||||
$v->setView('app/'. $app .'/views/Index_index.php');
|
||||
$v->setData($data);
|
||||
|
||||
$html = $v->render();
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo $html;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
class Model {
|
||||
|
||||
protected $db;
|
||||
|
||||
public function __construct() {
|
||||
$this->db = Db::getInstance();
|
||||
}
|
||||
|
||||
public static function factory($package, $model) {
|
||||
require_once ROOT_DIR .'/app/'. $package .'/models/'. $model .'.class.php';
|
||||
$class_name = ucfirst($package) .'_'. $model .'Model';
|
||||
return new $class_name();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
class View {
|
||||
|
||||
private $_template;
|
||||
private $_view;
|
||||
private $_data;
|
||||
|
||||
private $_block;
|
||||
|
||||
public function setTemplate($path) {
|
||||
$this->_template = $path;
|
||||
}
|
||||
|
||||
public function setView($path) {
|
||||
$this->_view = $path;
|
||||
}
|
||||
|
||||
public function setData($data) {
|
||||
$this->_data = $data;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$this->_block = $this->_sandbox($this->_view);
|
||||
return $this->_sandbox($this->_template);
|
||||
}
|
||||
|
||||
private function _sandbox($path) {
|
||||
ob_clean();
|
||||
include $path;
|
||||
$html = ob_get_contents();
|
||||
ob_clean();
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
abstract class Singleton {
|
||||
|
||||
protected function __construct() {}
|
||||
|
||||
final public static function getInstance() {
|
||||
static $_instances = array();
|
||||
|
||||
$class_name = get_called_class();
|
||||
|
||||
if (! isset($_instances[$class_name])) {
|
||||
$_instances[$class_name] = new $class_name();
|
||||
}
|
||||
|
||||
return $_instances[$class_name];
|
||||
}
|
||||
|
||||
final private function __clone() {}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
/www/cloudapp/Cloud/
|
|
@ -0,0 +1,75 @@
|
|||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background-color: #1A1A1A;
|
||||
background-image: url(../img/316.png);
|
||||
}
|
||||
#main {
|
||||
width: 1000px;
|
||||
//background-color: #FDD;
|
||||
}
|
||||
#logo {
|
||||
font: 40px Georgia, Helvetica, Arial;
|
||||
color: #09F;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
margin: 50px 0 0 0;
|
||||
}
|
||||
#navigation {
|
||||
float: right;
|
||||
margin: -32px 0 0 0;
|
||||
}
|
||||
#navigation li {
|
||||
display: block;
|
||||
float: left;
|
||||
margin: 0 0 0 10px;
|
||||
padding: 6px 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#navigation li.active {
|
||||
background-color: #20262B;
|
||||
border: #152025 1px solid;
|
||||
}
|
||||
#navigation li.active a {
|
||||
color: #FFF;
|
||||
}
|
||||
#navigation li a {
|
||||
color: #CCC;
|
||||
text-decoration: none;
|
||||
font: 16px Helvetica, Arial;
|
||||
//font-weight: bold;
|
||||
}
|
||||
#tagline {
|
||||
width: 100%;
|
||||
margin: 50px 0;
|
||||
text-align: center;
|
||||
color: #BDF;
|
||||
font: 18px Georgia;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.blue-shadow {
|
||||
text-shadow: 1px 1px 0px #05A;
|
||||
}
|
||||
.gray-shadow {
|
||||
text-shadow: 1px 1px 0px #555;
|
||||
}
|
||||
|
||||
#data-container {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
#data-container pre {
|
||||
background-color: #CCC;
|
||||
border-radius: 20px;
|
||||
display: block;
|
||||
padding: 20px;
|
||||
font-family: Georgia;
|
||||
}
|
||||
|
||||
.photo {
|
||||
|
||||
}
|
||||
.rounded {
|
||||
border-radius: 20px;
|
||||
}
|
After Width: | Height: | Size: 184 KiB |
After Width: | Height: | Size: 247 KiB |
|
@ -0,0 +1,22 @@
|
|||
function powerhug() {
|
||||
// Centerize
|
||||
correctView();
|
||||
$(window).resize(correctView);
|
||||
|
||||
parsePhotos();
|
||||
}
|
||||
|
||||
function correctView() {
|
||||
if ($(window).width() > $('#main').width()) {
|
||||
$('#main').css('margin-left', (($(window).width() - $('#main').width()) / 2) + 'px');
|
||||
}
|
||||
}
|
||||
|
||||
function parsePhotos() {
|
||||
$('#data-container img.photo').each(function(){
|
||||
$(this).replaceWith($('<div>').addClass('photo rounded').css('background-image', 'url('+ $(this).attr('src') +')').width($(this).width()).height($(this).height()));
|
||||
})
|
||||
}
|
||||
|
||||
google.load('jquery', '1.4.4');
|
||||
google.setOnLoadCallback(powerhug);
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
var_dump($_SERVER['REQUEST_URI']); echo "<br/>";
|
||||
echo '<pre>'; print_r($_GET);
|
|
@ -0,0 +1,43 @@
|
|||
#player_container, #main_container {
|
||||
width: 950px;
|
||||
}
|
||||
#player_container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
height: 6em;
|
||||
border-bottom: #444 1px solid;
|
||||
}
|
||||
#playerControlPrevTrack, #playerControlNextTrack {
|
||||
position: relative;
|
||||
float: left;
|
||||
background-color: aqua;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
line-height: 28px;
|
||||
margin-top: 18px;
|
||||
border-radius: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
}
|
||||
#playerControlPlay, #playerControlStop {
|
||||
position: relative;
|
||||
float: left;
|
||||
background-color: fuchsia;
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
text-align: center;
|
||||
line-height: 66px;
|
||||
border-radius: 35px;
|
||||
-moz-border-radius: 35px;
|
||||
margin: 0 10px;
|
||||
}
|
||||
#main_container {
|
||||
min-height: 500px;
|
||||
margin-top: 6em;
|
||||
}
|
||||
#main_container .artist-name {
|
||||
|
||||
}
|
||||
#main_container .album-name {
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
|
||||
|
||||
Blueprint CSS Framework 1.0
|
||||
http://blueprintcss.org
|
||||
|
||||
* Copyright (c) 2007-Present. See LICENSE for more info.
|
||||
* See README for instructions on how to use Blueprint.
|
||||
* For credits and origins, see AUTHORS.
|
||||
* This is a compressed file. See the sources in the 'src' directory.
|
||||
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
/* ie.css */
|
||||
body {text-align:center;}
|
||||
.container {text-align:left;}
|
||||
* html .column, * html .span-1, * html .span-2, * html .span-3, * html .span-4, * html .span-5, * html .span-6, * html .span-7, * html .span-8, * html .span-9, * html .span-10, * html .span-11, * html .span-12, * html .span-13, * html .span-14, * html .span-15, * html .span-16, * html .span-17, * html .span-18, * html .span-19, * html .span-20, * html .span-21, * html .span-22, * html .span-23, * html .span-24 {display:inline;overflow-x:hidden;}
|
||||
* html legend {margin:0px -8px 16px 0;padding:0;}
|
||||
sup {vertical-align:text-top;}
|
||||
sub {vertical-align:text-bottom;}
|
||||
html>body p code {*white-space:normal;}
|
||||
hr {margin:-8px auto 11px;}
|
||||
img {-ms-interpolation-mode:bicubic;}
|
||||
.clearfix, .container {display:inline-block;}
|
||||
* html .clearfix, * html .container {height:1%;}
|
||||
fieldset {padding-top:0;}
|
||||
legend {margin-top:-0.2em;margin-bottom:1em;margin-left:-0.5em;}
|
||||
textarea {overflow:auto;}
|
||||
label {vertical-align:middle;position:relative;top:-0.25em;}
|
||||
input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;}
|
||||
input.text:focus, input.title:focus {border-color:#666;}
|
||||
input.text, input.title, textarea, select {margin:0.5em 0;}
|
||||
input.checkbox, input.radio {position:relative;top:.25em;}
|
||||
form.inline div, form.inline p {vertical-align:middle;}
|
||||
form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;}
|
||||
button, input.button {position:relative;top:0.25em;}
|
After Width: | Height: | Size: 655 B |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 537 B |
|
@ -0,0 +1,32 @@
|
|||
Buttons
|
||||
|
||||
* Gives you great looking CSS buttons, for both <a> and <button>.
|
||||
* Demo: particletree.com/features/rediscovering-the-button-element
|
||||
|
||||
|
||||
Credits
|
||||
----------------------------------------------------------------
|
||||
|
||||
* Created by Kevin Hale [particletree.com]
|
||||
* Adapted for Blueprint by Olav Bjorkoy [bjorkoy.com]
|
||||
|
||||
|
||||
Usage
|
||||
----------------------------------------------------------------
|
||||
|
||||
1) Add this plugin to lib/settings.yml.
|
||||
See compress.rb for instructions.
|
||||
|
||||
2) Use the following HTML code to place the buttons on your site:
|
||||
|
||||
<button type="submit" class="button positive">
|
||||
<img src="css/blueprint/plugins/buttons/icons/tick.png" alt=""/> Save
|
||||
</button>
|
||||
|
||||
<a class="button" href="/password/reset/">
|
||||
<img src="css/blueprint/plugins/buttons/icons/key.png" alt=""/> Change Password
|
||||
</a>
|
||||
|
||||
<a href="#" class="button negative">
|
||||
<img src="css/blueprint/plugins/buttons/icons/cross.png" alt=""/> Cancel
|
||||
</a>
|
|
@ -0,0 +1,97 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
buttons.css
|
||||
* Gives you some great CSS-only buttons.
|
||||
|
||||
Created by Kevin Hale [particletree.com]
|
||||
* particletree.com/features/rediscovering-the-button-element
|
||||
|
||||
See Readme.txt in this folder for instructions.
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
a.button, button {
|
||||
display:block;
|
||||
float:left;
|
||||
margin: 0.7em 0.5em 0.7em 0;
|
||||
padding:5px 10px 5px 7px; /* Links */
|
||||
|
||||
border:1px solid #dedede;
|
||||
border-top:1px solid #eee;
|
||||
border-left:1px solid #eee;
|
||||
|
||||
background-color:#f5f5f5;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
font-size:100%;
|
||||
line-height:130%;
|
||||
text-decoration:none;
|
||||
font-weight:bold;
|
||||
color:#565656;
|
||||
cursor:pointer;
|
||||
}
|
||||
button {
|
||||
width:auto;
|
||||
overflow:visible;
|
||||
padding:4px 10px 3px 7px; /* IE6 */
|
||||
}
|
||||
button[type] {
|
||||
padding:4px 10px 4px 7px; /* Firefox */
|
||||
line-height:17px; /* Safari */
|
||||
}
|
||||
*:first-child+html button[type] {
|
||||
padding:4px 10px 3px 7px; /* IE7 */
|
||||
}
|
||||
button img, a.button img{
|
||||
margin:0 3px -3px 0 !important;
|
||||
padding:0;
|
||||
border:none;
|
||||
width:16px;
|
||||
height:16px;
|
||||
float:none;
|
||||
}
|
||||
|
||||
|
||||
/* Button colors
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Standard */
|
||||
button:hover, a.button:hover{
|
||||
background-color:#dff4ff;
|
||||
border:1px solid #c2e1ef;
|
||||
color:#336699;
|
||||
}
|
||||
a.button:active{
|
||||
background-color:#6299c5;
|
||||
border:1px solid #6299c5;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
/* Positive */
|
||||
body .positive {
|
||||
color:#529214;
|
||||
}
|
||||
a.positive:hover, button.positive:hover {
|
||||
background-color:#E6EFC2;
|
||||
border:1px solid #C6D880;
|
||||
color:#529214;
|
||||
}
|
||||
a.positive:active {
|
||||
background-color:#529214;
|
||||
border:1px solid #529214;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
/* Negative */
|
||||
body .negative {
|
||||
color:#d12f19;
|
||||
}
|
||||
a.negative:hover, button.negative:hover {
|
||||
background-color:#fbe3e4;
|
||||
border:1px solid #fbc2c4;
|
||||
color:#d12f19;
|
||||
}
|
||||
a.negative:active {
|
||||
background-color:#d12f19;
|
||||
border:1px solid #d12f19;
|
||||
color:#fff;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
Fancy Type
|
||||
|
||||
* Gives you classes to use if you'd like some
|
||||
extra fancy typography.
|
||||
|
||||
Credits and instructions are specified above each class
|
||||
in the fancy-type.css file in this directory.
|
||||
|
||||
|
||||
Usage
|
||||
----------------------------------------------------------------
|
||||
|
||||
1) Add this plugin to lib/settings.yml.
|
||||
See compress.rb for instructions.
|
|
@ -0,0 +1,71 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
fancy-type.css
|
||||
* Lots of pretty advanced classes for manipulating text.
|
||||
|
||||
See the Readme file in this folder for additional instructions.
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Indentation instead of line shifts for sibling paragraphs. */
|
||||
p + p { text-indent:2em; margin-top:-1.5em; }
|
||||
form p + p { text-indent: 0; } /* Don't want this in forms. */
|
||||
|
||||
|
||||
/* For great looking type, use this code instead of asdf:
|
||||
<span class="alt">asdf</span>
|
||||
Best used on prepositions and ampersands. */
|
||||
|
||||
.alt {
|
||||
color: #666;
|
||||
font-family: "Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
|
||||
/* For great looking quote marks in titles, replace "asdf" with:
|
||||
<span class="dquo">“</span>asdf”
|
||||
(That is, when the title starts with a quote mark).
|
||||
(You may have to change this value depending on your font size). */
|
||||
|
||||
.dquo { margin-left: -.5em; }
|
||||
|
||||
|
||||
/* Reduced size type with incremental leading
|
||||
(http://www.markboulton.co.uk/journal/comments/incremental_leading/)
|
||||
|
||||
This could be used for side notes. For smaller type, you don't necessarily want to
|
||||
follow the 1.5x vertical rhythm -- the line-height is too much.
|
||||
|
||||
Using this class, it reduces your font size and line-height so that for
|
||||
every four lines of normal sized type, there is five lines of the sidenote. eg:
|
||||
|
||||
New type size in em's:
|
||||
10px (wanted side note size) / 12px (existing base size) = 0.8333 (new type size in ems)
|
||||
|
||||
New line-height value:
|
||||
12px x 1.5 = 18px (old line-height)
|
||||
18px x 4 = 72px
|
||||
72px / 5 = 14.4px (new line height)
|
||||
14.4px / 10px = 1.44 (new line height in em's) */
|
||||
|
||||
p.incr, .incr p {
|
||||
font-size: 10px;
|
||||
line-height: 1.44em;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
|
||||
/* Surround uppercase words and abbreviations with this class.
|
||||
Based on work by Jørgen Arnor Gårdsø Lom [http://twistedintellect.com/] */
|
||||
|
||||
.caps {
|
||||
font-variant: small-caps;
|
||||
letter-spacing: 1px;
|
||||
text-transform: lowercase;
|
||||
font-size:1.2em;
|
||||
line-height:1%;
|
||||
font-weight:bold;
|
||||
padding:0 2px;
|
||||
}
|
After Width: | Height: | Size: 777 B |
After Width: | Height: | Size: 641 B |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 691 B |
After Width: | Height: | Size: 741 B |
After Width: | Height: | Size: 591 B |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 663 B |
|
@ -0,0 +1,18 @@
|
|||
Link Icons
|
||||
* Icons for links based on protocol or file type.
|
||||
|
||||
This is not supported in IE versions < 7.
|
||||
|
||||
|
||||
Credits
|
||||
----------------------------------------------------------------
|
||||
|
||||
* Marc Morgan
|
||||
* Olav Bjorkoy [bjorkoy.com]
|
||||
|
||||
|
||||
Usage
|
||||
----------------------------------------------------------------
|
||||
|
||||
1) Add this line to your HTML:
|
||||
<link rel="stylesheet" href="css/blueprint/plugins/link-icons/screen.css" type="text/css" media="screen, projection">
|
|
@ -0,0 +1,40 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
link-icons.css
|
||||
* Icons for links based on protocol or file type.
|
||||
|
||||
See the Readme file in this folder for additional instructions.
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Use this class if a link gets an icon when it shouldn't. */
|
||||
body a.noicon {
|
||||
background:transparent none !important;
|
||||
padding:0 !important;
|
||||
margin:0 !important;
|
||||
}
|
||||
|
||||
/* Make sure the icons are not cut */
|
||||
a[href^="http:"], a[href^="mailto:"], a[href^="http:"]:visited,
|
||||
a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".rss"],
|
||||
a[href$=".rdf"], a[href^="aim:"] {
|
||||
padding:2px 22px 2px 0;
|
||||
margin:-2px 0;
|
||||
background-repeat: no-repeat;
|
||||
background-position: right center;
|
||||
}
|
||||
|
||||
/* External links */
|
||||
a[href^="http:"] { background-image: url(icons/external.png); }
|
||||
a[href^="mailto:"] { background-image: url(icons/email.png); }
|
||||
a[href^="http:"]:visited { background-image: url(icons/visited.png); }
|
||||
|
||||
/* Files */
|
||||
a[href$=".pdf"] { background-image: url(icons/pdf.png); }
|
||||
a[href$=".doc"] { background-image: url(icons/doc.png); }
|
||||
a[href$=".xls"] { background-image: url(icons/xls.png); }
|
||||
|
||||
/* Misc */
|
||||
a[href$=".rss"],
|
||||
a[href$=".rdf"] { background-image: url(icons/feed.png); }
|
||||
a[href^="aim:"] { background-image: url(icons/im.png); }
|
|
@ -0,0 +1,10 @@
|
|||
RTL
|
||||
* Mirrors Blueprint, so it can be used with Right-to-Left languages.
|
||||
|
||||
By Ran Yaniv Hartstein, ranh.co.il
|
||||
|
||||
Usage
|
||||
----------------------------------------------------------------
|
||||
|
||||
1) Add this line to your HTML:
|
||||
<link rel="stylesheet" href="css/blueprint/plugins/rtl/screen.css" type="text/css" media="screen, projection">
|
|
@ -0,0 +1,110 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
rtl.css
|
||||
* Mirrors Blueprint for left-to-right languages
|
||||
|
||||
By Ran Yaniv Hartstein [ranh.co.il]
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
body .container { direction: rtl; }
|
||||
body .column, body .span-1, body .span-2, body .span-3, body .span-4, body .span-5, body .span-6, body .span-7, body .span-8, body .span-9, body .span-10, body .span-11, body .span-12, body .span-13, body .span-14, body .span-15, body .span-16, body .span-17, body .span-18, body .span-19, body .span-20, body .span-21, body .span-22, body .span-23, body .span-24 {
|
||||
float: right;
|
||||
margin-right: 0;
|
||||
margin-left: 10px;
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
body div.last { margin-left: 0; }
|
||||
body table .last { padding-left: 0; }
|
||||
|
||||
body .append-1 { padding-right: 0; padding-left: 40px; }
|
||||
body .append-2 { padding-right: 0; padding-left: 80px; }
|
||||
body .append-3 { padding-right: 0; padding-left: 120px; }
|
||||
body .append-4 { padding-right: 0; padding-left: 160px; }
|
||||
body .append-5 { padding-right: 0; padding-left: 200px; }
|
||||
body .append-6 { padding-right: 0; padding-left: 240px; }
|
||||
body .append-7 { padding-right: 0; padding-left: 280px; }
|
||||
body .append-8 { padding-right: 0; padding-left: 320px; }
|
||||
body .append-9 { padding-right: 0; padding-left: 360px; }
|
||||
body .append-10 { padding-right: 0; padding-left: 400px; }
|
||||
body .append-11 { padding-right: 0; padding-left: 440px; }
|
||||
body .append-12 { padding-right: 0; padding-left: 480px; }
|
||||
body .append-13 { padding-right: 0; padding-left: 520px; }
|
||||
body .append-14 { padding-right: 0; padding-left: 560px; }
|
||||
body .append-15 { padding-right: 0; padding-left: 600px; }
|
||||
body .append-16 { padding-right: 0; padding-left: 640px; }
|
||||
body .append-17 { padding-right: 0; padding-left: 680px; }
|
||||
body .append-18 { padding-right: 0; padding-left: 720px; }
|
||||
body .append-19 { padding-right: 0; padding-left: 760px; }
|
||||
body .append-20 { padding-right: 0; padding-left: 800px; }
|
||||
body .append-21 { padding-right: 0; padding-left: 840px; }
|
||||
body .append-22 { padding-right: 0; padding-left: 880px; }
|
||||
body .append-23 { padding-right: 0; padding-left: 920px; }
|
||||
|
||||
body .prepend-1 { padding-left: 0; padding-right: 40px; }
|
||||
body .prepend-2 { padding-left: 0; padding-right: 80px; }
|
||||
body .prepend-3 { padding-left: 0; padding-right: 120px; }
|
||||
body .prepend-4 { padding-left: 0; padding-right: 160px; }
|
||||
body .prepend-5 { padding-left: 0; padding-right: 200px; }
|
||||
body .prepend-6 { padding-left: 0; padding-right: 240px; }
|
||||
body .prepend-7 { padding-left: 0; padding-right: 280px; }
|
||||
body .prepend-8 { padding-left: 0; padding-right: 320px; }
|
||||
body .prepend-9 { padding-left: 0; padding-right: 360px; }
|
||||
body .prepend-10 { padding-left: 0; padding-right: 400px; }
|
||||
body .prepend-11 { padding-left: 0; padding-right: 440px; }
|
||||
body .prepend-12 { padding-left: 0; padding-right: 480px; }
|
||||
body .prepend-13 { padding-left: 0; padding-right: 520px; }
|
||||
body .prepend-14 { padding-left: 0; padding-right: 560px; }
|
||||
body .prepend-15 { padding-left: 0; padding-right: 600px; }
|
||||
body .prepend-16 { padding-left: 0; padding-right: 640px; }
|
||||
body .prepend-17 { padding-left: 0; padding-right: 680px; }
|
||||
body .prepend-18 { padding-left: 0; padding-right: 720px; }
|
||||
body .prepend-19 { padding-left: 0; padding-right: 760px; }
|
||||
body .prepend-20 { padding-left: 0; padding-right: 800px; }
|
||||
body .prepend-21 { padding-left: 0; padding-right: 840px; }
|
||||
body .prepend-22 { padding-left: 0; padding-right: 880px; }
|
||||
body .prepend-23 { padding-left: 0; padding-right: 920px; }
|
||||
|
||||
body .border {
|
||||
padding-right: 0;
|
||||
padding-left: 4px;
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
border-right: none;
|
||||
border-left: 1px solid #eee;
|
||||
}
|
||||
|
||||
body .colborder {
|
||||
padding-right: 0;
|
||||
padding-left: 24px;
|
||||
margin-right: 0;
|
||||
margin-left: 25px;
|
||||
border-right: none;
|
||||
border-left: 1px solid #eee;
|
||||
}
|
||||
|
||||
body .pull-1 { margin-left: 0; margin-right: -40px; }
|
||||
body .pull-2 { margin-left: 0; margin-right: -80px; }
|
||||
body .pull-3 { margin-left: 0; margin-right: -120px; }
|
||||
body .pull-4 { margin-left: 0; margin-right: -160px; }
|
||||
|
||||
body .push-0 { margin: 0 18px 0 0; }
|
||||
body .push-1 { margin: 0 18px 0 -40px; }
|
||||
body .push-2 { margin: 0 18px 0 -80px; }
|
||||
body .push-3 { margin: 0 18px 0 -120px; }
|
||||
body .push-4 { margin: 0 18px 0 -160px; }
|
||||
body .push-0, body .push-1, body .push-2,
|
||||
body .push-3, body .push-4 { float: left; }
|
||||
|
||||
|
||||
/* Typography with RTL support */
|
||||
body h1,body h2,body h3,
|
||||
body h4,body h5,body h6 { font-family: Arial, sans-serif; }
|
||||
html body { font-family: Arial, sans-serif; }
|
||||
body pre,body code,body tt { font-family: monospace; }
|
||||
|
||||
/* Mirror floats and margins on typographic elements */
|
||||
body p img { float: right; margin: 1.5em 0 1.5em 1.5em; }
|
||||
body dd, body ul, body ol { margin-left: 0; margin-right: 1.5em;}
|
||||
body td, body th { text-align:right; }
|
|
@ -0,0 +1,29 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
|
||||
|
||||
Blueprint CSS Framework 1.0
|
||||
http://blueprintcss.org
|
||||
|
||||
* Copyright (c) 2007-Present. See LICENSE for more info.
|
||||
* See README for instructions on how to use Blueprint.
|
||||
* For credits and origins, see AUTHORS.
|
||||
* This is a compressed file. See the sources in the 'src' directory.
|
||||
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
/* print.css */
|
||||
body {line-height:1.5;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;color:#000;background:none;font-size:10pt;}
|
||||
.container {background:none;}
|
||||
hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;}
|
||||
hr.space {background:#fff;color:#fff;visibility:hidden;}
|
||||
h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;}
|
||||
code {font:.9em "Courier New", Monaco, Courier, monospace;}
|
||||
a img {border:none;}
|
||||
p img.top {margin-top:0;}
|
||||
blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;}
|
||||
.small {font-size:.9em;}
|
||||
.large {font-size:1.1em;}
|
||||
.quiet {color:#999;}
|
||||
.hide {display:none;}
|
||||
a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;}
|
||||
a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;}
|
|
@ -0,0 +1,265 @@
|
|||
/* -----------------------------------------------------------------------
|
||||
|
||||
|
||||
Blueprint CSS Framework 1.0
|
||||
http://blueprintcss.org
|
||||
|
||||
* Copyright (c) 2007-Present. See LICENSE for more info.
|
||||
* See README for instructions on how to use Blueprint.
|
||||
* For credits and origins, see AUTHORS.
|
||||
* This is a compressed file. See the sources in the 'src' directory.
|
||||
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
/* reset.css */
|
||||
html {margin:0;padding:0;border:0;}
|
||||
body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
|
||||
article, aside, dialog, figure, footer, header, hgroup, nav, section {display:block;}
|
||||
body {line-height:1.5;background:white;}
|
||||
table {border-collapse:separate;border-spacing:0;}
|
||||
caption, th, td {text-align:left;font-weight:normal;float:none !important;}
|
||||
table, th, td {vertical-align:middle;}
|
||||
blockquote:before, blockquote:after, q:before, q:after {content:'';}
|
||||
blockquote, q {quotes:"" "";}
|
||||
a img {border:none;}
|
||||
:focus {outline:0;}
|
||||
|
||||
/* typography.css */
|
||||
html {font-size:100.01%;}
|
||||
body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
|
||||
h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;}
|
||||
h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
|
||||
h2 {font-size:2em;margin-bottom:0.75em;}
|
||||
h3 {font-size:1.5em;line-height:1;margin-bottom:1em;}
|
||||
h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;}
|
||||
h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
|
||||
h6 {font-size:1em;font-weight:bold;}
|
||||
h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
|
||||
p {margin:0 0 1.5em;}
|
||||
.left {float:left !important;}
|
||||
p .left {margin:1.5em 1.5em 1.5em 0;padding:0;}
|
||||
.right {float:right !important;}
|
||||
p .right {margin:1.5em 0 1.5em 1.5em;padding:0;}
|
||||
a:focus, a:hover {color:#09f;}
|
||||
a {color:#06c;text-decoration:underline;}
|
||||
blockquote {margin:1.5em;color:#666;font-style:italic;}
|
||||
strong, dfn {font-weight:bold;}
|
||||
em, dfn {font-style:italic;}
|
||||
sup, sub {line-height:0;}
|
||||
abbr, acronym {border-bottom:1px dotted #666;}
|
||||
address {margin:0 0 1.5em;font-style:italic;}
|
||||
del {color:#666;}
|
||||
pre {margin:1.5em 0;white-space:pre;}
|
||||
pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
|
||||
li ul, li ol {margin:0;}
|
||||
ul, ol {margin:0 1.5em 1.5em 0;padding-left:1.5em;}
|
||||
ul {list-style-type:disc;}
|
||||
ol {list-style-type:decimal;}
|
||||
dl {margin:0 0 1.5em 0;}
|
||||
dl dt {font-weight:bold;}
|
||||
dd {margin-left:1.5em;}
|
||||
table {margin-bottom:1.4em;width:100%;}
|
||||
th {font-weight:bold;}
|
||||
thead th {background:#c3d9ff;}
|
||||
th, td, caption {padding:4px 10px 4px 5px;}
|
||||
tbody tr:nth-child(even) td, tbody tr.even td {background:#e5ecf9;}
|
||||
tfoot {font-style:italic;}
|
||||
caption {background:#eee;}
|
||||
.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
|
||||
.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
|
||||
.hide {display:none;}
|
||||
.quiet {color:#666;}
|
||||
.loud {color:#000;}
|
||||
.highlight {background:#ff0;}
|
||||
.added {background:#060;color:#fff;}
|
||||
.removed {background:#900;color:#fff;}
|
||||
.first {margin-left:0;padding-left:0;}
|
||||
.last {margin-right:0;padding-right:0;}
|
||||
.top {margin-top:0;padding-top:0;}
|
||||
.bottom {margin-bottom:0;padding-bottom:0;}
|
||||
|
||||
/* forms.css */
|
||||
label {font-weight:bold;}
|
||||
fieldset {padding:0 1.4em 1.4em 1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
|
||||
legend {font-weight:bold;font-size:1.2em;margin-top:-0.2em;margin-bottom:1em;}
|
||||
fieldset, #IE8#HACK {padding-top:1.4em;}
|
||||
legend, #IE8#HACK {margin-top:0;margin-bottom:0;}
|
||||
input[type=text], input[type=password], input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;}
|
||||
input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus {border-color:#666;}
|
||||
select {background-color:#fff;border-width:1px;border-style:solid;}
|
||||
input[type=text], input[type=password], input.text, input.title, textarea, select {margin:0.5em 0;}
|
||||
input.text, input.title {width:300px;padding:5px;}
|
||||
input.title {font-size:1.5em;}
|
||||
textarea {width:390px;height:250px;padding:5px;}
|
||||
form.inline {line-height:3;}
|
||||
form.inline p {margin-bottom:0;}
|
||||
.error, .alert, .notice, .success, .info {padding:0.8em;margin-bottom:1em;border:2px solid #ddd;}
|
||||
.error, .alert {background:#fbe3e4;color:#8a1f11;border-color:#fbc2c4;}
|
||||
.notice {background:#fff6bf;color:#514721;border-color:#ffd324;}
|
||||
.success {background:#e6efc2;color:#264409;border-color:#c6d880;}
|
||||
.info {background:#d5edf8;color:#205791;border-color:#92cae4;}
|
||||
.error a, .alert a {color:#8a1f11;}
|
||||
.notice a {color:#514721;}
|
||||
.success a {color:#264409;}
|
||||
.info a {color:#205791;}
|
||||
|
||||
/* grid.css */
|
||||
.container {width:950px;margin:0 auto;}
|
||||
.showgrid {background:url(src/grid.png);}
|
||||
.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {float:left;margin-right:10px;}
|
||||
.last {margin-right:0;}
|
||||
.span-1 {width:30px;}
|
||||
.span-2 {width:70px;}
|
||||
.span-3 {width:110px;}
|
||||
.span-4 {width:150px;}
|
||||
.span-5 {width:190px;}
|
||||
.span-6 {width:230px;}
|
||||
.span-7 {width:270px;}
|
||||
.span-8 {width:310px;}
|
||||
.span-9 {width:350px;}
|
||||
.span-10 {width:390px;}
|
||||
.span-11 {width:430px;}
|
||||
.span-12 {width:470px;}
|
||||
.span-13 {width:510px;}
|
||||
.span-14 {width:550px;}
|
||||
.span-15 {width:590px;}
|
||||
.span-16 {width:630px;}
|
||||
.span-17 {width:670px;}
|
||||
.span-18 {width:710px;}
|
||||
.span-19 {width:750px;}
|
||||
.span-20 {width:790px;}
|
||||
.span-21 {width:830px;}
|
||||
.span-22 {width:870px;}
|
||||
.span-23 {width:910px;}
|
||||
.span-24 {width:950px;margin-right:0;}
|
||||
input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px;border-right-width:1px;padding-left:5px;padding-right:5px;}
|
||||
input.span-1, textarea.span-1 {width:18px;}
|
||||
input.span-2, textarea.span-2 {width:58px;}
|
||||
input.span-3, textarea.span-3 {width:98px;}
|
||||
input.span-4, textarea.span-4 {width:138px;}
|
||||
input.span-5, textarea.span-5 {width:178px;}
|
||||
input.span-6, textarea.span-6 {width:218px;}
|
||||
input.span-7, textarea.span-7 {width:258px;}
|
||||
input.span-8, textarea.span-8 {width:298px;}
|
||||
input.span-9, textarea.span-9 {width:338px;}
|
||||
input.span-10, textarea.span-10 {width:378px;}
|
||||
input.span-11, textarea.span-11 {width:418px;}
|
||||
input.span-12, textarea.span-12 {width:458px;}
|
||||
input.span-13, textarea.span-13 {width:498px;}
|
||||
input.span-14, textarea.span-14 {width:538px;}
|
||||
input.span-15, textarea.span-15 {width:578px;}
|
||||
input.span-16, textarea.span-16 {width:618px;}
|
||||
input.span-17, textarea.span-17 {width:658px;}
|
||||
input.span-18, textarea.span-18 {width:698px;}
|
||||
input.span-19, textarea.span-19 {width:738px;}
|
||||
input.span-20, textarea.span-20 {width:778px;}
|
||||
input.span-21, textarea.span-21 {width:818px;}
|
||||
input.span-22, textarea.span-22 {width:858px;}
|
||||
input.span-23, textarea.span-23 {width:898px;}
|
||||
input.span-24, textarea.span-24 {width:938px;}
|
||||
.append-1 {padding-right:40px;}
|
||||
.append-2 {padding-right:80px;}
|
||||
.append-3 {padding-right:120px;}
|
||||
.append-4 {padding-right:160px;}
|
||||
.append-5 {padding-right:200px;}
|
||||
.append-6 {padding-right:240px;}
|
||||
.append-7 {padding-right:280px;}
|
||||
.append-8 {padding-right:320px;}
|
||||
.append-9 {padding-right:360px;}
|
||||
.append-10 {padding-right:400px;}
|
||||
.append-11 {padding-right:440px;}
|
||||
.append-12 {padding-right:480px;}
|
||||
.append-13 {padding-right:520px;}
|
||||
.append-14 {padding-right:560px;}
|
||||
.append-15 {padding-right:600px;}
|
||||
.append-16 {padding-right:640px;}
|
||||
.append-17 {padding-right:680px;}
|
||||
.append-18 {padding-right:720px;}
|
||||
.append-19 {padding-right:760px;}
|
||||
.append-20 {padding-right:800px;}
|
||||
.append-21 {padding-right:840px;}
|
||||
.append-22 {padding-right:880px;}
|
||||
.append-23 {padding-right:920px;}
|
||||
.prepend-1 {padding-left:40px;}
|
||||
.prepend-2 {padding-left:80px;}
|
||||
.prepend-3 {padding-left:120px;}
|
||||
.prepend-4 {padding-left:160px;}
|
||||
.prepend-5 {padding-left:200px;}
|
||||
.prepend-6 {padding-left:240px;}
|
||||
.prepend-7 {padding-left:280px;}
|
||||
.prepend-8 {padding-left:320px;}
|
||||
.prepend-9 {padding-left:360px;}
|
||||
.prepend-10 {padding-left:400px;}
|
||||
.prepend-11 {padding-left:440px;}
|
||||
.prepend-12 {padding-left:480px;}
|
||||
.prepend-13 {padding-left:520px;}
|
||||
.prepend-14 {padding-left:560px;}
|
||||
.prepend-15 {padding-left:600px;}
|
||||
.prepend-16 {padding-left:640px;}
|
||||
.prepend-17 {padding-left:680px;}
|
||||
.prepend-18 {padding-left:720px;}
|
||||
.prepend-19 {padding-left:760px;}
|
||||
.prepend-20 {padding-left:800px;}
|
||||
.prepend-21 {padding-left:840px;}
|
||||
.prepend-22 {padding-left:880px;}
|
||||
.prepend-23 {padding-left:920px;}
|
||||
.border {padding-right:4px;margin-right:5px;border-right:1px solid #ddd;}
|
||||
.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #ddd;}
|
||||
.pull-1 {margin-left:-40px;}
|
||||
.pull-2 {margin-left:-80px;}
|
||||
.pull-3 {margin-left:-120px;}
|
||||
.pull-4 {margin-left:-160px;}
|
||||
.pull-5 {margin-left:-200px;}
|
||||
.pull-6 {margin-left:-240px;}
|
||||
.pull-7 {margin-left:-280px;}
|
||||
.pull-8 {margin-left:-320px;}
|
||||
.pull-9 {margin-left:-360px;}
|
||||
.pull-10 {margin-left:-400px;}
|
||||
.pull-11 {margin-left:-440px;}
|
||||
.pull-12 {margin-left:-480px;}
|
||||
.pull-13 {margin-left:-520px;}
|
||||
.pull-14 {margin-left:-560px;}
|
||||
.pull-15 {margin-left:-600px;}
|
||||
.pull-16 {margin-left:-640px;}
|
||||
.pull-17 {margin-left:-680px;}
|
||||
.pull-18 {margin-left:-720px;}
|
||||
.pull-19 {margin-left:-760px;}
|
||||
.pull-20 {margin-left:-800px;}
|
||||
.pull-21 {margin-left:-840px;}
|
||||
.pull-22 {margin-left:-880px;}
|
||||
.pull-23 {margin-left:-920px;}
|
||||
.pull-24 {margin-left:-960px;}
|
||||
.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;}
|
||||
.push-1 {margin:0 -40px 1.5em 40px;}
|
||||
.push-2 {margin:0 -80px 1.5em 80px;}
|
||||
.push-3 {margin:0 -120px 1.5em 120px;}
|
||||
.push-4 {margin:0 -160px 1.5em 160px;}
|
||||
.push-5 {margin:0 -200px 1.5em 200px;}
|
||||
.push-6 {margin:0 -240px 1.5em 240px;}
|
||||
.push-7 {margin:0 -280px 1.5em 280px;}
|
||||
.push-8 {margin:0 -320px 1.5em 320px;}
|
||||
.push-9 {margin:0 -360px 1.5em 360px;}
|
||||
.push-10 {margin:0 -400px 1.5em 400px;}
|
||||
.push-11 {margin:0 -440px 1.5em 440px;}
|
||||
.push-12 {margin:0 -480px 1.5em 480px;}
|
||||
.push-13 {margin:0 -520px 1.5em 520px;}
|
||||
.push-14 {margin:0 -560px 1.5em 560px;}
|
||||
.push-15 {margin:0 -600px 1.5em 600px;}
|
||||
.push-16 {margin:0 -640px 1.5em 640px;}
|
||||
.push-17 {margin:0 -680px 1.5em 680px;}
|
||||
.push-18 {margin:0 -720px 1.5em 720px;}
|
||||
.push-19 {margin:0 -760px 1.5em 760px;}
|
||||
.push-20 {margin:0 -800px 1.5em 800px;}
|
||||
.push-21 {margin:0 -840px 1.5em 840px;}
|
||||
.push-22 {margin:0 -880px 1.5em 880px;}
|
||||
.push-23 {margin:0 -920px 1.5em 920px;}
|
||||
.push-24 {margin:0 -960px 1.5em 960px;}
|
||||
.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:left;position:relative;}
|
||||
div.prepend-top, .prepend-top {margin-top:1.5em;}
|
||||
div.append-bottom, .append-bottom {margin-bottom:1.5em;}
|
||||
.box {padding:1.5em;margin-bottom:1.5em;background:#e5eCf9;}
|
||||
hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:1px;margin:0 0 1.45em;border:none;}
|
||||
hr.space {background:#fff;color:#fff;visibility:hidden;}
|
||||
.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;}
|
||||
.clearfix, .container {display:block;}
|
||||
.clear {clear:both;}
|
|
@ -0,0 +1,81 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
forms.css
|
||||
* Sets up some default styling for forms
|
||||
* Gives you classes to enhance your forms
|
||||
|
||||
Usage:
|
||||
* For text fields, use class .title or .text
|
||||
* For inline forms, use .inline (even when using columns)
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
A special hack is included for IE8 since it does not apply padding
|
||||
correctly on fieldsets
|
||||
*/
|
||||
label { font-weight: bold; }
|
||||
fieldset { padding:0 1.4em 1.4em 1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; }
|
||||
legend { font-weight: bold; font-size:1.2em; margin-top:-0.2em; margin-bottom:1em; }
|
||||
|
||||
fieldset, #IE8#HACK { padding-top:1.4em; }
|
||||
legend, #IE8#HACK { margin-top:0; margin-bottom:0; }
|
||||
|
||||
/* Form fields
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
Attribute selectors are used to differentiate the different types
|
||||
of input elements, but to support old browsers, you will have to
|
||||
add classes for each one. ".title" simply creates a large text
|
||||
field, this is purely for looks.
|
||||
*/
|
||||
input[type=text], input[type=password],
|
||||
input.text, input.title,
|
||||
textarea {
|
||||
background-color:#fff;
|
||||
border:1px solid #bbb;
|
||||
}
|
||||
input[type=text]:focus, input[type=password]:focus,
|
||||
input.text:focus, input.title:focus,
|
||||
textarea:focus {
|
||||
border-color:#666;
|
||||
}
|
||||
select { background-color:#fff; border-width:1px; border-style:solid; }
|
||||
|
||||
input[type=text], input[type=password],
|
||||
input.text, input.title,
|
||||
textarea, select {
|
||||
margin:0.5em 0;
|
||||
}
|
||||
|
||||
input.text,
|
||||
input.title { width: 300px; padding:5px; }
|
||||
input.title { font-size:1.5em; }
|
||||
textarea { width: 390px; height: 250px; padding:5px; }
|
||||
|
||||
/*
|
||||
This is to be used on forms where a variety of elements are
|
||||
placed side-by-side. Use the p tag to denote a line.
|
||||
*/
|
||||
form.inline { line-height:3; }
|
||||
form.inline p { margin-bottom:0; }
|
||||
|
||||
|
||||
/* Success, info, notice and error/alert boxes
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
.error,
|
||||
.alert,
|
||||
.notice,
|
||||
.success,
|
||||
.info { padding: 0.8em; margin-bottom: 1em; border: 2px solid #ddd; }
|
||||
|
||||
.error, .alert { background: #fbe3e4; color: #8a1f11; border-color: #fbc2c4; }
|
||||
.notice { background: #fff6bf; color: #514721; border-color: #ffd324; }
|
||||
.success { background: #e6efc2; color: #264409; border-color: #c6d880; }
|
||||
.info { background: #d5edf8; color: #205791; border-color: #92cae4; }
|
||||
.error a, .alert a { color: #8a1f11; }
|
||||
.notice a { color: #514721; }
|
||||
.success a { color: #264409; }
|
||||
.info a { color: #205791; }
|
|
@ -0,0 +1,280 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
grid.css
|
||||
* Sets up an easy-to-use grid of 24 columns.
|
||||
|
||||
By default, the grid is 950px wide, with 24 columns
|
||||
spanning 30px, and a 10px margin between columns.
|
||||
|
||||
If you need fewer or more columns, namespaces or semantic
|
||||
element names, use the compressor script (lib/compress.rb)
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* A container should group all your columns. */
|
||||
.container {
|
||||
width: 950px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* Use this class on any .span / container to see the grid. */
|
||||
.showgrid {
|
||||
background: url(src/grid.png);
|
||||
}
|
||||
|
||||
|
||||
/* Columns
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Sets up basic grid floating and margin. */
|
||||
.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/* The last column in a row needs this class. */
|
||||
.last { margin-right: 0; }
|
||||
|
||||
/* Use these classes to set the width of a column. */
|
||||
.span-1 {width: 30px;}
|
||||
|
||||
.span-2 {width: 70px;}
|
||||
.span-3 {width: 110px;}
|
||||
.span-4 {width: 150px;}
|
||||
.span-5 {width: 190px;}
|
||||
.span-6 {width: 230px;}
|
||||
.span-7 {width: 270px;}
|
||||
.span-8 {width: 310px;}
|
||||
.span-9 {width: 350px;}
|
||||
.span-10 {width: 390px;}
|
||||
.span-11 {width: 430px;}
|
||||
.span-12 {width: 470px;}
|
||||
.span-13 {width: 510px;}
|
||||
.span-14 {width: 550px;}
|
||||
.span-15 {width: 590px;}
|
||||
.span-16 {width: 630px;}
|
||||
.span-17 {width: 670px;}
|
||||
.span-18 {width: 710px;}
|
||||
.span-19 {width: 750px;}
|
||||
.span-20 {width: 790px;}
|
||||
.span-21 {width: 830px;}
|
||||
.span-22 {width: 870px;}
|
||||
.span-23 {width: 910px;}
|
||||
.span-24 {width:950px; margin-right:0;}
|
||||
|
||||
/* Use these classes to set the width of an input. */
|
||||
input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {
|
||||
border-left-width: 1px;
|
||||
border-right-width: 1px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
input.span-1, textarea.span-1 { width: 18px; }
|
||||
input.span-2, textarea.span-2 { width: 58px; }
|
||||
input.span-3, textarea.span-3 { width: 98px; }
|
||||
input.span-4, textarea.span-4 { width: 138px; }
|
||||
input.span-5, textarea.span-5 { width: 178px; }
|
||||
input.span-6, textarea.span-6 { width: 218px; }
|
||||
input.span-7, textarea.span-7 { width: 258px; }
|
||||
input.span-8, textarea.span-8 { width: 298px; }
|
||||
input.span-9, textarea.span-9 { width: 338px; }
|
||||
input.span-10, textarea.span-10 { width: 378px; }
|
||||
input.span-11, textarea.span-11 { width: 418px; }
|
||||
input.span-12, textarea.span-12 { width: 458px; }
|
||||
input.span-13, textarea.span-13 { width: 498px; }
|
||||
input.span-14, textarea.span-14 { width: 538px; }
|
||||
input.span-15, textarea.span-15 { width: 578px; }
|
||||
input.span-16, textarea.span-16 { width: 618px; }
|
||||
input.span-17, textarea.span-17 { width: 658px; }
|
||||
input.span-18, textarea.span-18 { width: 698px; }
|
||||
input.span-19, textarea.span-19 { width: 738px; }
|
||||
input.span-20, textarea.span-20 { width: 778px; }
|
||||
input.span-21, textarea.span-21 { width: 818px; }
|
||||
input.span-22, textarea.span-22 { width: 858px; }
|
||||
input.span-23, textarea.span-23 { width: 898px; }
|
||||
input.span-24, textarea.span-24 { width: 938px; }
|
||||
|
||||
/* Add these to a column to append empty cols. */
|
||||
|
||||
.append-1 { padding-right: 40px;}
|
||||
.append-2 { padding-right: 80px;}
|
||||
.append-3 { padding-right: 120px;}
|
||||
.append-4 { padding-right: 160px;}
|
||||
.append-5 { padding-right: 200px;}
|
||||
.append-6 { padding-right: 240px;}
|
||||
.append-7 { padding-right: 280px;}
|
||||
.append-8 { padding-right: 320px;}
|
||||
.append-9 { padding-right: 360px;}
|
||||
.append-10 { padding-right: 400px;}
|
||||
.append-11 { padding-right: 440px;}
|
||||
.append-12 { padding-right: 480px;}
|
||||
.append-13 { padding-right: 520px;}
|
||||
.append-14 { padding-right: 560px;}
|
||||
.append-15 { padding-right: 600px;}
|
||||
.append-16 { padding-right: 640px;}
|
||||
.append-17 { padding-right: 680px;}
|
||||
.append-18 { padding-right: 720px;}
|
||||
.append-19 { padding-right: 760px;}
|
||||
.append-20 { padding-right: 800px;}
|
||||
.append-21 { padding-right: 840px;}
|
||||
.append-22 { padding-right: 880px;}
|
||||
.append-23 { padding-right: 920px;}
|
||||
|
||||
/* Add these to a column to prepend empty cols. */
|
||||
|
||||
.prepend-1 { padding-left: 40px;}
|
||||
.prepend-2 { padding-left: 80px;}
|
||||
.prepend-3 { padding-left: 120px;}
|
||||
.prepend-4 { padding-left: 160px;}
|
||||
.prepend-5 { padding-left: 200px;}
|
||||
.prepend-6 { padding-left: 240px;}
|
||||
.prepend-7 { padding-left: 280px;}
|
||||
.prepend-8 { padding-left: 320px;}
|
||||
.prepend-9 { padding-left: 360px;}
|
||||
.prepend-10 { padding-left: 400px;}
|
||||
.prepend-11 { padding-left: 440px;}
|
||||
.prepend-12 { padding-left: 480px;}
|
||||
.prepend-13 { padding-left: 520px;}
|
||||
.prepend-14 { padding-left: 560px;}
|
||||
.prepend-15 { padding-left: 600px;}
|
||||
.prepend-16 { padding-left: 640px;}
|
||||
.prepend-17 { padding-left: 680px;}
|
||||
.prepend-18 { padding-left: 720px;}
|
||||
.prepend-19 { padding-left: 760px;}
|
||||
.prepend-20 { padding-left: 800px;}
|
||||
.prepend-21 { padding-left: 840px;}
|
||||
.prepend-22 { padding-left: 880px;}
|
||||
.prepend-23 { padding-left: 920px;}
|
||||
|
||||
|
||||
/* Border on right hand side of a column. */
|
||||
.border {
|
||||
padding-right: 4px;
|
||||
margin-right: 5px;
|
||||
border-right: 1px solid #ddd;
|
||||
}
|
||||
|
||||
/* Border with more whitespace, spans one column. */
|
||||
.colborder {
|
||||
padding-right: 24px;
|
||||
margin-right: 25px;
|
||||
border-right: 1px solid #ddd;
|
||||
}
|
||||
|
||||
|
||||
/* Use these classes on an element to push it into the
|
||||
next column, or to pull it into the previous column. */
|
||||
|
||||
|
||||
.pull-1 { margin-left: -40px; }
|
||||
.pull-2 { margin-left: -80px; }
|
||||
.pull-3 { margin-left: -120px; }
|
||||
.pull-4 { margin-left: -160px; }
|
||||
.pull-5 { margin-left: -200px; }
|
||||
.pull-6 { margin-left: -240px; }
|
||||
.pull-7 { margin-left: -280px; }
|
||||
.pull-8 { margin-left: -320px; }
|
||||
.pull-9 { margin-left: -360px; }
|
||||
.pull-10 { margin-left: -400px; }
|
||||
.pull-11 { margin-left: -440px; }
|
||||
.pull-12 { margin-left: -480px; }
|
||||
.pull-13 { margin-left: -520px; }
|
||||
.pull-14 { margin-left: -560px; }
|
||||
.pull-15 { margin-left: -600px; }
|
||||
.pull-16 { margin-left: -640px; }
|
||||
.pull-17 { margin-left: -680px; }
|
||||
.pull-18 { margin-left: -720px; }
|
||||
.pull-19 { margin-left: -760px; }
|
||||
.pull-20 { margin-left: -800px; }
|
||||
.pull-21 { margin-left: -840px; }
|
||||
.pull-22 { margin-left: -880px; }
|
||||
.pull-23 { margin-left: -920px; }
|
||||
.pull-24 { margin-left: -960px; }
|
||||
|
||||
.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float: left; position:relative;}
|
||||
|
||||
|
||||
.push-1 { margin: 0 -40px 1.5em 40px; }
|
||||
.push-2 { margin: 0 -80px 1.5em 80px; }
|
||||
.push-3 { margin: 0 -120px 1.5em 120px; }
|
||||
.push-4 { margin: 0 -160px 1.5em 160px; }
|
||||
.push-5 { margin: 0 -200px 1.5em 200px; }
|
||||
.push-6 { margin: 0 -240px 1.5em 240px; }
|
||||
.push-7 { margin: 0 -280px 1.5em 280px; }
|
||||
.push-8 { margin: 0 -320px 1.5em 320px; }
|
||||
.push-9 { margin: 0 -360px 1.5em 360px; }
|
||||
.push-10 { margin: 0 -400px 1.5em 400px; }
|
||||
.push-11 { margin: 0 -440px 1.5em 440px; }
|
||||
.push-12 { margin: 0 -480px 1.5em 480px; }
|
||||
.push-13 { margin: 0 -520px 1.5em 520px; }
|
||||
.push-14 { margin: 0 -560px 1.5em 560px; }
|
||||
.push-15 { margin: 0 -600px 1.5em 600px; }
|
||||
.push-16 { margin: 0 -640px 1.5em 640px; }
|
||||
.push-17 { margin: 0 -680px 1.5em 680px; }
|
||||
.push-18 { margin: 0 -720px 1.5em 720px; }
|
||||
.push-19 { margin: 0 -760px 1.5em 760px; }
|
||||
.push-20 { margin: 0 -800px 1.5em 800px; }
|
||||
.push-21 { margin: 0 -840px 1.5em 840px; }
|
||||
.push-22 { margin: 0 -880px 1.5em 880px; }
|
||||
.push-23 { margin: 0 -920px 1.5em 920px; }
|
||||
.push-24 { margin: 0 -960px 1.5em 960px; }
|
||||
|
||||
.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float: left; position:relative;}
|
||||
|
||||
|
||||
/* Misc classes and elements
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* In case you need to add a gutter above/below an element */
|
||||
div.prepend-top, .prepend-top {
|
||||
margin-top:1.5em;
|
||||
}
|
||||
div.append-bottom, .append-bottom {
|
||||
margin-bottom:1.5em;
|
||||
}
|
||||
|
||||
/* Use a .box to create a padded box inside a column. */
|
||||
.box {
|
||||
padding: 1.5em;
|
||||
margin-bottom: 1.5em;
|
||||
background: #e5eCf9;
|
||||
}
|
||||
|
||||
/* Use this to create a horizontal ruler across a column. */
|
||||
hr {
|
||||
background: #ddd;
|
||||
color: #ddd;
|
||||
clear: both;
|
||||
float: none;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
margin: 0 0 1.45em;
|
||||
border: none;
|
||||
}
|
||||
|
||||
hr.space {
|
||||
background: #fff;
|
||||
color: #fff;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* Clearing floats without extra markup
|
||||
Based on How To Clear Floats Without Structural Markup by PiE
|
||||
[http://www.positioniseverything.net/easyclearing.html] */
|
||||
|
||||
.clearfix:after, .container:after {
|
||||
content: "\0020";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
overflow:hidden;
|
||||
}
|
||||
.clearfix, .container {display: block;}
|
||||
|
||||
/* Regular clearing
|
||||
apply to column that should drop below previous ones. */
|
||||
|
||||
.clear { clear:both; }
|
After Width: | Height: | Size: 195 B |
|
@ -0,0 +1,79 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
ie.css
|
||||
|
||||
Contains every hack for Internet Explorer,
|
||||
so that our core files stay sweet and nimble.
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Make sure the layout is centered in IE5 */
|
||||
body { text-align: center; }
|
||||
.container { text-align: left; }
|
||||
|
||||
/* Fixes IE margin bugs */
|
||||
* html .column, * html .span-1, * html .span-2,
|
||||
* html .span-3, * html .span-4, * html .span-5,
|
||||
* html .span-6, * html .span-7, * html .span-8,
|
||||
* html .span-9, * html .span-10, * html .span-11,
|
||||
* html .span-12, * html .span-13, * html .span-14,
|
||||
* html .span-15, * html .span-16, * html .span-17,
|
||||
* html .span-18, * html .span-19, * html .span-20,
|
||||
* html .span-21, * html .span-22, * html .span-23,
|
||||
* html .span-24 { display:inline; overflow-x: hidden; }
|
||||
|
||||
|
||||
/* Elements
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Fixes incorrect styling of legend in IE6. */
|
||||
* html legend { margin:0px -8px 16px 0; padding:0; }
|
||||
|
||||
/* Fixes wrong line-height on sup/sub in IE. */
|
||||
sup { vertical-align:text-top; }
|
||||
sub { vertical-align:text-bottom; }
|
||||
|
||||
/* Fixes IE7 missing wrapping of code elements. */
|
||||
html>body p code { *white-space: normal; }
|
||||
|
||||
/* IE 6&7 has problems with setting proper <hr> margins. */
|
||||
hr { margin:-8px auto 11px; }
|
||||
|
||||
/* Explicitly set interpolation, allowing dynamically resized images to not look horrible */
|
||||
img { -ms-interpolation-mode:bicubic; }
|
||||
|
||||
/* Clearing
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Makes clearfix actually work in IE */
|
||||
.clearfix, .container { display:inline-block; }
|
||||
* html .clearfix,
|
||||
* html .container { height:1%; }
|
||||
|
||||
|
||||
/* Forms
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Fixes padding on fieldset */
|
||||
fieldset { padding-top:0; }
|
||||
legend { margin-top:-0.2em; margin-bottom:1em; margin-left:-0.5em; }
|
||||
|
||||
/* Makes classic textareas in IE 6 resemble other browsers */
|
||||
textarea { overflow:auto; }
|
||||
|
||||
/* Makes labels behave correctly in IE 6 and 7 */
|
||||
label { vertical-align:middle; position:relative; top:-0.25em; }
|
||||
|
||||
/* Fixes rule that IE 6 ignores */
|
||||
input.text, input.title, textarea { background-color:#fff; border:1px solid #bbb; }
|
||||
input.text:focus, input.title:focus { border-color:#666; }
|
||||
input.text, input.title, textarea, select { margin:0.5em 0; }
|
||||
input.checkbox, input.radio { position:relative; top:.25em; }
|
||||
|
||||
/* Fixes alignment of inline form elements */
|
||||
form.inline div, form.inline p { vertical-align:middle; }
|
||||
form.inline input.checkbox, form.inline input.radio,
|
||||
form.inline input.button, form.inline button {
|
||||
margin:0.5em 0;
|
||||
}
|
||||
button, input.button { position:relative;top:0.25em; }
|
|
@ -0,0 +1,92 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
print.css
|
||||
* Gives you some sensible styles for printing pages.
|
||||
* See Readme file in this directory for further instructions.
|
||||
|
||||
Some additions you'll want to make, customized to your markup:
|
||||
#header, #footer, #navigation { display:none; }
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
body {
|
||||
line-height: 1.5;
|
||||
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||
color:#000;
|
||||
background: none;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
|
||||
/* Layout
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
.container {
|
||||
background: none;
|
||||
}
|
||||
|
||||
hr {
|
||||
background:#ccc;
|
||||
color:#ccc;
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:2em 0;
|
||||
padding:0;
|
||||
border:none;
|
||||
}
|
||||
hr.space {
|
||||
background: #fff;
|
||||
color: #fff;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* Text
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
h1,h2,h3,h4,h5,h6 { font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif; }
|
||||
code { font:.9em "Courier New", Monaco, Courier, monospace; }
|
||||
|
||||
a img { border:none; }
|
||||
p img.top { margin-top: 0; }
|
||||
|
||||
blockquote {
|
||||
margin:1.5em;
|
||||
padding:1em;
|
||||
font-style:italic;
|
||||
font-size:.9em;
|
||||
}
|
||||
|
||||
.small { font-size: .9em; }
|
||||
.large { font-size: 1.1em; }
|
||||
.quiet { color: #999; }
|
||||
.hide { display:none; }
|
||||
|
||||
|
||||
/* Links
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
a:link, a:visited {
|
||||
background: transparent;
|
||||
font-weight:700;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/*
|
||||
This has been the source of many questions in the past. This
|
||||
snippet of CSS appends the URL of each link within the text.
|
||||
The idea is that users printing your webpage will want to know
|
||||
the URLs they go to. If you want to remove this functionality,
|
||||
comment out this snippet and make sure to re-compress your files.
|
||||
*/
|
||||
a:link:after, a:visited:after {
|
||||
content: " (" attr(href) ")";
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
/* If you're having trouble printing relative links, uncomment and customize this:
|
||||
(note: This is valid CSS3, but it still won't go through the W3C CSS Validator) */
|
||||
|
||||
/* a[href^="/"]:after {
|
||||
content: " (http://www.yourdomain.com" attr(href) ") ";
|
||||
} */
|
|
@ -0,0 +1,67 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
reset.css
|
||||
* Resets default browser CSS.
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
html {
|
||||
margin:0;
|
||||
padding:0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
body, div, span, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, code,
|
||||
del, dfn, em, img, q, dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
||||
article, aside, dialog, figure, footer, header,
|
||||
hgroup, nav, section {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-weight: inherit;
|
||||
font-style: inherit;
|
||||
font-size: 100%;
|
||||
font-family: inherit;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* This helps to make newer HTML5 elements behave like DIVs in older browers */
|
||||
article, aside, dialog, figure, footer, header,
|
||||
hgroup, nav, section {
|
||||
display:block;
|
||||
}
|
||||
|
||||
/* Line-height should always be unitless! */
|
||||
body {
|
||||
line-height: 1.5;
|
||||
background: white;
|
||||
}
|
||||
|
||||
/* Tables still need 'cellspacing="0"' in the markup. */
|
||||
table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
/* float:none prevents the span-x classes from breaking table-cell display */
|
||||
caption, th, td {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
float:none !important;
|
||||
}
|
||||
table, th, td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Remove possible quote marks (") from <q>, <blockquote>. */
|
||||
blockquote:before, blockquote:after, q:before, q:after { content: ''; }
|
||||
blockquote, q { quotes: "" ""; }
|
||||
|
||||
/* Remove annoying border on linked images. */
|
||||
a img { border: none; }
|
||||
|
||||
/* Remember to define your own focus styles! */
|
||||
:focus { outline: 0; }
|
|
@ -0,0 +1,123 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
typography.css
|
||||
* Sets up some sensible default typography.
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Default font settings.
|
||||
The font-size percentage is of 16px. (0.75 * 16px = 12px) */
|
||||
html { font-size:100.01%; }
|
||||
body {
|
||||
font-size: 75%;
|
||||
color: #222;
|
||||
background: #fff;
|
||||
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/* Headings
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
h1,h2,h3,h4,h5,h6 { font-weight: normal; color: #111; }
|
||||
|
||||
h1 { font-size: 3em; line-height: 1; margin-bottom: 0.5em; }
|
||||
h2 { font-size: 2em; margin-bottom: 0.75em; }
|
||||
h3 { font-size: 1.5em; line-height: 1; margin-bottom: 1em; }
|
||||
h4 { font-size: 1.2em; line-height: 1.25; margin-bottom: 1.25em; }
|
||||
h5 { font-size: 1em; font-weight: bold; margin-bottom: 1.5em; }
|
||||
h6 { font-size: 1em; font-weight: bold; }
|
||||
|
||||
h1 img, h2 img, h3 img,
|
||||
h4 img, h5 img, h6 img {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
/* Text elements
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
p { margin: 0 0 1.5em; }
|
||||
/*
|
||||
These can be used to pull an image at the start of a paragraph, so
|
||||
that the text flows around it (usage: <p><img class="left">Text</p>)
|
||||
*/
|
||||
.left { float: left !important; }
|
||||
p .left { margin: 1.5em 1.5em 1.5em 0; padding: 0; }
|
||||
.right { float: right !important; }
|
||||
p .right { margin: 1.5em 0 1.5em 1.5em; padding: 0; }
|
||||
|
||||
a:focus,
|
||||
a:hover { color: #09f; }
|
||||
a { color: #06c; text-decoration: underline; }
|
||||
|
||||
blockquote { margin: 1.5em; color: #666; font-style: italic; }
|
||||
strong,dfn { font-weight: bold; }
|
||||
em,dfn { font-style: italic; }
|
||||
sup, sub { line-height: 0; }
|
||||
|
||||
abbr,
|
||||
acronym { border-bottom: 1px dotted #666; }
|
||||
address { margin: 0 0 1.5em; font-style: italic; }
|
||||
del { color:#666; }
|
||||
|
||||
pre { margin: 1.5em 0; white-space: pre; }
|
||||
pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; }
|
||||
|
||||
|
||||
/* Lists
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
li ul,
|
||||
li ol { margin: 0; }
|
||||
ul, ol { margin: 0 1.5em 1.5em 0; padding-left: 1.5em; }
|
||||
|
||||
ul { list-style-type: disc; }
|
||||
ol { list-style-type: decimal; }
|
||||
|
||||
dl { margin: 0 0 1.5em 0; }
|
||||
dl dt { font-weight: bold; }
|
||||
dd { margin-left: 1.5em;}
|
||||
|
||||
|
||||
/* Tables
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
Because of the need for padding on TH and TD, the vertical rhythm
|
||||
on table cells has to be 27px, instead of the standard 18px or 36px
|
||||
of other elements.
|
||||
*/
|
||||
table { margin-bottom: 1.4em; width:100%; }
|
||||
th { font-weight: bold; }
|
||||
thead th { background: #c3d9ff; }
|
||||
th,td,caption { padding: 4px 10px 4px 5px; }
|
||||
/*
|
||||
You can zebra-stripe your tables in outdated browsers by adding
|
||||
the class "even" to every other table row.
|
||||
*/
|
||||
tbody tr:nth-child(even) td,
|
||||
tbody tr.even td {
|
||||
background: #e5ecf9;
|
||||
}
|
||||
tfoot { font-style: italic; }
|
||||
caption { background: #eee; }
|
||||
|
||||
|
||||
/* Misc classes
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
.small { font-size: .8em; margin-bottom: 1.875em; line-height: 1.875em; }
|
||||
.large { font-size: 1.2em; line-height: 2.5em; margin-bottom: 1.25em; }
|
||||
.hide { display: none; }
|
||||
|
||||
.quiet { color: #666; }
|
||||
.loud { color: #000; }
|
||||
.highlight { background:#ff0; }
|
||||
.added { background:#060; color: #fff; }
|
||||
.removed { background:#900; color: #fff; }
|
||||
|
||||
.first { margin-left:0; padding-left:0; }
|
||||
.last { margin-right:0; padding-right:0; }
|
||||
.top { margin-top:0; padding-top:0; }
|
||||
.bottom { margin-bottom:0; padding-bottom:0; }
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Blue Orchid - The White Stripes - BeatHaven</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="css/blueprint/screen.css" type="text/css" media="screen, projection" />
|
||||
<link rel="stylesheet" href="css/blueprint/print.css" type="text/css" media="print" />
|
||||
<link rel="stylesheet" href="css/beathaven.css" type="text/css" media="screen" />
|
||||
<!--[if lt IE 8]>
|
||||
<link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection" />
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js/beathaven.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="player_container" class="showgrid">
|
||||
<div id="playerControlPrevTrack">←</div>
|
||||
<div id="playerControlPlay">></div>
|
||||
<div id="playerControlStop" class="hide">[-]</div>
|
||||
<div id="playerControlNextTrack">→</div>
|
||||
</div>
|
||||
<div id="main_container" class="showgrid">
|
||||
<h1>The White Stripes</h1>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
$(function(){
|
||||
bhPage.init();
|
||||
})
|
||||
|
||||
var bhPage = {
|
||||
init: function(){
|
||||
this.fixPage();
|
||||
},
|
||||
fixPage: function(){
|
||||
$('#player_container').css('left', Math.round(($(window).width() - 950) / 2));
|
||||
$('#main_container').css('margin-left', Math.round(($(window).width() - 950) / 2));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
date_default_timezone_set('Europe/Moscow');
|
||||
|
||||
chdir('..');
|
||||
require_once 'common.php';
|
||||
Config::loadFile('app', 'config/app.ini');
|
||||
|
||||
$artist_name = 'Foo Fighters';
|
||||
if (isset($_GET['q']) && $_GET['q'] != '') {
|
||||
$artist_name = $q = $_GET['q'];
|
||||
} else {
|
||||
$q = $artist_name;
|
||||
}
|
||||
|
||||
$a_model = Model::factory('musicbrainz', 'Artist');
|
||||
$rg_model = Model::factory('musicbrainz', 'ReleaseGroup');
|
||||
$r_model = Model::factory('musicbrainz', 'Release');
|
||||
$t_model = Model::factory('musicbrainz', 'Track');
|
||||
|
||||
$artist_id = $a_model->getId($artist_name);
|
||||
|
||||
if (!$artist_id) {
|
||||
echo "Bad artist name!\n\n\n"; die;
|
||||
}
|
||||
|
||||
$albums = $rg_model->getArtistAlbums($artist_id);
|
||||
$release_groups = $r_model->getReleases(array_keys($albums), true);
|
||||
|
||||
$g_tracks = array();
|
||||
foreach ($release_groups as $release_group => $releases) {
|
||||
$g_tracks[$release_group] = $t_model->getUniqueReleaseTracks(array_keys($releases));
|
||||
}
|
||||
|
||||
include 'tpl/index.php';
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
$name = 'Hey, J.o-hN PArk\'em "all 21"';
|
||||
|
||||
preg_match_all('/[a-z0-9]/Ui', $name, $m);
|
||||
|
||||
echo strtolower(implode($m[0]));
|
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Beat Heaven: <?= $artist_name ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style type="text/css">
|
||||
body, input { font-family: Georgia; }
|
||||
hr { border: none; border-bottom: #AAA 1px solid; }
|
||||
.album { margin: 1em 0 3em 0; width: 50em; }
|
||||
.album .album-title { font-size: 1.5em; }
|
||||
.duration, .year, .bonus { color: #AAA; }
|
||||
.parsed { color: #4C4; }
|
||||
.unparsed { color: #C44; }
|
||||
input { font-size: 2em; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form>
|
||||
<input type="text" name="q" value="<?= $q ?>"/>
|
||||
</form>
|
||||
<div class="albums">
|
||||
<? foreach($albums as $rg => $album): if (isset($g_tracks[$rg]) && count($g_tracks[$rg]) > 0): ?>
|
||||
<div class="album">
|
||||
<div class="album-title">
|
||||
<span class="name"><?= $album['name'] ?></span>
|
||||
<span class="year">(<?= $album['year'] ? $album['year'] : '?' ?>)</span>
|
||||
</div>
|
||||
<ol>
|
||||
<? foreach($g_tracks[$rg]['tracks'] as $track): ?>
|
||||
<? $track['parsed'] = BeatDB::exists($track['id']); ?>
|
||||
<? $m = floor($track['length'] / 60); $s = ($track['length'] - ($m * 60)); $d = $m .':'. ($s < 10 ? '0' : ''). $s; ?>
|
||||
<li><?= $track['name'] ?> <span class="duration"><?= $d ?></span><?= ($track['parsed'] ? ' <span class="parsed">(parsed)</span>' : ' <span class="unparsed">(not parsed)</span>') ?></li>
|
||||
<? endforeach; ?>
|
||||
</ol>
|
||||
<? if (count($g_tracks[$rg]['bonus']) > 0): ?>
|
||||
<span class="bonus">Bonus:</span>
|
||||
<ol>
|
||||
<? foreach($g_tracks[$rg]['bonus'] as $track): ?>
|
||||
<? $track['parsed'] = BeatDB::exists($track['id']); ?>
|
||||
<? $m = floor($track['length'] / 60); $s = ($track['length'] - ($m * 60)); $d = $m .':'. ($s < 10 ? '0' : ''). $s; ?>
|
||||
<li><?= $track['name'] ?> <span class="duration"><?= $d ?></span><?= ($track['parsed'] ? ' <span class="parsed">(parsed)</span>' : ' <span class="unparsed">(not parsed)</span>') ?></li>
|
||||
<? endforeach; ?>
|
||||
</ol>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<? endif; endforeach; ?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,68 @@
|
|||
<style>
|
||||
body, td {font: 14px Verdana;}
|
||||
input {font: 18px Verdana;}
|
||||
.header td {background-color: #444; color: white;}
|
||||
.row td {background-color: #EEE;}
|
||||
a {text-decoration: none; border-bottom: 1px dashed;}
|
||||
.searches {position: absolute; left: 820px; top: 10px; line-height: 25px;}
|
||||
</style>
|
||||
<script>
|
||||
function play(url) {
|
||||
var player = document.getElementById('player');
|
||||
player.setAttribute('src', url);
|
||||
player.play();
|
||||
return(false);
|
||||
}
|
||||
function exec_search(q) {
|
||||
document.getElementById('search_field').setAttribute('value', q);
|
||||
document.getElementById('search_form').submit();
|
||||
return(false);
|
||||
}
|
||||
</script>
|
||||
<form method="post" id="search_form">
|
||||
<table cellspacing="1" cellpadding="10" border="0" style="width:800px;">
|
||||
<tr class="header">
|
||||
<td>
|
||||
<b>Query</b>
|
||||
</td>
|
||||
<td style="width:100%;" align="center">
|
||||
<input id="search_field" name="q" type"text" style="width:98%;" value="<?= (isset($_POST['q']) ? stripslashes($_POST['q']) : '') ?>"/>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Search"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="header">
|
||||
<td colspan="3" align="center">
|
||||
<audio id="player" controls preload></audio>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<table cellspacing="1" cellpadding="10" border="0" style="width:800px;">
|
||||
<? if (isset($_POST['q']) && count($files) > 0) { ?>
|
||||
<tr class="header">
|
||||
<? foreach (array_keys($files[0]) as $field) { ?>
|
||||
<td align="center"><b><?= $field ?></b></td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
<? foreach ($files as $row) { ?>
|
||||
<tr class="row">
|
||||
<? foreach ($row as $field_name => $field) { ?>
|
||||
<td><?= ( $field_name == 'url' ? '<a href="#" onclick="play(\''. $field .'\')">Play</a>' : $field) ?></td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
<? } ?>
|
||||
<tr class="row"><td align="center" colspan="7">Query time: <?= number_format($t_end - $t_start, 4, '.', '') ?>s</td></tr>
|
||||
<? } else { ?>
|
||||
<tr class="row"><td align="center">No data</td></tr>
|
||||
<? } ?>
|
||||
</table>
|
||||
|
||||
<div class="searches">
|
||||
<b>Parsed data:</b><br/>
|
||||
<? foreach ($completed as $file) { $file = str_replace('.data', '', $file); ?>
|
||||
<a href="#" onclick="exec_search('<?= $file ?>')"><?=$file?></a><br/>
|
||||
<? } ?>
|
||||
</div>
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
require_once 'classes/Vkontakte.class.php';
|
||||
require_once 'classes/File.class.php';
|
||||
require_once 'classes/Match.class.php';
|
||||
require_once 'classes/RemoteFile.class.php';
|
||||
|
||||
$_POST['q'] = 'Queen';
|
||||
|
||||
if (isset($_POST['q'])) {
|
||||
$q = File::prepareQuery($_POST['q']);
|
||||
$t_start = microtime(true);
|
||||
if (! file_exists('dump/html/'. $q .'.html')) {
|
||||
$parser = new Vkontakte();
|
||||
$files = $parser->parse($q);
|
||||
foreach ($files as $i => $file) {
|
||||
$size = File::getSizeByUrl($file['url']);
|
||||
if ($size) {
|
||||
$files[$i]['size'] = $size;
|
||||
$files[$i]['bitrate'] = File::calculateBitrate($files[$i]['size'], $files[$i]['duration']);
|
||||
} else {
|
||||
unset($files[$i]);
|
||||
}
|
||||
}
|
||||
//file_put_contents('dump/html/'. $q .'.html', $parser->getHtml());
|
||||
//file_put_contents('dump/data/'. $q .'.data', serialize($files));
|
||||
} else {
|
||||
$files = unserialize(file_get_contents('dump/data/'. $q .'.data'));
|
||||
}
|
||||
$t_end = microtime(true);
|
||||
$files = File::formatData($files);
|
||||
}
|
||||
|
||||
$completed = array_slice(scandir('dump/data'), 2);
|
||||
|
||||
|
||||
include 'tpl/vksearch.php';
|
|
@ -0,0 +1,6 @@
|
|||
class ArtistController < ApplicationController
|
||||
|
||||
def view
|
||||
@artist = Artist.find(params[:id])
|
||||
end
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
module ArtistHelper
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
class Artist < ActiveRecord::Base
|
||||
set_table_name 'musicbrainz.bh_artist'
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
<h1><% artist.name %></h1>
|
||||
<p>Find me in app/views/artist/view.rhtml</p>
|
|
@ -0,0 +1,5 @@
|
|||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
one:
|
||||
id: 1
|
||||
two:
|
||||
id: 2
|
|
@ -0,0 +1,18 @@
|
|||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'artist_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class ArtistController; def rescue_action(e) raise e end; end
|
||||
|
||||
class ArtistControllerTest < Test::Unit::TestCase
|
||||
def setup
|
||||
@controller = ArtistController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
# Replace this with your real tests.
|
||||
def test_truth
|
||||
assert true
|
||||
end
|
||||
end
|
|
@ -0,0 +1,10 @@
|
|||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class ArtistTest < Test::Unit::TestCase
|
||||
fixtures :artists
|
||||
|
||||
# Replace this with your real tests.
|
||||
def test_truth
|
||||
assert true
|
||||
end
|
||||
end
|