diff --git a/PHPCI/Application.php b/PHPCI/Application.php index 646645af..16fab7cf 100644 --- a/PHPCI/Application.php +++ b/PHPCI/Application.php @@ -14,6 +14,7 @@ use b8\Exception\HttpException; use b8\Http\Response; use b8\Http\Response\RedirectResponse; use b8\View; +use PHPCI\Model\Build; /** * PHPCI Front Controller @@ -91,18 +92,30 @@ class Application extends b8\Application $this->response->setContent($view->render()); } - if (View::exists('layout') && $this->response->hasLayout()) { - $view = new View('layout'); - $pageTitle = $this->config->get('page_title', null); + if ($this->response->hasLayout()) { + $this->setLayoutVariables($this->controller->layout); - if (!is_null($pageTitle)) { - $view->title = $pageTitle; - } - - $view->content = $this->response->getContent(); - $this->response->setContent($view->render()); + $this->controller->layout->content = $this->response->getContent(); + $this->response->setContent($this->controller->layout->render()); } return $this->response; } + + protected function loadController($class) + { + $controller = parent::loadController($class); + $controller->layout = new View('layout'); + $controller->layout->title = 'PHPCI'; + $controller->layout->breadcrumb = array(); + + return $controller; + } + + protected function setLayoutVariables(View &$layout) + { + /** @var \PHPCI\Store\ProjectStore $projectStore */ + $projectStore = b8\Store\Factory::getStore('Project'); + $layout->projects = $projectStore->getAll(); + } } diff --git a/PHPCI/Command/RunCommand.php b/PHPCI/Command/RunCommand.php index f6aa1288..f1c02360 100644 --- a/PHPCI/Command/RunCommand.php +++ b/PHPCI/Command/RunCommand.php @@ -62,8 +62,7 @@ class RunCommand extends Command { $this ->setName('phpci:run-builds') - ->setDescription('Run all pending PHPCI builds.') - ->addOption('verbose', 'v', InputOption::VALUE_NONE); + ->setDescription('Run all pending PHPCI builds.'); } /** @@ -75,7 +74,7 @@ class RunCommand extends Command // For verbose mode we want to output all informational and above // messages to the symphony output interface. - if ($input->getOption('verbose')) { + if ($input->hasOption('verbose') && $input->getOption('verbose')) { $this->logger->pushHandler( new OutputLogHandler($this->output, Logger::INFO) ); @@ -117,6 +116,7 @@ class RunCommand extends Command $this->logger->popHandler($buildDbLog); } catch (\Exception $ex) { $build->setStatus(Build::STATUS_FAILED); + $build->setFinished(new \DateTime()); $build->setLog($build->getLog() . PHP_EOL . PHP_EOL . $ex->getMessage()); $store->save($build); } diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php index 79e9eb94..2d0ea73a 100644 --- a/PHPCI/Controller/BuildController.php +++ b/PHPCI/Controller/BuildController.php @@ -13,6 +13,7 @@ use b8; use b8\Exception\HttpException\NotFoundException; use PHPCI\BuildFactory; use PHPCI\Model\Build; +use PHPCI\Model\Project; use PHPCI\Service\BuildService; /** @@ -58,8 +59,22 @@ class BuildController extends \PHPCI\Controller $this->view->build = $build; $this->view->data = $this->getBuildData($build); - $title = 'Build #' . $build->getId() . ' - ' . $build->getProjectTitle(); - $this->config->set('page_title', $title); + $this->layout->title = 'Build #' . $build->getId(); + $this->layout->subtitle = $build->getProjectTitle(); + + $nav = array( + 'title' => 'Build '.$build->getId(), + 'icon' => 'cog', + 'links' => array( + 'build/rebuild/' . $build->getId() => 'Rebuild Now', + ), + ); + + if ($_SESSION['phpci_user']->getIsAdmin()) { + $nav['links']['build/delete/' . $build->getId()] = 'Delete Build'; + } + + $this->layout->nav = $nav; } protected function getUiPlugins() @@ -168,4 +183,36 @@ class BuildController extends \PHPCI\Controller return $log; } + + public function latest() + { + $rtn = array( + 'pending' => $this->formatBuilds($this->buildStore->getByStatus(Build::STATUS_NEW)), + 'running' => $this->formatBuilds($this->buildStore->getByStatus(Build::STATUS_RUNNING)), + ); + + if ($this->request->isAjax()) { + die(json_encode($rtn)); + } + } + + protected function formatBuilds($builds) + { + Project::$sleepable = array('id', 'title', 'reference', 'type'); + + $rtn = array('count' => $builds['count'], 'items' => array()); + + foreach ($builds['items'] as $build) { + $item = $build->toArray(1); + + $header = new b8\View('Build/header-row'); + $header->build = $build; + + $item['header_row'] = $header->render(); + $rtn['items'][$item['id']] = $item; + } + + ksort($rtn['items']); + return $rtn; + } } diff --git a/PHPCI/Controller/HomeController.php b/PHPCI/Controller/HomeController.php index a4f8003d..3d42775d 100644 --- a/PHPCI/Controller/HomeController.php +++ b/PHPCI/Controller/HomeController.php @@ -11,6 +11,7 @@ namespace PHPCI\Controller; use b8; use PHPCI\BuildFactory; +use PHPCI\Model\Build; /** * Home Controller - Displays the PHPCI Dashboard. @@ -41,14 +42,14 @@ class HomeController extends \PHPCI\Controller */ public function index() { + $this->layout->title = 'Dashboard'; + $projects = $this->projectStore->getWhere(array(), 50, 0, array(), array('title' => 'ASC')); - $this->view->builds = $this->getLatestBuildsHtml(); + $this->view->builds = $this->buildStore->getLatestBuilds(null, 10); $this->view->projects = $projects['items']; $this->view->summary = $this->getSummaryHtml($projects); - $this->config->set('page_title', 'Dashboard'); - return $this->view->render(); } diff --git a/PHPCI/Controller/PluginController.php b/PHPCI/Controller/PluginController.php index 5cbb662d..b4281626 100644 --- a/PHPCI/Controller/PluginController.php +++ b/PHPCI/Controller/PluginController.php @@ -24,6 +24,10 @@ use PHPCI\Plugin\Util\PluginInformationCollection; class PluginController extends \PHPCI\Controller { protected $required = array( + 'php', + 'ext-mcrypt', + 'ext-pdo', + 'ext-pdo_mysql', 'block8/b8framework', 'ircmaxell/password-compat', 'swiftmailer/swiftmailer', @@ -31,7 +35,8 @@ class PluginController extends \PHPCI\Controller 'symfony/console', 'psr/log', 'monolog/monolog', - 'pimple/pimple' + 'pimple/pimple', + 'robmorgan/phinx', ); protected $canInstall; @@ -60,7 +65,7 @@ class PluginController extends \PHPCI\Controller $this->view->plugins = $pluginInfo->getInstalledPlugins(); - $this->config->set('page_title', 'Plugins'); + $this->layout->title = 'Plugins'; return $this->view->render(); } diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index 1e2c68d1..5b594b96 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -62,8 +62,9 @@ class ProjectController extends \PHPCI\Controller /** * View a specific project. */ - public function view($projectId, $branch = '') + public function view($projectId) { + $branch = $this->getParam('branch', ''); $project = $this->projectStore->getById($projectId); if (empty($project)) { @@ -87,7 +88,8 @@ class ProjectController extends \PHPCI\Controller $this->view->page = $page; $this->view->pages = $pages; - $this->config->set('page_title', $project->getTitle()); + $this->layout->title = $project->getTitle(); + $this->layout->subtitle = $this->view->branch; return $this->view->render(); } @@ -134,8 +136,9 @@ class ProjectController extends \PHPCI\Controller /** * AJAX get latest builds. */ - public function builds($projectId, $branch = '') + public function builds($projectId) { + $branch = $this->getParam('branch', ''); $builds = $this->getLatestBuildsHtml($projectId, urldecode($branch)); die($builds[0]); } @@ -173,7 +176,7 @@ class ProjectController extends \PHPCI\Controller */ public function add() { - $this->config->set('page_title', 'Add Project'); + $this->layout->title = 'Add Project'; $this->requireAdmin(); $method = $this->request->getMethod(); diff --git a/PHPCI/Controller/SessionController.php b/PHPCI/Controller/SessionController.php index a9b60333..f7bfa982 100644 --- a/PHPCI/Controller/SessionController.php +++ b/PHPCI/Controller/SessionController.php @@ -40,7 +40,7 @@ class SessionController extends \PHPCI\Controller if ($this->request->getMethod() == 'POST') { $user = $this->userStore->getByEmail($this->getParam('email')); - + if ($user && password_verify($this->getParam('password', ''), $user->getHash())) { $_SESSION['phpci_user_id'] = $user->getId(); header('Location: ' . $this->getLoginRedirect()); diff --git a/PHPCI/Controller/SettingsController.php b/PHPCI/Controller/SettingsController.php index bc5558ba..4cd9f0be 100644 --- a/PHPCI/Controller/SettingsController.php +++ b/PHPCI/Controller/SettingsController.php @@ -38,6 +38,7 @@ class SettingsController extends Controller public function index() { + $this->layout->title = 'Settings'; $this->view->settings = $this->settings; $emailSettings = array(); diff --git a/PHPCI/Controller/UserController.php b/PHPCI/Controller/UserController.php index 182cc3f0..3240edce 100644 --- a/PHPCI/Controller/UserController.php +++ b/PHPCI/Controller/UserController.php @@ -49,7 +49,7 @@ class UserController extends Controller $users = $this->userStore->getWhere(array(), 1000, 0, array(), array('email' => 'ASC')); $this->view->users = $users; - $this->config->set('page_title', 'Users'); + $this->layout->title = 'Users'; return $this->view->render(); } @@ -58,6 +58,8 @@ class UserController extends Controller { $user = $_SESSION['phpci_user']; + $this->layout->title = 'Edit Profile'; + if ($this->request->getMethod() == 'POST') { $name = $this->getParam('name', null); $email = $this->getParam('email', null); @@ -65,6 +67,8 @@ class UserController extends Controller $_SESSION['phpci_user'] = $this->userService->updateUser($user, $name, $email, $password); $user = $_SESSION['phpci_user']; + + $this->view->updated = 1; } $values = $user->getDataArray(); @@ -115,7 +119,7 @@ class UserController extends Controller throw new ForbiddenException('You do not have permission to do that.'); } - $this->config->set('page_title', 'Add User'); + $this->layout->title = 'Add User'; $method = $this->request->getMethod(); @@ -164,6 +168,9 @@ class UserController extends Controller throw new NotFoundException('User with ID: ' . $userId . ' does not exist.'); } + $this->layout->title = $user->getName(); + $this->layout->subtitle = 'Edit User'; + $values = array_merge($user->getDataArray(), $this->getParams()); $form = $this->userForm($values, 'edit/' . $userId); diff --git a/PHPCI/Model/Base/ProjectBase.php b/PHPCI/Model/Base/ProjectBase.php index 5e1f4f37..0161243c 100644 --- a/PHPCI/Model/Base/ProjectBase.php +++ b/PHPCI/Model/Base/ProjectBase.php @@ -36,13 +36,12 @@ class ProjectBase extends Model 'id' => null, 'title' => null, 'reference' => null, - 'branch' => null, 'ssh_private_key' => null, - 'ssh_public_key' => null, 'type' => null, 'access_information' => null, 'last_commit' => null, 'build_config' => null, + 'ssh_public_key' => null, 'allow_public_status' => null, ); @@ -54,13 +53,12 @@ class ProjectBase extends Model 'id' => 'getId', 'title' => 'getTitle', 'reference' => 'getReference', - 'branch' => 'getBranch', 'ssh_private_key' => 'getSshPrivateKey', - 'ssh_public_key' => 'getSshPublicKey', 'type' => 'getType', 'access_information' => 'getAccessInformation', 'last_commit' => 'getLastCommit', 'build_config' => 'getBuildConfig', + 'ssh_public_key' => 'getSshPublicKey', 'allow_public_status' => 'getAllowPublicStatus', // Foreign key getters: @@ -74,13 +72,12 @@ class ProjectBase extends Model 'id' => 'setId', 'title' => 'setTitle', 'reference' => 'setReference', - 'branch' => 'setBranch', 'ssh_private_key' => 'setSshPrivateKey', - 'ssh_public_key' => 'setSshPublicKey', 'type' => 'setType', 'access_information' => 'setAccessInformation', 'last_commit' => 'setLastCommit', 'build_config' => 'setBuildConfig', + 'ssh_public_key' => 'setSshPublicKey', 'allow_public_status' => 'setAllowPublicStatus', // Foreign key setters: @@ -107,21 +104,11 @@ class ProjectBase extends Model 'length' => 250, 'default' => null, ), - 'branch' => array( - 'type' => 'varchar', - 'length' => 250, - 'default' => null, - ), 'ssh_private_key' => array( 'type' => 'text', 'nullable' => true, 'default' => null, ), - 'ssh_public_key' => array( - 'type' => 'text', - 'nullable' => true, - 'default' => null, - ), 'type' => array( 'type' => 'varchar', 'length' => 50, @@ -144,9 +131,15 @@ class ProjectBase extends Model 'nullable' => true, 'default' => null, ), + 'ssh_public_key' => array( + 'type' => 'text', + 'nullable' => true, + 'default' => null, + ), 'allow_public_status' => array( 'type' => 'tinyint', 'length' => 4, + 'default' => null, ), ); @@ -200,18 +193,6 @@ class ProjectBase extends Model return $rtn; } - /** - * Get the value of Branch / branch. - * - * @return string - */ - public function getBranch() - { - $rtn = $this->data['branch']; - - return $rtn; - } - /** * Get the value of SshPrivateKey / ssh_private_key. * @@ -224,18 +205,6 @@ class ProjectBase extends Model return $rtn; } - /** - * Get the value of SshPublicKey / ssh_public_key. - * - * @return string - */ - public function getSshPublicKey() - { - $rtn = $this->data['ssh_public_key']; - - return $rtn; - } - /** * Get the value of Type / type. * @@ -284,6 +253,18 @@ class ProjectBase extends Model return $rtn; } + /** + * Get the value of SshPublicKey / ssh_public_key. + * + * @return string + */ + public function getSshPublicKey() + { + $rtn = $this->data['ssh_public_key']; + + return $rtn; + } + /** * Get the value of AllowPublicStatus / allow_public_status. * @@ -356,26 +337,6 @@ class ProjectBase extends Model $this->_setModified('reference'); } - /** - * Set the value of Branch / branch. - * - * Must not be null. - * @param $value string - */ - public function setBranch($value) - { - $this->_validateNotNull('Branch', $value); - $this->_validateString('Branch', $value); - - if ($this->data['branch'] === $value) { - return; - } - - $this->data['branch'] = $value; - - $this->_setModified('branch'); - } - /** * Set the value of SshPrivateKey / ssh_private_key. * @@ -394,24 +355,6 @@ class ProjectBase extends Model $this->_setModified('ssh_private_key'); } - /** - * Set the value of SshPublicKey / ssh_public_key. - * - * @param $value string - */ - public function setSshPublicKey($value) - { - $this->_validateString('SshPublicKey', $value); - - if ($this->data['ssh_public_key'] === $value) { - return; - } - - $this->data['ssh_public_key'] = $value; - - $this->_setModified('ssh_public_key'); - } - /** * Set the value of Type / type. * @@ -486,6 +429,24 @@ class ProjectBase extends Model $this->_setModified('build_config'); } + /** + * Set the value of SshPublicKey / ssh_public_key. + * + * @param $value string + */ + public function setSshPublicKey($value) + { + $this->_validateString('SshPublicKey', $value); + + if ($this->data['ssh_public_key'] === $value) { + return; + } + + $this->data['ssh_public_key'] = $value; + + $this->_setModified('ssh_public_key'); + } + /** * Set the value of AllowPublicStatus / allow_public_status. * diff --git a/PHPCI/Model/Project.php b/PHPCI/Model/Project.php index 702d9c89..98283d77 100644 --- a/PHPCI/Model/Project.php +++ b/PHPCI/Model/Project.php @@ -88,4 +88,28 @@ class Project extends ProjectBase return $this->data['branch']; } } + + public function getIcon() + { + switch ($this->getType()) { + case 'github': + $icon = 'github'; + break; + + case 'bitbucket': + $icon = 'bitbucket'; + break; + + case 'git': + case 'gitlab': + $icon = 'git'; + break; + + default: + $icon = 'cog'; + break; + } + + return $icon; + } } diff --git a/PHPCI/Store/Base/BuildMetaStoreBase.php b/PHPCI/Store/Base/BuildMetaStoreBase.php index bc1589cc..f6158c13 100644 --- a/PHPCI/Store/Base/BuildMetaStoreBase.php +++ b/PHPCI/Store/Base/BuildMetaStoreBase.php @@ -56,7 +56,6 @@ class BuildMetaStoreBase extends Store $add .= ' LIMIT ' . $limit; } - $count = null; $query = 'SELECT * FROM `build_meta` WHERE `project_id` = :project_id' . $add; $stmt = Database::getConnection($useConnection)->prepare($query); @@ -70,6 +69,9 @@ class BuildMetaStoreBase extends Store }; $rtn = array_map($map, $res); + $count = count($rtn); + + return array('items' => $rtn, 'count' => $count); } else { return array('items' => array(), 'count' => 0); @@ -88,7 +90,6 @@ class BuildMetaStoreBase extends Store $add .= ' LIMIT ' . $limit; } - $count = null; $query = 'SELECT * FROM `build_meta` WHERE `build_id` = :build_id' . $add; $stmt = Database::getConnection($useConnection)->prepare($query); @@ -102,6 +103,9 @@ class BuildMetaStoreBase extends Store }; $rtn = array_map($map, $res); + $count = count($rtn); + + return array('items' => $rtn, 'count' => $count); } else { return array('items' => array(), 'count' => 0); diff --git a/PHPCI/Store/Base/BuildStoreBase.php b/PHPCI/Store/Base/BuildStoreBase.php index b67d5f73..20927caa 100644 --- a/PHPCI/Store/Base/BuildStoreBase.php +++ b/PHPCI/Store/Base/BuildStoreBase.php @@ -56,7 +56,6 @@ class BuildStoreBase extends Store $add .= ' LIMIT ' . $limit; } - $count = null; $query = 'SELECT * FROM `build` WHERE `project_id` = :project_id' . $add; $stmt = Database::getConnection($useConnection)->prepare($query); @@ -70,6 +69,9 @@ class BuildStoreBase extends Store }; $rtn = array_map($map, $res); + $count = count($rtn); + + return array('items' => $rtn, 'count' => $count); } else { return array('items' => array(), 'count' => 0); @@ -88,7 +90,6 @@ class BuildStoreBase extends Store $add .= ' LIMIT ' . $limit; } - $count = null; $query = 'SELECT * FROM `build` WHERE `status` = :status' . $add; $stmt = Database::getConnection($useConnection)->prepare($query); @@ -102,6 +103,9 @@ class BuildStoreBase extends Store }; $rtn = array_map($map, $res); + $count = count($rtn); + + return array('items' => $rtn, 'count' => $count); } else { return array('items' => array(), 'count' => 0); diff --git a/PHPCI/Store/Base/ProjectStoreBase.php b/PHPCI/Store/Base/ProjectStoreBase.php index 410a305e..dda946a5 100644 --- a/PHPCI/Store/Base/ProjectStoreBase.php +++ b/PHPCI/Store/Base/ProjectStoreBase.php @@ -56,7 +56,6 @@ class ProjectStoreBase extends Store $add .= ' LIMIT ' . $limit; } - $count = null; $query = 'SELECT * FROM `project` WHERE `title` = :title' . $add; $stmt = Database::getConnection($useConnection)->prepare($query); @@ -70,6 +69,9 @@ class ProjectStoreBase extends Store }; $rtn = array_map($map, $res); + $count = count($rtn); + + return array('items' => $rtn, 'count' => $count); } else { return array('items' => array(), 'count' => 0); diff --git a/PHPCI/Store/BuildStore.php b/PHPCI/Store/BuildStore.php index a1da7cb1..8c36b3b1 100644 --- a/PHPCI/Store/BuildStore.php +++ b/PHPCI/Store/BuildStore.php @@ -10,6 +10,7 @@ namespace PHPCI\Store; use b8\Database; +use PHPCI\BuildFactory; use PHPCI\Model\Build; use PHPCI\Store\Base\BuildStoreBase; @@ -21,11 +22,22 @@ use PHPCI\Store\Base\BuildStoreBase; */ class BuildStore extends BuildStoreBase { - public function getLatestBuilds($projectId) + public function getLatestBuilds($projectId = null, $limit = 5) { - $query = 'SELECT * FROM build WHERE project_id = :pid ORDER BY id DESC LIMIT 5'; + $where = ''; + + if (!is_null($projectId)) { + $where = ' WHERE `project_id` = :pid '; + } + + $query = 'SELECT * FROM build '.$where.' ORDER BY id DESC LIMIT :limit'; $stmt = Database::getConnection('read')->prepare($query); - $stmt->bindValue(':pid', $projectId); + + if (!is_null($projectId)) { + $stmt->bindValue(':pid', $projectId); + } + + $stmt->bindValue(':limit', $limit, \PDO::PARAM_INT); if ($stmt->execute()) { $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); diff --git a/PHPCI/Store/ProjectStore.php b/PHPCI/Store/ProjectStore.php index 6f81b8f4..4657fb8d 100644 --- a/PHPCI/Store/ProjectStore.php +++ b/PHPCI/Store/ProjectStore.php @@ -10,6 +10,7 @@ namespace PHPCI\Store; use b8\Database; +use PHPCI\Model\Project; use PHPCI\Store\Base\ProjectStoreBase; /** @@ -39,4 +40,26 @@ class ProjectStore extends ProjectStoreBase return array(); } } + + public function getAll() + { + $query = 'SELECT * FROM `project` ORDER BY `title` ASC'; + $stmt = Database::getConnection('read')->prepare($query); + + if ($stmt->execute()) { + $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); + + $map = function ($item) { + return new Project($item); + }; + $rtn = array_map($map, $res); + + $count = count($rtn); + + + return array('items' => $rtn, 'count' => $count); + } else { + return array('items' => array(), 'count' => 0); + } + } } diff --git a/PHPCI/View/Build/header-row.phtml b/PHPCI/View/Build/header-row.phtml new file mode 100644 index 00000000..3dab6c80 --- /dev/null +++ b/PHPCI/View/Build/header-row.phtml @@ -0,0 +1,20 @@ +
  • + + getCommitterEmail()): ?> +
    + +
    + + +

    + getProject()->getTitle(); ?> + + getStatus() == \PHPCI\Model\Build::STATUS_NEW): ?> + Created getCreated()->format('g:ia'); ?> + getStatus() == \PHPCI\Model\Build::STATUS_RUNNING): ?> + Started getStarted()->format('g:ia'); ?> + +

    +

    Branch: getBranch(); ?>

    +
    +
  • \ No newline at end of file diff --git a/PHPCI/View/Build/view.phtml b/PHPCI/View/Build/view.phtml index c2fd9381..a6ecc6db 100644 --- a/PHPCI/View/Build/view.phtml +++ b/PHPCI/View/Build/view.phtml @@ -1,17 +1,15 @@ -
    - - -
    -

    - - getProject()->getTitle(); ?> - #getId(); ?> +
    +
    +

    + Committed by getCommitterEmail(); ?>

    -
    +
    + +
    getCommitMessage()): ?>
    @@ -19,8 +17,7 @@
    - Branch: getBranch(); ?>
    - Committer: getCommitterEmail(); ?> + Branch: getBranch(); ?> getCommitId() != 'Manual'): ?>
    Commit ID: getCommitId(); ?>
    @@ -30,35 +27,19 @@
    -
    -
    -
    -

    Options

    -
    - -
    -

    Quick links

    -
    -
      - -
      -
      - -
      +
      + $(document).ready(function() { - PHPCI.renderPlugins(); + ActiveBuild.renderPlugins(); $('#delete-build').on('click', function (e) { e.preventDefault(); @@ -86,41 +67,38 @@ foreach ($plugins as $plugin) { }); function updateBuildStatus(status) { - var statusClass = null; - var statusText = null; - switch (status) { case 0: - statusClass = 'info'; - statusText = 'Pending'; + $('.build-info-panel') + .removeClass('bg-yellow') + .removeClass('bg-green') + .removeClass('bg-red') + .addClass('bg-blue'); break; + case 1: - statusClass = 'warning'; - statusText = 'Running'; + $('.build-info-panel') + .removeClass('bg-green') + .removeClass('bg-red') + .removeClass('bg-blue') + .addClass('bg-yellow'); break; + case 2: - statusClass = 'success'; - statusText = 'Success'; + $('.build-info-panel') + .removeClass('bg-yellow') + .removeClass('bg-red') + .removeClass('bg-blue') + .addClass('bg-green'); break; + case 3: - statusClass = 'danger'; - statusText = 'Failed'; + $('.build-info-panel') + .removeClass('bg-yellow') + .removeClass('bg-green') + .removeClass('bg-blue') + .addClass('bg-red'); break; } - - $('.build-info-panel') - .removeClass('panel-info') - .removeClass('panel-warning') - .removeClass('panel-success') - .removeClass('panel-danger') - .addClass('panel-' + statusClass); - - $('.build-info-panel .label') - .removeClass('label-info') - .removeClass('label-warning') - .removeClass('label-success') - .removeClass('label-danger') - .addClass('label-' + statusClass) - .text(statusText); } diff --git a/PHPCI/View/BuildStatus/view.phtml b/PHPCI/View/BuildStatus/view.phtml index e8536bf6..3b5d29a3 100644 --- a/PHPCI/View/BuildStatus/view.phtml +++ b/PHPCI/View/BuildStatus/view.phtml @@ -66,8 +66,8 @@
      -
      -

      +
      +

      getProject()->getTitle(); ?> #getId(); ?> @@ -76,7 +76,7 @@

      -
      +
      getCommitMessage()): ?>
      @@ -97,8 +97,8 @@ -
      -

      Builds

      +
      +

      Builds

      diff --git a/PHPCI/View/BuildsTable.phtml b/PHPCI/View/BuildsTable.phtml index 4fb5fa91..fc604a4e 100644 --- a/PHPCI/View/BuildsTable.phtml +++ b/PHPCI/View/BuildsTable.phtml @@ -47,10 +47,10 @@ switch($build->getStatus()) } ?> - - + diff --git a/PHPCI/View/Home/index.phtml b/PHPCI/View/Home/index.phtml index bcac0775..5a1f7a84 100644 --- a/PHPCI/View/Home/index.phtml +++ b/PHPCI/View/Home/index.phtml @@ -1,93 +1,115 @@ -
      -

      Dashboard

      -
      - -
      -
      - -
      -
      -

      Projects

      +
      +
      +
      +

      Latest Builds

      -
      - - getTitle()); ?> - + +
      +
        + + + getProject()->getType()) { + case 'github': + $icon = 'github'; + break; + + case 'bitbucket': + $icon = 'bitbucket'; + break; + + case 'git': + case 'gitlab': + $icon = 'git'; + break; + + default: + $icon = 'cog'; + break; + } + + switch ($build->getStatus()) { + case \PHPCI\Model\Build::STATUS_NEW: + $updated = $build->getCreated(); + $label = 'created'; + $color = 'blue'; + break; + + case \PHPCI\Model\Build::STATUS_RUNNING: + $updated = $build->getStarted(); + $label = 'started'; + $color = 'yellow'; + break; + + case \PHPCI\Model\Build::STATUS_SUCCESS: + $updated = $build->getFinished(); + $label = 'success'; + $color = 'green'; + break; + + case \PHPCI\Model\Build::STATUS_FAILED: + $updated = $build->getFinished(); + $label = 'failed'; + $color = 'red'; + break; + } + + if ($updated->format('Y-m-d') != $last->format('Y-m-d')): $last = $updated; + ?> +
      • + + format('M j Y'); ?> + +
      • + + + + +
      • + +
        + format('g:ia'); ?> +

        + + getProject()->getTitle(); ?> + +

        + +
        + Build +
        +
        +
      • + + + + +
      • + +
      • +
      - -
      -
      -
      -

      Project Overview

      -
      + getBranch(); ?>getBranch(); ?>
      + +
      +
      +

      Project Overview

      +
      - - - - + - +
      Health ProjectLast SuccessLast FailureSuccess/FailuresHealth
      - -
      -
      -

      Last 5 Builds

      -
      - - - - - - - - - - - - - - - -
      IDProjectCommitBranchStatus
      -
      -
      +
      - - diff --git a/PHPCI/View/Plugin/index.phtml b/PHPCI/View/Plugin/index.phtml index a224c752..15e20590 100644 --- a/PHPCI/View/Plugin/index.phtml +++ b/PHPCI/View/Plugin/index.phtml @@ -1,5 +1,3 @@ -

      Packages and Provided Plugins

      -

      PHPCI cannot update composer.json for you as it is not writable.

      @@ -12,10 +10,12 @@

      has been added to composer.json for you and will be installed next time you run composer update.

      -
      -

      Available Plugins

      +
      +
      +

      Enabled Plugins

      +
      - +
      @@ -35,85 +35,104 @@
      Name
      -
      -

      Installed Packages

      - - - - - - - - - - $version): ?> - - - - - - - -
      TitleVersion
      - - Remove » - -
      + +
      +
      +
      +
      +

      Installed Packages

      +
      + + + + + + + + + + + $version): ?> + + + + + + + +
      TitleVersion
      + + Remove » + +
      +
      + +
      + +
      +
      +
      +

      Suggested Packages

      +
      + + + + + + + + + + + $version): ?> + + + + + + + + +
      TitleDescription
      + + + +
      +
      + +
      -
      -

      Suggested Packages

      +
      +
      +

      Search Packagist for More Packages

      +
      - - - - - - - - - - $version): ?> - - - - - - - - -
      TitleDescription
      - - - -
      -
      - -
      -

      Search Packagist for More Packages

      - -
      - +
      +
      + +
      + +
      -
      + +
      +
      + Build Now + +
      + + + +
      -

      +
      -
      -
      -
      -

      Options

      +
      +
      +
      + +

      Builds

      - -
      - - Build Now - - - User()->getIsAdmin()): ?> - Edit Project - Delete Project - -
      -
      - - getType(), array('github', 'gitlab', 'bitbucket'))): ?> -
      -
      -

      Webhooks

      -
      - -
      - To automatically build this project when new commits are pushed, add the URL below - - getType()) - { - case 'github': - $url = PHPCI_URL . 'webhook/github/' . $project->getId(); - print ' as a "WebHook URL" in the Service Hooks section of your Github repository.

      ' . $url . ''; - break; - - case 'gitlab': - $url = PHPCI_URL. 'webhook/gitlab/' . $project->getId(); - print ' as a "WebHook URL" in the Web Hooks section of your Gitlab repository.

      ' . $url . ''; - break; - - case 'bitbucket': - $url = PHPCI_URL . 'webhook/bitbucket/' . $project->getId(); - print ' as a "POST" service in the Services section of your Bitbucket repository.

      ' . $url . ''; - break; - } - ?> -
      -
      - - - getSshPublicKey()): ?> -
      - -
      -
      getSshPublicKey(); ?>
      -
      -
      - -
      -
      - - - - -
      -
      - -

      Builds

      -
      - +
      - + @@ -107,63 +52,76 @@
      ID ProjectCommit Branch Status
      - -
        '; - - $project_url = PHPCI_URL . 'project/view/' . $project->getId() . ((!empty($branch)) ? '/' . urlencode($branch) : ''); - - if ($page > 1) { - print '
      • « Prev
      • '; - } - - if ($pages > 1) { - for($i = 1; $i <= $pages; $i++) - { - if ($i == $page) { - print '
      • ' . $i . '
      • '; - } else { - print '
      • ' . $i . '
      • '; - } - } - } - - if ($page < $pages) { - print '
      • Next »
      • '; - } - - print '
      '; - - ?> - -
      + +
      + + getType(), array('github', 'gitlab', 'bitbucket'))): ?> +
      +
      +

      Webhooks

      +
      + +
      + To automatically build this project when new commits are pushed, add the URL below + + getType()) + { + case 'github': + $url = PHPCI_URL . 'webhook/github/' . $project->getId(); + print ' as a "WebHook URL" in the Service Hooks section of your Github repository.

      ' . $url . ''; + break; + + case 'gitlab': + $url = PHPCI_URL. 'webhook/gitlab/' . $project->getId(); + print ' as a "WebHook URL" in the Web Hooks section of your Gitlab repository.

      ' . $url . ''; + break; + + case 'bitbucket': + $url = PHPCI_URL . 'webhook/bitbucket/' . $project->getId(); + print ' as a "POST" service in the Services section of your Bitbucket repository.

      ' . $url . ''; + break; + } + ?> +
      +
      + + + getSshPublicKey()): ?> +
      + +
      getSshPublicKey(); ?>
      +
      + +
      - - - +?> \ No newline at end of file diff --git a/PHPCI/View/ProjectForm.phtml b/PHPCI/View/ProjectForm.phtml index 7a2b93d2..a7a5abd6 100644 --- a/PHPCI/View/ProjectForm.phtml +++ b/PHPCI/View/ProjectForm.phtml @@ -1,34 +1,29 @@ -
      -

      -
      -
      -
      -
      -
      - -

      To make it easier to get started, we've generated a public / private key pair for you to use for this project. To use it, just add the following public key to the "deploy keys" section of your repository settings on Github / Bitbucket.

      - - -

      Fill in the form to the right to add your new project.

      - -

      Edit your project details using the form to the right.

      - -
      -
      -
      -
      -
      -
      -

      Project Details

      +
      +
      +
      +

      Project Details

      -
      +
      + + +
      +
      +
      +

      To make it easier to get started, we've generated a public / private key pair for you to use for this project. To use it, just add the following public key to the "deploy keys" section of your repository settings on Github / Bitbucket.

      + + +
      +
      +
      + +
      + + + + - - + - - - - - - - - -
      + + + -
      - -
      - -
      Loading...
      - - + + \ No newline at end of file diff --git a/composer.json b/composer.json index f0859996..dbced983 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "ext-mcrypt": "*", "ext-pdo": "*", "ext-pdo_mysql": "*", - "block8/b8framework": "~1.1", + "block8/b8framework": "~1.0", "ircmaxell/password-compat": "~1.0", "swiftmailer/swiftmailer": "~5.0", "symfony/yaml": "~2.1", diff --git a/composer.lock b/composer.lock index 532a1932..8e769534 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d97c4373b84222bb233cb510044650b4", + "hash": "650fe5576922dea4ac3b1be72d882a58", "packages": [ { "name": "block8/b8framework", - "version": "1.1.8", + "version": "1.1.9", "source": { "type": "git", "url": "https://github.com/Block8/b8framework.git", - "reference": "cfb0bbd87a2ff71f9ebdfa53fca139d50407e0e0" + "reference": "3952dabee84cbf5be3dd8d20eadd13b6219e7a6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Block8/b8framework/zipball/cfb0bbd87a2ff71f9ebdfa53fca139d50407e0e0", - "reference": "cfb0bbd87a2ff71f9ebdfa53fca139d50407e0e0", + "url": "https://api.github.com/repos/Block8/b8framework/zipball/3952dabee84cbf5be3dd8d20eadd13b6219e7a6a", + "reference": "3952dabee84cbf5be3dd8d20eadd13b6219e7a6a", "shasum": "" }, "require": { @@ -51,7 +51,7 @@ "mvc", "php" ], - "time": "2014-07-29 15:49:02" + "time": "2014-12-01 21:02:58" }, { "name": "ircmaxell/password-compat", diff --git a/public/assets/css/AdminLTE.css b/public/assets/css/AdminLTE.css new file mode 100755 index 00000000..cbb95dc3 --- /dev/null +++ b/public/assets/css/AdminLTE.css @@ -0,0 +1,3539 @@ +@import url(//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic); +@import url(//fonts.googleapis.com/css?family=Kaushan+Script); +/*! + * AdminLTE v1.2 + * Author: AlmsaeedStudio.com + * License: Open source - MIT + * Please visit http://opensource.org/licenses/MIT for more information +!*/ +/* + Core: General style +---------------------------- +*/ +html, +body { + overflow-x: hidden!important; + font-family: 'Source Sans Pro', sans-serif; + -webkit-font-smoothing: antialiased; + min-height: 100%; + background: #f9f9f9; +} +a { + color: #3c8dbc; +} +a:hover, +a:active, +a:focus { + outline: none; + text-decoration: none; + color: #72afd2; +} +/* Layouts */ +.wrapper { + min-height: 100%; +} +.wrapper:before, +.wrapper:after { + display: table; + content: " "; +} +.wrapper:after { + clear: both; +} +/* Header */ +body > .header { + position: absolute; + top: 0; + left: 0; + right: 0; + z-index: 1030; +} +/* Define 2 column template */ +.right-side, +.left-side { + min-height: 100%; + display: block; +} +/*right side - contins main content*/ +.right-side { + background-color: #f9f9f9; + margin-left: 220px; +} +/*left side - contains sidebar*/ +.left-side { + position: absolute; + width: 220px; + top: 0; +} +@media screen and (min-width: 992px) { + .left-side { + top: 50px; + } + /*Right side strech mode*/ + .right-side.strech { + margin-left: 0; + } + .right-side.strech > .content-header { + margin-top: 0px; + } + /* Left side collapse */ + .left-side.collapse-left { + left: -220px; + } +} +/*Give content full width on xs screens*/ +@media screen and (max-width: 992px) { + .right-side { + margin-left: 0; + } +} +/* + By default the layout is not fixed but if you add the class .fixed to the body element + the sidebar and the navbar will automatically become poisitioned fixed +*/ +body.fixed > .header, +body.fixed .left-side, +body.fixed .navbar { + position: fixed; +} +body.fixed > .header { + top: 0; + right: 0; + left: 0; +} +body.fixed .navbar { + left: 0; + right: 0; +} +body.fixed .wrapper { + margin-top: 50px; +} +/* Content */ +.content { + padding: 20px 15px; + background: #f9f9f9; + overflow: auto; +} +/* Utility */ +/* H1 - H6 font */ +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: 'Source Sans Pro', sans-serif; +} +/* Page Header */ +.page-header { + margin: 10px 0 20px 0; + font-size: 22px; +} +.page-header > small { + color: #666; + display: block; + margin-top: 5px; +} +/* All images should be responsive */ +img { + max-width: 100% !important; +} +.sort-highlight { + background: #f4f4f4; + border: 1px dashed #ddd; + margin-bottom: 10px; +} +/* 10px padding and margins */ +.pad { + padding: 10px; +} +.margin { + margin: 10px; +} +/* Display inline */ +.inline { + display: inline; + width: auto; +} +/* Background colors */ +.bg-red, +.bg-yellow, +.bg-aqua, +.bg-blue, +.bg-light-blue, +.bg-green, +.bg-navy, +.bg-teal, +.bg-olive, +.bg-lime, +.bg-orange, +.bg-fuchsia, +.bg-purple, +.bg-maroon, +.bg-black { + color: #f9f9f9 !important; +} +.bg-gray { + background-color: #eaeaec !important; +} +.bg-black { + background-color: #222222 !important; +} +.bg-red { + background-color: #f56954 !important; +} +.bg-yellow { + background-color: #f39c12 !important; +} +.bg-aqua { + background-color: #00c0ef !important; +} +.bg-blue { + background-color: #0073b7 !important; +} +.bg-light-blue { + background-color: #3c8dbc !important; +} +.bg-green { + background-color: #00a65a !important; +} +.bg-navy { + background-color: #001f3f !important; +} +.bg-teal { + background-color: #39cccc !important; +} +.bg-olive { + background-color: #3d9970 !important; +} +.bg-lime { + background-color: #01ff70 !important; +} +.bg-orange { + background-color: #ff851b !important; +} +.bg-fuchsia { + background-color: #f012be !important; +} +.bg-purple { + background-color: #932ab6 !important; +} +.bg-maroon { + background-color: #85144b !important; +} +/* Text colors */ +.text-red { + color: #f56954 !important; +} +.text-yellow { + color: #f39c12 !important; +} +.text-aqua { + color: #00c0ef !important; +} +.text-blue { + color: #0073b7 !important; +} +.text-black { + color: #222222 !important; +} +.text-light-blue { + color: #3c8dbc !important; +} +.text-green { + color: #00a65a !important; +} +.text-navy { + color: #001f3f !important; +} +.text-teal { + color: #39cccc !important; +} +.text-olive { + color: #3d9970 !important; +} +.text-lime { + color: #01ff70 !important; +} +.text-orange { + color: #ff851b !important; +} +.text-fuchsia { + color: #f012be !important; +} +.text-purple { + color: #932ab6 !important; +} +.text-maroon { + color: #85144b !important; +} +/*Hide elements by display none only*/ +.hide { + display: none !important; +} +/* Remove borders */ +.no-border { + border: 0px !important; +} +/* Remove padding */ +.no-padding { + padding: 0px !important; +} +/* Remove margins */ +.no-margin { + margin: 0px !important; +} +/* Remove box shadow */ +.no-shadow { + box-shadow: none!important; +} +/* Don't display when printing */ +@media print { + .no-print { + display: none; + } + .left-side, + .header, + .content-header { + display: none; + } + .right-side { + margin: 0; + } +} +/* Remove border radius */ +.flat { + -webkit-border-radius: 0 !important; + -moz-border-radius: 0 !important; + border-radius: 0 !important; +} +/* Change the color of the striped tables */ +.table-striped > tbody > tr:nth-child(odd) > td, +.table-striped > tbody > tr:nth-child(odd) > th { + background-color: #f3f4f5; +} +.table.no-border, +.table.no-border td, +.table.no-border th { + border: 0; +} +/* .text-center in tables */ +table.text-center, +table.text-center td, +table.text-center th { + text-align: center; +} +.table.align th { + text-align: left; +} +.table.align td { + text-align: right; +} +.text-bold, +.text-bold.table td, +.text-bold.table th { + font-weight: 700; +} +.border-radius-none { + -webkit-border-radius: 0 !important; + -moz-border-radius: 0 !important; + border-radius: 0 !important; +} +/* _fix for sparkline tooltip */ +.jqstooltip { + padding: 5px!important; + width: auto!important; + height: auto!important; +} +/* +Gradient Background colors +*/ +.bg-teal-gradient { + background: #39cccc !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #39cccc), color-stop(1, #7adddd)) !important; + background: -ms-linear-gradient(bottom, #39cccc, #7adddd) !important; + background: -moz-linear-gradient(center bottom, #39cccc 0%, #7adddd 100%) !important; + background: -o-linear-gradient(#7adddd, #39cccc) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39cccc', GradientType=0) !important; + color: #fff; +} +.bg-light-blue-gradient { + background: #3c8dbc !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #3c8dbc), color-stop(1, #67a8ce)) !important; + background: -ms-linear-gradient(bottom, #3c8dbc, #67a8ce) !important; + background: -moz-linear-gradient(center bottom, #3c8dbc 0%, #67a8ce 100%) !important; + background: -o-linear-gradient(#67a8ce, #3c8dbc) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#67a8ce', endColorstr='#3c8dbc', GradientType=0) !important; + color: #fff; +} +.bg-blue-gradient { + background: #0073b7 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #0073b7), color-stop(1, #0089db)) !important; + background: -ms-linear-gradient(bottom, #0073b7, #0089db) !important; + background: -moz-linear-gradient(center bottom, #0073b7 0%, #0089db 100%) !important; + background: -o-linear-gradient(#0089db, #0073b7) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0089db', endColorstr='#0073b7', GradientType=0) !important; + color: #fff; +} +.bg-aqua-gradient { + background: #00c0ef !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #00c0ef), color-stop(1, #14d1ff)) !important; + background: -ms-linear-gradient(bottom, #00c0ef, #14d1ff) !important; + background: -moz-linear-gradient(center bottom, #00c0ef 0%, #14d1ff 100%) !important; + background: -o-linear-gradient(#14d1ff, #00c0ef) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#14d1ff', endColorstr='#00c0ef', GradientType=0) !important; + color: #fff; +} +.bg-yellow-gradient { + background: #f39c12 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #f39c12), color-stop(1, #f7bc60)) !important; + background: -ms-linear-gradient(bottom, #f39c12, #f7bc60) !important; + background: -moz-linear-gradient(center bottom, #f39c12 0%, #f7bc60 100%) !important; + background: -o-linear-gradient(#f7bc60, #f39c12) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7bc60', endColorstr='#f39c12', GradientType=0) !important; + color: #fff; +} +.bg-purple-gradient { + background: #932ab6 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #932ab6), color-stop(1, #b959d9)) !important; + background: -ms-linear-gradient(bottom, #932ab6, #b959d9) !important; + background: -moz-linear-gradient(center bottom, #932ab6 0%, #b959d9 100%) !important; + background: -o-linear-gradient(#b959d9, #932ab6) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b959d9', endColorstr='#932ab6', GradientType=0) !important; + color: #fff; +} +.bg-green-gradient { + background: #00a65a !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #00a65a), color-stop(1, #00ca6d)) !important; + background: -ms-linear-gradient(bottom, #00a65a, #00ca6d) !important; + background: -moz-linear-gradient(center bottom, #00a65a 0%, #00ca6d 100%) !important; + background: -o-linear-gradient(#00ca6d, #00a65a) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ca6d', endColorstr='#00a65a', GradientType=0) !important; + color: #fff; +} +.bg-red-gradient { + background: #f56954 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #f56954), color-stop(1, #f89384)) !important; + background: -ms-linear-gradient(bottom, #f56954, #f89384) !important; + background: -moz-linear-gradient(center bottom, #f56954 0%, #f89384 100%) !important; + background: -o-linear-gradient(#f89384, #f56954) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f89384', endColorstr='#f56954', GradientType=0) !important; + color: #fff; +} +.bg-black-gradient { + background: #222222 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #222222), color-stop(1, #3c3c3c)) !important; + background: -ms-linear-gradient(bottom, #222222, #3c3c3c) !important; + background: -moz-linear-gradient(center bottom, #222222 0%, #3c3c3c 100%) !important; + background: -o-linear-gradient(#3c3c3c, #222222) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#3c3c3c', endColorstr='#222222', GradientType=0) !important; + color: #fff; +} +.bg-maroon-gradient { + background: #85144b !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #85144b), color-stop(1, #b11b64)) !important; + background: -ms-linear-gradient(bottom, #85144b, #b11b64) !important; + background: -moz-linear-gradient(center bottom, #85144b 0%, #b11b64 100%) !important; + background: -o-linear-gradient(#b11b64, #85144b) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b11b64', endColorstr='#85144b', GradientType=0) !important; + color: #fff; +} +.connectedSortable { + min-height: 100px; +} +/*--------------------------------------------------- + LESS Elements 0.9 + --------------------------------------------------- + A set of useful LESS mixins + More info at: http://lesselements.com + ---------------------------------------------------*/ +/* + Components: navbar, logo and content header +------------------------------------------------- +*/ +body > .header { + position: relative; + max-height: 100px; + z-index: 1030; +} +body > .header .navbar { + height: 50px; + margin-bottom: 0; + margin-left: 220px; +} +body > .header .navbar .sidebar-toggle { + float: left; + padding: 9px 5px; + margin-top: 8px; + margin-right: 0; + margin-bottom: 8px; + margin-left: 5px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + -webkit-border-radius: 0 !important; + -moz-border-radius: 0 !important; + border-radius: 0 !important; +} +body > .header .navbar .sidebar-toggle:hover .icon-bar { + background: #f6f6f6; +} +body > .header .navbar .sidebar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +body > .header .navbar .sidebar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +body > .header .navbar .nav > li.user > a { + font-weight: bold; +} +body > .header .navbar .nav > li.user > a > .fa, +body > .header .navbar .nav > li.user > a > .glyphicon, +body > .header .navbar .nav > li.user > a > .ion { + margin-right: 5px; +} +body > .header .navbar .nav > li > a > .label { + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + position: absolute; + top: 7px; + right: 2px; + font-size: 10px; + font-weight: normal; + width: 15px; + height: 15px; + line-height: 1.0em; + text-align: center; + padding: 2px; +} +body > .header .navbar .nav > li > a:hover > .label { + top: 3px; +} +body > .header .logo { + float: left; + font-size: 20px; + line-height: 50px; + text-align: center; + padding: 0 10px; + width: 220px; + font-family: 'Kaushan Script', cursive; + font-weight: 500; + height: 50px; + display: block; +} +body > .header .logo .icon { + margin-right: 10px; +} +.right-side > .content-header { + position: relative; + padding: 15px 15px 10px 20px; +} +.right-side > .content-header > h1 { + margin: 0; + font-size: 24px; +} +.right-side > .content-header > h1 > small { + font-size: 15px; + display: inline-block; + padding-left: 4px; + font-weight: 300; +} +.right-side > .content-header > .breadcrumb { + float: right; + background: transparent; + margin-top: 0px; + margin-bottom: 0; + font-size: 12px; + padding: 7px 5px; + position: absolute; + top: 15px; + right: 10px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.right-side > .content-header > .breadcrumb > li > a { + color: #444; + text-decoration: none; +} +.right-side > .content-header > .breadcrumb > li > a > .fa, +.right-side > .content-header > .breadcrumb > li > a > .glyphicon, +.right-side > .content-header > .breadcrumb > li > a > .ion { + margin-right: 5px; +} +.right-side > .content-header > .breadcrumb > li + li:before { + content: '>\00a0'; +} +@media screen and (max-width: 767px) { + .right-side > .content-header > .breadcrumb { + position: relative; + margin-top: 5px; + top: 0; + right: 0; + float: none; + background: #efefef; + } +} +@media (max-width: 767px) { + .navbar .navbar-nav > li { + float: left; + } + .navbar-nav { + margin: 0; + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + line-height: 20px; + } + .navbar .navbar-right { + float: right; + } +} +@media screen and (max-width: 560px) { + body > .header { + position: relative; + } + body > .header .logo, + body > .header .navbar { + width: 100%; + float: none; + position: relative!important; + } + body > .header .navbar { + margin: 0; + } + body.fixed > .header { + position: fixed; + } + body.fixed > .wrapper, + body.fixed .sidebar-offcanvas { + margin-top: 100px!important; + } +} +/* + Component: Sidebar +-------------------------- +*/ +.sidebar { + margin-bottom: 5px; +} +.sidebar .sidebar-form input:focus { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + border-color: transparent!important; +} +.sidebar .sidebar-menu { + list-style: none; + margin: 0; + padding: 0; +} +.sidebar .sidebar-menu > li { + margin: 0; + padding: 0; +} +.sidebar .sidebar-menu > li > a { + padding: 12px 5px 12px 15px; + display: block; +} +.sidebar .sidebar-menu > li > a > .fa, +.sidebar .sidebar-menu > li > a > .glyphicon, +.sidebar .sidebar-menu > li > a > .ion { + width: 20px; +} +.sidebar .sidebar-menu .treeview-menu { + display: none; + list-style: none; + padding: 0; + margin: 0; +} +.sidebar .sidebar-menu .treeview-menu > li { + margin: 0; +} +.sidebar .sidebar-menu .treeview-menu > li > a { + padding: 5px 5px 5px 15px; + display: block; + font-size: 14px; + margin: 0px 0px; +} +.sidebar .sidebar-menu .treeview-menu > li > a > .fa, +.sidebar .sidebar-menu .treeview-menu > li > a > .glyphicon, +.sidebar .sidebar-menu .treeview-menu > li > a > .ion { + width: 20px; +} +.user-panel { + padding: 10px; +} +.user-panel:before, +.user-panel:after { + display: table; + content: " "; +} +.user-panel:after { + clear: both; +} +.user-panel > .image > img { + width: 45px; + height: 45px; +} +.user-panel > .info { + font-weight: 600; + padding: 5px 5px 5px 15px; + font-size: 14px; + line-height: 1; +} +.user-panel > .info > p { + margin-bottom: 9px; +} +.user-panel > .info > a { + text-decoration: none; + padding-right: 5px; + margin-top: 3px; + font-size: 11px; + font-weight: normal; +} +.user-panel > .info > a > .fa, +.user-panel > .info > a > .ion, +.user-panel > .info > a > .glyphicon { + margin-right: 3px; +} +/* + * Off Canvas + * -------------------------------------------------- + * Gives us the push menu effect + */ +@media screen and (max-width: 992px) { + .relative { + position: relative; + } + .row-offcanvas-right .sidebar-offcanvas { + right: -220px; + } + .row-offcanvas-left .sidebar-offcanvas { + left: -220px; + } + .row-offcanvas-right.active { + right: 220px; + } + .row-offcanvas-left.active { + left: 220px; + } + .sidebar-offcanvas { + left: 0; + } + body.fixed .sidebar-offcanvas { + margin-top: 50px; + left: -220px; + } + body.fixed .row-offcanvas-left.active .navbar { + left: 220px !important; + right: 0; + } + body.fixed .row-offcanvas-left.active .sidebar-offcanvas { + left: 0px; + } +} +/* + Dropdown menus +---------------------------- +*/ +/*Dropdowns in general*/ +.dropdown-menu { + -webkit-box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1); + box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1); + z-index: 2300; +} +.dropdown-menu > li > a > .glyphicon, +.dropdown-menu > li > a > .fa, +.dropdown-menu > li > a > .ion { + margin-right: 10px; +} +.dropdown-menu > li > a:hover { + background-color: #3c8dbc; + color: #f9f9f9; +} +/*Drodown in navbars*/ +.skin-blue .navbar .dropdown-menu > li > a { + color: #444444; +} +/* + Navbar custom dropdown menu +------------------------------------ +*/ +.navbar-nav > .notifications-menu > .dropdown-menu, +.navbar-nav > .messages-menu > .dropdown-menu, +.navbar-nav > .tasks-menu > .dropdown-menu { + width: 280px; + padding: 0 0 0 0!important; + margin: 0!important; + top: 100%; + border: 1px solid #dfdfdf; + -webkit-border-radius: 4px !important; + -moz-border-radius: 4px !important; + border-radius: 4px !important; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li.header, +.navbar-nav > .messages-menu > .dropdown-menu > li.header, +.navbar-nav > .tasks-menu > .dropdown-menu > li.header { + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background-color: #ffffff; + padding: 7px 10px; + border-bottom: 1px solid #f4f4f4; + color: #444444; + font-size: 14px; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li.header:after, +.navbar-nav > .messages-menu > .dropdown-menu > li.header:after, +.navbar-nav > .tasks-menu > .dropdown-menu > li.header:after { + bottom: 100%; + left: 92%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: rgba(255, 255, 255, 0); + border-bottom-color: #ffffff; + border-width: 7px; + margin-left: -7px; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li.footer > a, +.navbar-nav > .messages-menu > .dropdown-menu > li.footer > a, +.navbar-nav > .tasks-menu > .dropdown-menu > li.footer > a { + -webkit-border-top-left-radius: 0px; + -webkit-border-top-right-radius: 0px; + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-topleft: 0px; + -moz-border-radius-topright: 0px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; + border-top-left-radius: 0px; + border-top-right-radius: 0px; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + font-size: 12px; + background-color: #f4f4f4; + padding: 7px 10px; + border-bottom: 1px solid #eeeeee; + color: #444444; + text-align: center; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li.footer > a:hover, +.navbar-nav > .messages-menu > .dropdown-menu > li.footer > a:hover, +.navbar-nav > .tasks-menu > .dropdown-menu > li.footer > a:hover { + background: #f4f4f4; + text-decoration: none; + font-weight: normal; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu, +.navbar-nav > .messages-menu > .dropdown-menu > li .menu, +.navbar-nav > .tasks-menu > .dropdown-menu > li .menu { + margin: 0; + padding: 0; + list-style: none; + overflow-x: hidden; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a, +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a, +.navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a { + display: block; + white-space: nowrap; + /* Prevent text from breaking */ + border-bottom: 1px solid #f4f4f4; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a:hover, +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:hover, +.navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a:hover { + background: #f6f6f6; + text-decoration: none; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a { + font-size: 12px; + color: #444444; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .glyphicon, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .fa, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .ion { + font-size: 20px; + width: 50px; + text-align: center; + padding: 15px 0px; + margin-right: 5px; + /* Default background and font colors */ + background: #00c0ef; + color: #f9f9f9; + /* Fallback for browsers that doesn't support rgba */ + color: rgba(255, 255, 255, 0.7); +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .glyphicon.danger, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .fa.danger, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .ion.danger { + background: #f56954; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .glyphicon.warning, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .fa.warning, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .ion.warning { + background: #f39c12; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .glyphicon.success, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .fa.success, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .ion.success { + background: #00a65a; +} +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .glyphicon.info, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .fa.info, +.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .ion.info { + background: #00c0ef; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a { + margin: 0px; + line-height: 20px; + padding: 10px 5px 10px 5px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > div > img { + margin: auto 10px auto auto; + width: 40px; + height: 40px; + border: 1px solid #dddddd; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > h4 { + padding: 0; + margin: 0 0 0 45px; + color: #444444; + font-size: 15px; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > h4 > small { + color: #999999; + font-size: 10px; + float: right; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > p { + margin: 0 0 0 45px; + font-size: 12px; + color: #888888; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:before, +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:after { + display: table; + content: " "; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:after { + clear: both; +} +.navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a { + padding: 10px; +} +.navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a > h3 { + font-size: 14px; + padding: 0; + margin: 0 0 10px 0; + color: #666666; +} +.navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a > .progress { + padding: 0; + margin: 0; +} +.navbar-nav > .user-menu > .dropdown-menu { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + padding: 1px 0 0 0; + border-top-width: 0; + width: 280px; +} +.navbar-nav > .user-menu > .dropdown-menu:after { + bottom: 100%; + right: 10px; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: rgba(255, 255, 255, 0); + border-bottom-color: #ffffff; + border-width: 10px; + margin-left: -10px; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-header { + height: 175px; + padding: 10px; + background: #3c8dbc; + text-align: center; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-header > img { + z-index: 5; + height: 90px; + width: 90px; + border: 8px solid; + border-color: transparent; + border-color: rgba(255, 255, 255, 0.2); +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-header > p { + z-index: 5; + color: #f9f9f9; + color: rgba(255, 255, 255, 0.8); + font-size: 17px; + text-shadow: 2px 2px 3px #333333; + margin-top: 10px; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-header > p > small { + display: block; + font-size: 12px; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-body { + padding: 15px; + border-bottom: 1px solid #f4f4f4; + border-top: 1px solid #dddddd; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-body:before, +.navbar-nav > .user-menu > .dropdown-menu > li.user-body:after { + display: table; + content: " "; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-body:after { + clear: both; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-body > div > a { + color: #0073b7; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-footer { + background-color: #f9f9f9; + padding: 10px; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-footer:before, +.navbar-nav > .user-menu > .dropdown-menu > li.user-footer:after { + display: table; + content: " "; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-footer:after { + clear: both; +} +.navbar-nav > .user-menu > .dropdown-menu > li.user-footer .btn-default { + color: #666666; +} +/* Add fade animation to dropdown menus */ +.open > .dropdown-menu { + animation-name: fadeAnimation; + animation-duration: .7s; + animation-iteration-count: 1; + animation-timing-function: ease; + animation-fill-mode: forwards; + -webkit-animation-name: fadeAnimation; + -webkit-animation-duration: .7s; + -webkit-animation-iteration-count: 1; + -webkit-animation-timing-function: ease; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: fadeAnimation; + -moz-animation-duration: .7s; + -moz-animation-iteration-count: 1; + -moz-animation-timing-function: ease; + -moz-animation-fill-mode: forwards; +} +@keyframes fadeAnimation { + from { + opacity: 0; + top: 120%; + } + to { + opacity: 1; + top: 100%; + } +} +@-webkit-keyframes fadeAnimation { + from { + opacity: 0; + top: 120%; + } + to { + opacity: 1; + top: 100%; + } +} +/* Fix dropdown menu for small screens to display correctly on small screens */ +@media screen and (max-width: 767px) { + .navbar-nav > .notifications-menu > .dropdown-menu, + .navbar-nav > .user-menu > .dropdown-menu, + .navbar-nav > .tasks-menu > .dropdown-menu, + .navbar-nav > .messages-menu > .dropdown-menu { + position: absolute; + top: 100%; + right: 0; + left: auto; + border-right: 1px solid #dddddd; + border-bottom: 1px solid #dddddd; + border-left: 1px solid #dddddd; + background: #ffffff; + } +} +/* Fix menu positions on xs screens to appear correctly and fully */ +@media screen and (max-width: 480px) { + .navbar-nav > .notifications-menu > .dropdown-menu > li.header, + .navbar-nav > .tasks-menu > .dropdown-menu > li.header, + .navbar-nav > .messages-menu > .dropdown-menu > li.header { + /* Remove arrow from the top */ + } + .navbar-nav > .notifications-menu > .dropdown-menu > li.header:after, + .navbar-nav > .tasks-menu > .dropdown-menu > li.header:after, + .navbar-nav > .messages-menu > .dropdown-menu > li.header:after { + border-width: 0px!important; + } + .navbar-nav > .tasks-menu > .dropdown-menu { + position: absolute; + right: -120px; + left: auto; + } + .navbar-nav > .notifications-menu > .dropdown-menu { + position: absolute; + right: -170px; + left: auto; + } + .navbar-nav > .messages-menu > .dropdown-menu { + position: absolute; + right: -210px; + left: auto; + } +} +/* + All form elements including input, select, textarea etc. +----------------------------------------------------------------- +*/ +.form-control { + -webkit-border-radius: 0px !important; + -moz-border-radius: 0px !important; + border-radius: 0px !important; + box-shadow: none; +} +.form-control:focus { + border-color: #3c8dbc !important; + box-shadow: none; +} +.form-group.has-success label { + color: #00a65a; +} +.form-group.has-success .form-control { + border-color: #00a65a !important; + box-shadow: none; +} +.form-group.has-warning label { + color: #f39c12; +} +.form-group.has-warning .form-control { + border-color: #f39c12 !important; + box-shadow: none; +} +.form-group.has-error label { + color: #f56954; +} +.form-group.has-error .form-control { + border-color: #f56954 !important; + box-shadow: none; +} +/* Input group */ +.input-group .input-group-addon { + border-radius: 0; + background-color: #f4f4f4; +} +/* button groups */ +.btn-group-vertical .btn.btn-flat:first-of-type, +.btn-group-vertical .btn.btn-flat:last-of-type { + border-radius: 0; +} +/* Checkbox and radio inputs */ +.checkbox, +.radio { + padding-left: 0; +} +/* + Compenent: Progress bars +-------------------------------- +*/ +/* size variation */ +.progress.sm { + height: 10px; +} +.progress.xs { + height: 7px; +} +/* Vertical bars */ +.progress.vertical { + position: relative; + width: 30px; + height: 200px; + display: inline-block; + margin-right: 10px; +} +.progress.vertical > .progress-bar { + width: 100%!important; + position: absolute; + bottom: 0; +} +.progress.vertical.sm { + width: 20px; +} +.progress.vertical.xs { + width: 10px; +} +/* Remove margins from progress bars when put in a table */ +.table tr > td .progress { + margin: 0; +} +.progress-bar-light-blue, +.progress-bar-primary { + background-color: #3c8dbc; +} +.progress-striped .progress-bar-light-blue, +.progress-striped .progress-bar-primary { + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-green, +.progress-bar-success { + background-color: #00a65a; +} +.progress-striped .progress-bar-green, +.progress-striped .progress-bar-success { + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-aqua, +.progress-bar-info { + background-color: #00c0ef; +} +.progress-striped .progress-bar-aqua, +.progress-striped .progress-bar-info { + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-yellow, +.progress-bar-warning { + background-color: #f39c12; +} +.progress-striped .progress-bar-yellow, +.progress-striped .progress-bar-warning { + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-red, +.progress-bar-danger { + background-color: #f56954; +} +.progress-striped .progress-bar-red, +.progress-striped .progress-bar-danger { + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +/* + Component: Small boxes +*/ +.small-box { + position: relative; + display: block; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + margin-bottom: 15px; +} +.small-box > .inner { + padding: 10px; +} +.small-box > .small-box-footer { + position: relative; + text-align: center; + padding: 3px 0; + color: #fff; + color: rgba(255, 255, 255, 0.8); + display: block; + z-index: 10; + background: rgba(0, 0, 0, 0.1); + text-decoration: none; +} +.small-box > .small-box-footer:hover { + color: #fff; + background: rgba(0, 0, 0, 0.15); +} +.small-box h3 { + font-size: 38px; + font-weight: bold; + margin: 0 0 10px 0; + white-space: nowrap; + padding: 0; +} +.small-box p { + font-size: 15px; +} +.small-box p > small { + display: block; + color: #f9f9f9; + font-size: 13px; + margin-top: 5px; +} +.small-box h3, +.small-box p { + z-index: 5px; +} +.small-box .icon { + position: absolute; + top: auto; + bottom: 5px; + right: 5px; + z-index: 0; + font-size: 90px; + color: rgba(0, 0, 0, 0.15); +} +.small-box:hover { + text-decoration: none; + color: #f9f9f9; +} +.small-box:hover .icon { + animation-name: tansformAnimation; + animation-duration: .5s; + animation-iteration-count: 1; + animation-timing-function: ease; + animation-fill-mode: forwards; + -webkit-animation-name: tansformAnimation; + -webkit-animation-duration: .5s; + -webkit-animation-iteration-count: 1; + -webkit-animation-timing-function: ease; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: tansformAnimation; + -moz-animation-duration: .5s; + -moz-animation-iteration-count: 1; + -moz-animation-timing-function: ease; + -moz-animation-fill-mode: forwards; +} +@keyframes tansformAnimation { + from { + font-size: 90px; + } + to { + font-size: 100px; + } +} +@-webkit-keyframes tansformAnimation { + from { + font-size: 90px; + } + to { + font-size: 100px; + } +} +@media screen and (max-width: 480px) { + .small-box { + text-align: center; + } + .small-box .icon { + display: none; + } + .small-box p { + font-size: 12px; + } +} +/* + component: Boxes +------------------------- +*/ +.box { + position: relative; + background: #ffffff; + border-top: 2px solid #c1c1c1; + margin-bottom: 20px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + width: 100%; + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); +} +.box.box-primary { + border-top-color: #3c8dbc; +} +.box.box-info { + border-top-color: #00c0ef; +} +.box.box-danger { + border-top-color: #f56954; +} +.box.box-warning { + border-top-color: #f39c12; +} +.box.box-success { + border-top-color: #00a65a; +} +.box.height-control .box-body { + max-height: 300px; + overflow: auto; +} +.box .box-header { + position: relative; + -webkit-border-top-left-radius: 3px; + -webkit-border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -moz-border-radius-topleft: 3px; + -moz-border-radius-topright: 3px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-bottom: 0px solid #f4f4f4; + color: #444; +} +.box .box-header:before, +.box .box-header:after { + display: table; + content: " "; +} +.box .box-header:after { + clear: both; +} +.box .box-header > .fa, +.box .box-header > .glyphicon, +.box .box-header > .ion, +.box .box-header .box-title { + display: inline-block; + padding: 10px 10px 10px 10px; + margin: 0; + font-size: 20px; + font-weight: 400; + float: left; + cursor: default; +} +.box .box-header a { + color: #444; +} +.box .box-header > .box-tools { + padding: 5px 10px 5px 5px; +} +.box .box-body { + padding: 10px; + -webkit-border-top-left-radius: 0; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + -moz-border-radius-topleft: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomright: 3px; + -moz-border-radius-bottomleft: 3px; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.box .box-body > table, +.box .box-body > .table { + margin-bottom: 0; +} +.box .box-body.chart-responsive { + width: 100%; + overflow: hidden; +} +.box .box-body > .chart { + position: relative; + overflow: hidden; + width: 100%; +} +.box .box-body > .chart svg, +.box .box-body > .chart canvas { + width: 100%!important; +} +.box .box-body .fc { + margin-top: 5px; +} +.box .box-body .fc-header-title h2 { + font-size: 15px; + line-height: 1.6em; + color: #666; + margin-left: 10px; +} +.box .box-body .fc-header-right { + padding-right: 10px; +} +.box .box-body .fc-header-left { + padding-left: 10px; +} +.box .box-body .fc-widget-header { + background: #fafafa; + box-shadow: inset 0px -3px 1px rgba(0, 0, 0, 0.02); +} +.box .box-body .fc-grid { + width: 100%; + border: 0; +} +.box .box-body .fc-widget-header:first-of-type, +.box .box-body .fc-widget-content:first-of-type { + border-left: 0; + border-right: 0; +} +.box .box-body .fc-widget-header:last-of-type, +.box .box-body .fc-widget-content:last-of-type { + border-right: 0; +} +.box .box-body .table { + margin-bottom: 0; +} +.box .box-body .full-width-chart { + margin: -19px; +} +.box .box-body.no-padding .full-width-chart { + margin: -9px; +} +.box .box-footer { + border-top: 1px solid #f4f4f4; + -webkit-border-top-left-radius: 0; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + -moz-border-radius-topleft: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomright: 3px; + -moz-border-radius-bottomleft: 3px; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + padding: 10px; + background-color: #ffffff; +} +.box.box-solid { + border-top: 0px; +} +.box.box-solid > .box-header { + padding-bottom: 0px!important; +} +.box.box-solid > .box-header .btn.btn-default { + background: transparent; +} +.box.box-solid.box-primary > .box-header { + color: #fff; + background: #3c8dbc; + background-color: #3c8dbc; +} +.box.box-solid.box-primary > .box-header a { + color: #444; +} +.box.box-solid.box-info > .box-header { + color: #fff; + background: #00c0ef; + background-color: #00c0ef; +} +.box.box-solid.box-info > .box-header a { + color: #444; +} +.box.box-solid.box-danger > .box-header { + color: #fff; + background: #f56954; + background-color: #f56954; +} +.box.box-solid.box-danger > .box-header a { + color: #444; +} +.box.box-solid.box-warning > .box-header { + color: #fff; + background: #f39c12; + background-color: #f39c12; +} +.box.box-solid.box-warning > .box-header a { + color: #444; +} +.box.box-solid.box-success > .box-header { + color: #fff; + background: #00a65a; + background-color: #00a65a; +} +.box.box-solid.box-success > .box-header a { + color: #444; +} +.box.box-solid > .box-header > .box-tools .btn { + border: 0; + box-shadow: none; +} +.box.box-solid.collapsed-box .box-header { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.box.box-solid[class*='bg'] > .box-header { + color: #fff; +} +.box .box-group > .box { + margin-bottom: 5px; +} +.box .knob-label { + text-align: center; + color: #333; + font-weight: 100; + font-size: 12px; + margin-bottom: 0.3em; +} +.box .todo-list { + margin: 0; + padding: 0px 0px; + list-style: none; +} +.box .todo-list > li { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + padding: 10px; + background: #f3f4f5; + margin-bottom: 2px; + border-left: 2px solid #e6e7e8; + color: #444; +} +.box .todo-list > li:last-of-type { + margin-bottom: 0; +} +.box .todo-list > li.danger { + border-left-color: #f56954; +} +.box .todo-list > li.warning { + border-left-color: #f39c12; +} +.box .todo-list > li.info { + border-left-color: #00c0ef; +} +.box .todo-list > li.success { + border-left-color: #00a65a; +} +.box .todo-list > li.primary { + border-left-color: #3c8dbc; +} +.box .todo-list > li > input[type='checkbox'] { + margin: 0 10px 0 5px; +} +.box .todo-list > li .text { + display: inline-block; + margin-left: 5px; + font-weight: 600; +} +.box .todo-list > li .label { + margin-left: 10px; + font-size: 9px; +} +.box .todo-list > li .tools { + display: none; + float: right; + color: #f56954; +} +.box .todo-list > li .tools > .fa, +.box .todo-list > li .tools > .glyphicon, +.box .todo-list > li .tools > .ion { + margin-right: 5px; + cursor: pointer; +} +.box .todo-list > li:hover .tools { + display: inline-block; +} +.box .todo-list > li.done { + color: #999; +} +.box .todo-list > li.done .text { + text-decoration: line-through; + font-weight: 500; +} +.box .todo-list > li.done .label { + background: #eaeaec !important; +} +.box .todo-list .handle { + display: inline-block; + cursor: move; + margin: 0 5px; +} +.box .chat { + padding: 5px 20px 5px 10px; +} +.box .chat .item { + margin-bottom: 10px; +} +.box .chat .item:before, +.box .chat .item:after { + display: table; + content: " "; +} +.box .chat .item:after { + clear: both; +} +.box .chat .item > img { + width: 40px; + height: 40px; + border: 2px solid transparent; + -webkit-border-radius: 50% !important; + -moz-border-radius: 50% !important; + border-radius: 50% !important; +} +.box .chat .item > img.online { + border: 2px solid #00a65a; +} +.box .chat .item > img.offline { + border: 2px solid #f56954; +} +.box .chat .item > .message { + margin-left: 55px; + margin-top: -40px; +} +.box .chat .item > .message > .name { + display: block; + font-weight: 600; +} +.box .chat .item > .attachment { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + background: #f0f0f0; + margin-left: 65px; + margin-right: 15px; + padding: 10px; +} +.box .chat .item > .attachment > h4 { + margin: 0 0 5px 0; + font-weight: 600; + font-size: 14px; +} +.box .chat .item > .attachment > p, +.box .chat .item > .attachment > .filename { + font-weight: 600; + font-size: 13px; + font-style: italic; + margin: 0; +} +.box .chat .item > .attachment:before, +.box .chat .item > .attachment:after { + display: table; + content: " "; +} +.box .chat .item > .attachment:after { + clear: both; +} +.box > .overlay, +.box > .loading-img { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.box > .overlay { + z-index: 1010; + background: rgba(255, 255, 255, 0.7); +} +.box > .overlay.dark { + background: rgba(0, 0, 0, 0.5); +} +.box > .loading-img { + z-index: 1020; + background: transparent url('../img/ajax-loader1.gif') 50% 50% no-repeat; +} +/* +Component: timeline +-------------------- +*/ +.timeline { + position: relative; + margin: 0 0 30px 0; + padding: 0; + list-style: none; +} +.timeline:before { + content: ''; + position: absolute; + top: 0px; + bottom: 0; + width: 5px; + background: #ddd; + left: 30px; + border: 1px solid #eee; + margin: 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.timeline > li { + position: relative; + margin-right: 10px; + margin-bottom: 15px; +} +.timeline > li:before, +.timeline > li:after { + display: table; + content: " "; +} +.timeline > li:after { + clear: both; +} +.timeline > li > .timeline-item { + margin-top: 10px; + border: 0px solid #dfdfdf; + background: #fff; + color: #555; + margin-left: 60px; + margin-right: 15px; + padding: 5px; + position: relative; + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); +} +.timeline > li > .timeline-item > .time { + color: #999; + float: right; + margin: 2px 0 0 0; +} +.timeline > li > .timeline-item > .timeline-header { + margin: 0; + color: #555; + border-bottom: 1px solid #f4f4f4; + padding: 5px; + font-size: 16px; + line-height: 1.1; +} +.timeline > li > .timeline-item > .timeline-header > a { + font-weight: 600; +} +.timeline > li > .timeline-item > .timeline-body, +.timeline > li > .timeline-item > .timeline-footer { + padding: 10px; +} +.timeline > li.time-label > span { + font-weight: 600; + padding: 5px; + display: inline-block; + background-color: #fff; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.timeline > li > .fa, +.timeline > li > .glyphicon, +.timeline > li > .ion { + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + width: 30px; + height: 30px; + font-size: 15px; + line-height: 30px; + position: absolute; + color: #666; + background: #eee; + border-radius: 50%; + text-align: center; + left: 18px; + top: 0; +} +/* + Component: Buttons +------------------------- +*/ +.btn { + font-weight: 500; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + border: 1px solid transparent; + -webkit-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.09); + -moz-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.09); + box-shadow: inset 0px -1px 0px 0px rgba(0, 0, 0, 0.09); +} +.btn.btn-default { + background-color: #fafafa; + color: #666; + border-color: #ddd; + border-bottom-color: #ddd; +} +.btn.btn-default:hover, +.btn.btn-default:active, +.btn.btn-default.hover { + background-color: #f4f4f4!important; +} +.btn.btn-default.btn-flat { + border-bottom-color: #d9dadc; +} +.btn.btn-primary { + background-color: #3c8dbc; + border-color: #367fa9; +} +.btn.btn-primary:hover, +.btn.btn-primary:active, +.btn.btn-primary.hover { + background-color: #367fa9; +} +.btn.btn-success { + background-color: #00a65a; + border-color: #008d4c; +} +.btn.btn-success:hover, +.btn.btn-success:active, +.btn.btn-success.hover { + background-color: #008d4c; +} +.btn.btn-info { + background-color: #00c0ef; + border-color: #00acd6; +} +.btn.btn-info:hover, +.btn.btn-info:active, +.btn.btn-info.hover { + background-color: #00acd6; +} +.btn.btn-danger { + background-color: #f56954; + border-color: #f4543c; +} +.btn.btn-danger:hover, +.btn.btn-danger:active, +.btn.btn-danger.hover { + background-color: #f4543c; +} +.btn.btn-warning { + background-color: #f39c12; + border-color: #e08e0b; +} +.btn.btn-warning:hover, +.btn.btn-warning:active, +.btn.btn-warning.hover { + background-color: #e08e0b; +} +.btn.btn-flat { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + border-width: 1px; +} +.btn:active { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn:focus { + outline: none; +} +.btn.btn-file { + position: relative; + overflow: hidden; +} +.btn.btn-file > input[type='file'] { + position: absolute; + top: 0; + right: 0; + min-width: 100%; + min-height: 100%; + font-size: 100px; + text-align: right; + filter: alpha(opacity=0); + opacity: 0; + outline: none; + background: white; + cursor: inherit; + display: block; +} +.btn.btn-app { + position: relative; + padding: 15px 5px; + margin: 0 0 10px 10px; + min-width: 80px; + height: 60px; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + text-align: center; + color: #666; + border: 1px solid #ddd; + background-color: #fafafa; + font-size: 12px; +} +.btn.btn-app > .fa, +.btn.btn-app > .glyphicon, +.btn.btn-app > .ion { + font-size: 20px; + display: block; +} +.btn.btn-app:hover { + background: #f4f4f4; + color: #444; + border-color: #aaa; +} +.btn.btn-app:active, +.btn.btn-app:focus { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.btn-app > .badge { + position: absolute; + top: -3px; + right: -10px; + font-size: 10px; + font-weight: 400; +} +.btn.btn-social-old { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + opacity: 0.9; + padding: 0; +} +.btn.btn-social-old > .fa { + padding: 10px 0; + width: 40px; +} +.btn.btn-social-old > .fa + span { + border-left: 1px solid rgba(255, 255, 255, 0.3); +} +.btn.btn-social-old span { + padding: 10px; +} +.btn.btn-social-old:hover { + opacity: 1; +} +.btn.btn-circle { + width: 30px; + height: 30px; + line-height: 30px; + padding: 0; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; +} +/* + Component: callout +------------------------ +*/ +.callout { + margin: 0 0 20px 0; + padding: 15px 30px 15px 15px; + border-left: 5px solid #eee; +} +.callout h4 { + margin-top: 0; +} +.callout p:last-child { + margin-bottom: 0; +} +.callout code, +.callout .highlight { + background-color: #fff; +} +.callout.callout-danger { + background-color: #fcf2f2; + border-color: #dFb5b4; +} +.callout.callout-warning { + background-color: #fefbed; + border-color: #f1e7bc; +} +.callout.callout-info { + background-color: #f0f7fd; + border-color: #d0e3f0; +} +.callout.callout-danger h4 { + color: #B94A48; +} +.callout.callout-warning h4 { + color: #C09853; +} +.callout.callout-info h4 { + color: #3A87AD; +} +/* + Component: alert +------------------------ +*/ +.alert { + padding-left: 30px; + margin-left: 15px; + position: relative; +} +.alert > .fa, +.alert > .glyphicon { + position: absolute; + left: -15px; + top: -15px; + width: 35px; + height: 35px; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + line-height: 35px; + text-align: center; + background: inherit; + border: inherit; +} +/* + Component: Navs +*/ +/* NAV PILLS */ +.nav.nav-pills > li > a { + border-top: 3px solid transparent; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + color: #444; +} +.nav.nav-pills > li > a > .fa, +.nav.nav-pills > li > a > .glyphicon, +.nav.nav-pills > li > a > .ion { + margin-right: 5px; +} +.nav.nav-pills > li.active > a, +.nav.nav-pills > li.active > a:hover { + background-color: #f6f6f6; + border-top-color: #3c8dbc; + color: #444; +} +.nav.nav-pills > li.active > a { + font-weight: 600; +} +.nav.nav-pills > li > a:hover { + background-color: #f6f6f6; +} +.nav.nav-pills.nav-stacked > li > a { + border-top: 0; + border-left: 3px solid transparent; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + color: #444; +} +.nav.nav-pills.nav-stacked > li.active > a, +.nav.nav-pills.nav-stacked > li.active > a:hover { + background-color: #f6f6f6; + border-left-color: #3c8dbc; + color: #444; +} +.nav.nav-pills.nav-stacked > li.header { + border-bottom: 1px solid #ddd; + color: #777; + margin-bottom: 10px; + padding: 5px 10px; + text-transform: uppercase; +} +/* NAV TABS */ +.nav-tabs-custom { + margin-bottom: 20px; + background: #fff; + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); +} +.nav-tabs-custom > .nav-tabs { + margin: 0; + border-bottom-color: #f4f4f4; +} +.nav-tabs-custom > .nav-tabs > li { + border-top: 3px solid transparent; + margin-bottom: -2px; + margin-right: 5px; +} +.nav-tabs-custom > .nav-tabs > li > a { + -webkit-border-radius: 0 !important; + -moz-border-radius: 0 !important; + border-radius: 0 !important; +} +.nav-tabs-custom > .nav-tabs > li > a, +.nav-tabs-custom > .nav-tabs > li > a:hover { + background: transparent; + margin: 0; +} +.nav-tabs-custom > .nav-tabs > li:not(.active) > a:hover, +.nav-tabs-custom > .nav-tabs > li:not(.active) > a:focus, +.nav-tabs-custom > .nav-tabs > li:not(.active) > a:active { + border-color: transparent; +} +.nav-tabs-custom > .nav-tabs > li.active { + border-top-color: #3c8dbc; +} +.nav-tabs-custom > .nav-tabs > li.active > a, +.nav-tabs-custom > .nav-tabs > li.active:hover > a { + background-color: #fff; +} +.nav-tabs-custom > .nav-tabs > li.active > a { + border-top: 0; + border-left-color: #f4f4f4; + border-right-color: #f4f4f4; +} +.nav-tabs-custom > .nav-tabs > li:first-of-type { + margin-left: 0px; +} +.nav-tabs-custom > .nav-tabs > li:first-of-type.active > a { + border-left-width: 0; +} +.nav-tabs-custom > .nav-tabs.pull-right { + float: none!important; +} +.nav-tabs-custom > .nav-tabs.pull-right > li { + float: right; +} +.nav-tabs-custom > .nav-tabs.pull-right > li:first-of-type { + margin-right: 0px; +} +.nav-tabs-custom > .nav-tabs.pull-right > li:first-of-type.active > a { + border-left-width: 1px; + border-right-width: 0px; +} +.nav-tabs-custom > .nav-tabs > li.header { + font-weight: 400; + line-height: 35px; + padding: 0 10px; + font-size: 20px; + color: #444; + cursor: default; +} +.nav-tabs-custom > .nav-tabs > li.header > .fa, +.nav-tabs-custom > .nav-tabs > li.header > .glyphicon, +.nav-tabs-custom > .nav-tabs > li.header > .ion { + margin-right: 10px; +} +.nav-tabs-custom > .tab-content { + background: #fff; + padding: 10px; +} +/* Nav tabs bottom */ +.tabs-bottom.nav-3 li a { + width: 3333.33333333% !important; +} +.tabs-bottom li a { + border: 0; +} +/* PAGINATION */ +.pagination > li > a { + background: #fafafa; + color: #666; + -webkit-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.09); + -moz-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.09); + box-shadow: inset 0px -1px 0px 0px rgba(0, 0, 0, 0.09); +} +.pagination > li:first-of-type a, +.pagination > li:last-of-type a { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +/* + Component: Mailbox +*/ +.mailbox .table-mailbox { + border-left: 1px solid #ddd; + border-right: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} +.mailbox .table-mailbox tr.unread > td { + background-color: rgba(0, 0, 0, 0.05); + color: #000; + font-weight: 600; +} +.mailbox .table-mailbox tr > td > .fa.fa-star, +.mailbox .table-mailbox tr > td > .fa.fa-star-o, +.mailbox .table-mailbox tr > td > .glyphicon.glyphicon-star, +.mailbox .table-mailbox tr > td > .glyphicon.glyphicon-star-empty { + color: #f39c12; + cursor: pointer; +} +.mailbox .table-mailbox tr > td.small-col { + width: 30px; +} +.mailbox .table-mailbox tr > td.name { + width: 150px; + font-weight: 600; +} +.mailbox .table-mailbox tr > td.time { + text-align: right; + width: 100px; +} +.mailbox .table-mailbox tr > td { + white-space: nowrap; +} +.mailbox .table-mailbox tr > td > a { + color: #444; +} +@media screen and (max-width: 767px) { + .mailbox .nav-stacked > li:not(.header) { + float: left; + width: 50%; + } + .mailbox .nav-stacked > li:not(.header).header { + border: 0!important; + } + .mailbox .search-form { + margin-top: 10px; + } +} +/* + Page: locked screen +*/ +/* ADD THIS CLASS TO THE TAG */ +.lockscreen { + background: url(../img/blur-background09.jpg) repeat center center fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; +} +/* Remove the background from the body element */ +.lockscreen > body { + background: transparent; +} +/* We will put the dynamically generated digital clock here */ +.lockscreen .headline { + color: #fff; + text-shadow: 1px 3px 5px rgba(0, 0, 0, 0.5); + font-weight: 300; + -webkit-font-smoothing: antialiased !important; + opacity: 0.8; + margin: 10px 0 30px 0; + font-size: 90px; +} +@media screen and (max-width: 480px) { + .lockscreen .headline { + font-size: 60px; + margin-bottom: 40px; + } +} +/* User name [optional] */ +.lockscreen .lockscreen-name { + text-align: center; + font-weight: 600; + font-size: 16px; +} +/* Will contain the image and the sign in form */ +.lockscreen-item { + padding: 0; + background: #fff; + position: relative; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + margin: 10px auto; + width: 290px; +} +.lockscreen-item:before, +.lockscreen-item:after { + display: table; + content: " "; +} +.lockscreen-item:after { + clear: both; +} +/* User image */ +.lockscreen-item > .lockscreen-image { + position: absolute; + left: -10px; + top: -30px; + background: #fff; + padding: 10px; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + z-index: 10; +} +.lockscreen-item > .lockscreen-image > img { + width: 70px; + height: 70px; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; +} +/* Contains the password input and the login button */ +.lockscreen-item > .lockscreen-credentials { + margin-left: 80px; +} +.lockscreen-item > .lockscreen-credentials input { + border: 0 !important; +} +.lockscreen-item > .lockscreen-credentials .btn { + background-color: #fff; + border: 0; +} +/* Extra to give the user an option to navigate the website [optional]*/ +.lockscreen-link { + margin-top: 30px; + text-align: center; +} +/* + Page: register and login +*/ +.form-box { + width: 360px; + margin: 90px auto 0 auto; +} +.form-box .header { + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background: #3d9970; + box-shadow: inset 0px -3px 0px rgba(0, 0, 0, 0.2); + padding: 20px 10px; + text-align: center; + font-size: 26px; + font-weight: 300; + color: #fff; +} +.form-box .body, +.form-box .footer { + padding: 10px 20px; + background: #fff; + color: #444; +} +.form-box .body > .form-group, +.form-box .footer > .form-group { + margin-top: 20px; +} +.form-box .body > .form-group > input, +.form-box .footer > .form-group > input { + border: #fff; +} +.form-box .body > .btn, +.form-box .footer > .btn { + margin-bottom: 10px; +} +.form-box .footer { + -webkit-border-top-left-radius: 0; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-topleft: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +@media (max-width: 767px) { + .form-box { + width: 90%; + } +} +/* + Page: 404 and 500 error pages +------------------------------------ +*/ +.error-page { + width: 600px; + margin: 20px auto 0 auto; +} +@media screen and (max-width: 767px) { + .error-page { + width: 100%; + } +} +.error-page > .headline { + float: left; + font-size: 100px; + font-weight: 300; +} +@media screen and (max-width: 767px) { + .error-page > .headline { + float: none; + text-align: center; + } +} +.error-page > .error-content { + margin-left: 190px; + display: block; +} +@media screen and (max-width: 767px) { + .error-page > .error-content { + margin-left: 0; + } +} +.error-page > .error-content > h3 { + font-weight: 300; + font-size: 25px; +} +@media screen and (max-width: 767px) { + .error-page > .error-content > h3 { + text-align: center; + } +} +.error-page:before, +.error-page:after { + display: table; + content: " "; +} +.error-page:after { + clear: both; +} +/* + Page: Invoice +*/ +.invoice { + position: relative; + width: 90%; + margin: 10px auto; + background: #fff; + border: 1px solid #f4f4f4; +} +.invoice-title { + margin-top: 0; +} +/* Enhancement for printing */ +@media print { + .invoice { + width: 100%; + border: 0; + margin: 0; + padding: 0; + } + .invoice-col { + float: left; + width: 33.3333333%; + } + .table-responsive { + overflow: auto; + } + .table-responsive > .table tr th, + .table-responsive > .table tr td { + white-space: normal!important; + } +} +/* + Skins + ----- +*/ +/* + Skin Blue + --------- +*/ +/* skin-blue navbar */ +.skin-blue .navbar { + background-color: #3c8dbc; +} +.skin-blue .navbar .nav a { + color: rgba(255, 255, 255, 0.8); +} +.skin-blue .navbar .nav > li > a:hover, +.skin-blue .navbar .nav > li > a:active, +.skin-blue .navbar .nav > li > a:focus, +.skin-blue .navbar .nav .open > a, +.skin-blue .navbar .nav .open > a:hover, +.skin-blue .navbar .nav .open > a:focus { + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; +} +.skin-blue .navbar .navbar-right > .nav { + margin-right: 10px; +} +.skin-blue .navbar .sidebar-toggle .icon-bar { + background: rgba(255, 255, 255, 0.8); +} +.skin-blue .navbar .sidebar-toggle:hover .icon-bar { + background: #f6f6f6 !important; +} +/* skin-blue logo */ +.skin-blue .logo { + background-color: #367fa9; + color: #f9f9f9; +} +.skin-blue .logo > a { + color: #f9f9f9; +} +.skin-blue .logo:hover { + background: #357ca5; +} +/* skin-blue content header */ +.skin-blue .right-side > .content-header { + background: #fbfbfb; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); +} +/* Skin-blue user panel */ +.skin-blue .user-panel > .image > img { + border: 1px solid #dfdfdf; +} +.skin-blue .user-panel > .info, +.skin-blue .user-panel > .info > a { + color: #555555; +} +/* skin-blue sidebar */ +.skin-blue .sidebar { + border-bottom: 1px solid #fff; +} +.skin-blue .sidebar > .sidebar-menu > li { + border-top: 1px solid #fff; + border-bottom: 1px solid #dbdbdb; +} +.skin-blue .sidebar > .sidebar-menu > li:first-of-type { + border-top: 1px solid #dbdbdb; +} +.skin-blue .sidebar > .sidebar-menu > li:first-of-type > a { + border-top: 1px solid #fff; +} +.skin-blue .sidebar > .sidebar-menu > li > a { + margin-right: 1px; +} +.skin-blue .sidebar > .sidebar-menu > li > a:hover, +.skin-blue .sidebar > .sidebar-menu > li.active > a { + color: #222; + background: #f9f9f9; +} +.skin-blue .sidebar > .sidebar-menu > li > .treeview-menu { + margin: 0 1px; + background: #f9f9f9; +} +.skin-blue .left-side { + background: #f4f4f4; + -webkit-box-shadow: inset -3px 0px 8px -4px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset -3px 0px 8px -4px rgba(0, 0, 0, 0.1); + box-shadow: inset -3px 0px 8px -4px rgba(0, 0, 0, 0.07); +} +.skin-blue .sidebar a { + color: #555555; +} +.skin-blue .sidebar a:hover { + text-decoration: none; +} +.skin-blue .treeview-menu > li > a { + color: #777; +} +.skin-blue .treeview-menu > li.active > a, +.skin-blue .treeview-menu > li > a:hover { + color: #111; +} +.skin-blue .sidebar-form { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + border: 1px solid #dbdbdb; + margin: 10px 10px; +} +.skin-blue .sidebar-form input[type="text"], +.skin-blue .sidebar-form .btn { + box-shadow: none; + background-color: #fafafa; + border: 1px solid #fafafa; + height: 35px; +} +.skin-blue .sidebar-form input[type="text"] { + color: #666; + -webkit-border-top-left-radius: 2px !important; + -webkit-border-top-right-radius: 0 !important; + -webkit-border-bottom-right-radius: 0 !important; + -webkit-border-bottom-left-radius: 2px !important; + -moz-border-radius-topleft: 2px !important; + -moz-border-radius-topright: 0 !important; + -moz-border-radius-bottomright: 0 !important; + -moz-border-radius-bottomleft: 2px !important; + border-top-left-radius: 2px !important; + border-top-right-radius: 0 !important; + border-bottom-right-radius: 0 !important; + border-bottom-left-radius: 2px !important; +} +.skin-blue .sidebar-form input[type="text"]:focus, +.skin-blue .sidebar-form input[type="text"]:focus + .input-group-btn .btn { + background-color: #fff; + color: #666; +} +.skin-blue .sidebar-form input[type="text"]:focus + .input-group-btn .btn { + border-left-color: #fff; +} +.skin-blue .sidebar-form .btn { + color: #999; + -webkit-border-top-left-radius: 0 !important; + -webkit-border-top-right-radius: 2px !important; + -webkit-border-bottom-right-radius: 2px !important; + -webkit-border-bottom-left-radius: 0 !important; + -moz-border-radius-topleft: 0 !important; + -moz-border-radius-topright: 2px !important; + -moz-border-radius-bottomright: 2px !important; + -moz-border-radius-bottomleft: 0 !important; + border-top-left-radius: 0 !important; + border-top-right-radius: 2px !important; + border-bottom-right-radius: 2px !important; + border-bottom-left-radius: 0 !important; +} +/* + Skin Black + -------- +*/ +/* skin-black navbar */ +.skin-black .navbar { + background-color: #ffffff; + border-bottom: 1px solid #eee; +} +.skin-black .navbar .nav a { + color: #333333; +} +.skin-black .navbar .nav > li > a:hover, +.skin-black .navbar .nav > li > a:active, +.skin-black .navbar .nav > li > a:focus, +.skin-black .navbar .nav .open > a, +.skin-black .navbar .nav .open > a:hover, +.skin-black .navbar .nav .open > a:focus { + background: #ffffff; + color: #999999; +} +.skin-black .navbar .navbar-right > .nav { + margin-right: 10px; +} +.skin-black .navbar .sidebar-toggle .icon-bar { + background: #333333; +} +.skin-black .navbar .sidebar-toggle:hover .icon-bar { + background: #999999 !important; +} +/* skin-black logo */ +.skin-black .logo { + background-color: #333333; + color: #f9f9f9; +} +.skin-black .logo > a { + color: #f9f9f9; +} +.skin-black .logo:hover { + background: #303030; +} +/* skin-black content header */ +.skin-black .right-side > .content-header { + background: transparent; + box-shadow: none; +} +/* Skin-red user panel */ +.skin-black .user-panel > .image > img { + border: 1px solid #444; +} +.skin-black .user-panel > .info, +.skin-black .user-panel > .info > a { + color: #eee; +} +/* skin-black sidebar */ +.skin-black .sidebar { + border-bottom: 1px solid #333; +} +.skin-black .sidebar > .sidebar-menu > li { + border-top: 1px solid #333; + border-bottom: 0px solid #444; +} +.skin-black .sidebar > .sidebar-menu > li:first-of-type { + border-top: 1px solid #444; +} +.skin-black .sidebar > .sidebar-menu > li:first-of-type > a { + border-top: 0px solid #333; +} +.skin-black .sidebar > .sidebar-menu > li > a { + margin-right: 1px; +} +.skin-black .sidebar > .sidebar-menu > li > a:hover, +.skin-black .sidebar > .sidebar-menu > li.active > a { + color: #f6f6f6; + background: #444; +} +.skin-black .sidebar > .sidebar-menu > li > .treeview-menu { + margin: 0 1px; + background: #444; +} +.skin-black .left-side { + background: #333; +} +.skin-black .sidebar a { + color: #eee; +} +.skin-black .sidebar a:hover { + text-decoration: none; +} +.skin-black .treeview-menu > li > a { + color: #ccc; +} +.skin-black .treeview-menu > li.active > a, +.skin-black .treeview-menu > li > a:hover { + color: #fff; +} +.skin-black .sidebar-form { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + border: 0px solid #555; + margin: 10px 10px; +} +.skin-black .sidebar-form input[type="text"], +.skin-black .sidebar-form .btn { + box-shadow: none; + background-color: rgba(255, 255, 255, 0.1); + border: 0 solid rgba(255, 255, 255, 0.1); + height: 35px; + outline: none; +} +.skin-black .sidebar-form input[type="text"] { + color: #666; + -webkit-border-top-left-radius: 2px !important; + -webkit-border-top-right-radius: 0 !important; + -webkit-border-bottom-right-radius: 0 !important; + -webkit-border-bottom-left-radius: 2px !important; + -moz-border-radius-topleft: 2px !important; + -moz-border-radius-topright: 0 !important; + -moz-border-radius-bottomright: 0 !important; + -moz-border-radius-bottomleft: 2px !important; + border-top-left-radius: 2px !important; + border-top-right-radius: 0 !important; + border-bottom-right-radius: 0 !important; + border-bottom-left-radius: 2px !important; +} +.skin-black .sidebar-form input[type="text"]:focus, +.skin-black .sidebar-form input[type="text"]:focus + .input-group-btn .btn { + background-color: #444; + border: 0; +} +.skin-black .sidebar-form input[type="text"]:focus + .input-group-btn .btn { + border-left: 0; +} +.skin-black .sidebar-form .btn { + color: #999; + -webkit-border-top-left-radius: 0 !important; + -webkit-border-top-right-radius: 2px !important; + -webkit-border-bottom-right-radius: 2px !important; + -webkit-border-bottom-left-radius: 0 !important; + -moz-border-radius-topleft: 0 !important; + -moz-border-radius-topright: 2px !important; + -moz-border-radius-bottomright: 2px !important; + -moz-border-radius-bottomleft: 0 !important; + border-top-left-radius: 0 !important; + border-top-right-radius: 2px !important; + border-bottom-right-radius: 2px !important; + border-bottom-left-radius: 0 !important; + border-left: 0; +} +/*! + * iCheck v1.0.1, http://git.io/arlzeA + * ================================= + * Powerful jQuery and Zepto plugin for checkboxes and radio buttons customization + * + * (c) 2013 Damir Sultanov, http://fronteed.com + * MIT Licensed + */ +/* iCheck plugin Minimal skin, black +----------------------------------- */ +.icheckbox_minimal, +.iradio_minimal { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: rgba(255, 255, 255, 0.7) url(iCheck/minimal/minimal.png) no-repeat; + border: none; + cursor: pointer; +} +.icheckbox_minimal { + background-position: 0 0; +} +.icheckbox_minimal.hover { + background-position: -20px 0; +} +.icheckbox_minimal.checked { + background-position: -40px 0; +} +.icheckbox_minimal.disabled { + background-position: -60px 0; + cursor: default; +} +.icheckbox_minimal.checked.disabled { + background-position: -80px 0; +} +.iradio_minimal { + background-position: -100px 0; +} +.iradio_minimal.hover { + background-position: -120px 0; +} +.iradio_minimal.checked { + background-position: -140px 0; +} +.iradio_minimal.disabled { + background-position: -160px 0; + cursor: default; +} +.iradio_minimal.checked.disabled { + background-position: -180px 0; +} +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal, + .iradio_minimal { + background-image: url('iCheck/minimal/minimal@2x.png'); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} +.pace .pace-progress { + background: #00c0ef; + position: fixed; + z-index: 2000; + top: 0; + left: 0; + height: 2px; + -webkit-transition: width 1s; + -moz-transition: width 1s; + -o-transition: width 1s; + transition: width 1s; +} +.pace-inactive { + display: none; +} +/* + * Social Buttons for Bootstrap + * + * Copyright 2013-2014 Panayiotis Lipiridis + * Licensed under the MIT License + * + * https://github.com/lipis/bootstrap-social + * + * Note: this file has been altered to work correctly with AdminLTE + */ +.btn-social { + position: relative; + padding-left: 44px !important; + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.btn-social :first-child { + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 32px !important; + line-height: 34px !important; + font-size: 1.6em!important; + text-align: center; + border-right: 1px solid rgba(0, 0, 0, 0.2); +} +.btn-social.btn-lg { + padding-left: 60px !important; +} +.btn-social.btn-lg :first-child { + line-height: 45px; + width: 45px; + font-size: 1.8em; +} +.btn-social.btn-sm { + padding-left: 38px !important; +} +.btn-social.btn-sm :first-child { + line-height: 28px; + width: 28px; + font-size: 1.4em; +} +.btn-social.btn-xs { + padding-left: 30px !important; +} +.btn-social.btn-xs :first-child { + line-height: 20px; + width: 20px; + font-size: 1.2em; +} +.btn-social-icon { + position: relative; + padding-left: 44px !important; + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + height: 34px; + width: 34px; + padding: 0; +} +.btn-social-icon :first-child { + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 32px !important; + line-height: 34px !important; + font-size: 1.6em!important; + text-align: center; + border-right: 1px solid rgba(0, 0, 0, 0.2); +} +.btn-social-icon.btn-lg { + padding-left: 60px !important; +} +.btn-social-icon.btn-lg :first-child { + line-height: 45px; + width: 45px; + font-size: 1.8em; +} +.btn-social-icon.btn-sm { + padding-left: 38px !important; +} +.btn-social-icon.btn-sm :first-child { + line-height: 28px; + width: 28px; + font-size: 1.4em; +} +.btn-social-icon.btn-xs { + padding-left: 30px !important; +} +.btn-social-icon.btn-xs :first-child { + line-height: 20px; + width: 20px; + font-size: 1.2em; +} +.btn-social-icon :first-child { + border: none; + text-align: center; + width: 100%!important; +} +.btn-social-icon.btn-lg { + height: 45px; + width: 45px; + padding-left: 0; + padding-right: 0; +} +.btn-social-icon.btn-sm { + height: 30px; + width: 30px; + padding-left: 0; + padding-right: 0; +} +.btn-social-icon.btn-xs { + height: 22px; + width: 22px; + padding-left: 0; + padding-right: 0; +} +.btn-bitbucket { + color: #ffffff; + background-color: #205081; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-bitbucket:hover, +.btn-bitbucket:focus, +.btn-bitbucket:active, +.btn-bitbucket.active, +.open .dropdown-toggle.btn-bitbucket { + color: #ffffff; + background-color: #183c60; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-bitbucket:active, +.btn-bitbucket.active, +.open .dropdown-toggle.btn-bitbucket { + background-image: none; +} +.btn-bitbucket.disabled, +.btn-bitbucket[disabled], +fieldset[disabled] .btn-bitbucket, +.btn-bitbucket.disabled:hover, +.btn-bitbucket[disabled]:hover, +fieldset[disabled] .btn-bitbucket:hover, +.btn-bitbucket.disabled:focus, +.btn-bitbucket[disabled]:focus, +fieldset[disabled] .btn-bitbucket:focus, +.btn-bitbucket.disabled:active, +.btn-bitbucket[disabled]:active, +fieldset[disabled] .btn-bitbucket:active, +.btn-bitbucket.disabled.active, +.btn-bitbucket[disabled].active, +fieldset[disabled] .btn-bitbucket.active { + background-color: #205081; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-bitbucket .badge { + color: #205081; + background-color: #ffffff; +} +.btn-dropbox { + color: #ffffff; + background-color: #1087dd; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-dropbox:hover, +.btn-dropbox:focus, +.btn-dropbox:active, +.btn-dropbox.active, +.open .dropdown-toggle.btn-dropbox { + color: #ffffff; + background-color: #0d70b7; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-dropbox:active, +.btn-dropbox.active, +.open .dropdown-toggle.btn-dropbox { + background-image: none; +} +.btn-dropbox.disabled, +.btn-dropbox[disabled], +fieldset[disabled] .btn-dropbox, +.btn-dropbox.disabled:hover, +.btn-dropbox[disabled]:hover, +fieldset[disabled] .btn-dropbox:hover, +.btn-dropbox.disabled:focus, +.btn-dropbox[disabled]:focus, +fieldset[disabled] .btn-dropbox:focus, +.btn-dropbox.disabled:active, +.btn-dropbox[disabled]:active, +fieldset[disabled] .btn-dropbox:active, +.btn-dropbox.disabled.active, +.btn-dropbox[disabled].active, +fieldset[disabled] .btn-dropbox.active { + background-color: #1087dd; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-dropbox .badge { + color: #1087dd; + background-color: #ffffff; +} +.btn-facebook { + color: #ffffff; + background-color: #3b5998; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-facebook:hover, +.btn-facebook:focus, +.btn-facebook:active, +.btn-facebook.active, +.open .dropdown-toggle.btn-facebook { + color: #ffffff; + background-color: #30487b; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-facebook:active, +.btn-facebook.active, +.open .dropdown-toggle.btn-facebook { + background-image: none; +} +.btn-facebook.disabled, +.btn-facebook[disabled], +fieldset[disabled] .btn-facebook, +.btn-facebook.disabled:hover, +.btn-facebook[disabled]:hover, +fieldset[disabled] .btn-facebook:hover, +.btn-facebook.disabled:focus, +.btn-facebook[disabled]:focus, +fieldset[disabled] .btn-facebook:focus, +.btn-facebook.disabled:active, +.btn-facebook[disabled]:active, +fieldset[disabled] .btn-facebook:active, +.btn-facebook.disabled.active, +.btn-facebook[disabled].active, +fieldset[disabled] .btn-facebook.active { + background-color: #3b5998; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-facebook .badge { + color: #3b5998; + background-color: #ffffff; +} +.btn-flickr { + color: #ffffff; + background-color: #ff0084; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-flickr:hover, +.btn-flickr:focus, +.btn-flickr:active, +.btn-flickr.active, +.open .dropdown-toggle.btn-flickr { + color: #ffffff; + background-color: #d6006f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-flickr:active, +.btn-flickr.active, +.open .dropdown-toggle.btn-flickr { + background-image: none; +} +.btn-flickr.disabled, +.btn-flickr[disabled], +fieldset[disabled] .btn-flickr, +.btn-flickr.disabled:hover, +.btn-flickr[disabled]:hover, +fieldset[disabled] .btn-flickr:hover, +.btn-flickr.disabled:focus, +.btn-flickr[disabled]:focus, +fieldset[disabled] .btn-flickr:focus, +.btn-flickr.disabled:active, +.btn-flickr[disabled]:active, +fieldset[disabled] .btn-flickr:active, +.btn-flickr.disabled.active, +.btn-flickr[disabled].active, +fieldset[disabled] .btn-flickr.active { + background-color: #ff0084; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-flickr .badge { + color: #ff0084; + background-color: #ffffff; +} +.btn-foursquare { + color: #ffffff; + background-color: #0072b1; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-foursquare:hover, +.btn-foursquare:focus, +.btn-foursquare:active, +.btn-foursquare.active, +.open .dropdown-toggle.btn-foursquare { + color: #ffffff; + background-color: #005888; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-foursquare:active, +.btn-foursquare.active, +.open .dropdown-toggle.btn-foursquare { + background-image: none; +} +.btn-foursquare.disabled, +.btn-foursquare[disabled], +fieldset[disabled] .btn-foursquare, +.btn-foursquare.disabled:hover, +.btn-foursquare[disabled]:hover, +fieldset[disabled] .btn-foursquare:hover, +.btn-foursquare.disabled:focus, +.btn-foursquare[disabled]:focus, +fieldset[disabled] .btn-foursquare:focus, +.btn-foursquare.disabled:active, +.btn-foursquare[disabled]:active, +fieldset[disabled] .btn-foursquare:active, +.btn-foursquare.disabled.active, +.btn-foursquare[disabled].active, +fieldset[disabled] .btn-foursquare.active { + background-color: #0072b1; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-foursquare .badge { + color: #0072b1; + background-color: #ffffff; +} +.btn-github { + color: #ffffff; + background-color: #444444; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-github:hover, +.btn-github:focus, +.btn-github:active, +.btn-github.active, +.open .dropdown-toggle.btn-github { + color: #ffffff; + background-color: #303030; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-github:active, +.btn-github.active, +.open .dropdown-toggle.btn-github { + background-image: none; +} +.btn-github.disabled, +.btn-github[disabled], +fieldset[disabled] .btn-github, +.btn-github.disabled:hover, +.btn-github[disabled]:hover, +fieldset[disabled] .btn-github:hover, +.btn-github.disabled:focus, +.btn-github[disabled]:focus, +fieldset[disabled] .btn-github:focus, +.btn-github.disabled:active, +.btn-github[disabled]:active, +fieldset[disabled] .btn-github:active, +.btn-github.disabled.active, +.btn-github[disabled].active, +fieldset[disabled] .btn-github.active { + background-color: #444444; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-github .badge { + color: #444444; + background-color: #ffffff; +} +.btn-google-plus { + color: #ffffff; + background-color: #dd4b39; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-google-plus:hover, +.btn-google-plus:focus, +.btn-google-plus:active, +.btn-google-plus.active, +.open .dropdown-toggle.btn-google-plus { + color: #ffffff; + background-color: #ca3523; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-google-plus:active, +.btn-google-plus.active, +.open .dropdown-toggle.btn-google-plus { + background-image: none; +} +.btn-google-plus.disabled, +.btn-google-plus[disabled], +fieldset[disabled] .btn-google-plus, +.btn-google-plus.disabled:hover, +.btn-google-plus[disabled]:hover, +fieldset[disabled] .btn-google-plus:hover, +.btn-google-plus.disabled:focus, +.btn-google-plus[disabled]:focus, +fieldset[disabled] .btn-google-plus:focus, +.btn-google-plus.disabled:active, +.btn-google-plus[disabled]:active, +fieldset[disabled] .btn-google-plus:active, +.btn-google-plus.disabled.active, +.btn-google-plus[disabled].active, +fieldset[disabled] .btn-google-plus.active { + background-color: #dd4b39; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-google-plus .badge { + color: #dd4b39; + background-color: #ffffff; +} +.btn-instagram { + color: #ffffff; + background-color: #3f729b; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-instagram:hover, +.btn-instagram:focus, +.btn-instagram:active, +.btn-instagram.active, +.open .dropdown-toggle.btn-instagram { + color: #ffffff; + background-color: #335d7e; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-instagram:active, +.btn-instagram.active, +.open .dropdown-toggle.btn-instagram { + background-image: none; +} +.btn-instagram.disabled, +.btn-instagram[disabled], +fieldset[disabled] .btn-instagram, +.btn-instagram.disabled:hover, +.btn-instagram[disabled]:hover, +fieldset[disabled] .btn-instagram:hover, +.btn-instagram.disabled:focus, +.btn-instagram[disabled]:focus, +fieldset[disabled] .btn-instagram:focus, +.btn-instagram.disabled:active, +.btn-instagram[disabled]:active, +fieldset[disabled] .btn-instagram:active, +.btn-instagram.disabled.active, +.btn-instagram[disabled].active, +fieldset[disabled] .btn-instagram.active { + background-color: #3f729b; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-instagram .badge { + color: #3f729b; + background-color: #ffffff; +} +.btn-linkedin { + color: #ffffff; + background-color: #007bb6; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-linkedin:hover, +.btn-linkedin:focus, +.btn-linkedin:active, +.btn-linkedin.active, +.open .dropdown-toggle.btn-linkedin { + color: #ffffff; + background-color: #005f8d; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-linkedin:active, +.btn-linkedin.active, +.open .dropdown-toggle.btn-linkedin { + background-image: none; +} +.btn-linkedin.disabled, +.btn-linkedin[disabled], +fieldset[disabled] .btn-linkedin, +.btn-linkedin.disabled:hover, +.btn-linkedin[disabled]:hover, +fieldset[disabled] .btn-linkedin:hover, +.btn-linkedin.disabled:focus, +.btn-linkedin[disabled]:focus, +fieldset[disabled] .btn-linkedin:focus, +.btn-linkedin.disabled:active, +.btn-linkedin[disabled]:active, +fieldset[disabled] .btn-linkedin:active, +.btn-linkedin.disabled.active, +.btn-linkedin[disabled].active, +fieldset[disabled] .btn-linkedin.active { + background-color: #007bb6; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-linkedin .badge { + color: #007bb6; + background-color: #ffffff; +} +.btn-tumblr { + color: #ffffff; + background-color: #2c4762; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-tumblr:hover, +.btn-tumblr:focus, +.btn-tumblr:active, +.btn-tumblr.active, +.open .dropdown-toggle.btn-tumblr { + color: #ffffff; + background-color: #1f3346; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-tumblr:active, +.btn-tumblr.active, +.open .dropdown-toggle.btn-tumblr { + background-image: none; +} +.btn-tumblr.disabled, +.btn-tumblr[disabled], +fieldset[disabled] .btn-tumblr, +.btn-tumblr.disabled:hover, +.btn-tumblr[disabled]:hover, +fieldset[disabled] .btn-tumblr:hover, +.btn-tumblr.disabled:focus, +.btn-tumblr[disabled]:focus, +fieldset[disabled] .btn-tumblr:focus, +.btn-tumblr.disabled:active, +.btn-tumblr[disabled]:active, +fieldset[disabled] .btn-tumblr:active, +.btn-tumblr.disabled.active, +.btn-tumblr[disabled].active, +fieldset[disabled] .btn-tumblr.active { + background-color: #2c4762; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-tumblr .badge { + color: #2c4762; + background-color: #ffffff; +} +.btn-twitter { + color: #ffffff; + background-color: #55acee; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-twitter:hover, +.btn-twitter:focus, +.btn-twitter:active, +.btn-twitter.active, +.open .dropdown-toggle.btn-twitter { + color: #ffffff; + background-color: #309aea; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-twitter:active, +.btn-twitter.active, +.open .dropdown-toggle.btn-twitter { + background-image: none; +} +.btn-twitter.disabled, +.btn-twitter[disabled], +fieldset[disabled] .btn-twitter, +.btn-twitter.disabled:hover, +.btn-twitter[disabled]:hover, +fieldset[disabled] .btn-twitter:hover, +.btn-twitter.disabled:focus, +.btn-twitter[disabled]:focus, +fieldset[disabled] .btn-twitter:focus, +.btn-twitter.disabled:active, +.btn-twitter[disabled]:active, +fieldset[disabled] .btn-twitter:active, +.btn-twitter.disabled.active, +.btn-twitter[disabled].active, +fieldset[disabled] .btn-twitter.active { + background-color: #55acee; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-twitter .badge { + color: #55acee; + background-color: #ffffff; +} +.btn-vk { + color: #ffffff; + background-color: #587ea3; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vk:hover, +.btn-vk:focus, +.btn-vk:active, +.btn-vk.active, +.open .dropdown-toggle.btn-vk { + color: #ffffff; + background-color: #4a6a89; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vk:active, +.btn-vk.active, +.open .dropdown-toggle.btn-vk { + background-image: none; +} +.btn-vk.disabled, +.btn-vk[disabled], +fieldset[disabled] .btn-vk, +.btn-vk.disabled:hover, +.btn-vk[disabled]:hover, +fieldset[disabled] .btn-vk:hover, +.btn-vk.disabled:focus, +.btn-vk[disabled]:focus, +fieldset[disabled] .btn-vk:focus, +.btn-vk.disabled:active, +.btn-vk[disabled]:active, +fieldset[disabled] .btn-vk:active, +.btn-vk.disabled.active, +.btn-vk[disabled].active, +fieldset[disabled] .btn-vk.active { + background-color: #587ea3; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vk .badge { + color: #587ea3; + background-color: #ffffff; +} diff --git a/public/assets/css/bootstrap-slider/slider.css b/public/assets/css/bootstrap-slider/slider.css new file mode 100755 index 00000000..a96db7fb --- /dev/null +++ b/public/assets/css/bootstrap-slider/slider.css @@ -0,0 +1,169 @@ +/*! + * Slider for Bootstrap + * + * Copyright 2012 Stefan Petre + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +.slider { + display: block; + vertical-align: middle; + position: relative; + +} +.slider.slider-horizontal { + width: 100%; + height: 20px; + margin-bottom: 20px; +} +.slider.slider-horizontal:last-of-type { + margin-bottom: 0; +} +.slider.slider-horizontal .slider-track { + height: 10px; + width: 100%; + margin-top: -5px; + top: 50%; + left: 0; +} +.slider.slider-horizontal .slider-selection { + height: 100%; + top: 0; + bottom: 0; +} +.slider.slider-horizontal .slider-handle { + margin-left: -10px; + margin-top: -5px; +} +.slider.slider-horizontal .slider-handle.triangle { + border-width: 0 10px 10px 10px; + width: 0; + height: 0; + border-bottom-color: #0480be; + margin-top: 0; +} +.slider.slider-vertical { + height: 230px; + width: 20px; + margin-right: 20px; + display: inline-block; +} +.slider.slider-vertical:last-of-type { + margin-right: 0; +} +.slider.slider-vertical .slider-track { + width: 10px; + height: 100%; + margin-left: -5px; + left: 50%; + top: 0; +} +.slider.slider-vertical .slider-selection { + width: 100%; + left: 0; + top: 0; + bottom: 0; +} +.slider.slider-vertical .slider-handle { + margin-left: -5px; + margin-top: -10px; +} +.slider.slider-vertical .slider-handle.triangle { + border-width: 10px 0 10px 10px; + width: 1px; + height: 1px; + border-left-color: #0480be; + margin-left: 0; +} +.slider input { + display: none; +} +.slider .tooltip-inner { + white-space: nowrap; +} +.slider-track { + position: absolute; + cursor: pointer; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f0f0f0, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f0f0f0), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f0f0f0, #f9f9f9); + background-image: -o-linear-gradient(top, #f0f0f0, #f9f9f9); + background-image: linear-gradient(to bottom, #f0f0f0, #f9f9f9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0f0f0', endColorstr='#fff9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.slider-selection { + position: absolute; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f9f9f9, #f5f5f5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f9f9f9), to(#f5f5f5)); + background-image: -webkit-linear-gradient(top, #f9f9f9, #f5f5f5); + background-image: -o-linear-gradient(top, #f9f9f9, #f5f5f5); + background-image: linear-gradient(to bottom, #f9f9f9, #f5f5f5); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#fff5f5f5', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.slider-handle { + position: absolute; + width: 20px; + height: 20px; + background-color: #444; + -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); + -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); + box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); + opacity: 1; + border: 0px solid transparent; +} +.slider-handle.round { + -webkit-border-radius: 20px; + -moz-border-radius: 20px; + border-radius: 20px; +} +.slider-handle.triangle { + background: transparent none; +} + +.slider-disabled .slider-selection { + opacity: 0.5; +} + +#red .slider-selection { + background: #f56954; +} + +#blue .slider-selection { + background: #3c8dbc; +} + +#green .slider-selection { + background: #00a65a; +} + +#yellow .slider-selection { + background: #f39c12; +} + +#aqua .slider-selection { + background: #00c0ef; +} + +#purple .slider-selection { + background: #932ab6; +} \ No newline at end of file diff --git a/public/assets/css/bootstrap-theme.min.css b/public/assets/css/bootstrap-theme.min.css index 8dee0720..9c85321d 100755 --- a/public/assets/css/bootstrap-theme.min.css +++ b/public/assets/css/bootstrap-theme.min.css @@ -4,4 +4,4 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn:active,.btn.active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top, #fff 0, #e0e0e0 100%);background-image:linear-gradient(to bottom, #fff 0, #e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top, #428bca 0, #2d6ca2 100%);background-image:linear-gradient(to bottom, #428bca 0, #2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top, #5cb85c 0, #419641 100%);background-image:linear-gradient(to bottom, #5cb85c 0, #419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-info{background-image:-webkit-linear-gradient(top, #5bc0de 0, #2aabd2 100%);background-image:linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-warning{background-image:-webkit-linear-gradient(top, #f0ad4e 0, #eb9316 100%);background-image:linear-gradient(to bottom, #f0ad4e 0, #eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top, #d9534f 0, #c12e2a 100%);background-image:linear-gradient(to bottom, #d9534f 0, #c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-image:-webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-image:-webkit-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:linear-gradient(to bottom, #428bca 0, #357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-color:#357ebd}.navbar-default{background-image:-webkit-linear-gradient(top, #fff 0, #f8f8f8 100%);background-image:linear-gradient(to bottom, #fff 0, #f8f8f8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top, #ebebeb 0, #f3f3f3 100%);background-image:linear-gradient(to bottom, #ebebeb 0, #f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.075);box-shadow:inset 0 3px 9px rgba(0,0,0,0.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,0.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top, #3c3c3c 0, #222 100%);background-image:linear-gradient(to bottom, #3c3c3c 0, #222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top, #222 0, #282828 100%);background-image:linear-gradient(to bottom, #222 0, #282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.25);box-shadow:inset 0 3px 9px rgba(0,0,0,0.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05)}.alert-success{background-image:-webkit-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);background-image:linear-gradient(to bottom, #dff0d8 0, #c8e5bc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top, #d9edf7 0, #b9def0 100%);background-image:linear-gradient(to bottom, #d9edf7 0, #b9def0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);background-image:linear-gradient(to bottom, #fcf8e3 0, #f8efc0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top, #f2dede 0, #e7c3c3 100%);background-image:linear-gradient(to bottom, #f2dede 0, #e7c3c3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);background-image:linear-gradient(to bottom, #ebebeb 0, #f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top, #428bca 0, #3071a9 100%);background-image:linear-gradient(to bottom, #428bca 0, #3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top, #5cb85c 0, #449d44 100%);background-image:linear-gradient(to bottom, #5cb85c 0, #449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top, #5bc0de 0, #31b0d5 100%);background-image:linear-gradient(to bottom, #5bc0de 0, #31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top, #f0ad4e 0, #ec971f 100%);background-image:linear-gradient(to bottom, #f0ad4e 0, #ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top, #d9534f 0, #c9302c 100%);background-image:linear-gradient(to bottom, #d9534f 0, #c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top, #428bca 0, #3278b3 100%);background-image:linear-gradient(to bottom, #428bca 0, #3278b3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);border-color:#3278b3}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:linear-gradient(to bottom, #428bca 0, #357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);background-image:linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);background-image:linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);background-image:linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top, #f2dede 0, #ebcccc 100%);background-image:linear-gradient(to bottom, #f2dede 0, #ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.well{background-image:-webkit-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);background-image:linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1)} \ No newline at end of file +.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn:active,.btn.active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top, #fff 0, #e0e0e0 100%);background-image:linear-gradient(to bottom, #fff 0, #e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top, #428bca 0, #2d6ca2 100%);background-image:linear-gradient(to bottom, #428bca 0, #2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top, #5cb85c 0, #419641 100%);background-image:linear-gradient(to bottom, #5cb85c 0, #419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-info{background-image:-webkit-linear-gradient(top, #5bc0de 0, #2aabd2 100%);background-image:linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-warning{background-image:-webkit-linear-gradient(top, #f0ad4e 0, #eb9316 100%);background-image:linear-gradient(to bottom, #f0ad4e 0, #eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top, #d9534f 0, #c12e2a 100%);background-image:linear-gradient(to bottom, #d9534f 0, #c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-image:-webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-image:-webkit-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:linear-gradient(to bottom, #428bca 0, #357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-color:#357ebd}.navbar-default{background-image:-webkit-linear-gradient(top, #fff 0, #f8f8f8 100%);background-image:linear-gradient(to bottom, #fff 0, #f8f8f8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top, #ebebeb 0, #f3f3f3 100%);background-image:linear-gradient(to bottom, #ebebeb 0, #f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.075);box-shadow:inset 0 3px 9px rgba(0,0,0,0.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,0.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top, #3c3c3c 0, #222 100%);background-image:linear-gradient(to bottom, #3c3c3c 0, #222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top, #222 0, #282828 100%);background-image:linear-gradient(to bottom, #222 0, #282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.25);box-shadow:inset 0 3px 9px rgba(0,0,0,0.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05)}.alert-success{background-image:-webkit-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);background-image:linear-gradient(to bottom, #dff0d8 0, #c8e5bc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top, #d9edf7 0, #b9def0 100%);background-image:linear-gradient(to bottom, #d9edf7 0, #b9def0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);background-image:linear-gradient(to bottom, #fcf8e3 0, #f8efc0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top, #f2dede 0, #e7c3c3 100%);background-image:linear-gradient(to bottom, #f2dede 0, #e7c3c3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);background-image:linear-gradient(to bottom, #ebebeb 0, #f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top, #428bca 0, #3071a9 100%);background-image:linear-gradient(to bottom, #428bca 0, #3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top, #5cb85c 0, #449d44 100%);background-image:linear-gradient(to bottom, #5cb85c 0, #449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top, #5bc0de 0, #31b0d5 100%);background-image:linear-gradient(to bottom, #5bc0de 0, #31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top, #f0ad4e 0, #ec971f 100%);background-image:linear-gradient(to bottom, #f0ad4e 0, #ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top, #d9534f 0, #c9302c 100%);background-image:linear-gradient(to bottom, #d9534f 0, #c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top, #428bca 0, #3278b3 100%);background-image:linear-gradient(to bottom, #428bca 0, #3278b3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);border-color:#3278b3}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.panel-default>.box-header{background-image:-webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.panel-primary>.box-header{background-image:-webkit-linear-gradient(top, #428bca 0, #357ebd 100%);background-image:linear-gradient(to bottom, #428bca 0, #357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.panel-success>.box-header{background-image:-webkit-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);background-image:linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.panel-info>.box-header{background-image:-webkit-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);background-image:linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.panel-warning>.box-header{background-image:-webkit-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);background-image:linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.panel-danger>.box-header{background-image:-webkit-linear-gradient(top, #f2dede 0, #ebcccc 100%);background-image:linear-gradient(to bottom, #f2dede 0, #ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.well{background-image:-webkit-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);background-image:linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1)} \ No newline at end of file diff --git a/public/assets/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.css b/public/assets/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.css new file mode 100755 index 00000000..44ed7774 --- /dev/null +++ b/public/assets/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.css @@ -0,0 +1,102 @@ +ul.wysihtml5-toolbar { + margin: 0; + padding: 0; + display: block; +} + +ul.wysihtml5-toolbar::after { + clear: both; + display: table; + content: ""; +} + +ul.wysihtml5-toolbar > li { + float: left; + display: list-item; + list-style: none; + margin: 0 5px 10px 0; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] { + font-weight: bold; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] { + font-style: italic; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] { + text-decoration: underline; +} + +ul.wysihtml5-toolbar a.btn.wysihtml5-command-active { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + background-color: #E6E6E6; + background-color: #D9D9D9; + outline: 0; +} + +ul.wysihtml5-commands-disabled .dropdown-menu { + display: none !important; +} + +ul.wysihtml5-toolbar div.wysihtml5-colors { + display:block; + width: 50px; + height: 20px; + margin-top: 2px; + margin-left: 5px; + position: absolute; + pointer-events: none; +} + +ul.wysihtml5-toolbar a.wysihtml5-colors-title { + padding-left: 70px; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] { + background: black !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] { + background: silver !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] { + background: gray !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] { + background: maroon !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] { + background: red !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] { + background: purple !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] { + background: green !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] { + background: olive !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] { + background: navy !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] { + background: blue !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] { + background: orange !important; +} diff --git a/public/assets/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css b/public/assets/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css new file mode 100755 index 00000000..d8dd3c22 --- /dev/null +++ b/public/assets/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css @@ -0,0 +1,3 @@ +/*! bootstrap3-wysihtml5-bower 2013-11-22 */ + +ul.wysihtml5-toolbar{margin:0;padding:0;display:block}ul.wysihtml5-toolbar::after{clear:both;display:table;content:""}ul.wysihtml5-toolbar>li{float:left;display:list-item;list-style:none;margin:0 5px 10px 0}ul.wysihtml5-toolbar a[data-wysihtml5-command=bold]{font-weight:700}ul.wysihtml5-toolbar a[data-wysihtml5-command=italic]{font-style:italic}ul.wysihtml5-toolbar a[data-wysihtml5-command=underline]{text-decoration:underline}ul.wysihtml5-toolbar a.btn.wysihtml5-command-active{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);background-color:#E6E6E6;background-color:#D9D9D9;outline:0}ul.wysihtml5-commands-disabled .dropdown-menu{display:none!important}ul.wysihtml5-toolbar div.wysihtml5-colors{display:block;width:50px;height:20px;margin-top:2px;margin-left:5px;position:absolute;pointer-events:none}ul.wysihtml5-toolbar a.wysihtml5-colors-title{padding-left:70px}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=black]{background:#000!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=silver]{background:silver!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=gray]{background:gray!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=maroon]{background:maroon!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=red]{background:red!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=purple]{background:purple!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=green]{background:green!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=olive]{background:olive!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=navy]{background:navy!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=blue]{background:#00f!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=orange]{background:orange!important} \ No newline at end of file diff --git a/public/assets/css/bootstrap.min.css b/public/assets/css/bootstrap.min.css index 85b03e0f..7af7ea7c 100755 --- a/public/assets/css/bootstrap.min.css +++ b/public/assets/css/bootstrap.min.css @@ -4,4 +4,4 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}@media print{*{text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff !important}.navbar{display:none}.table td,.table th{background-color:#fff !important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#999}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-muted{color:#999}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#999}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:0}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:0}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}input[type="date"]{line-height:34px}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;margin-top:10px;margin-bottom:10px;padding-left:20px}.radio label,.checkbox label{display:inline;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.has-feedback .form-control-feedback{position:absolute;top:25px;right:0;display:block;width:34px;height:34px;line-height:34px;text-align:center}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.form-control-static{margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-control-static{padding-top:7px}@media (min-width:768px){.form-horizontal .control-label{text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#428bca;font-weight:normal;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:none}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:4px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px;height:50px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:none}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#428bca;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#fff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px;overflow:hidden}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#faebcc}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ebccd1}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ebccd1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-moz-transition:-moz-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);transform:translate(0, 0)}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box;outline:none}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.42857143px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important;visibility:hidden !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}@media print{.hidden-print{display:none !important}} \ No newline at end of file +/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}@media print{*{text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff !important}.navbar{display:none}.table td,.table th{background-color:#fff !important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#999}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-muted{color:#999}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#999}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:0}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:0}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}input[type="date"]{line-height:34px}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;margin-top:10px;margin-bottom:10px;padding-left:20px}.radio label,.checkbox label{display:inline;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.has-feedback .form-control-feedback{position:absolute;top:25px;right:0;display:block;width:34px;height:34px;line-height:34px;text-align:center}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.form-control-static{margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-control-static{padding-top:7px}@media (min-width:768px){.form-horizontal .control-label{text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#428bca;font-weight:normal;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:none}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:4px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px;height:50px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:none}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#428bca;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#fff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.box-body{padding:15px}.box-header{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.box-header>.dropdown .dropdown-toggle{color:inherit}.box-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.box-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.box-header+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.box-body+.table,.panel>.box-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px;overflow:hidden}.panel-group .panel+.panel{margin-top:5px}.panel-group .box-header{border-bottom:0}.panel-group .box-header+.panel-collapse .box-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .box-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.box-header{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.box-header+.panel-collapse .box-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .box-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.box-header{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.box-header+.panel-collapse .box-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .box-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.box-header{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.box-header+.panel-collapse .box-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .box-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.box-header{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.box-header+.panel-collapse .box-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .box-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.box-header{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.box-header+.panel-collapse .box-body{border-top-color:#faebcc}.panel-warning>.panel-footer+.panel-collapse .box-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.box-header{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.box-header+.panel-collapse .box-body{border-top-color:#ebccd1}.panel-danger>.panel-footer+.panel-collapse .box-body{border-bottom-color:#ebccd1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-moz-transition:-moz-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);transform:translate(0, 0)}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box;outline:none}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.42857143px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.box-body:before,.box-body:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.box-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important;visibility:hidden !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}@media print{.hidden-print{display:none !important}} \ No newline at end of file diff --git a/public/assets/css/colorpicker/bootstrap-colorpicker.css b/public/assets/css/colorpicker/bootstrap-colorpicker.css new file mode 100755 index 00000000..8252394f --- /dev/null +++ b/public/assets/css/colorpicker/bootstrap-colorpicker.css @@ -0,0 +1,214 @@ +/*! + * Bootstrap Colorpicker + * http://mjolnic.github.io/bootstrap-colorpicker/ + * + * Originally written by (c) 2012 Stefan Petre + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + */ + +.colorpicker-saturation { + float: left; + width: 100px; + height: 100px; + cursor: crosshair; + background-image: url("../../img/bootstrap-colorpicker/saturation.png"); +} + +.colorpicker-saturation i { + position: absolute; + top: 0; + left: 0; + display: block; + width: 5px; + height: 5px; + margin: -4px 0 0 -4px; + border: 1px solid #000; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} + +.colorpicker-saturation i b { + display: block; + width: 5px; + height: 5px; + border: 1px solid #fff; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} + +.colorpicker-hue, +.colorpicker-alpha { + float: left; + width: 15px; + height: 100px; + margin-bottom: 4px; + margin-left: 4px; + cursor: row-resize; +} + +.colorpicker-hue i, +.colorpicker-alpha i { + position: absolute; + top: 0; + left: 0; + display: block; + width: 100%; + height: 1px; + margin-top: -1px; + background: #000; + border-top: 1px solid #fff; +} + +.colorpicker-hue { + background-image: url("../../img/bootstrap-colorpicker/hue.png"); +} + +.colorpicker-alpha { + display: none; + background-image: url("../../img/bootstrap-colorpicker/alpha.png"); +} + +.colorpicker { + top: 0; + left: 0; + z-index: 2500; + min-width: 130px; + padding: 4px; + margin-top: 1px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + *zoom: 1; +} + +.colorpicker:before, +.colorpicker:after { + display: table; + line-height: 0; + content: ""; +} + +.colorpicker:after { + clear: both; +} + +.colorpicker:before { + position: absolute; + top: -7px; + left: 6px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; +} + +.colorpicker:after { + position: absolute; + top: -6px; + left: 7px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; +} + +.colorpicker div { + position: relative; +} + +.colorpicker.colorpicker-with-alpha { + min-width: 140px; +} + +.colorpicker.colorpicker-with-alpha .colorpicker-alpha { + display: block; +} + +.colorpicker-color { + height: 10px; + margin-top: 5px; + clear: both; + background-image: url("../../img/bootstrap-colorpicker/alpha.png"); + background-position: 0 100%; +} + +.colorpicker-color div { + height: 10px; +} + +.colorpicker-element .input-group-addon i { + display: block; + width: 16px; + height: 16px; + cursor: pointer; +} + +.colorpicker.colorpicker-inline { + position: relative; + display: inline-block; + float: none; +} + +.colorpicker.colorpicker-horizontal { + width: 110px; + height: auto; + min-width: 110px; +} + +.colorpicker.colorpicker-horizontal .colorpicker-saturation { + margin-bottom: 4px; +} + +.colorpicker.colorpicker-horizontal .colorpicker-color { + width: 100px; +} + +.colorpicker.colorpicker-horizontal .colorpicker-hue, +.colorpicker.colorpicker-horizontal .colorpicker-alpha { + float: left; + width: 100px; + height: 15px; + margin-bottom: 4px; + margin-left: 0; + cursor: col-resize; +} + +.colorpicker.colorpicker-horizontal .colorpicker-hue i, +.colorpicker.colorpicker-horizontal .colorpicker-alpha i { + position: absolute; + top: 0; + left: 0; + display: block; + width: 1px; + height: 15px; + margin-top: 0; + background: #ffffff; + border: none; +} + +.colorpicker.colorpicker-horizontal .colorpicker-hue { + background-image: url("../../img/bootstrap-colorpicker/hue-horizontal.png"); +} + +.colorpicker.colorpicker-horizontal .colorpicker-alpha { + background-image: url("../../img/bootstrap-colorpicker/alpha-horizontal.png"); +} + +.colorpicker.colorpicker-hidden { + display: none; +} + +.colorpicker.colorpicker-visible { + display: block; +} + +.colorpicker-inline.colorpicker-visible { + display: inline-block; +} \ No newline at end of file diff --git a/public/assets/css/colorpicker/bootstrap-colorpicker.min.css b/public/assets/css/colorpicker/bootstrap-colorpicker.min.css new file mode 100755 index 00000000..5f315042 --- /dev/null +++ b/public/assets/css/colorpicker/bootstrap-colorpicker.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Colorpicker + * http://mjolnic.github.io/bootstrap-colorpicker/ + * + * Originally written by (c) 2012 Stefan Petre + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + */.colorpicker-saturation{float:left;width:100px;height:100px;cursor:crosshair;background-image:url("../../img/bootstrap-colorpicker/saturation.png")}.colorpicker-saturation i{position:absolute;top:0;left:0;display:block;width:5px;height:5px;margin:-4px 0 0 -4px;border:1px solid #000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-saturation i b{display:block;width:5px;height:5px;border:1px solid #fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-hue,.colorpicker-alpha{float:left;width:15px;height:100px;margin-bottom:4px;margin-left:4px;cursor:row-resize}.colorpicker-hue i,.colorpicker-alpha i{position:absolute;top:0;left:0;display:block;width:100%;height:1px;margin-top:-1px;background:#000;border-top:1px solid #fff}.colorpicker-hue{background-image:url("../../img/bootstrap-colorpicker/hue.png")}.colorpicker-alpha{display:none;background-image:url("../../img/bootstrap-colorpicker/alpha.png")}.colorpicker{top:0;left:0;z-index:2500;min-width:130px;padding:4px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1}.colorpicker:before,.colorpicker:after{display:table;line-height:0;content:""}.colorpicker:after{clear:both}.colorpicker:before{position:absolute;top:-7px;left:6px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.colorpicker:after{position:absolute;top:-6px;left:7px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.colorpicker div{position:relative}.colorpicker.colorpicker-with-alpha{min-width:140px}.colorpicker.colorpicker-with-alpha .colorpicker-alpha{display:block}.colorpicker-color{height:10px;margin-top:5px;clear:both;background-image:url("../../img/bootstrap-colorpicker/alpha.png");background-position:0 100%}.colorpicker-color div{height:10px}.colorpicker-element .input-group-addon i{display:block;width:16px;height:16px;cursor:pointer}.colorpicker.colorpicker-inline{position:relative;display:inline-block;float:none}.colorpicker.colorpicker-horizontal{width:110px;height:auto;min-width:110px}.colorpicker.colorpicker-horizontal .colorpicker-saturation{margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-color{width:100px}.colorpicker.colorpicker-horizontal .colorpicker-hue,.colorpicker.colorpicker-horizontal .colorpicker-alpha{float:left;width:100px;height:15px;margin-bottom:4px;margin-left:0;cursor:col-resize}.colorpicker.colorpicker-horizontal .colorpicker-hue i,.colorpicker.colorpicker-horizontal .colorpicker-alpha i{position:absolute;top:0;left:0;display:block;width:1px;height:15px;margin-top:0;background:#fff;border:0}.colorpicker.colorpicker-horizontal .colorpicker-hue{background-image:url("../../img/bootstrap-colorpicker/hue-horizontal.png")}.colorpicker.colorpicker-horizontal .colorpicker-alpha{background-image:url("../../img/bootstrap-colorpicker/alpha-horizontal.png")}.colorpicker.colorpicker-hidden{display:none}.colorpicker.colorpicker-visible{display:block}.colorpicker-inline.colorpicker-visible{display:inline-block} \ No newline at end of file diff --git a/public/assets/css/datatables/dataTables.bootstrap.css b/public/assets/css/datatables/dataTables.bootstrap.css new file mode 100755 index 00000000..27036b0e --- /dev/null +++ b/public/assets/css/datatables/dataTables.bootstrap.css @@ -0,0 +1,223 @@ +div.dataTables_length label { + font-weight: normal; + float: left; + text-align: left; +} + +div.dataTables_length select { + width: 75px; +} + +div.dataTables_filter label { + font-weight: normal; + float: right; +} + +div.dataTables_filter input { + width: 16em; +} + +div.dataTables_info { + padding-top: 8px; +} + +div.dataTables_paginate { + float: right; + margin: 0; +} + +div.dataTables_paginate ul.pagination { + margin: 2px 0; + white-space: nowrap; +} + +table.dataTable, +table.dataTable td, +table.dataTable th { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + + +table.dataTable { + clear: both; + margin-top: 6px !important; + margin-bottom: 6px !important; + max-width: none !important; +} + +table.dataTable thead .sorting, +table.dataTable thead .sorting_asc, +table.dataTable thead .sorting_desc, +table.dataTable thead .sorting_asc_disabled, +table.dataTable thead .sorting_desc_disabled { + cursor: pointer; +} + +table.dataTable thead .sorting { background: url('images/sort_both.png') no-repeat center right; } +table.dataTable thead .sorting_asc { background: url('images/sort_asc.png') no-repeat center right; } +table.dataTable thead .sorting_desc { background: url('images/sort_desc.png') no-repeat center right; } + +table.dataTable thead .sorting_asc_disabled { background: url('images/sort_asc_disabled.png') no-repeat center right; } +table.dataTable thead .sorting_desc_disabled { background: url('images/sort_desc_disabled.png') no-repeat center right; } + +table.dataTable th:active { + outline: none; +} + +/* Scrolling */ +div.dataTables_scrollHead table { + margin-bottom: 0 !important; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +div.dataTables_scrollHead table thead tr:last-child th:first-child, +div.dataTables_scrollHead table thead tr:last-child td:first-child { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.dataTables_scrollBody table { + border-top: none; + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +div.dataTables_scrollBody tbody tr:first-child th, +div.dataTables_scrollBody tbody tr:first-child td { + border-top: none; +} + +div.dataTables_scrollFoot table { + margin-top: 0 !important; + border-top: none; +} + + + + +/* + * TableTools styles + */ +.table tbody tr.active td, +.table tbody tr.active th { + background-color: #08C; + color: white; +} + +.table tbody tr.active:hover td, +.table tbody tr.active:hover th { + background-color: #0075b0 !important; +} + +.table tbody tr.active a { + color: white; +} + +.table-striped tbody tr.active:nth-child(odd) td, +.table-striped tbody tr.active:nth-child(odd) th { + background-color: #017ebc; +} + +table.DTTT_selectable tbody tr { + cursor: pointer; +} + +div.DTTT .btn { + color: #333 !important; + font-size: 12px; +} + +div.DTTT .btn:hover { + text-decoration: none !important; +} + +ul.DTTT_dropdown.dropdown-menu { + z-index: 2003; +} + +ul.DTTT_dropdown.dropdown-menu a { + color: #333 !important; /* needed only when demo_page.css is included */ +} + +ul.DTTT_dropdown.dropdown-menu li { + position: relative; +} + +ul.DTTT_dropdown.dropdown-menu li:hover a { + background-color: #0088cc; + color: white !important; +} + +div.DTTT_collection_background { + z-index: 2002; +} + +/* TableTools information display */ +div.DTTT_print_info.modal { + height: 150px; + margin-top: -75px; + text-align: center; +} + +div.DTTT_print_info h6 { + font-weight: normal; + font-size: 28px; + line-height: 28px; + margin: 1em; +} + +div.DTTT_print_info p { + font-size: 14px; + line-height: 20px; +} + + + +/* + * FixedColumns styles + */ +div.DTFC_LeftHeadWrapper table, +div.DTFC_LeftFootWrapper table, +div.DTFC_RightHeadWrapper table, +div.DTFC_RightFootWrapper table, +table.DTFC_Cloned tr.even { + background-color: white; +} + +div.DTFC_RightHeadWrapper table , +div.DTFC_LeftHeadWrapper table { + margin-bottom: 0 !important; + border-top-right-radius: 0 !important; + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child, +div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child, +div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child, +div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.DTFC_RightBodyWrapper table, +div.DTFC_LeftBodyWrapper table { + border-top: none; + margin-bottom: 0 !important; +} + +div.DTFC_RightBodyWrapper tbody tr:first-child th, +div.DTFC_RightBodyWrapper tbody tr:first-child td, +div.DTFC_LeftBodyWrapper tbody tr:first-child th, +div.DTFC_LeftBodyWrapper tbody tr:first-child td { + border-top: none; +} + +div.DTFC_RightFootWrapper table, +div.DTFC_LeftFootWrapper table { + border-top: none; +} + diff --git a/public/assets/css/datatables/images/sort_asc.png b/public/assets/css/datatables/images/sort_asc.png new file mode 100755 index 00000000..a88d7975 Binary files /dev/null and b/public/assets/css/datatables/images/sort_asc.png differ diff --git a/public/assets/css/datatables/images/sort_asc_disabled.png b/public/assets/css/datatables/images/sort_asc_disabled.png new file mode 100755 index 00000000..4e144cf0 Binary files /dev/null and b/public/assets/css/datatables/images/sort_asc_disabled.png differ diff --git a/public/assets/css/datatables/images/sort_both.png b/public/assets/css/datatables/images/sort_both.png new file mode 100755 index 00000000..18670406 Binary files /dev/null and b/public/assets/css/datatables/images/sort_both.png differ diff --git a/public/assets/css/datatables/images/sort_desc.png b/public/assets/css/datatables/images/sort_desc.png new file mode 100755 index 00000000..def071ed Binary files /dev/null and b/public/assets/css/datatables/images/sort_desc.png differ diff --git a/public/assets/css/datatables/images/sort_desc_disabled.png b/public/assets/css/datatables/images/sort_desc_disabled.png new file mode 100755 index 00000000..7824973c Binary files /dev/null and b/public/assets/css/datatables/images/sort_desc_disabled.png differ diff --git a/public/assets/css/datepicker/datepicker3.css b/public/assets/css/datepicker/datepicker3.css new file mode 100755 index 00000000..d9c3fb6b --- /dev/null +++ b/public/assets/css/datepicker/datepicker3.css @@ -0,0 +1,790 @@ +/*! + * Datepicker for Bootstrap + * + * Copyright 2012 Stefan Petre + * Improvements by Andrew Rowls + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +.datepicker { + padding: 4px; + border-radius: 4px; + direction: ltr; + /*.dow { + border-top: 1px solid #ddd !important; + }*/ +} +.datepicker-inline { + width: 100%; +} +.datepicker.datepicker-rtl { + direction: rtl; +} +.datepicker.datepicker-rtl table tr td span { + float: right; +} +.datepicker-dropdown { + top: 0; + left: 0; +} +.datepicker-dropdown:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-top: 0; + border-bottom-color: rgba(0, 0, 0, 0.2); + position: absolute; +} +.datepicker-dropdown:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #fff; + border-top: 0; + position: absolute; +} +.datepicker-dropdown.datepicker-orient-left:before { + left: 6px; +} +.datepicker-dropdown.datepicker-orient-left:after { + left: 7px; +} +.datepicker-dropdown.datepicker-orient-right:before { + right: 6px; +} +.datepicker-dropdown.datepicker-orient-right:after { + right: 7px; +} +.datepicker-dropdown.datepicker-orient-top:before { + top: -7px; +} +.datepicker-dropdown.datepicker-orient-top:after { + top: -6px; +} +.datepicker-dropdown.datepicker-orient-bottom:before { + bottom: -7px; + border-bottom: 0; + border-top: 7px solid #999; +} +.datepicker-dropdown.datepicker-orient-bottom:after { + bottom: -6px; + border-bottom: 0; + border-top: 6px solid #fff; +} +.datepicker > div { + display: none; +} +.datepicker.days div.datepicker-days { + display: block; +} +.datepicker.months div.datepicker-months { + display: block; +} +.datepicker.years div.datepicker-years { + display: block; +} +.datepicker table { + margin: 0; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.datepicker table tr td, +.datepicker table tr th { + text-align: center; + width: 30px; + height: 30px; + border-radius: 4px; + border: none; +} +.table-striped .datepicker table tr td, +.table-striped .datepicker table tr th { + background-color: transparent; +} +.datepicker table tr td.day:hover, +.datepicker table tr td.day.focused { + background: rgba(0,0,0,0.2); + cursor: pointer; +} +.datepicker table tr td.old, +.datepicker table tr td.new { + color: #777; +} +.datepicker table tr td.disabled, +.datepicker table tr td.disabled:hover { + background: none; + color: #444; + cursor: default; +} +.datepicker table tr td.today, +.datepicker table tr td.today:hover, +.datepicker table tr td.today.disabled, +.datepicker table tr td.today.disabled:hover { + color: #000000; + background: rgba(0,0,0,0.2); + border-color: #ffb733; +} +.datepicker table tr td.today:hover, +.datepicker table tr td.today:hover:hover, +.datepicker table tr td.today.disabled:hover, +.datepicker table tr td.today.disabled:hover:hover, +.datepicker table tr td.today:focus, +.datepicker table tr td.today:hover:focus, +.datepicker table tr td.today.disabled:focus, +.datepicker table tr td.today.disabled:hover:focus, +.datepicker table tr td.today:active, +.datepicker table tr td.today:hover:active, +.datepicker table tr td.today.disabled:active, +.datepicker table tr td.today.disabled:hover:active, +.datepicker table tr td.today.active, +.datepicker table tr td.today:hover.active, +.datepicker table tr td.today.disabled.active, +.datepicker table tr td.today.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td.today, +.open .dropdown-toggle.datepicker table tr td.today:hover, +.open .dropdown-toggle.datepicker table tr td.today.disabled, +.open .dropdown-toggle.datepicker table tr td.today.disabled:hover { + color: #000000; + background: rgba(0,0,0,0.2); + border-color: #f59e00; +} +.datepicker table tr td.today:active, +.datepicker table tr td.today:hover:active, +.datepicker table tr td.today.disabled:active, +.datepicker table tr td.today.disabled:hover:active, +.datepicker table tr td.today.active, +.datepicker table tr td.today:hover.active, +.datepicker table tr td.today.disabled.active, +.datepicker table tr td.today.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td.today, +.open .dropdown-toggle.datepicker table tr td.today:hover, +.open .dropdown-toggle.datepicker table tr td.today.disabled, +.open .dropdown-toggle.datepicker table tr td.today.disabled:hover { + background-image: none; +} +.datepicker table tr td.today.disabled, +.datepicker table tr td.today:hover.disabled, +.datepicker table tr td.today.disabled.disabled, +.datepicker table tr td.today.disabled:hover.disabled, +.datepicker table tr td.today[disabled], +.datepicker table tr td.today:hover[disabled], +.datepicker table tr td.today.disabled[disabled], +.datepicker table tr td.today.disabled:hover[disabled], +fieldset[disabled] .datepicker table tr td.today, +fieldset[disabled] .datepicker table tr td.today:hover, +fieldset[disabled] .datepicker table tr td.today.disabled, +fieldset[disabled] .datepicker table tr td.today.disabled:hover, +.datepicker table tr td.today.disabled:hover, +.datepicker table tr td.today:hover.disabled:hover, +.datepicker table tr td.today.disabled.disabled:hover, +.datepicker table tr td.today.disabled:hover.disabled:hover, +.datepicker table tr td.today[disabled]:hover, +.datepicker table tr td.today:hover[disabled]:hover, +.datepicker table tr td.today.disabled[disabled]:hover, +.datepicker table tr td.today.disabled:hover[disabled]:hover, +fieldset[disabled] .datepicker table tr td.today:hover, +fieldset[disabled] .datepicker table tr td.today:hover:hover, +fieldset[disabled] .datepicker table tr td.today.disabled:hover, +fieldset[disabled] .datepicker table tr td.today.disabled:hover:hover, +.datepicker table tr td.today.disabled:focus, +.datepicker table tr td.today:hover.disabled:focus, +.datepicker table tr td.today.disabled.disabled:focus, +.datepicker table tr td.today.disabled:hover.disabled:focus, +.datepicker table tr td.today[disabled]:focus, +.datepicker table tr td.today:hover[disabled]:focus, +.datepicker table tr td.today.disabled[disabled]:focus, +.datepicker table tr td.today.disabled:hover[disabled]:focus, +fieldset[disabled] .datepicker table tr td.today:focus, +fieldset[disabled] .datepicker table tr td.today:hover:focus, +fieldset[disabled] .datepicker table tr td.today.disabled:focus, +fieldset[disabled] .datepicker table tr td.today.disabled:hover:focus, +.datepicker table tr td.today.disabled:active, +.datepicker table tr td.today:hover.disabled:active, +.datepicker table tr td.today.disabled.disabled:active, +.datepicker table tr td.today.disabled:hover.disabled:active, +.datepicker table tr td.today[disabled]:active, +.datepicker table tr td.today:hover[disabled]:active, +.datepicker table tr td.today.disabled[disabled]:active, +.datepicker table tr td.today.disabled:hover[disabled]:active, +fieldset[disabled] .datepicker table tr td.today:active, +fieldset[disabled] .datepicker table tr td.today:hover:active, +fieldset[disabled] .datepicker table tr td.today.disabled:active, +fieldset[disabled] .datepicker table tr td.today.disabled:hover:active, +.datepicker table tr td.today.disabled.active, +.datepicker table tr td.today:hover.disabled.active, +.datepicker table tr td.today.disabled.disabled.active, +.datepicker table tr td.today.disabled:hover.disabled.active, +.datepicker table tr td.today[disabled].active, +.datepicker table tr td.today:hover[disabled].active, +.datepicker table tr td.today.disabled[disabled].active, +.datepicker table tr td.today.disabled:hover[disabled].active, +fieldset[disabled] .datepicker table tr td.today.active, +fieldset[disabled] .datepicker table tr td.today:hover.active, +fieldset[disabled] .datepicker table tr td.today.disabled.active, +fieldset[disabled] .datepicker table tr td.today.disabled:hover.active { + background: rgba(0,0,0,0.2); + border-color: #ffb733; +} +.datepicker table tr td.today:hover:hover { + color: #000; +} +.datepicker table tr td.today.active:hover { + color: #fff; +} +.datepicker table tr td.range, +.datepicker table tr td.range:hover, +.datepicker table tr td.range.disabled, +.datepicker table tr td.range.disabled:hover { + background: rgba(0,0,0,0.2); + border-radius: 0; +} +.datepicker table tr td.range.today, +.datepicker table tr td.range.today:hover, +.datepicker table tr td.range.today.disabled, +.datepicker table tr td.range.today.disabled:hover { + color: #000000; + background: rgba(0,0,0,0.2); + border-color: #f1a417; + border-radius: 0; +} +.datepicker table tr td.range.today:hover, +.datepicker table tr td.range.today:hover:hover, +.datepicker table tr td.range.today.disabled:hover, +.datepicker table tr td.range.today.disabled:hover:hover, +.datepicker table tr td.range.today:focus, +.datepicker table tr td.range.today:hover:focus, +.datepicker table tr td.range.today.disabled:focus, +.datepicker table tr td.range.today.disabled:hover:focus, +.datepicker table tr td.range.today:active, +.datepicker table tr td.range.today:hover:active, +.datepicker table tr td.range.today.disabled:active, +.datepicker table tr td.range.today.disabled:hover:active, +.datepicker table tr td.range.today.active, +.datepicker table tr td.range.today:hover.active, +.datepicker table tr td.range.today.disabled.active, +.datepicker table tr td.range.today.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td.range.today, +.open .dropdown-toggle.datepicker table tr td.range.today:hover, +.open .dropdown-toggle.datepicker table tr td.range.today.disabled, +.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover { + color: #000000; + background: rgba(0,0,0,0.2); + border-color: #bf800c; +} +.datepicker table tr td.range.today:active, +.datepicker table tr td.range.today:hover:active, +.datepicker table tr td.range.today.disabled:active, +.datepicker table tr td.range.today.disabled:hover:active, +.datepicker table tr td.range.today.active, +.datepicker table tr td.range.today:hover.active, +.datepicker table tr td.range.today.disabled.active, +.datepicker table tr td.range.today.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td.range.today, +.open .dropdown-toggle.datepicker table tr td.range.today:hover, +.open .dropdown-toggle.datepicker table tr td.range.today.disabled, +.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover { + background-image: none; +} +.datepicker table tr td.range.today.disabled, +.datepicker table tr td.range.today:hover.disabled, +.datepicker table tr td.range.today.disabled.disabled, +.datepicker table tr td.range.today.disabled:hover.disabled, +.datepicker table tr td.range.today[disabled], +.datepicker table tr td.range.today:hover[disabled], +.datepicker table tr td.range.today.disabled[disabled], +.datepicker table tr td.range.today.disabled:hover[disabled], +fieldset[disabled] .datepicker table tr td.range.today, +fieldset[disabled] .datepicker table tr td.range.today:hover, +fieldset[disabled] .datepicker table tr td.range.today.disabled, +fieldset[disabled] .datepicker table tr td.range.today.disabled:hover, +.datepicker table tr td.range.today.disabled:hover, +.datepicker table tr td.range.today:hover.disabled:hover, +.datepicker table tr td.range.today.disabled.disabled:hover, +.datepicker table tr td.range.today.disabled:hover.disabled:hover, +.datepicker table tr td.range.today[disabled]:hover, +.datepicker table tr td.range.today:hover[disabled]:hover, +.datepicker table tr td.range.today.disabled[disabled]:hover, +.datepicker table tr td.range.today.disabled:hover[disabled]:hover, +fieldset[disabled] .datepicker table tr td.range.today:hover, +fieldset[disabled] .datepicker table tr td.range.today:hover:hover, +fieldset[disabled] .datepicker table tr td.range.today.disabled:hover, +fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:hover, +.datepicker table tr td.range.today.disabled:focus, +.datepicker table tr td.range.today:hover.disabled:focus, +.datepicker table tr td.range.today.disabled.disabled:focus, +.datepicker table tr td.range.today.disabled:hover.disabled:focus, +.datepicker table tr td.range.today[disabled]:focus, +.datepicker table tr td.range.today:hover[disabled]:focus, +.datepicker table tr td.range.today.disabled[disabled]:focus, +.datepicker table tr td.range.today.disabled:hover[disabled]:focus, +fieldset[disabled] .datepicker table tr td.range.today:focus, +fieldset[disabled] .datepicker table tr td.range.today:hover:focus, +fieldset[disabled] .datepicker table tr td.range.today.disabled:focus, +fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:focus, +.datepicker table tr td.range.today.disabled:active, +.datepicker table tr td.range.today:hover.disabled:active, +.datepicker table tr td.range.today.disabled.disabled:active, +.datepicker table tr td.range.today.disabled:hover.disabled:active, +.datepicker table tr td.range.today[disabled]:active, +.datepicker table tr td.range.today:hover[disabled]:active, +.datepicker table tr td.range.today.disabled[disabled]:active, +.datepicker table tr td.range.today.disabled:hover[disabled]:active, +fieldset[disabled] .datepicker table tr td.range.today:active, +fieldset[disabled] .datepicker table tr td.range.today:hover:active, +fieldset[disabled] .datepicker table tr td.range.today.disabled:active, +fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:active, +.datepicker table tr td.range.today.disabled.active, +.datepicker table tr td.range.today:hover.disabled.active, +.datepicker table tr td.range.today.disabled.disabled.active, +.datepicker table tr td.range.today.disabled:hover.disabled.active, +.datepicker table tr td.range.today[disabled].active, +.datepicker table tr td.range.today:hover[disabled].active, +.datepicker table tr td.range.today.disabled[disabled].active, +.datepicker table tr td.range.today.disabled:hover[disabled].active, +fieldset[disabled] .datepicker table tr td.range.today.active, +fieldset[disabled] .datepicker table tr td.range.today:hover.active, +fieldset[disabled] .datepicker table tr td.range.today.disabled.active, +fieldset[disabled] .datepicker table tr td.range.today.disabled:hover.active { + background: rgba(0,0,0,0.2); + border-color: #f1a417; +} +.datepicker table tr td.selected, +.datepicker table tr td.selected:hover, +.datepicker table tr td.selected.disabled, +.datepicker table tr td.selected.disabled:hover { + color: #ffffff; + background: rgba(0,0,0,0.2); + border-color: #555555; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker table tr td.selected:hover, +.datepicker table tr td.selected:hover:hover, +.datepicker table tr td.selected.disabled:hover, +.datepicker table tr td.selected.disabled:hover:hover, +.datepicker table tr td.selected:focus, +.datepicker table tr td.selected:hover:focus, +.datepicker table tr td.selected.disabled:focus, +.datepicker table tr td.selected.disabled:hover:focus, +.datepicker table tr td.selected:active, +.datepicker table tr td.selected:hover:active, +.datepicker table tr td.selected.disabled:active, +.datepicker table tr td.selected.disabled:hover:active, +.datepicker table tr td.selected.active, +.datepicker table tr td.selected:hover.active, +.datepicker table tr td.selected.disabled.active, +.datepicker table tr td.selected.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td.selected, +.open .dropdown-toggle.datepicker table tr td.selected:hover, +.open .dropdown-toggle.datepicker table tr td.selected.disabled, +.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover { + color: #ffffff; + background: rgba(0,0,0,0.2); + border-color: #373737; +} +.datepicker table tr td.selected:active, +.datepicker table tr td.selected:hover:active, +.datepicker table tr td.selected.disabled:active, +.datepicker table tr td.selected.disabled:hover:active, +.datepicker table tr td.selected.active, +.datepicker table tr td.selected:hover.active, +.datepicker table tr td.selected.disabled.active, +.datepicker table tr td.selected.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td.selected, +.open .dropdown-toggle.datepicker table tr td.selected:hover, +.open .dropdown-toggle.datepicker table tr td.selected.disabled, +.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover { + background-image: none; +} +.datepicker table tr td.selected.disabled, +.datepicker table tr td.selected:hover.disabled, +.datepicker table tr td.selected.disabled.disabled, +.datepicker table tr td.selected.disabled:hover.disabled, +.datepicker table tr td.selected[disabled], +.datepicker table tr td.selected:hover[disabled], +.datepicker table tr td.selected.disabled[disabled], +.datepicker table tr td.selected.disabled:hover[disabled], +fieldset[disabled] .datepicker table tr td.selected, +fieldset[disabled] .datepicker table tr td.selected:hover, +fieldset[disabled] .datepicker table tr td.selected.disabled, +fieldset[disabled] .datepicker table tr td.selected.disabled:hover, +.datepicker table tr td.selected.disabled:hover, +.datepicker table tr td.selected:hover.disabled:hover, +.datepicker table tr td.selected.disabled.disabled:hover, +.datepicker table tr td.selected.disabled:hover.disabled:hover, +.datepicker table tr td.selected[disabled]:hover, +.datepicker table tr td.selected:hover[disabled]:hover, +.datepicker table tr td.selected.disabled[disabled]:hover, +.datepicker table tr td.selected.disabled:hover[disabled]:hover, +fieldset[disabled] .datepicker table tr td.selected:hover, +fieldset[disabled] .datepicker table tr td.selected:hover:hover, +fieldset[disabled] .datepicker table tr td.selected.disabled:hover, +fieldset[disabled] .datepicker table tr td.selected.disabled:hover:hover, +.datepicker table tr td.selected.disabled:focus, +.datepicker table tr td.selected:hover.disabled:focus, +.datepicker table tr td.selected.disabled.disabled:focus, +.datepicker table tr td.selected.disabled:hover.disabled:focus, +.datepicker table tr td.selected[disabled]:focus, +.datepicker table tr td.selected:hover[disabled]:focus, +.datepicker table tr td.selected.disabled[disabled]:focus, +.datepicker table tr td.selected.disabled:hover[disabled]:focus, +fieldset[disabled] .datepicker table tr td.selected:focus, +fieldset[disabled] .datepicker table tr td.selected:hover:focus, +fieldset[disabled] .datepicker table tr td.selected.disabled:focus, +fieldset[disabled] .datepicker table tr td.selected.disabled:hover:focus, +.datepicker table tr td.selected.disabled:active, +.datepicker table tr td.selected:hover.disabled:active, +.datepicker table tr td.selected.disabled.disabled:active, +.datepicker table tr td.selected.disabled:hover.disabled:active, +.datepicker table tr td.selected[disabled]:active, +.datepicker table tr td.selected:hover[disabled]:active, +.datepicker table tr td.selected.disabled[disabled]:active, +.datepicker table tr td.selected.disabled:hover[disabled]:active, +fieldset[disabled] .datepicker table tr td.selected:active, +fieldset[disabled] .datepicker table tr td.selected:hover:active, +fieldset[disabled] .datepicker table tr td.selected.disabled:active, +fieldset[disabled] .datepicker table tr td.selected.disabled:hover:active, +.datepicker table tr td.selected.disabled.active, +.datepicker table tr td.selected:hover.disabled.active, +.datepicker table tr td.selected.disabled.disabled.active, +.datepicker table tr td.selected.disabled:hover.disabled.active, +.datepicker table tr td.selected[disabled].active, +.datepicker table tr td.selected:hover[disabled].active, +.datepicker table tr td.selected.disabled[disabled].active, +.datepicker table tr td.selected.disabled:hover[disabled].active, +fieldset[disabled] .datepicker table tr td.selected.active, +fieldset[disabled] .datepicker table tr td.selected:hover.active, +fieldset[disabled] .datepicker table tr td.selected.disabled.active, +fieldset[disabled] .datepicker table tr td.selected.disabled:hover.active { + background: rgba(0,0,0,0.2); + border-color: #555555; +} +.datepicker table tr td.active, +.datepicker table tr td.active:hover, +.datepicker table tr td.active.disabled, +.datepicker table tr td.active.disabled:hover { + color: #ffffff; + background: rgba(0,0,0,0.2); + border-color: #357ebd; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker table tr td.active:hover, +.datepicker table tr td.active:hover:hover, +.datepicker table tr td.active.disabled:hover, +.datepicker table tr td.active.disabled:hover:hover, +.datepicker table tr td.active:focus, +.datepicker table tr td.active:hover:focus, +.datepicker table tr td.active.disabled:focus, +.datepicker table tr td.active.disabled:hover:focus, +.datepicker table tr td.active:active, +.datepicker table tr td.active:hover:active, +.datepicker table tr td.active.disabled:active, +.datepicker table tr td.active.disabled:hover:active, +.datepicker table tr td.active.active, +.datepicker table tr td.active:hover.active, +.datepicker table tr td.active.disabled.active, +.datepicker table tr td.active.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td.active, +.open .dropdown-toggle.datepicker table tr td.active:hover, +.open .dropdown-toggle.datepicker table tr td.active.disabled, +.open .dropdown-toggle.datepicker table tr td.active.disabled:hover { + color: #ffffff; + background: rgba(0,0,0,0.5); + border-color: #285e8e; +} +.datepicker table tr td.active:active, +.datepicker table tr td.active:hover:active, +.datepicker table tr td.active.disabled:active, +.datepicker table tr td.active.disabled:hover:active, +.datepicker table tr td.active.active, +.datepicker table tr td.active:hover.active, +.datepicker table tr td.active.disabled.active, +.datepicker table tr td.active.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td.active, +.open .dropdown-toggle.datepicker table tr td.active:hover, +.open .dropdown-toggle.datepicker table tr td.active.disabled, +.open .dropdown-toggle.datepicker table tr td.active.disabled:hover { + background-image: none; +} +.datepicker table tr td.active.disabled, +.datepicker table tr td.active:hover.disabled, +.datepicker table tr td.active.disabled.disabled, +.datepicker table tr td.active.disabled:hover.disabled, +.datepicker table tr td.active[disabled], +.datepicker table tr td.active:hover[disabled], +.datepicker table tr td.active.disabled[disabled], +.datepicker table tr td.active.disabled:hover[disabled], +fieldset[disabled] .datepicker table tr td.active, +fieldset[disabled] .datepicker table tr td.active:hover, +fieldset[disabled] .datepicker table tr td.active.disabled, +fieldset[disabled] .datepicker table tr td.active.disabled:hover, +.datepicker table tr td.active.disabled:hover, +.datepicker table tr td.active:hover.disabled:hover, +.datepicker table tr td.active.disabled.disabled:hover, +.datepicker table tr td.active.disabled:hover.disabled:hover, +.datepicker table tr td.active[disabled]:hover, +.datepicker table tr td.active:hover[disabled]:hover, +.datepicker table tr td.active.disabled[disabled]:hover, +.datepicker table tr td.active.disabled:hover[disabled]:hover, +fieldset[disabled] .datepicker table tr td.active:hover, +fieldset[disabled] .datepicker table tr td.active:hover:hover, +fieldset[disabled] .datepicker table tr td.active.disabled:hover, +fieldset[disabled] .datepicker table tr td.active.disabled:hover:hover, +.datepicker table tr td.active.disabled:focus, +.datepicker table tr td.active:hover.disabled:focus, +.datepicker table tr td.active.disabled.disabled:focus, +.datepicker table tr td.active.disabled:hover.disabled:focus, +.datepicker table tr td.active[disabled]:focus, +.datepicker table tr td.active:hover[disabled]:focus, +.datepicker table tr td.active.disabled[disabled]:focus, +.datepicker table tr td.active.disabled:hover[disabled]:focus, +fieldset[disabled] .datepicker table tr td.active:focus, +fieldset[disabled] .datepicker table tr td.active:hover:focus, +fieldset[disabled] .datepicker table tr td.active.disabled:focus, +fieldset[disabled] .datepicker table tr td.active.disabled:hover:focus, +.datepicker table tr td.active.disabled:active, +.datepicker table tr td.active:hover.disabled:active, +.datepicker table tr td.active.disabled.disabled:active, +.datepicker table tr td.active.disabled:hover.disabled:active, +.datepicker table tr td.active[disabled]:active, +.datepicker table tr td.active:hover[disabled]:active, +.datepicker table tr td.active.disabled[disabled]:active, +.datepicker table tr td.active.disabled:hover[disabled]:active, +fieldset[disabled] .datepicker table tr td.active:active, +fieldset[disabled] .datepicker table tr td.active:hover:active, +fieldset[disabled] .datepicker table tr td.active.disabled:active, +fieldset[disabled] .datepicker table tr td.active.disabled:hover:active, +.datepicker table tr td.active.disabled.active, +.datepicker table tr td.active:hover.disabled.active, +.datepicker table tr td.active.disabled.disabled.active, +.datepicker table tr td.active.disabled:hover.disabled.active, +.datepicker table tr td.active[disabled].active, +.datepicker table tr td.active:hover[disabled].active, +.datepicker table tr td.active.disabled[disabled].active, +.datepicker table tr td.active.disabled:hover[disabled].active, +fieldset[disabled] .datepicker table tr td.active.active, +fieldset[disabled] .datepicker table tr td.active:hover.active, +fieldset[disabled] .datepicker table tr td.active.disabled.active, +fieldset[disabled] .datepicker table tr td.active.disabled:hover.active { + background-color: #428bca; + border-color: #357ebd; +} +.datepicker table tr td span { + display: block; + width: 23%; + height: 54px; + line-height: 54px; + float: left; + margin: 1%; + cursor: pointer; + border-radius: 4px; +} +.datepicker table tr td span:hover { + background: rgba(0,0,0,0.2); +} +.datepicker table tr td span.disabled, +.datepicker table tr td span.disabled:hover { + background: none; + color: #444; + cursor: default; +} +.datepicker table tr td span.active, +.datepicker table tr td span.active:hover, +.datepicker table tr td span.active.disabled, +.datepicker table tr td span.active.disabled:hover { + color: #ffffff; + background-color: #428bca; + border-color: #357ebd; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker table tr td span.active:hover, +.datepicker table tr td span.active:hover:hover, +.datepicker table tr td span.active.disabled:hover, +.datepicker table tr td span.active.disabled:hover:hover, +.datepicker table tr td span.active:focus, +.datepicker table tr td span.active:hover:focus, +.datepicker table tr td span.active.disabled:focus, +.datepicker table tr td span.active.disabled:hover:focus, +.datepicker table tr td span.active:active, +.datepicker table tr td span.active:hover:active, +.datepicker table tr td span.active.disabled:active, +.datepicker table tr td span.active.disabled:hover:active, +.datepicker table tr td span.active.active, +.datepicker table tr td span.active:hover.active, +.datepicker table tr td span.active.disabled.active, +.datepicker table tr td span.active.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td span.active, +.open .dropdown-toggle.datepicker table tr td span.active:hover, +.open .dropdown-toggle.datepicker table tr td span.active.disabled, +.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover { + color: #ffffff; + background-color: #3276b1; + border-color: #285e8e; +} +.datepicker table tr td span.active:active, +.datepicker table tr td span.active:hover:active, +.datepicker table tr td span.active.disabled:active, +.datepicker table tr td span.active.disabled:hover:active, +.datepicker table tr td span.active.active, +.datepicker table tr td span.active:hover.active, +.datepicker table tr td span.active.disabled.active, +.datepicker table tr td span.active.disabled:hover.active, +.open .dropdown-toggle.datepicker table tr td span.active, +.open .dropdown-toggle.datepicker table tr td span.active:hover, +.open .dropdown-toggle.datepicker table tr td span.active.disabled, +.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover { + background-image: none; +} +.datepicker table tr td span.active.disabled, +.datepicker table tr td span.active:hover.disabled, +.datepicker table tr td span.active.disabled.disabled, +.datepicker table tr td span.active.disabled:hover.disabled, +.datepicker table tr td span.active[disabled], +.datepicker table tr td span.active:hover[disabled], +.datepicker table tr td span.active.disabled[disabled], +.datepicker table tr td span.active.disabled:hover[disabled], +fieldset[disabled] .datepicker table tr td span.active, +fieldset[disabled] .datepicker table tr td span.active:hover, +fieldset[disabled] .datepicker table tr td span.active.disabled, +fieldset[disabled] .datepicker table tr td span.active.disabled:hover, +.datepicker table tr td span.active.disabled:hover, +.datepicker table tr td span.active:hover.disabled:hover, +.datepicker table tr td span.active.disabled.disabled:hover, +.datepicker table tr td span.active.disabled:hover.disabled:hover, +.datepicker table tr td span.active[disabled]:hover, +.datepicker table tr td span.active:hover[disabled]:hover, +.datepicker table tr td span.active.disabled[disabled]:hover, +.datepicker table tr td span.active.disabled:hover[disabled]:hover, +fieldset[disabled] .datepicker table tr td span.active:hover, +fieldset[disabled] .datepicker table tr td span.active:hover:hover, +fieldset[disabled] .datepicker table tr td span.active.disabled:hover, +fieldset[disabled] .datepicker table tr td span.active.disabled:hover:hover, +.datepicker table tr td span.active.disabled:focus, +.datepicker table tr td span.active:hover.disabled:focus, +.datepicker table tr td span.active.disabled.disabled:focus, +.datepicker table tr td span.active.disabled:hover.disabled:focus, +.datepicker table tr td span.active[disabled]:focus, +.datepicker table tr td span.active:hover[disabled]:focus, +.datepicker table tr td span.active.disabled[disabled]:focus, +.datepicker table tr td span.active.disabled:hover[disabled]:focus, +fieldset[disabled] .datepicker table tr td span.active:focus, +fieldset[disabled] .datepicker table tr td span.active:hover:focus, +fieldset[disabled] .datepicker table tr td span.active.disabled:focus, +fieldset[disabled] .datepicker table tr td span.active.disabled:hover:focus, +.datepicker table tr td span.active.disabled:active, +.datepicker table tr td span.active:hover.disabled:active, +.datepicker table tr td span.active.disabled.disabled:active, +.datepicker table tr td span.active.disabled:hover.disabled:active, +.datepicker table tr td span.active[disabled]:active, +.datepicker table tr td span.active:hover[disabled]:active, +.datepicker table tr td span.active.disabled[disabled]:active, +.datepicker table tr td span.active.disabled:hover[disabled]:active, +fieldset[disabled] .datepicker table tr td span.active:active, +fieldset[disabled] .datepicker table tr td span.active:hover:active, +fieldset[disabled] .datepicker table tr td span.active.disabled:active, +fieldset[disabled] .datepicker table tr td span.active.disabled:hover:active, +.datepicker table tr td span.active.disabled.active, +.datepicker table tr td span.active:hover.disabled.active, +.datepicker table tr td span.active.disabled.disabled.active, +.datepicker table tr td span.active.disabled:hover.disabled.active, +.datepicker table tr td span.active[disabled].active, +.datepicker table tr td span.active:hover[disabled].active, +.datepicker table tr td span.active.disabled[disabled].active, +.datepicker table tr td span.active.disabled:hover[disabled].active, +fieldset[disabled] .datepicker table tr td span.active.active, +fieldset[disabled] .datepicker table tr td span.active:hover.active, +fieldset[disabled] .datepicker table tr td span.active.disabled.active, +fieldset[disabled] .datepicker table tr td span.active.disabled:hover.active { + background-color: #428bca; + border-color: #357ebd; +} +.datepicker table tr td span.old, +.datepicker table tr td span.new { + color: #444; +} +.datepicker th.datepicker-switch { + width: 145px; +} +.datepicker thead tr:first-child th, +.datepicker tfoot tr th { + cursor: pointer; +} +.datepicker thead tr:first-child th:hover, +.datepicker tfoot tr th:hover { + background: rgba(0,0,0,0.2); +} +.datepicker .cw { + font-size: 10px; + width: 12px; + padding: 0 2px 0 5px; + vertical-align: middle; +} +.datepicker thead tr:first-child th.cw { + cursor: default; + background-color: transparent; +} +.input-group.date .input-group-addon i { + cursor: pointer; + width: 16px; + height: 16px; +} +.input-daterange input { + text-align: center; +} +.input-daterange input:first-child { + border-radius: 3px 0 0 3px; +} +.input-daterange input:last-child { + border-radius: 0 3px 3px 0; +} +.input-daterange .input-group-addon { + width: auto; + min-width: 16px; + padding: 4px 5px; + font-weight: normal; + line-height: 1.428571429; + text-align: center; + text-shadow: 0 1px 0 #fff; + vertical-align: middle; + background-color: #eeeeee; + border: solid #cccccc; + border-width: 1px 0; + margin-left: -5px; + margin-right: -5px; +} +.datepicker.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + float: left; + display: none; + min-width: 160px; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 5px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + *border-right-width: 2px; + *border-bottom-width: 2px; + color: #333333; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + line-height: 1.428571429; +} +.datepicker.dropdown-menu th, +.datepicker.dropdown-menu td { + padding: 4px 5px; +} diff --git a/public/assets/css/daterangepicker/daterangepicker-bs3.css b/public/assets/css/daterangepicker/daterangepicker-bs3.css new file mode 100755 index 00000000..eed1e9f4 --- /dev/null +++ b/public/assets/css/daterangepicker/daterangepicker-bs3.css @@ -0,0 +1,245 @@ +/*! + * Stylesheet for the Date Range Picker, for use with Bootstrap 3.x + * + * Copyright 2013 Dan Grossman ( http://www.dangrossman.info ) + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Built for http://www.improvely.com + */ + + .daterangepicker.dropdown-menu { + max-width: none; + z-index: 3000; +} + +.daterangepicker.opensleft .ranges, .daterangepicker.opensleft .calendar { + float: left; + margin: 4px; +} + +.daterangepicker.opensright .ranges, .daterangepicker.opensright .calendar { + float: right; + margin: 4px; +} + +.daterangepicker .ranges { + width: 160px; + text-align: left; +} + +.daterangepicker .ranges .range_inputs>div { + float: left; +} + +.daterangepicker .ranges .range_inputs>div:nth-child(2) { + padding-left: 11px; +} + +.daterangepicker .calendar { + display: none; + max-width: 270px; +} + +.daterangepicker .calendar th, .daterangepicker .calendar td { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + white-space: nowrap; + text-align: center; + min-width: 32px; +} + +.daterangepicker .ranges label { + color: #333; + display: block; + font-size: 11px; + font-weight: normal; + height: 20px; + line-height: 20px; + margin-bottom: 2px; + text-shadow: #fff 1px 1px 0px; + text-transform: uppercase; + width: 74px; +} + +.daterangepicker .ranges input { + font-size: 11px; +} + +.daterangepicker .ranges .input-mini { + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; + color: #555; + display: block; + font-size: 11px; + height: 30px; + line-height: 30px; + vertical-align: middle; + margin: 0 0 10px 0; + padding: 0 6px; + width: 74px; +} + +.daterangepicker .ranges ul { + list-style: none; + margin: 0; + padding: 0; +} + +.daterangepicker .ranges li { + font-size: 13px; + background: #f5f5f5; + border: 1px solid #f5f5f5; + color: #08c; + padding: 3px 12px; + margin-bottom: 8px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + cursor: pointer; +} + +.daterangepicker .ranges li.active, .daterangepicker .ranges li:hover { + background: #08c; + border: 1px solid #08c; + color: #fff; +} + +.daterangepicker .calendar-date { + border: 1px solid #ddd; + padding: 4px; + border-radius: 4px; + background: #fff; +} + +.daterangepicker .calendar-time { + text-align: center; + margin: 8px auto 0 auto; + line-height: 30px; +} + +.daterangepicker { + position: absolute; + background: #fff; + top: 100px; + left: 20px; + padding: 4px; + margin-top: 1px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.daterangepicker.opensleft:before { + position: absolute; + top: -7px; + right: 9px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; +} + +.daterangepicker.opensleft:after { + position: absolute; + top: -6px; + right: 10px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #fff; + border-left: 6px solid transparent; + content: ''; +} + +.daterangepicker.opensright:before { + position: absolute; + top: -7px; + left: 9px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; +} + +.daterangepicker.opensright:after { + position: absolute; + top: -6px; + left: 10px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #fff; + border-left: 6px solid transparent; + content: ''; +} + +.daterangepicker table { + width: 100%; + margin: 0; +} + +.daterangepicker td, .daterangepicker th { + text-align: center; + width: 20px; + height: 20px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + cursor: pointer; + white-space: nowrap; +} + +.daterangepicker td.off { + color: #999; +} + +.daterangepicker td.disabled { + color: #999; +} + +.daterangepicker td.available:hover, .daterangepicker th.available:hover { + background: #eee; +} + +.daterangepicker td.in-range { + background: #ebf4f8; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.daterangepicker td.active, .daterangepicker td.active:hover { + background-color: #357ebd; + border-color: #3071a9; + color: #fff; +} + +.daterangepicker td.week, .daterangepicker th.week { + font-size: 80%; + color: #ccc; +} + +.daterangepicker select.monthselect, .daterangepicker select.yearselect { + font-size: 12px; + padding: 1px; + height: auto; + margin: 0; + cursor: default; +} + +.daterangepicker select.monthselect { + margin-right: 2%; + width: 56%; +} + +.daterangepicker select.yearselect { + width: 40%; +} + +.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.ampmselect { + width: 50px; + margin-bottom: 0; +} diff --git a/public/assets/css/iCheck/all.css b/public/assets/css/iCheck/all.css new file mode 100755 index 00000000..6439b742 --- /dev/null +++ b/public/assets/css/iCheck/all.css @@ -0,0 +1,61 @@ +/* iCheck plugin skins +----------------------------------- */ +@import url("minimal/_all.css"); +/* +@import url("minimal/minimal.css"); +@import url("minimal/red.css"); +@import url("minimal/green.css"); +@import url("minimal/blue.css"); +@import url("minimal/aero.css"); +@import url("minimal/grey.css"); +@import url("minimal/orange.css"); +@import url("minimal/yellow.css"); +@import url("minimal/pink.css"); +@import url("minimal/purple.css"); +*/ + +@import url("square/_all.css"); +/* +@import url("square/square.css"); +@import url("square/red.css"); +@import url("square/green.css"); +@import url("square/blue.css"); +@import url("square/aero.css"); +@import url("square/grey.css"); +@import url("square/orange.css"); +@import url("square/yellow.css"); +@import url("square/pink.css"); +@import url("square/purple.css"); +*/ + +@import url("flat/_all.css"); +/* +@import url("flat/flat.css"); +@import url("flat/red.css"); +@import url("flat/green.css"); +@import url("flat/blue.css"); +@import url("flat/aero.css"); +@import url("flat/grey.css"); +@import url("flat/orange.css"); +@import url("flat/yellow.css"); +@import url("flat/pink.css"); +@import url("flat/purple.css"); +*/ + +@import url("line/_all.css"); +/* +@import url("line/line.css"); +@import url("line/red.css"); +@import url("line/green.css"); +@import url("line/blue.css"); +@import url("line/aero.css"); +@import url("line/grey.css"); +@import url("line/orange.css"); +@import url("line/yellow.css"); +@import url("line/pink.css"); +@import url("line/purple.css"); +*/ + +@import url("polaris/polaris.css"); + +@import url("futurico/futurico.css"); \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/_all.css b/public/assets/css/iCheck/flat/_all.css new file mode 100755 index 00000000..21647b50 --- /dev/null +++ b/public/assets/css/iCheck/flat/_all.css @@ -0,0 +1,560 @@ +/* iCheck plugin Flat skin +----------------------------------- */ +.icheckbox_flat, +.iradio_flat { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(flat.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat { + background-position: 0 0; +} + .icheckbox_flat.checked { + background-position: -22px 0; + } + .icheckbox_flat.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat { + background-position: -88px 0; +} + .iradio_flat.checked { + background-position: -110px 0; + } + .iradio_flat.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat, + .iradio_flat { + background-image: url(flat@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* red */ +.icheckbox_flat-red, +.iradio_flat-red { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(red.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-red { + background-position: 0 0; +} + .icheckbox_flat-red.checked { + background-position: -22px 0; + } + .icheckbox_flat-red.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-red.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-red { + background-position: -88px 0; +} + .iradio_flat-red.checked { + background-position: -110px 0; + } + .iradio_flat-red.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-red.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-red, + .iradio_flat-red { + background-image: url(red@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* green */ +.icheckbox_flat-green, +.iradio_flat-green { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(green.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-green { + background-position: 0 0; +} + .icheckbox_flat-green.checked { + background-position: -22px 0; + } + .icheckbox_flat-green.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-green.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-green { + background-position: -88px 0; +} + .iradio_flat-green.checked { + background-position: -110px 0; + } + .iradio_flat-green.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-green.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-green, + .iradio_flat-green { + background-image: url(green@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* blue */ +.icheckbox_flat-blue, +.iradio_flat-blue { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(blue.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-blue { + background-position: 0 0; +} + .icheckbox_flat-blue.checked { + background-position: -22px 0; + } + .icheckbox_flat-blue.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-blue.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-blue { + background-position: -88px 0; +} + .iradio_flat-blue.checked { + background-position: -110px 0; + } + .iradio_flat-blue.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-blue.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-blue, + .iradio_flat-blue { + background-image: url(blue@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* aero */ +.icheckbox_flat-aero, +.iradio_flat-aero { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(aero.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-aero { + background-position: 0 0; +} + .icheckbox_flat-aero.checked { + background-position: -22px 0; + } + .icheckbox_flat-aero.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-aero.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-aero { + background-position: -88px 0; +} + .iradio_flat-aero.checked { + background-position: -110px 0; + } + .iradio_flat-aero.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-aero.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-aero, + .iradio_flat-aero { + background-image: url(aero@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* grey */ +.icheckbox_flat-grey, +.iradio_flat-grey { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(grey.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-grey { + background-position: 0 0; +} + .icheckbox_flat-grey.checked { + background-position: -22px 0; + } + .icheckbox_flat-grey.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-grey.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-grey { + background-position: -88px 0; +} + .iradio_flat-grey.checked { + background-position: -110px 0; + } + .iradio_flat-grey.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-grey.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-grey, + .iradio_flat-grey { + background-image: url(grey@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* orange */ +.icheckbox_flat-orange, +.iradio_flat-orange { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(orange.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-orange { + background-position: 0 0; +} + .icheckbox_flat-orange.checked { + background-position: -22px 0; + } + .icheckbox_flat-orange.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-orange.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-orange { + background-position: -88px 0; +} + .iradio_flat-orange.checked { + background-position: -110px 0; + } + .iradio_flat-orange.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-orange.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-orange, + .iradio_flat-orange { + background-image: url(orange@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* yellow */ +.icheckbox_flat-yellow, +.iradio_flat-yellow { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(yellow.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-yellow { + background-position: 0 0; +} + .icheckbox_flat-yellow.checked { + background-position: -22px 0; + } + .icheckbox_flat-yellow.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-yellow.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-yellow { + background-position: -88px 0; +} + .iradio_flat-yellow.checked { + background-position: -110px 0; + } + .iradio_flat-yellow.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-yellow.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-yellow, + .iradio_flat-yellow { + background-image: url(yellow@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* pink */ +.icheckbox_flat-pink, +.iradio_flat-pink { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(pink.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-pink { + background-position: 0 0; +} + .icheckbox_flat-pink.checked { + background-position: -22px 0; + } + .icheckbox_flat-pink.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-pink.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-pink { + background-position: -88px 0; +} + .iradio_flat-pink.checked { + background-position: -110px 0; + } + .iradio_flat-pink.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-pink.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-pink, + .iradio_flat-pink { + background-image: url(pink@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} + +/* purple */ +.icheckbox_flat-purple, +.iradio_flat-purple { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(purple.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-purple { + background-position: 0 0; +} + .icheckbox_flat-purple.checked { + background-position: -22px 0; + } + .icheckbox_flat-purple.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-purple.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-purple { + background-position: -88px 0; +} + .iradio_flat-purple.checked { + background-position: -110px 0; + } + .iradio_flat-purple.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-purple.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-purple, + .iradio_flat-purple { + background-image: url(purple@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/aero.css b/public/assets/css/iCheck/flat/aero.css new file mode 100755 index 00000000..98fd65c8 --- /dev/null +++ b/public/assets/css/iCheck/flat/aero.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, aero +----------------------------------- */ +.icheckbox_flat-aero, +.iradio_flat-aero { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(aero.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-aero { + background-position: 0 0; +} + .icheckbox_flat-aero.checked { + background-position: -22px 0; + } + .icheckbox_flat-aero.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-aero.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-aero { + background-position: -88px 0; +} + .iradio_flat-aero.checked { + background-position: -110px 0; + } + .iradio_flat-aero.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-aero.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-aero, + .iradio_flat-aero { + background-image: url(aero@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/aero.png b/public/assets/css/iCheck/flat/aero.png new file mode 100755 index 00000000..f4277aa4 Binary files /dev/null and b/public/assets/css/iCheck/flat/aero.png differ diff --git a/public/assets/css/iCheck/flat/aero@2x.png b/public/assets/css/iCheck/flat/aero@2x.png new file mode 100755 index 00000000..a9a74945 Binary files /dev/null and b/public/assets/css/iCheck/flat/aero@2x.png differ diff --git a/public/assets/css/iCheck/flat/blue.css b/public/assets/css/iCheck/flat/blue.css new file mode 100755 index 00000000..07836749 --- /dev/null +++ b/public/assets/css/iCheck/flat/blue.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, blue +----------------------------------- */ +.icheckbox_flat-blue, +.iradio_flat-blue { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(blue.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-blue { + background-position: 0 0; +} + .icheckbox_flat-blue.checked { + background-position: -22px 0; + } + .icheckbox_flat-blue.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-blue.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-blue { + background-position: -88px 0; +} + .iradio_flat-blue.checked { + background-position: -110px 0; + } + .iradio_flat-blue.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-blue.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-blue, + .iradio_flat-blue { + background-image: url(blue@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/blue.png b/public/assets/css/iCheck/flat/blue.png new file mode 100755 index 00000000..4b6ef982 Binary files /dev/null and b/public/assets/css/iCheck/flat/blue.png differ diff --git a/public/assets/css/iCheck/flat/blue@2x.png b/public/assets/css/iCheck/flat/blue@2x.png new file mode 100755 index 00000000..d52da057 Binary files /dev/null and b/public/assets/css/iCheck/flat/blue@2x.png differ diff --git a/public/assets/css/iCheck/flat/flat.css b/public/assets/css/iCheck/flat/flat.css new file mode 100755 index 00000000..418620ee --- /dev/null +++ b/public/assets/css/iCheck/flat/flat.css @@ -0,0 +1,56 @@ +/* iCheck plugin flat skin, black +----------------------------------- */ +.icheckbox_flat, +.iradio_flat { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(flat.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat { + background-position: 0 0; +} + .icheckbox_flat.checked { + background-position: -22px 0; + } + .icheckbox_flat.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat { + background-position: -88px 0; +} + .iradio_flat.checked { + background-position: -110px 0; + } + .iradio_flat.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat, + .iradio_flat { + background-image: url(flat@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/flat.png b/public/assets/css/iCheck/flat/flat.png new file mode 100755 index 00000000..15af826e Binary files /dev/null and b/public/assets/css/iCheck/flat/flat.png differ diff --git a/public/assets/css/iCheck/flat/flat@2x.png b/public/assets/css/iCheck/flat/flat@2x.png new file mode 100755 index 00000000..e70e438c Binary files /dev/null and b/public/assets/css/iCheck/flat/flat@2x.png differ diff --git a/public/assets/css/iCheck/flat/green.css b/public/assets/css/iCheck/flat/green.css new file mode 100755 index 00000000..c9d17c16 --- /dev/null +++ b/public/assets/css/iCheck/flat/green.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, green +----------------------------------- */ +.icheckbox_flat-green, +.iradio_flat-green { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(green.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-green { + background-position: 0 0; +} + .icheckbox_flat-green.checked { + background-position: -22px 0; + } + .icheckbox_flat-green.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-green.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-green { + background-position: -88px 0; +} + .iradio_flat-green.checked { + background-position: -110px 0; + } + .iradio_flat-green.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-green.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-green, + .iradio_flat-green { + background-image: url(green@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/green.png b/public/assets/css/iCheck/flat/green.png new file mode 100755 index 00000000..6b303fbe Binary files /dev/null and b/public/assets/css/iCheck/flat/green.png differ diff --git a/public/assets/css/iCheck/flat/green@2x.png b/public/assets/css/iCheck/flat/green@2x.png new file mode 100755 index 00000000..92b4411d Binary files /dev/null and b/public/assets/css/iCheck/flat/green@2x.png differ diff --git a/public/assets/css/iCheck/flat/grey.css b/public/assets/css/iCheck/flat/grey.css new file mode 100755 index 00000000..a451650e --- /dev/null +++ b/public/assets/css/iCheck/flat/grey.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, grey +----------------------------------- */ +.icheckbox_flat-grey, +.iradio_flat-grey { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(grey.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-grey { + background-position: 0 0; +} + .icheckbox_flat-grey.checked { + background-position: -22px 0; + } + .icheckbox_flat-grey.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-grey.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-grey { + background-position: -88px 0; +} + .iradio_flat-grey.checked { + background-position: -110px 0; + } + .iradio_flat-grey.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-grey.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-grey, + .iradio_flat-grey { + background-image: url(grey@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/grey.png b/public/assets/css/iCheck/flat/grey.png new file mode 100755 index 00000000..c6e2873e Binary files /dev/null and b/public/assets/css/iCheck/flat/grey.png differ diff --git a/public/assets/css/iCheck/flat/grey@2x.png b/public/assets/css/iCheck/flat/grey@2x.png new file mode 100755 index 00000000..0b47b1c6 Binary files /dev/null and b/public/assets/css/iCheck/flat/grey@2x.png differ diff --git a/public/assets/css/iCheck/flat/orange.css b/public/assets/css/iCheck/flat/orange.css new file mode 100755 index 00000000..8c9c9297 --- /dev/null +++ b/public/assets/css/iCheck/flat/orange.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, orange +----------------------------------- */ +.icheckbox_flat-orange, +.iradio_flat-orange { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(orange.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-orange { + background-position: 0 0; +} + .icheckbox_flat-orange.checked { + background-position: -22px 0; + } + .icheckbox_flat-orange.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-orange.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-orange { + background-position: -88px 0; +} + .iradio_flat-orange.checked { + background-position: -110px 0; + } + .iradio_flat-orange.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-orange.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-orange, + .iradio_flat-orange { + background-image: url(orange@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/orange.png b/public/assets/css/iCheck/flat/orange.png new file mode 100755 index 00000000..ec2532eb Binary files /dev/null and b/public/assets/css/iCheck/flat/orange.png differ diff --git a/public/assets/css/iCheck/flat/orange@2x.png b/public/assets/css/iCheck/flat/orange@2x.png new file mode 100755 index 00000000..9350b506 Binary files /dev/null and b/public/assets/css/iCheck/flat/orange@2x.png differ diff --git a/public/assets/css/iCheck/flat/pink.css b/public/assets/css/iCheck/flat/pink.css new file mode 100755 index 00000000..afa49566 --- /dev/null +++ b/public/assets/css/iCheck/flat/pink.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, pink +----------------------------------- */ +.icheckbox_flat-pink, +.iradio_flat-pink { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(pink.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-pink { + background-position: 0 0; +} + .icheckbox_flat-pink.checked { + background-position: -22px 0; + } + .icheckbox_flat-pink.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-pink.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-pink { + background-position: -88px 0; +} + .iradio_flat-pink.checked { + background-position: -110px 0; + } + .iradio_flat-pink.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-pink.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-pink, + .iradio_flat-pink { + background-image: url(pink@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/pink.png b/public/assets/css/iCheck/flat/pink.png new file mode 100755 index 00000000..3e65d9dd Binary files /dev/null and b/public/assets/css/iCheck/flat/pink.png differ diff --git a/public/assets/css/iCheck/flat/pink@2x.png b/public/assets/css/iCheck/flat/pink@2x.png new file mode 100755 index 00000000..281ba06b Binary files /dev/null and b/public/assets/css/iCheck/flat/pink@2x.png differ diff --git a/public/assets/css/iCheck/flat/purple.css b/public/assets/css/iCheck/flat/purple.css new file mode 100755 index 00000000..a9760b36 --- /dev/null +++ b/public/assets/css/iCheck/flat/purple.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, purple +----------------------------------- */ +.icheckbox_flat-purple, +.iradio_flat-purple { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(purple.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-purple { + background-position: 0 0; +} + .icheckbox_flat-purple.checked { + background-position: -22px 0; + } + .icheckbox_flat-purple.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-purple.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-purple { + background-position: -88px 0; +} + .iradio_flat-purple.checked { + background-position: -110px 0; + } + .iradio_flat-purple.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-purple.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-purple, + .iradio_flat-purple { + background-image: url(purple@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/purple.png b/public/assets/css/iCheck/flat/purple.png new file mode 100755 index 00000000..3699fd58 Binary files /dev/null and b/public/assets/css/iCheck/flat/purple.png differ diff --git a/public/assets/css/iCheck/flat/purple@2x.png b/public/assets/css/iCheck/flat/purple@2x.png new file mode 100755 index 00000000..7f4be74a Binary files /dev/null and b/public/assets/css/iCheck/flat/purple@2x.png differ diff --git a/public/assets/css/iCheck/flat/red.css b/public/assets/css/iCheck/flat/red.css new file mode 100755 index 00000000..34b71e47 --- /dev/null +++ b/public/assets/css/iCheck/flat/red.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, red +----------------------------------- */ +.icheckbox_flat-red, +.iradio_flat-red { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(red.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-red { + background-position: 0 0; +} + .icheckbox_flat-red.checked { + background-position: -22px 0; + } + .icheckbox_flat-red.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-red.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-red { + background-position: -88px 0; +} + .iradio_flat-red.checked { + background-position: -110px 0; + } + .iradio_flat-red.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-red.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-red, + .iradio_flat-red { + background-image: url(red@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/red.png b/public/assets/css/iCheck/flat/red.png new file mode 100755 index 00000000..0d5ac381 Binary files /dev/null and b/public/assets/css/iCheck/flat/red.png differ diff --git a/public/assets/css/iCheck/flat/red@2x.png b/public/assets/css/iCheck/flat/red@2x.png new file mode 100755 index 00000000..38590d98 Binary files /dev/null and b/public/assets/css/iCheck/flat/red@2x.png differ diff --git a/public/assets/css/iCheck/flat/yellow.css b/public/assets/css/iCheck/flat/yellow.css new file mode 100755 index 00000000..96ae5b1f --- /dev/null +++ b/public/assets/css/iCheck/flat/yellow.css @@ -0,0 +1,56 @@ +/* iCheck plugin Flat skin, yellow +----------------------------------- */ +.icheckbox_flat-yellow, +.iradio_flat-yellow { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 20px; + height: 20px; + background: url(yellow.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_flat-yellow { + background-position: 0 0; +} + .icheckbox_flat-yellow.checked { + background-position: -22px 0; + } + .icheckbox_flat-yellow.disabled { + background-position: -44px 0; + cursor: default; + } + .icheckbox_flat-yellow.checked.disabled { + background-position: -66px 0; + } + +.iradio_flat-yellow { + background-position: -88px 0; +} + .iradio_flat-yellow.checked { + background-position: -110px 0; + } + .iradio_flat-yellow.disabled { + background-position: -132px 0; + cursor: default; + } + .iradio_flat-yellow.checked.disabled { + background-position: -154px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_flat-yellow, + .iradio_flat-yellow { + background-image: url(yellow@2x.png); + -webkit-background-size: 176px 22px; + background-size: 176px 22px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/flat/yellow.png b/public/assets/css/iCheck/flat/yellow.png new file mode 100755 index 00000000..909dadc5 Binary files /dev/null and b/public/assets/css/iCheck/flat/yellow.png differ diff --git a/public/assets/css/iCheck/flat/yellow@2x.png b/public/assets/css/iCheck/flat/yellow@2x.png new file mode 100755 index 00000000..9fd5d733 Binary files /dev/null and b/public/assets/css/iCheck/flat/yellow@2x.png differ diff --git a/public/assets/css/iCheck/futurico/futurico.css b/public/assets/css/iCheck/futurico/futurico.css new file mode 100755 index 00000000..2654cf4f --- /dev/null +++ b/public/assets/css/iCheck/futurico/futurico.css @@ -0,0 +1,56 @@ +/* iCheck plugin Futurico skin +----------------------------------- */ +.icheckbox_futurico, +.iradio_futurico { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 16px; + height: 17px; + background: url(futurico.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_futurico { + background-position: 0 0; +} + .icheckbox_futurico.checked { + background-position: -18px 0; + } + .icheckbox_futurico.disabled { + background-position: -36px 0; + cursor: default; + } + .icheckbox_futurico.checked.disabled { + background-position: -54px 0; + } + +.iradio_futurico { + background-position: -72px 0; +} + .iradio_futurico.checked { + background-position: -90px 0; + } + .iradio_futurico.disabled { + background-position: -108px 0; + cursor: default; + } + .iradio_futurico.checked.disabled { + background-position: -126px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_futurico, + .iradio_futurico { + background-image: url(futurico@2x.png); + -webkit-background-size: 144px 19px; + background-size: 144px 19px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/futurico/futurico.png b/public/assets/css/iCheck/futurico/futurico.png new file mode 100755 index 00000000..50d62b5d Binary files /dev/null and b/public/assets/css/iCheck/futurico/futurico.png differ diff --git a/public/assets/css/iCheck/futurico/futurico@2x.png b/public/assets/css/iCheck/futurico/futurico@2x.png new file mode 100755 index 00000000..f7eb45aa Binary files /dev/null and b/public/assets/css/iCheck/futurico/futurico@2x.png differ diff --git a/public/assets/css/iCheck/line/_all.css b/public/assets/css/iCheck/line/_all.css new file mode 100755 index 00000000..a18d0d90 --- /dev/null +++ b/public/assets/css/iCheck/line/_all.css @@ -0,0 +1,740 @@ +/* iCheck plugin Line skin +----------------------------------- */ +.icheckbox_line, +.iradio_line { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #000; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line .icheck_line-icon, + .iradio_line .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line.hover, + .icheckbox_line.checked.hover, + .iradio_line.hover { + background: #444; + } + .icheckbox_line.checked, + .iradio_line.checked { + background: #000; + } + .icheckbox_line.checked .icheck_line-icon, + .iradio_line.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line.disabled, + .iradio_line.disabled { + background: #ccc; + cursor: default; + } + .icheckbox_line.disabled .icheck_line-icon, + .iradio_line.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line.checked.disabled, + .iradio_line.checked.disabled { + background: #ccc; + } + .icheckbox_line.checked.disabled .icheck_line-icon, + .iradio_line.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line .icheck_line-icon, + .iradio_line .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* red */ +.icheckbox_line-red, +.iradio_line-red { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #e56c69; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-red .icheck_line-icon, + .iradio_line-red .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-red.hover, + .icheckbox_line-red.checked.hover, + .iradio_line-red.hover { + background: #E98582; + } + .icheckbox_line-red.checked, + .iradio_line-red.checked { + background: #e56c69; + } + .icheckbox_line-red.checked .icheck_line-icon, + .iradio_line-red.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-red.disabled, + .iradio_line-red.disabled { + background: #F7D3D2; + cursor: default; + } + .icheckbox_line-red.disabled .icheck_line-icon, + .iradio_line-red.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-red.checked.disabled, + .iradio_line-red.checked.disabled { + background: #F7D3D2; + } + .icheckbox_line-red.checked.disabled .icheck_line-icon, + .iradio_line-red.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-red .icheck_line-icon, + .iradio_line-red .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* green */ +.icheckbox_line-green, +.iradio_line-green { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #1b7e5a; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-green .icheck_line-icon, + .iradio_line-green .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-green.hover, + .icheckbox_line-green.checked.hover, + .iradio_line-green.hover { + background: #24AA7A; + } + .icheckbox_line-green.checked, + .iradio_line-green.checked { + background: #1b7e5a; + } + .icheckbox_line-green.checked .icheck_line-icon, + .iradio_line-green.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-green.disabled, + .iradio_line-green.disabled { + background: #89E6C4; + cursor: default; + } + .icheckbox_line-green.disabled .icheck_line-icon, + .iradio_line-green.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-green.checked.disabled, + .iradio_line-green.checked.disabled { + background: #89E6C4; + } + .icheckbox_line-green.checked.disabled .icheck_line-icon, + .iradio_line-green.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-green .icheck_line-icon, + .iradio_line-green .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* blue */ +.icheckbox_line-blue, +.iradio_line-blue { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #2489c5; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-blue .icheck_line-icon, + .iradio_line-blue .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-blue.hover, + .icheckbox_line-blue.checked.hover, + .iradio_line-blue.hover { + background: #3DA0DB; + } + .icheckbox_line-blue.checked, + .iradio_line-blue.checked { + background: #2489c5; + } + .icheckbox_line-blue.checked .icheck_line-icon, + .iradio_line-blue.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-blue.disabled, + .iradio_line-blue.disabled { + background: #ADD7F0; + cursor: default; + } + .icheckbox_line-blue.disabled .icheck_line-icon, + .iradio_line-blue.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-blue.checked.disabled, + .iradio_line-blue.checked.disabled { + background: #ADD7F0; + } + .icheckbox_line-blue.checked.disabled .icheck_line-icon, + .iradio_line-blue.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-blue .icheck_line-icon, + .iradio_line-blue .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* aero */ +.icheckbox_line-aero, +.iradio_line-aero { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #9cc2cb; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-aero .icheck_line-icon, + .iradio_line-aero .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-aero.hover, + .icheckbox_line-aero.checked.hover, + .iradio_line-aero.hover { + background: #B5D1D8; + } + .icheckbox_line-aero.checked, + .iradio_line-aero.checked { + background: #9cc2cb; + } + .icheckbox_line-aero.checked .icheck_line-icon, + .iradio_line-aero.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-aero.disabled, + .iradio_line-aero.disabled { + background: #D2E4E8; + cursor: default; + } + .icheckbox_line-aero.disabled .icheck_line-icon, + .iradio_line-aero.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-aero.checked.disabled, + .iradio_line-aero.checked.disabled { + background: #D2E4E8; + } + .icheckbox_line-aero.checked.disabled .icheck_line-icon, + .iradio_line-aero.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-aero .icheck_line-icon, + .iradio_line-aero .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* grey */ +.icheckbox_line-grey, +.iradio_line-grey { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #73716e; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-grey .icheck_line-icon, + .iradio_line-grey .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-grey.hover, + .icheckbox_line-grey.checked.hover, + .iradio_line-grey.hover { + background: #8B8986; + } + .icheckbox_line-grey.checked, + .iradio_line-grey.checked { + background: #73716e; + } + .icheckbox_line-grey.checked .icheck_line-icon, + .iradio_line-grey.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-grey.disabled, + .iradio_line-grey.disabled { + background: #D5D4D3; + cursor: default; + } + .icheckbox_line-grey.disabled .icheck_line-icon, + .iradio_line-grey.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-grey.checked.disabled, + .iradio_line-grey.checked.disabled { + background: #D5D4D3; + } + .icheckbox_line-grey.checked.disabled .icheck_line-icon, + .iradio_line-grey.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-grey .icheck_line-icon, + .iradio_line-grey .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* orange */ +.icheckbox_line-orange, +.iradio_line-orange { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #f70; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-orange .icheck_line-icon, + .iradio_line-orange .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-orange.hover, + .icheckbox_line-orange.checked.hover, + .iradio_line-orange.hover { + background: #FF9233; + } + .icheckbox_line-orange.checked, + .iradio_line-orange.checked { + background: #f70; + } + .icheckbox_line-orange.checked .icheck_line-icon, + .iradio_line-orange.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-orange.disabled, + .iradio_line-orange.disabled { + background: #FFD6B3; + cursor: default; + } + .icheckbox_line-orange.disabled .icheck_line-icon, + .iradio_line-orange.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-orange.checked.disabled, + .iradio_line-orange.checked.disabled { + background: #FFD6B3; + } + .icheckbox_line-orange.checked.disabled .icheck_line-icon, + .iradio_line-orange.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-orange .icheck_line-icon, + .iradio_line-orange .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* yellow */ +.icheckbox_line-yellow, +.iradio_line-yellow { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #FFC414; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-yellow .icheck_line-icon, + .iradio_line-yellow .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-yellow.hover, + .icheckbox_line-yellow.checked.hover, + .iradio_line-yellow.hover { + background: #FFD34F; + } + .icheckbox_line-yellow.checked, + .iradio_line-yellow.checked { + background: #FFC414; + } + .icheckbox_line-yellow.checked .icheck_line-icon, + .iradio_line-yellow.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-yellow.disabled, + .iradio_line-yellow.disabled { + background: #FFE495; + cursor: default; + } + .icheckbox_line-yellow.disabled .icheck_line-icon, + .iradio_line-yellow.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-yellow.checked.disabled, + .iradio_line-yellow.checked.disabled { + background: #FFE495; + } + .icheckbox_line-yellow.checked.disabled .icheck_line-icon, + .iradio_line-yellow.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-yellow .icheck_line-icon, + .iradio_line-yellow .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* pink */ +.icheckbox_line-pink, +.iradio_line-pink { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #a77a94; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-pink .icheck_line-icon, + .iradio_line-pink .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-pink.hover, + .icheckbox_line-pink.checked.hover, + .iradio_line-pink.hover { + background: #B995A9; + } + .icheckbox_line-pink.checked, + .iradio_line-pink.checked { + background: #a77a94; + } + .icheckbox_line-pink.checked .icheck_line-icon, + .iradio_line-pink.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-pink.disabled, + .iradio_line-pink.disabled { + background: #E0D0DA; + cursor: default; + } + .icheckbox_line-pink.disabled .icheck_line-icon, + .iradio_line-pink.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-pink.checked.disabled, + .iradio_line-pink.checked.disabled { + background: #E0D0DA; + } + .icheckbox_line-pink.checked.disabled .icheck_line-icon, + .iradio_line-pink.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-pink .icheck_line-icon, + .iradio_line-pink .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} + +/* purple */ +.icheckbox_line-purple, +.iradio_line-purple { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #6a5a8c; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-purple .icheck_line-icon, + .iradio_line-purple .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-purple.hover, + .icheckbox_line-purple.checked.hover, + .iradio_line-purple.hover { + background: #8677A7; + } + .icheckbox_line-purple.checked, + .iradio_line-purple.checked { + background: #6a5a8c; + } + .icheckbox_line-purple.checked .icheck_line-icon, + .iradio_line-purple.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-purple.disabled, + .iradio_line-purple.disabled { + background: #D2CCDE; + cursor: default; + } + .icheckbox_line-purple.disabled .icheck_line-icon, + .iradio_line-purple.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-purple.checked.disabled, + .iradio_line-purple.checked.disabled { + background: #D2CCDE; + } + .icheckbox_line-purple.checked.disabled .icheck_line-icon, + .iradio_line-purple.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-purple .icheck_line-icon, + .iradio_line-purple .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/aero.css b/public/assets/css/iCheck/line/aero.css new file mode 100755 index 00000000..44989a46 --- /dev/null +++ b/public/assets/css/iCheck/line/aero.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, aero +----------------------------------- */ +.icheckbox_line-aero, +.iradio_line-aero { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #9cc2cb; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-aero .icheck_line-icon, + .iradio_line-aero .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-aero.hover, + .icheckbox_line-aero.checked.hover, + .iradio_line-aero.hover { + background: #B5D1D8; + } + .icheckbox_line-aero.checked, + .iradio_line-aero.checked { + background: #9cc2cb; + } + .icheckbox_line-aero.checked .icheck_line-icon, + .iradio_line-aero.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-aero.disabled, + .iradio_line-aero.disabled { + background: #D2E4E8; + cursor: default; + } + .icheckbox_line-aero.disabled .icheck_line-icon, + .iradio_line-aero.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-aero.checked.disabled, + .iradio_line-aero.checked.disabled { + background: #D2E4E8; + } + .icheckbox_line-aero.checked.disabled .icheck_line-icon, + .iradio_line-aero.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-aero .icheck_line-icon, + .iradio_line-aero .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/blue.css b/public/assets/css/iCheck/line/blue.css new file mode 100755 index 00000000..5c9c0a78 --- /dev/null +++ b/public/assets/css/iCheck/line/blue.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, blue +----------------------------------- */ +.icheckbox_line-blue, +.iradio_line-blue { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #2489c5; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-blue .icheck_line-icon, + .iradio_line-blue .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-blue.hover, + .icheckbox_line-blue.checked.hover, + .iradio_line-blue.hover { + background: #3DA0DB; + } + .icheckbox_line-blue.checked, + .iradio_line-blue.checked { + background: #2489c5; + } + .icheckbox_line-blue.checked .icheck_line-icon, + .iradio_line-blue.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-blue.disabled, + .iradio_line-blue.disabled { + background: #ADD7F0; + cursor: default; + } + .icheckbox_line-blue.disabled .icheck_line-icon, + .iradio_line-blue.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-blue.checked.disabled, + .iradio_line-blue.checked.disabled { + background: #ADD7F0; + } + .icheckbox_line-blue.checked.disabled .icheck_line-icon, + .iradio_line-blue.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-blue .icheck_line-icon, + .iradio_line-blue .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/green.css b/public/assets/css/iCheck/line/green.css new file mode 100755 index 00000000..8bbe5140 --- /dev/null +++ b/public/assets/css/iCheck/line/green.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, green +----------------------------------- */ +.icheckbox_line-green, +.iradio_line-green { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #1b7e5a; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-green .icheck_line-icon, + .iradio_line-green .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-green.hover, + .icheckbox_line-green.checked.hover, + .iradio_line-green.hover { + background: #24AA7A; + } + .icheckbox_line-green.checked, + .iradio_line-green.checked { + background: #1b7e5a; + } + .icheckbox_line-green.checked .icheck_line-icon, + .iradio_line-green.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-green.disabled, + .iradio_line-green.disabled { + background: #89E6C4; + cursor: default; + } + .icheckbox_line-green.disabled .icheck_line-icon, + .iradio_line-green.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-green.checked.disabled, + .iradio_line-green.checked.disabled { + background: #89E6C4; + } + .icheckbox_line-green.checked.disabled .icheck_line-icon, + .iradio_line-green.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-green .icheck_line-icon, + .iradio_line-green .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/grey.css b/public/assets/css/iCheck/line/grey.css new file mode 100755 index 00000000..fc16a80e --- /dev/null +++ b/public/assets/css/iCheck/line/grey.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, grey +----------------------------------- */ +.icheckbox_line-grey, +.iradio_line-grey { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #73716e; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-grey .icheck_line-icon, + .iradio_line-grey .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-grey.hover, + .icheckbox_line-grey.checked.hover, + .iradio_line-grey.hover { + background: #8B8986; + } + .icheckbox_line-grey.checked, + .iradio_line-grey.checked { + background: #73716e; + } + .icheckbox_line-grey.checked .icheck_line-icon, + .iradio_line-grey.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-grey.disabled, + .iradio_line-grey.disabled { + background: #D5D4D3; + cursor: default; + } + .icheckbox_line-grey.disabled .icheck_line-icon, + .iradio_line-grey.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-grey.checked.disabled, + .iradio_line-grey.checked.disabled { + background: #D5D4D3; + } + .icheckbox_line-grey.checked.disabled .icheck_line-icon, + .iradio_line-grey.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-grey .icheck_line-icon, + .iradio_line-grey .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/line.css b/public/assets/css/iCheck/line/line.css new file mode 100755 index 00000000..dbde8d4d --- /dev/null +++ b/public/assets/css/iCheck/line/line.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, black +----------------------------------- */ +.icheckbox_line, +.iradio_line { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #000; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line .icheck_line-icon, + .iradio_line .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line.hover, + .icheckbox_line.checked.hover, + .iradio_line.hover { + background: #444; + } + .icheckbox_line.checked, + .iradio_line.checked { + background: #000; + } + .icheckbox_line.checked .icheck_line-icon, + .iradio_line.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line.disabled, + .iradio_line.disabled { + background: #ccc; + cursor: default; + } + .icheckbox_line.disabled .icheck_line-icon, + .iradio_line.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line.checked.disabled, + .iradio_line.checked.disabled { + background: #ccc; + } + .icheckbox_line.checked.disabled .icheck_line-icon, + .iradio_line.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line .icheck_line-icon, + .iradio_line .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/line.png b/public/assets/css/iCheck/line/line.png new file mode 100755 index 00000000..d21d7a7b Binary files /dev/null and b/public/assets/css/iCheck/line/line.png differ diff --git a/public/assets/css/iCheck/line/line@2x.png b/public/assets/css/iCheck/line/line@2x.png new file mode 100755 index 00000000..62900a2d Binary files /dev/null and b/public/assets/css/iCheck/line/line@2x.png differ diff --git a/public/assets/css/iCheck/line/orange.css b/public/assets/css/iCheck/line/orange.css new file mode 100755 index 00000000..210f3340 --- /dev/null +++ b/public/assets/css/iCheck/line/orange.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, orange +----------------------------------- */ +.icheckbox_line-orange, +.iradio_line-orange { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #f70; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-orange .icheck_line-icon, + .iradio_line-orange .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-orange.hover, + .icheckbox_line-orange.checked.hover, + .iradio_line-orange.hover { + background: #FF9233; + } + .icheckbox_line-orange.checked, + .iradio_line-orange.checked { + background: #f70; + } + .icheckbox_line-orange.checked .icheck_line-icon, + .iradio_line-orange.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-orange.disabled, + .iradio_line-orange.disabled { + background: #FFD6B3; + cursor: default; + } + .icheckbox_line-orange.disabled .icheck_line-icon, + .iradio_line-orange.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-orange.checked.disabled, + .iradio_line-orange.checked.disabled { + background: #FFD6B3; + } + .icheckbox_line-orange.checked.disabled .icheck_line-icon, + .iradio_line-orange.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-orange .icheck_line-icon, + .iradio_line-orange .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/pink.css b/public/assets/css/iCheck/line/pink.css new file mode 100755 index 00000000..44c9cea1 --- /dev/null +++ b/public/assets/css/iCheck/line/pink.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, pink +----------------------------------- */ +.icheckbox_line-pink, +.iradio_line-pink { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #a77a94; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-pink .icheck_line-icon, + .iradio_line-pink .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-pink.hover, + .icheckbox_line-pink.checked.hover, + .iradio_line-pink.hover { + background: #B995A9; + } + .icheckbox_line-pink.checked, + .iradio_line-pink.checked { + background: #a77a94; + } + .icheckbox_line-pink.checked .icheck_line-icon, + .iradio_line-pink.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-pink.disabled, + .iradio_line-pink.disabled { + background: #E0D0DA; + cursor: default; + } + .icheckbox_line-pink.disabled .icheck_line-icon, + .iradio_line-pink.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-pink.checked.disabled, + .iradio_line-pink.checked.disabled { + background: #E0D0DA; + } + .icheckbox_line-pink.checked.disabled .icheck_line-icon, + .iradio_line-pink.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-pink .icheck_line-icon, + .iradio_line-pink .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/purple.css b/public/assets/css/iCheck/line/purple.css new file mode 100755 index 00000000..be4c4e2b --- /dev/null +++ b/public/assets/css/iCheck/line/purple.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, purple +----------------------------------- */ +.icheckbox_line-purple, +.iradio_line-purple { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #6a5a8c; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-purple .icheck_line-icon, + .iradio_line-purple .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-purple.hover, + .icheckbox_line-purple.checked.hover, + .iradio_line-purple.hover { + background: #8677A7; + } + .icheckbox_line-purple.checked, + .iradio_line-purple.checked { + background: #6a5a8c; + } + .icheckbox_line-purple.checked .icheck_line-icon, + .iradio_line-purple.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-purple.disabled, + .iradio_line-purple.disabled { + background: #D2CCDE; + cursor: default; + } + .icheckbox_line-purple.disabled .icheck_line-icon, + .iradio_line-purple.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-purple.checked.disabled, + .iradio_line-purple.checked.disabled { + background: #D2CCDE; + } + .icheckbox_line-purple.checked.disabled .icheck_line-icon, + .iradio_line-purple.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-purple .icheck_line-icon, + .iradio_line-purple .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/red.css b/public/assets/css/iCheck/line/red.css new file mode 100755 index 00000000..ebcd8bef --- /dev/null +++ b/public/assets/css/iCheck/line/red.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, red +----------------------------------- */ +.icheckbox_line-red, +.iradio_line-red { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #e56c69; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-red .icheck_line-icon, + .iradio_line-red .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-red.hover, + .icheckbox_line-red.checked.hover, + .iradio_line-red.hover { + background: #E98582; + } + .icheckbox_line-red.checked, + .iradio_line-red.checked { + background: #e56c69; + } + .icheckbox_line-red.checked .icheck_line-icon, + .iradio_line-red.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-red.disabled, + .iradio_line-red.disabled { + background: #F7D3D2; + cursor: default; + } + .icheckbox_line-red.disabled .icheck_line-icon, + .iradio_line-red.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-red.checked.disabled, + .iradio_line-red.checked.disabled { + background: #F7D3D2; + } + .icheckbox_line-red.checked.disabled .icheck_line-icon, + .iradio_line-red.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-red .icheck_line-icon, + .iradio_line-red .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/line/yellow.css b/public/assets/css/iCheck/line/yellow.css new file mode 100755 index 00000000..8e088714 --- /dev/null +++ b/public/assets/css/iCheck/line/yellow.css @@ -0,0 +1,74 @@ +/* iCheck plugin Line skin, yellow +----------------------------------- */ +.icheckbox_line-yellow, +.iradio_line-yellow { + position: relative; + display: block; + margin: 0; + padding: 5px 15px 5px 38px; + font-size: 13px; + line-height: 17px; + color: #fff; + background: #FFC414; + border: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + cursor: pointer; +} + .icheckbox_line-yellow .icheck_line-icon, + .iradio_line-yellow .icheck_line-icon { + position: absolute; + top: 50%; + left: 13px; + width: 13px; + height: 11px; + margin: -5px 0 0 0; + padding: 0; + overflow: hidden; + background: url(line.png) no-repeat; + border: none; + } + .icheckbox_line-yellow.hover, + .icheckbox_line-yellow.checked.hover, + .iradio_line-yellow.hover { + background: #FFD34F; + } + .icheckbox_line-yellow.checked, + .iradio_line-yellow.checked { + background: #FFC414; + } + .icheckbox_line-yellow.checked .icheck_line-icon, + .iradio_line-yellow.checked .icheck_line-icon { + background-position: -15px 0; + } + .icheckbox_line-yellow.disabled, + .iradio_line-yellow.disabled { + background: #FFE495; + cursor: default; + } + .icheckbox_line-yellow.disabled .icheck_line-icon, + .iradio_line-yellow.disabled .icheck_line-icon { + background-position: -30px 0; + } + .icheckbox_line-yellow.checked.disabled, + .iradio_line-yellow.checked.disabled { + background: #FFE495; + } + .icheckbox_line-yellow.checked.disabled .icheck_line-icon, + .iradio_line-yellow.checked.disabled .icheck_line-icon { + background-position: -45px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_line-yellow .icheck_line-icon, + .iradio_line-yellow .icheck_line-icon { + background-image: url(line@2x.png); + -webkit-background-size: 60px 13px; + background-size: 60px 13px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/_all.css b/public/assets/css/iCheck/minimal/_all.css new file mode 100755 index 00000000..b2165ecc --- /dev/null +++ b/public/assets/css/iCheck/minimal/_all.css @@ -0,0 +1,557 @@ +/* red */ +.icheckbox_minimal-red, +.iradio_minimal-red { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(red.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-red { + background-position: 0 0; +} + .icheckbox_minimal-red.hover { + background-position: -20px 0; + } + .icheckbox_minimal-red.checked { + background-position: -40px 0; + } + .icheckbox_minimal-red.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-red.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-red { + background-position: -100px 0; +} + .iradio_minimal-red.hover { + background-position: -120px 0; + } + .iradio_minimal-red.checked { + background-position: -140px 0; + } + .iradio_minimal-red.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-red.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-red, + .iradio_minimal-red { + background-image: url(red@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} + +/* green */ +.icheckbox_minimal-green, +.iradio_minimal-green { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(green.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-green { + background-position: 0 0; +} + .icheckbox_minimal-green.hover { + background-position: -20px 0; + } + .icheckbox_minimal-green.checked { + background-position: -40px 0; + } + .icheckbox_minimal-green.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-green.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-green { + background-position: -100px 0; +} + .iradio_minimal-green.hover { + background-position: -120px 0; + } + .iradio_minimal-green.checked { + background-position: -140px 0; + } + .iradio_minimal-green.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-green.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-green, + .iradio_minimal-green { + background-image: url(green@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} + +/* blue */ +.icheckbox_minimal-blue, +.iradio_minimal-blue { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(blue.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-blue { + background-position: 0 0; +} + .icheckbox_minimal-blue.hover { + background-position: -20px 0; + } + .icheckbox_minimal-blue.checked { + background-position: -40px 0; + } + .icheckbox_minimal-blue.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-blue.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-blue { + background-position: -100px 0; +} + .iradio_minimal-blue.hover { + background-position: -120px 0; + } + .iradio_minimal-blue.checked { + background-position: -140px 0; + } + .iradio_minimal-blue.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-blue.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-blue, + .iradio_minimal-blue { + background-image: url(blue@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} + +/* aero */ +.icheckbox_minimal-aero, +.iradio_minimal-aero { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(aero.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-aero { + background-position: 0 0; +} + .icheckbox_minimal-aero.hover { + background-position: -20px 0; + } + .icheckbox_minimal-aero.checked { + background-position: -40px 0; + } + .icheckbox_minimal-aero.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-aero.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-aero { + background-position: -100px 0; +} + .iradio_minimal-aero.hover { + background-position: -120px 0; + } + .iradio_minimal-aero.checked { + background-position: -140px 0; + } + .iradio_minimal-aero.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-aero.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-aero, + .iradio_minimal-aero { + background-image: url(aero@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} + +/* grey */ +.icheckbox_minimal-grey, +.iradio_minimal-grey { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(grey.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-grey { + background-position: 0 0; +} + .icheckbox_minimal-grey.hover { + background-position: -20px 0; + } + .icheckbox_minimal-grey.checked { + background-position: -40px 0; + } + .icheckbox_minimal-grey.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-grey.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-grey { + background-position: -100px 0; +} + .iradio_minimal-grey.hover { + background-position: -120px 0; + } + .iradio_minimal-grey.checked { + background-position: -140px 0; + } + .iradio_minimal-grey.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-grey.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-grey, + .iradio_minimal-grey { + background-image: url(grey@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} + +/* orange */ +.icheckbox_minimal-orange, +.iradio_minimal-orange { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(orange.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-orange { + background-position: 0 0; +} + .icheckbox_minimal-orange.hover { + background-position: -20px 0; + } + .icheckbox_minimal-orange.checked { + background-position: -40px 0; + } + .icheckbox_minimal-orange.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-orange.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-orange { + background-position: -100px 0; +} + .iradio_minimal-orange.hover { + background-position: -120px 0; + } + .iradio_minimal-orange.checked { + background-position: -140px 0; + } + .iradio_minimal-orange.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-orange.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-orange, + .iradio_minimal-orange { + background-image: url(orange@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} + +/* yellow */ +.icheckbox_minimal-yellow, +.iradio_minimal-yellow { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(yellow.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-yellow { + background-position: 0 0; +} + .icheckbox_minimal-yellow.hover { + background-position: -20px 0; + } + .icheckbox_minimal-yellow.checked { + background-position: -40px 0; + } + .icheckbox_minimal-yellow.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-yellow.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-yellow { + background-position: -100px 0; +} + .iradio_minimal-yellow.hover { + background-position: -120px 0; + } + .iradio_minimal-yellow.checked { + background-position: -140px 0; + } + .iradio_minimal-yellow.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-yellow.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-yellow, + .iradio_minimal-yellow { + background-image: url(yellow@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} + +/* pink */ +.icheckbox_minimal-pink, +.iradio_minimal-pink { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(pink.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-pink { + background-position: 0 0; +} + .icheckbox_minimal-pink.hover { + background-position: -20px 0; + } + .icheckbox_minimal-pink.checked { + background-position: -40px 0; + } + .icheckbox_minimal-pink.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-pink.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-pink { + background-position: -100px 0; +} + .iradio_minimal-pink.hover { + background-position: -120px 0; + } + .iradio_minimal-pink.checked { + background-position: -140px 0; + } + .iradio_minimal-pink.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-pink.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-pink, + .iradio_minimal-pink { + background-image: url(pink@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} + +/* purple */ +.icheckbox_minimal-purple, +.iradio_minimal-purple { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(purple.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-purple { + background-position: 0 0; +} + .icheckbox_minimal-purple.hover { + background-position: -20px 0; + } + .icheckbox_minimal-purple.checked { + background-position: -40px 0; + } + .icheckbox_minimal-purple.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-purple.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-purple { + background-position: -100px 0; +} + .iradio_minimal-purple.hover { + background-position: -120px 0; + } + .iradio_minimal-purple.checked { + background-position: -140px 0; + } + .iradio_minimal-purple.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-purple.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-purple, + .iradio_minimal-purple { + background-image: url(purple@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/aero.css b/public/assets/css/iCheck/minimal/aero.css new file mode 100755 index 00000000..c97acc8c --- /dev/null +++ b/public/assets/css/iCheck/minimal/aero.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, aero +----------------------------------- */ +.icheckbox_minimal-aero, +.iradio_minimal-aero { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(aero.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-aero { + background-position: 0 0; +} + .icheckbox_minimal-aero.hover { + background-position: -20px 0; + } + .icheckbox_minimal-aero.checked { + background-position: -40px 0; + } + .icheckbox_minimal-aero.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-aero.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-aero { + background-position: -100px 0; +} + .iradio_minimal-aero.hover { + background-position: -120px 0; + } + .iradio_minimal-aero.checked { + background-position: -140px 0; + } + .iradio_minimal-aero.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-aero.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-aero, + .iradio_minimal-aero { + background-image: url(aero@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/aero.png b/public/assets/css/iCheck/minimal/aero.png new file mode 100755 index 00000000..dccf7740 Binary files /dev/null and b/public/assets/css/iCheck/minimal/aero.png differ diff --git a/public/assets/css/iCheck/minimal/aero@2x.png b/public/assets/css/iCheck/minimal/aero@2x.png new file mode 100755 index 00000000..5537ee36 Binary files /dev/null and b/public/assets/css/iCheck/minimal/aero@2x.png differ diff --git a/public/assets/css/iCheck/minimal/blue.css b/public/assets/css/iCheck/minimal/blue.css new file mode 100755 index 00000000..42477cd6 --- /dev/null +++ b/public/assets/css/iCheck/minimal/blue.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, blue +----------------------------------- */ +.icheckbox_minimal-blue, +.iradio_minimal-blue { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(blue.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-blue { + background-position: 0 0; +} + .icheckbox_minimal-blue.hover { + background-position: -20px 0; + } + .icheckbox_minimal-blue.checked { + background-position: -40px 0; + } + .icheckbox_minimal-blue.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-blue.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-blue { + background-position: -100px 0; +} + .iradio_minimal-blue.hover { + background-position: -120px 0; + } + .iradio_minimal-blue.checked { + background-position: -140px 0; + } + .iradio_minimal-blue.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-blue.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-blue, + .iradio_minimal-blue { + background-image: url(blue@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/blue.png b/public/assets/css/iCheck/minimal/blue.png new file mode 100755 index 00000000..af04cee5 Binary files /dev/null and b/public/assets/css/iCheck/minimal/blue.png differ diff --git a/public/assets/css/iCheck/minimal/blue@2x.png b/public/assets/css/iCheck/minimal/blue@2x.png new file mode 100755 index 00000000..f19210a9 Binary files /dev/null and b/public/assets/css/iCheck/minimal/blue@2x.png differ diff --git a/public/assets/css/iCheck/minimal/green.css b/public/assets/css/iCheck/minimal/green.css new file mode 100755 index 00000000..bd1e3d0f --- /dev/null +++ b/public/assets/css/iCheck/minimal/green.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, green +----------------------------------- */ +.icheckbox_minimal-green, +.iradio_minimal-green { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(green.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-green { + background-position: 0 0; +} + .icheckbox_minimal-green.hover { + background-position: -20px 0; + } + .icheckbox_minimal-green.checked { + background-position: -40px 0; + } + .icheckbox_minimal-green.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-green.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-green { + background-position: -100px 0; +} + .iradio_minimal-green.hover { + background-position: -120px 0; + } + .iradio_minimal-green.checked { + background-position: -140px 0; + } + .iradio_minimal-green.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-green.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-green, + .iradio_minimal-green { + background-image: url(green@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/green.png b/public/assets/css/iCheck/minimal/green.png new file mode 100755 index 00000000..9171ebc7 Binary files /dev/null and b/public/assets/css/iCheck/minimal/green.png differ diff --git a/public/assets/css/iCheck/minimal/green@2x.png b/public/assets/css/iCheck/minimal/green@2x.png new file mode 100755 index 00000000..7f18f96a Binary files /dev/null and b/public/assets/css/iCheck/minimal/green@2x.png differ diff --git a/public/assets/css/iCheck/minimal/grey.css b/public/assets/css/iCheck/minimal/grey.css new file mode 100755 index 00000000..6e2730c6 --- /dev/null +++ b/public/assets/css/iCheck/minimal/grey.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, grey +----------------------------------- */ +.icheckbox_minimal-grey, +.iradio_minimal-grey { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(grey.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-grey { + background-position: 0 0; +} + .icheckbox_minimal-grey.hover { + background-position: -20px 0; + } + .icheckbox_minimal-grey.checked { + background-position: -40px 0; + } + .icheckbox_minimal-grey.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-grey.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-grey { + background-position: -100px 0; +} + .iradio_minimal-grey.hover { + background-position: -120px 0; + } + .iradio_minimal-grey.checked { + background-position: -140px 0; + } + .iradio_minimal-grey.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-grey.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-grey, + .iradio_minimal-grey { + background-image: url(grey@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/grey.png b/public/assets/css/iCheck/minimal/grey.png new file mode 100755 index 00000000..22dcdbcf Binary files /dev/null and b/public/assets/css/iCheck/minimal/grey.png differ diff --git a/public/assets/css/iCheck/minimal/grey@2x.png b/public/assets/css/iCheck/minimal/grey@2x.png new file mode 100755 index 00000000..85e82ddd Binary files /dev/null and b/public/assets/css/iCheck/minimal/grey@2x.png differ diff --git a/public/assets/css/iCheck/minimal/minimal.css b/public/assets/css/iCheck/minimal/minimal.css new file mode 100755 index 00000000..7c0e52e1 --- /dev/null +++ b/public/assets/css/iCheck/minimal/minimal.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, black +----------------------------------- */ +.icheckbox_minimal, +.iradio_minimal { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(minimal.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal { + background-position: 0 0; +} + .icheckbox_minimal.hover { + background-position: -20px 0; + } + .icheckbox_minimal.checked { + background-position: -40px 0; + } + .icheckbox_minimal.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal { + background-position: -100px 0; +} + .iradio_minimal.hover { + background-position: -120px 0; + } + .iradio_minimal.checked { + background-position: -140px 0; + } + .iradio_minimal.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal, + .iradio_minimal { + background-image: url(minimal@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/minimal.png b/public/assets/css/iCheck/minimal/minimal.png new file mode 100755 index 00000000..943be16f Binary files /dev/null and b/public/assets/css/iCheck/minimal/minimal.png differ diff --git a/public/assets/css/iCheck/minimal/minimal@2x.png b/public/assets/css/iCheck/minimal/minimal@2x.png new file mode 100755 index 00000000..d62291da Binary files /dev/null and b/public/assets/css/iCheck/minimal/minimal@2x.png differ diff --git a/public/assets/css/iCheck/minimal/orange.css b/public/assets/css/iCheck/minimal/orange.css new file mode 100755 index 00000000..842e400a --- /dev/null +++ b/public/assets/css/iCheck/minimal/orange.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, orange +----------------------------------- */ +.icheckbox_minimal-orange, +.iradio_minimal-orange { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(orange.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-orange { + background-position: 0 0; +} + .icheckbox_minimal-orange.hover { + background-position: -20px 0; + } + .icheckbox_minimal-orange.checked { + background-position: -40px 0; + } + .icheckbox_minimal-orange.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-orange.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-orange { + background-position: -100px 0; +} + .iradio_minimal-orange.hover { + background-position: -120px 0; + } + .iradio_minimal-orange.checked { + background-position: -140px 0; + } + .iradio_minimal-orange.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-orange.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-orange, + .iradio_minimal-orange { + background-image: url(orange@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/orange.png b/public/assets/css/iCheck/minimal/orange.png new file mode 100755 index 00000000..f2a31497 Binary files /dev/null and b/public/assets/css/iCheck/minimal/orange.png differ diff --git a/public/assets/css/iCheck/minimal/orange@2x.png b/public/assets/css/iCheck/minimal/orange@2x.png new file mode 100755 index 00000000..68c83591 Binary files /dev/null and b/public/assets/css/iCheck/minimal/orange@2x.png differ diff --git a/public/assets/css/iCheck/minimal/pink.css b/public/assets/css/iCheck/minimal/pink.css new file mode 100755 index 00000000..10ace218 --- /dev/null +++ b/public/assets/css/iCheck/minimal/pink.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, pink +----------------------------------- */ +.icheckbox_minimal-pink, +.iradio_minimal-pink { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(pink.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-pink { + background-position: 0 0; +} + .icheckbox_minimal-pink.hover { + background-position: -20px 0; + } + .icheckbox_minimal-pink.checked { + background-position: -40px 0; + } + .icheckbox_minimal-pink.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-pink.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-pink { + background-position: -100px 0; +} + .iradio_minimal-pink.hover { + background-position: -120px 0; + } + .iradio_minimal-pink.checked { + background-position: -140px 0; + } + .iradio_minimal-pink.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-pink.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-pink, + .iradio_minimal-pink { + background-image: url(pink@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/pink.png b/public/assets/css/iCheck/minimal/pink.png new file mode 100755 index 00000000..660553c0 Binary files /dev/null and b/public/assets/css/iCheck/minimal/pink.png differ diff --git a/public/assets/css/iCheck/minimal/pink@2x.png b/public/assets/css/iCheck/minimal/pink@2x.png new file mode 100755 index 00000000..7d7b3851 Binary files /dev/null and b/public/assets/css/iCheck/minimal/pink@2x.png differ diff --git a/public/assets/css/iCheck/minimal/purple.css b/public/assets/css/iCheck/minimal/purple.css new file mode 100755 index 00000000..1c5dcbc7 --- /dev/null +++ b/public/assets/css/iCheck/minimal/purple.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, purple +----------------------------------- */ +.icheckbox_minimal-purple, +.iradio_minimal-purple { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(purple.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-purple { + background-position: 0 0; +} + .icheckbox_minimal-purple.hover { + background-position: -20px 0; + } + .icheckbox_minimal-purple.checked { + background-position: -40px 0; + } + .icheckbox_minimal-purple.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-purple.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-purple { + background-position: -100px 0; +} + .iradio_minimal-purple.hover { + background-position: -120px 0; + } + .iradio_minimal-purple.checked { + background-position: -140px 0; + } + .iradio_minimal-purple.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-purple.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-purple, + .iradio_minimal-purple { + background-image: url(purple@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/purple.png b/public/assets/css/iCheck/minimal/purple.png new file mode 100755 index 00000000..48dec794 Binary files /dev/null and b/public/assets/css/iCheck/minimal/purple.png differ diff --git a/public/assets/css/iCheck/minimal/purple@2x.png b/public/assets/css/iCheck/minimal/purple@2x.png new file mode 100755 index 00000000..3bb70417 Binary files /dev/null and b/public/assets/css/iCheck/minimal/purple@2x.png differ diff --git a/public/assets/css/iCheck/minimal/red.css b/public/assets/css/iCheck/minimal/red.css new file mode 100755 index 00000000..9340c4f6 --- /dev/null +++ b/public/assets/css/iCheck/minimal/red.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, red +----------------------------------- */ +.icheckbox_minimal-red, +.iradio_minimal-red { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(red.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-red { + background-position: 0 0; +} + .icheckbox_minimal-red.hover { + background-position: -20px 0; + } + .icheckbox_minimal-red.checked { + background-position: -40px 0; + } + .icheckbox_minimal-red.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-red.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-red { + background-position: -100px 0; +} + .iradio_minimal-red.hover { + background-position: -120px 0; + } + .iradio_minimal-red.checked { + background-position: -140px 0; + } + .iradio_minimal-red.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-red.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-red, + .iradio_minimal-red { + background-image: url(red@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/red.png b/public/assets/css/iCheck/minimal/red.png new file mode 100755 index 00000000..4443f809 Binary files /dev/null and b/public/assets/css/iCheck/minimal/red.png differ diff --git a/public/assets/css/iCheck/minimal/red@2x.png b/public/assets/css/iCheck/minimal/red@2x.png new file mode 100755 index 00000000..2eb55a65 Binary files /dev/null and b/public/assets/css/iCheck/minimal/red@2x.png differ diff --git a/public/assets/css/iCheck/minimal/yellow.css b/public/assets/css/iCheck/minimal/yellow.css new file mode 100755 index 00000000..2c384231 --- /dev/null +++ b/public/assets/css/iCheck/minimal/yellow.css @@ -0,0 +1,62 @@ +/* iCheck plugin Minimal skin, yellow +----------------------------------- */ +.icheckbox_minimal-yellow, +.iradio_minimal-yellow { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 18px; + height: 18px; + background: url(yellow.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_minimal-yellow { + background-position: 0 0; +} + .icheckbox_minimal-yellow.hover { + background-position: -20px 0; + } + .icheckbox_minimal-yellow.checked { + background-position: -40px 0; + } + .icheckbox_minimal-yellow.disabled { + background-position: -60px 0; + cursor: default; + } + .icheckbox_minimal-yellow.checked.disabled { + background-position: -80px 0; + } + +.iradio_minimal-yellow { + background-position: -100px 0; +} + .iradio_minimal-yellow.hover { + background-position: -120px 0; + } + .iradio_minimal-yellow.checked { + background-position: -140px 0; + } + .iradio_minimal-yellow.disabled { + background-position: -160px 0; + cursor: default; + } + .iradio_minimal-yellow.checked.disabled { + background-position: -180px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_minimal-yellow, + .iradio_minimal-yellow { + background-image: url(yellow@2x.png); + -webkit-background-size: 200px 20px; + background-size: 200px 20px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/minimal/yellow.png b/public/assets/css/iCheck/minimal/yellow.png new file mode 100755 index 00000000..0999b7ec Binary files /dev/null and b/public/assets/css/iCheck/minimal/yellow.png differ diff --git a/public/assets/css/iCheck/minimal/yellow@2x.png b/public/assets/css/iCheck/minimal/yellow@2x.png new file mode 100755 index 00000000..c16f2b7d Binary files /dev/null and b/public/assets/css/iCheck/minimal/yellow@2x.png differ diff --git a/public/assets/css/iCheck/polaris/polaris.css b/public/assets/css/iCheck/polaris/polaris.css new file mode 100755 index 00000000..1cb4bcc0 --- /dev/null +++ b/public/assets/css/iCheck/polaris/polaris.css @@ -0,0 +1,62 @@ +/* iCheck plugin Polaris skin +----------------------------------- */ +.icheckbox_polaris, +.iradio_polaris { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 29px; + height: 29px; + background: url(polaris.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_polaris { + background-position: 0 0; +} + .icheckbox_polaris.hover { + background-position: -31px 0; + } + .icheckbox_polaris.checked { + background-position: -62px 0; + } + .icheckbox_polaris.disabled { + background-position: -93px 0; + cursor: default; + } + .icheckbox_polaris.checked.disabled { + background-position: -124px 0; + } + +.iradio_polaris { + background-position: -155px 0; +} + .iradio_polaris.hover { + background-position: -186px 0; + } + .iradio_polaris.checked { + background-position: -217px 0; + } + .iradio_polaris.disabled { + background-position: -248px 0; + cursor: default; + } + .iradio_polaris.checked.disabled { + background-position: -279px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_polaris, + .iradio_polaris { + background-image: url(polaris@2x.png); + -webkit-background-size: 310px 31px; + background-size: 310px 31px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/polaris/polaris.png b/public/assets/css/iCheck/polaris/polaris.png new file mode 100755 index 00000000..60c14e6a Binary files /dev/null and b/public/assets/css/iCheck/polaris/polaris.png differ diff --git a/public/assets/css/iCheck/polaris/polaris@2x.png b/public/assets/css/iCheck/polaris/polaris@2x.png new file mode 100755 index 00000000..c75b8269 Binary files /dev/null and b/public/assets/css/iCheck/polaris/polaris@2x.png differ diff --git a/public/assets/css/iCheck/square/_all.css b/public/assets/css/iCheck/square/_all.css new file mode 100755 index 00000000..a2ff0368 --- /dev/null +++ b/public/assets/css/iCheck/square/_all.css @@ -0,0 +1,620 @@ +/* iCheck plugin Square skin +----------------------------------- */ +.icheckbox_square, +.iradio_square { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(square.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square { + background-position: 0 0; +} + .icheckbox_square.hover { + background-position: -24px 0; + } + .icheckbox_square.checked { + background-position: -48px 0; + } + .icheckbox_square.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square.checked.disabled { + background-position: -96px 0; + } + +.iradio_square { + background-position: -120px 0; +} + .iradio_square.hover { + background-position: -144px 0; + } + .iradio_square.checked { + background-position: -168px 0; + } + .iradio_square.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square, + .iradio_square { + background-image: url(square@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* red */ +.icheckbox_square-red, +.iradio_square-red { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(red.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-red { + background-position: 0 0; +} + .icheckbox_square-red.hover { + background-position: -24px 0; + } + .icheckbox_square-red.checked { + background-position: -48px 0; + } + .icheckbox_square-red.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-red.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-red { + background-position: -120px 0; +} + .iradio_square-red.hover { + background-position: -144px 0; + } + .iradio_square-red.checked { + background-position: -168px 0; + } + .iradio_square-red.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-red.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-red, + .iradio_square-red { + background-image: url(red@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* green */ +.icheckbox_square-green, +.iradio_square-green { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(green.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-green { + background-position: 0 0; +} + .icheckbox_square-green.hover { + background-position: -24px 0; + } + .icheckbox_square-green.checked { + background-position: -48px 0; + } + .icheckbox_square-green.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-green.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-green { + background-position: -120px 0; +} + .iradio_square-green.hover { + background-position: -144px 0; + } + .iradio_square-green.checked { + background-position: -168px 0; + } + .iradio_square-green.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-green.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-green, + .iradio_square-green { + background-image: url(green@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* blue */ +.icheckbox_square-blue, +.iradio_square-blue { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(blue.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-blue { + background-position: 0 0; +} + .icheckbox_square-blue.hover { + background-position: -24px 0; + } + .icheckbox_square-blue.checked { + background-position: -48px 0; + } + .icheckbox_square-blue.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-blue.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-blue { + background-position: -120px 0; +} + .iradio_square-blue.hover { + background-position: -144px 0; + } + .iradio_square-blue.checked { + background-position: -168px 0; + } + .iradio_square-blue.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-blue.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-blue, + .iradio_square-blue { + background-image: url(blue@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* aero */ +.icheckbox_square-aero, +.iradio_square-aero { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(aero.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-aero { + background-position: 0 0; +} + .icheckbox_square-aero.hover { + background-position: -24px 0; + } + .icheckbox_square-aero.checked { + background-position: -48px 0; + } + .icheckbox_square-aero.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-aero.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-aero { + background-position: -120px 0; +} + .iradio_square-aero.hover { + background-position: -144px 0; + } + .iradio_square-aero.checked { + background-position: -168px 0; + } + .iradio_square-aero.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-aero.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-aero, + .iradio_square-aero { + background-image: url(aero@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* grey */ +.icheckbox_square-grey, +.iradio_square-grey { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(grey.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-grey { + background-position: 0 0; +} + .icheckbox_square-grey.hover { + background-position: -24px 0; + } + .icheckbox_square-grey.checked { + background-position: -48px 0; + } + .icheckbox_square-grey.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-grey.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-grey { + background-position: -120px 0; +} + .iradio_square-grey.hover { + background-position: -144px 0; + } + .iradio_square-grey.checked { + background-position: -168px 0; + } + .iradio_square-grey.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-grey.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-grey, + .iradio_square-grey { + background-image: url(grey@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* orange */ +.icheckbox_square-orange, +.iradio_square-orange { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(orange.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-orange { + background-position: 0 0; +} + .icheckbox_square-orange.hover { + background-position: -24px 0; + } + .icheckbox_square-orange.checked { + background-position: -48px 0; + } + .icheckbox_square-orange.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-orange.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-orange { + background-position: -120px 0; +} + .iradio_square-orange.hover { + background-position: -144px 0; + } + .iradio_square-orange.checked { + background-position: -168px 0; + } + .iradio_square-orange.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-orange.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-orange, + .iradio_square-orange { + background-image: url(orange@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* yellow */ +.icheckbox_square-yellow, +.iradio_square-yellow { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(yellow.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-yellow { + background-position: 0 0; +} + .icheckbox_square-yellow.hover { + background-position: -24px 0; + } + .icheckbox_square-yellow.checked { + background-position: -48px 0; + } + .icheckbox_square-yellow.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-yellow.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-yellow { + background-position: -120px 0; +} + .iradio_square-yellow.hover { + background-position: -144px 0; + } + .iradio_square-yellow.checked { + background-position: -168px 0; + } + .iradio_square-yellow.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-yellow.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-yellow, + .iradio_square-yellow { + background-image: url(yellow@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* pink */ +.icheckbox_square-pink, +.iradio_square-pink { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(pink.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-pink { + background-position: 0 0; +} + .icheckbox_square-pink.hover { + background-position: -24px 0; + } + .icheckbox_square-pink.checked { + background-position: -48px 0; + } + .icheckbox_square-pink.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-pink.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-pink { + background-position: -120px 0; +} + .iradio_square-pink.hover { + background-position: -144px 0; + } + .iradio_square-pink.checked { + background-position: -168px 0; + } + .iradio_square-pink.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-pink.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-pink, + .iradio_square-pink { + background-image: url(pink@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} + +/* purple */ +.icheckbox_square-purple, +.iradio_square-purple { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(purple.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-purple { + background-position: 0 0; +} + .icheckbox_square-purple.hover { + background-position: -24px 0; + } + .icheckbox_square-purple.checked { + background-position: -48px 0; + } + .icheckbox_square-purple.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-purple.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-purple { + background-position: -120px 0; +} + .iradio_square-purple.hover { + background-position: -144px 0; + } + .iradio_square-purple.checked { + background-position: -168px 0; + } + .iradio_square-purple.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-purple.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-purple, + .iradio_square-purple { + background-image: url(purple@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/aero.css b/public/assets/css/iCheck/square/aero.css new file mode 100755 index 00000000..51fca0a8 --- /dev/null +++ b/public/assets/css/iCheck/square/aero.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, aero +----------------------------------- */ +.icheckbox_square-aero, +.iradio_square-aero { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(aero.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-aero { + background-position: 0 0; +} + .icheckbox_square-aero.hover { + background-position: -24px 0; + } + .icheckbox_square-aero.checked { + background-position: -48px 0; + } + .icheckbox_square-aero.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-aero.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-aero { + background-position: -120px 0; +} + .iradio_square-aero.hover { + background-position: -144px 0; + } + .iradio_square-aero.checked { + background-position: -168px 0; + } + .iradio_square-aero.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-aero.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-aero, + .iradio_square-aero { + background-image: url(aero@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/aero.png b/public/assets/css/iCheck/square/aero.png new file mode 100755 index 00000000..1a332e6c Binary files /dev/null and b/public/assets/css/iCheck/square/aero.png differ diff --git a/public/assets/css/iCheck/square/aero@2x.png b/public/assets/css/iCheck/square/aero@2x.png new file mode 100755 index 00000000..07c5a022 Binary files /dev/null and b/public/assets/css/iCheck/square/aero@2x.png differ diff --git a/public/assets/css/iCheck/square/blue.css b/public/assets/css/iCheck/square/blue.css new file mode 100755 index 00000000..95340fea --- /dev/null +++ b/public/assets/css/iCheck/square/blue.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, blue +----------------------------------- */ +.icheckbox_square-blue, +.iradio_square-blue { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(blue.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-blue { + background-position: 0 0; +} + .icheckbox_square-blue.hover { + background-position: -24px 0; + } + .icheckbox_square-blue.checked { + background-position: -48px 0; + } + .icheckbox_square-blue.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-blue.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-blue { + background-position: -120px 0; +} + .iradio_square-blue.hover { + background-position: -144px 0; + } + .iradio_square-blue.checked { + background-position: -168px 0; + } + .iradio_square-blue.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-blue.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-blue, + .iradio_square-blue { + background-image: url(blue@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/blue.png b/public/assets/css/iCheck/square/blue.png new file mode 100755 index 00000000..a3e040fc Binary files /dev/null and b/public/assets/css/iCheck/square/blue.png differ diff --git a/public/assets/css/iCheck/square/blue@2x.png b/public/assets/css/iCheck/square/blue@2x.png new file mode 100755 index 00000000..8fdea12f Binary files /dev/null and b/public/assets/css/iCheck/square/blue@2x.png differ diff --git a/public/assets/css/iCheck/square/green.css b/public/assets/css/iCheck/square/green.css new file mode 100755 index 00000000..eb43f2a4 --- /dev/null +++ b/public/assets/css/iCheck/square/green.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, green +----------------------------------- */ +.icheckbox_square-green, +.iradio_square-green { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(green.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-green { + background-position: 0 0; +} + .icheckbox_square-green.hover { + background-position: -24px 0; + } + .icheckbox_square-green.checked { + background-position: -48px 0; + } + .icheckbox_square-green.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-green.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-green { + background-position: -120px 0; +} + .iradio_square-green.hover { + background-position: -144px 0; + } + .iradio_square-green.checked { + background-position: -168px 0; + } + .iradio_square-green.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-green.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-green, + .iradio_square-green { + background-image: url(green@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/green.png b/public/assets/css/iCheck/square/green.png new file mode 100755 index 00000000..465824e7 Binary files /dev/null and b/public/assets/css/iCheck/square/green.png differ diff --git a/public/assets/css/iCheck/square/green@2x.png b/public/assets/css/iCheck/square/green@2x.png new file mode 100755 index 00000000..784e8747 Binary files /dev/null and b/public/assets/css/iCheck/square/green@2x.png differ diff --git a/public/assets/css/iCheck/square/grey.css b/public/assets/css/iCheck/square/grey.css new file mode 100755 index 00000000..ecc57ff4 --- /dev/null +++ b/public/assets/css/iCheck/square/grey.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, grey +----------------------------------- */ +.icheckbox_square-grey, +.iradio_square-grey { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(grey.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-grey { + background-position: 0 0; +} + .icheckbox_square-grey.hover { + background-position: -24px 0; + } + .icheckbox_square-grey.checked { + background-position: -48px 0; + } + .icheckbox_square-grey.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-grey.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-grey { + background-position: -120px 0; +} + .iradio_square-grey.hover { + background-position: -144px 0; + } + .iradio_square-grey.checked { + background-position: -168px 0; + } + .iradio_square-grey.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-grey.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-grey, + .iradio_square-grey { + background-image: url(grey@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/grey.png b/public/assets/css/iCheck/square/grey.png new file mode 100755 index 00000000..f6937585 Binary files /dev/null and b/public/assets/css/iCheck/square/grey.png differ diff --git a/public/assets/css/iCheck/square/grey@2x.png b/public/assets/css/iCheck/square/grey@2x.png new file mode 100755 index 00000000..5d6341c0 Binary files /dev/null and b/public/assets/css/iCheck/square/grey@2x.png differ diff --git a/public/assets/css/iCheck/square/orange.css b/public/assets/css/iCheck/square/orange.css new file mode 100755 index 00000000..d0c7a2cf --- /dev/null +++ b/public/assets/css/iCheck/square/orange.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, orange +----------------------------------- */ +.icheckbox_square-orange, +.iradio_square-orange { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(orange.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-orange { + background-position: 0 0; +} + .icheckbox_square-orange.hover { + background-position: -24px 0; + } + .icheckbox_square-orange.checked { + background-position: -48px 0; + } + .icheckbox_square-orange.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-orange.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-orange { + background-position: -120px 0; +} + .iradio_square-orange.hover { + background-position: -144px 0; + } + .iradio_square-orange.checked { + background-position: -168px 0; + } + .iradio_square-orange.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-orange.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-orange, + .iradio_square-orange { + background-image: url(orange@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/orange.png b/public/assets/css/iCheck/square/orange.png new file mode 100755 index 00000000..84608500 Binary files /dev/null and b/public/assets/css/iCheck/square/orange.png differ diff --git a/public/assets/css/iCheck/square/orange@2x.png b/public/assets/css/iCheck/square/orange@2x.png new file mode 100755 index 00000000..b1f23197 Binary files /dev/null and b/public/assets/css/iCheck/square/orange@2x.png differ diff --git a/public/assets/css/iCheck/square/pink.css b/public/assets/css/iCheck/square/pink.css new file mode 100755 index 00000000..6b706f6d --- /dev/null +++ b/public/assets/css/iCheck/square/pink.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, pink +----------------------------------- */ +.icheckbox_square-pink, +.iradio_square-pink { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(pink.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-pink { + background-position: 0 0; +} + .icheckbox_square-pink.hover { + background-position: -24px 0; + } + .icheckbox_square-pink.checked { + background-position: -48px 0; + } + .icheckbox_square-pink.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-pink.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-pink { + background-position: -120px 0; +} + .iradio_square-pink.hover { + background-position: -144px 0; + } + .iradio_square-pink.checked { + background-position: -168px 0; + } + .iradio_square-pink.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-pink.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-pink, + .iradio_square-pink { + background-image: url(pink@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/pink.png b/public/assets/css/iCheck/square/pink.png new file mode 100755 index 00000000..9c8b4e2b Binary files /dev/null and b/public/assets/css/iCheck/square/pink.png differ diff --git a/public/assets/css/iCheck/square/pink@2x.png b/public/assets/css/iCheck/square/pink@2x.png new file mode 100755 index 00000000..b1f3a6ed Binary files /dev/null and b/public/assets/css/iCheck/square/pink@2x.png differ diff --git a/public/assets/css/iCheck/square/purple.css b/public/assets/css/iCheck/square/purple.css new file mode 100755 index 00000000..43051d3d --- /dev/null +++ b/public/assets/css/iCheck/square/purple.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, purple +----------------------------------- */ +.icheckbox_square-purple, +.iradio_square-purple { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(purple.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-purple { + background-position: 0 0; +} + .icheckbox_square-purple.hover { + background-position: -24px 0; + } + .icheckbox_square-purple.checked { + background-position: -48px 0; + } + .icheckbox_square-purple.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-purple.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-purple { + background-position: -120px 0; +} + .iradio_square-purple.hover { + background-position: -144px 0; + } + .iradio_square-purple.checked { + background-position: -168px 0; + } + .iradio_square-purple.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-purple.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-purple, + .iradio_square-purple { + background-image: url(purple@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/purple.png b/public/assets/css/iCheck/square/purple.png new file mode 100755 index 00000000..6bfc16a3 Binary files /dev/null and b/public/assets/css/iCheck/square/purple.png differ diff --git a/public/assets/css/iCheck/square/purple@2x.png b/public/assets/css/iCheck/square/purple@2x.png new file mode 100755 index 00000000..6d3c8b1a Binary files /dev/null and b/public/assets/css/iCheck/square/purple@2x.png differ diff --git a/public/assets/css/iCheck/square/red.css b/public/assets/css/iCheck/square/red.css new file mode 100755 index 00000000..40013c42 --- /dev/null +++ b/public/assets/css/iCheck/square/red.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, red +----------------------------------- */ +.icheckbox_square-red, +.iradio_square-red { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(red.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-red { + background-position: 0 0; +} + .icheckbox_square-red.hover { + background-position: -24px 0; + } + .icheckbox_square-red.checked { + background-position: -48px 0; + } + .icheckbox_square-red.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-red.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-red { + background-position: -120px 0; +} + .iradio_square-red.hover { + background-position: -144px 0; + } + .iradio_square-red.checked { + background-position: -168px 0; + } + .iradio_square-red.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-red.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-red, + .iradio_square-red { + background-image: url(red@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/red.png b/public/assets/css/iCheck/square/red.png new file mode 100755 index 00000000..749675a9 Binary files /dev/null and b/public/assets/css/iCheck/square/red.png differ diff --git a/public/assets/css/iCheck/square/red@2x.png b/public/assets/css/iCheck/square/red@2x.png new file mode 100755 index 00000000..c05700a5 Binary files /dev/null and b/public/assets/css/iCheck/square/red@2x.png differ diff --git a/public/assets/css/iCheck/square/square.css b/public/assets/css/iCheck/square/square.css new file mode 100755 index 00000000..b604fa84 --- /dev/null +++ b/public/assets/css/iCheck/square/square.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, black +----------------------------------- */ +.icheckbox_square, +.iradio_square { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(square.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square { + background-position: 0 0; +} + .icheckbox_square.hover { + background-position: -24px 0; + } + .icheckbox_square.checked { + background-position: -48px 0; + } + .icheckbox_square.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square.checked.disabled { + background-position: -96px 0; + } + +.iradio_square { + background-position: -120px 0; +} + .iradio_square.hover { + background-position: -144px 0; + } + .iradio_square.checked { + background-position: -168px 0; + } + .iradio_square.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square, + .iradio_square { + background-image: url(square@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/square.png b/public/assets/css/iCheck/square/square.png new file mode 100755 index 00000000..2a3c8811 Binary files /dev/null and b/public/assets/css/iCheck/square/square.png differ diff --git a/public/assets/css/iCheck/square/square@2x.png b/public/assets/css/iCheck/square/square@2x.png new file mode 100755 index 00000000..9b56c448 Binary files /dev/null and b/public/assets/css/iCheck/square/square@2x.png differ diff --git a/public/assets/css/iCheck/square/yellow.css b/public/assets/css/iCheck/square/yellow.css new file mode 100755 index 00000000..55113499 --- /dev/null +++ b/public/assets/css/iCheck/square/yellow.css @@ -0,0 +1,62 @@ +/* iCheck plugin Square skin, yellow +----------------------------------- */ +.icheckbox_square-yellow, +.iradio_square-yellow { + display: inline-block; + *display: inline; + vertical-align: middle; + margin: 0; + padding: 0; + width: 22px; + height: 22px; + background: url(yellow.png) no-repeat; + border: none; + cursor: pointer; +} + +.icheckbox_square-yellow { + background-position: 0 0; +} + .icheckbox_square-yellow.hover { + background-position: -24px 0; + } + .icheckbox_square-yellow.checked { + background-position: -48px 0; + } + .icheckbox_square-yellow.disabled { + background-position: -72px 0; + cursor: default; + } + .icheckbox_square-yellow.checked.disabled { + background-position: -96px 0; + } + +.iradio_square-yellow { + background-position: -120px 0; +} + .iradio_square-yellow.hover { + background-position: -144px 0; + } + .iradio_square-yellow.checked { + background-position: -168px 0; + } + .iradio_square-yellow.disabled { + background-position: -192px 0; + cursor: default; + } + .iradio_square-yellow.checked.disabled { + background-position: -216px 0; + } + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (min-device-pixel-ratio: 1.5) { + .icheckbox_square-yellow, + .iradio_square-yellow { + background-image: url(yellow@2x.png); + -webkit-background-size: 240px 24px; + background-size: 240px 24px; + } +} \ No newline at end of file diff --git a/public/assets/css/iCheck/square/yellow.png b/public/assets/css/iCheck/square/yellow.png new file mode 100755 index 00000000..b6c03309 Binary files /dev/null and b/public/assets/css/iCheck/square/yellow.png differ diff --git a/public/assets/css/iCheck/square/yellow@2x.png b/public/assets/css/iCheck/square/yellow@2x.png new file mode 100755 index 00000000..6b8e328e Binary files /dev/null and b/public/assets/css/iCheck/square/yellow@2x.png differ diff --git a/public/assets/css/images/animated-overlay.gif b/public/assets/css/images/animated-overlay.gif new file mode 100755 index 00000000..d441f75e Binary files /dev/null and b/public/assets/css/images/animated-overlay.gif differ diff --git a/public/assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png b/public/assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100755 index 00000000..c09235f6 Binary files /dev/null and b/public/assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/public/assets/css/images/ui-bg_flat_55_fbec88_40x100.png b/public/assets/css/images/ui-bg_flat_55_fbec88_40x100.png new file mode 100755 index 00000000..d48c482d Binary files /dev/null and b/public/assets/css/images/ui-bg_flat_55_fbec88_40x100.png differ diff --git a/public/assets/css/images/ui-bg_glass_75_d0e5f5_1x400.png b/public/assets/css/images/ui-bg_glass_75_d0e5f5_1x400.png new file mode 100755 index 00000000..c621bd68 Binary files /dev/null and b/public/assets/css/images/ui-bg_glass_75_d0e5f5_1x400.png differ diff --git a/public/assets/css/images/ui-bg_glass_85_dfeffc_1x400.png b/public/assets/css/images/ui-bg_glass_85_dfeffc_1x400.png new file mode 100755 index 00000000..f042e76a Binary files /dev/null and b/public/assets/css/images/ui-bg_glass_85_dfeffc_1x400.png differ diff --git a/public/assets/css/images/ui-bg_glass_95_fef1ec_1x400.png b/public/assets/css/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100755 index 00000000..398c56a9 Binary files /dev/null and b/public/assets/css/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/public/assets/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png b/public/assets/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png new file mode 100755 index 00000000..1025df02 Binary files /dev/null and b/public/assets/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png differ diff --git a/public/assets/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png b/public/assets/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png new file mode 100755 index 00000000..e29b0ca3 Binary files /dev/null and b/public/assets/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png differ diff --git a/public/assets/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png b/public/assets/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png new file mode 100755 index 00000000..5888e51e Binary files /dev/null and b/public/assets/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png differ diff --git a/public/assets/css/images/ui-icons_217bc0_256x240.png b/public/assets/css/images/ui-icons_217bc0_256x240.png new file mode 100755 index 00000000..8d2b7e57 Binary files /dev/null and b/public/assets/css/images/ui-icons_217bc0_256x240.png differ diff --git a/public/assets/css/images/ui-icons_2e83ff_256x240.png b/public/assets/css/images/ui-icons_2e83ff_256x240.png new file mode 100755 index 00000000..84b601bf Binary files /dev/null and b/public/assets/css/images/ui-icons_2e83ff_256x240.png differ diff --git a/public/assets/css/images/ui-icons_469bdd_256x240.png b/public/assets/css/images/ui-icons_469bdd_256x240.png new file mode 100755 index 00000000..5dff3f96 Binary files /dev/null and b/public/assets/css/images/ui-icons_469bdd_256x240.png differ diff --git a/public/assets/css/images/ui-icons_6da8d5_256x240.png b/public/assets/css/images/ui-icons_6da8d5_256x240.png new file mode 100755 index 00000000..f7809f85 Binary files /dev/null and b/public/assets/css/images/ui-icons_6da8d5_256x240.png differ diff --git a/public/assets/css/images/ui-icons_cd0a0a_256x240.png b/public/assets/css/images/ui-icons_cd0a0a_256x240.png new file mode 100755 index 00000000..ed5b6b09 Binary files /dev/null and b/public/assets/css/images/ui-icons_cd0a0a_256x240.png differ diff --git a/public/assets/css/images/ui-icons_d8e7f3_256x240.png b/public/assets/css/images/ui-icons_d8e7f3_256x240.png new file mode 100755 index 00000000..9b46228f Binary files /dev/null and b/public/assets/css/images/ui-icons_d8e7f3_256x240.png differ diff --git a/public/assets/css/images/ui-icons_f9bd01_256x240.png b/public/assets/css/images/ui-icons_f9bd01_256x240.png new file mode 100755 index 00000000..f1f0531a Binary files /dev/null and b/public/assets/css/images/ui-icons_f9bd01_256x240.png differ diff --git a/public/assets/css/ionslider/ion.rangeSlider.css b/public/assets/css/ionslider/ion.rangeSlider.css new file mode 100755 index 00000000..052d477e --- /dev/null +++ b/public/assets/css/ionslider/ion.rangeSlider.css @@ -0,0 +1,126 @@ +/* Ion.RangeSlider +// css version 1.8.5 +// by Denis Ineshin | ionden.com +// ===================================================================================================================*/ + +/* ===================================================================================================================== +// RangeSlider */ + +.irs { + position: relative; display: block; +} + .irs-line { + position: relative; display: block; + overflow: hidden; + } + .irs-line-left, .irs-line-mid, .irs-line-right { + position: absolute; display: block; + top: 0; + } + .irs-line-left { + left: 0; width: 10%; + } + .irs-line-mid { + left: 10%; width: 80%; + } + .irs-line-right { + right: 0; width: 10%; + } + + .irs-diapason { + position: absolute; display: block; + left: 0; width: 100%; + } + .irs-slider { + position: absolute; display: block; + cursor: default; + z-index: 1; + } + .irs-slider.single { + left: 10px; + } + .irs-slider.single:before { + position: absolute; display: block; content: ""; + top: -30%; left: -30%; + width: 160%; height: 160%; + background: rgba(0,0,0,0.0); + } + .irs-slider.from { + left: 100px; + } + .irs-slider.from:before { + position: absolute; display: block; content: ""; + top: -30%; left: -30%; + width: 130%; height: 160%; + background: rgba(0,0,0,0.0); + } + .irs-slider.to { + left: 300px; + } + .irs-slider.to:before { + position: absolute; display: block; content: ""; + top: -30%; left: 0; + width: 130%; height: 160%; + background: rgba(0,0,0,0.0); + } + .irs-slider.last { + z-index: 2; + } + + .irs-min { + position: absolute; display: block; + left: 0; + cursor: default; + } + .irs-max { + position: absolute; display: block; + right: 0; + cursor: default; + } + + .irs-from, .irs-to, .irs-single { + position: absolute; display: block; + top: 0; left: 0; + cursor: default; + white-space: nowrap; + } + + +.irs-grid { + position: absolute; display: none; + bottom: 0; left: 0; + width: 100%; height: 20px; +} +.irs-with-grid .irs-grid { + display: block; +} + .irs-grid-pol { + position: absolute; + top: 0; left: 0; + width: 1px; height: 8px; + background: #000; + } + .irs-grid-pol.small { + height: 4px; + } + .irs-grid-text { + position: absolute; + bottom: 0; left: 0; + width: 100px; + white-space: nowrap; + text-align: center; + font-size: 9px; line-height: 9px; + color: #000; + } + +.irs-disable-mask { + position: absolute; display: block; + top: 0; left: 0; + width: 100%; height: 100%; + cursor: default; + background: rgba(0,0,0,0.0); + z-index: 2; +} +.irs-disabled { + opacity: 0.4; +} \ No newline at end of file diff --git a/public/assets/css/ionslider/ion.rangeSlider.skinFlat.css b/public/assets/css/ionslider/ion.rangeSlider.skinFlat.css new file mode 100755 index 00000000..8618e1bc --- /dev/null +++ b/public/assets/css/ionslider/ion.rangeSlider.skinFlat.css @@ -0,0 +1,89 @@ +/* Ion.RangeSlider, Flat UI Skin +// css version 1.8.5 +// by Denis Ineshin | ionden.com +// ===================================================================================================================*/ + +/* ===================================================================================================================== +// Skin details */ + +.irs-line-mid, +.irs-line-left, +.irs-line-right, +.irs-diapason, +.irs-slider { + background: url(../../img/sprite-skin-flat.png) repeat-x; +} + +.irs { + height: 40px; +} +.irs-with-grid { + height: 60px; +} +.irs-line { + height: 12px; top: 25px; +} + .irs-line-left { + height: 12px; + background-position: 0 -30px; + } + .irs-line-mid { + height: 12px; + background-position: 0 0; + } + .irs-line-right { + height: 12px; + background-position: 100% -30px; + } + +.irs-diapason { + height: 12px; top: 25px; + background-position: 0 -60px; +} + +.irs-slider { + width: 16px; height: 18px; + top: 22px; + background-position: 0 -90px; +} +#irs-active-slider, .irs-slider:hover { + background-position: 0 -120px; +} + +.irs-min, .irs-max { + color: #999; + font-size: 10px; line-height: 1.333; + text-shadow: none; + top: 0; padding: 1px 3px; + background: #e1e4e9; + border-radius: 4px; +} + +.irs-from, .irs-to, .irs-single { + color: #fff; + font-size: 10px; line-height: 1.333; + text-shadow: none; + padding: 1px 5px; + background: #ed5565; + border-radius: 4px; +} +.irs-from:after, .irs-to:after, .irs-single:after { + position: absolute; display: block; content: ""; + bottom: -6px; left: 50%; + width: 0; height: 0; + margin-left: -3px; + overflow: hidden; + border: 3px solid transparent; + border-top-color: #ed5565; +} + + +.irs-grid-pol { + background: #e1e4e9; +} +.irs-grid-text { + color: #999; +} + +.irs-disabled { +} \ No newline at end of file diff --git a/public/assets/css/ionslider/ion.rangeSlider.skinNice.css b/public/assets/css/ionslider/ion.rangeSlider.skinNice.css new file mode 100755 index 00000000..51063a75 --- /dev/null +++ b/public/assets/css/ionslider/ion.rangeSlider.skinNice.css @@ -0,0 +1,85 @@ +/* Ion.RangeSlider, Nice Skin +// css version 1.8.5 +// by Denis Ineshin | ionden.com +// ===================================================================================================================*/ + +/* ===================================================================================================================== +// Skin details */ + +.irs-line-mid, +.irs-line-left, +.irs-line-right, +.irs-diapason, +.irs-slider { + background: url(../../img/sprite-skin-nice.png) repeat-x; +} + +.irs { + height: 40px; +} +.irs-with-grid { + height: 60px; +} +.irs-line { + height: 8px; top: 25px; +} + .irs-line-left { + height: 8px; + background-position: 0 -30px; + } + .irs-line-mid { + height: 8px; + background-position: 0 0; + } + .irs-line-right { + height: 8px; + background-position: 100% -30px; + } + +.irs-diapason { + height: 8px; top: 25px; + background-position: 0 -60px; +} + +.irs-slider { + width: 22px; height: 22px; + top: 17px; + background-position: 0 -90px; +} +#irs-active-slider, .irs-slider:hover { + background-position: 0 -120px; +} + +.irs-min, .irs-max { + color: #999; + font-size: 10px; line-height: 1.333; + text-shadow: none; + top: 0; padding: 1px 3px; + background: rgba(0,0,0,0.1); + border-radius: 3px; +} +.lt-ie9 .irs-min, .lt-ie9 .irs-max { + background: #ccc; +} + +.irs-from, .irs-to, .irs-single { + color: #fff; + font-size: 10px; line-height: 1.333; + text-shadow: none; + padding: 1px 5px; + background: rgba(0,0,0,0.3); + border-radius: 3px; +} +.lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single { + background: #999; +} + +.irs-grid-pol { + background: #99a4ac; +} +.irs-grid-text { + color: #99a4ac; +} + +.irs-disabled { +} \ No newline at end of file diff --git a/public/assets/css/jvectormap/jquery-jvectormap-1.2.2.css b/public/assets/css/jvectormap/jquery-jvectormap-1.2.2.css new file mode 100755 index 00000000..5178c188 --- /dev/null +++ b/public/assets/css/jvectormap/jquery-jvectormap-1.2.2.css @@ -0,0 +1,36 @@ +.jvectormap-label { + position: absolute; + display: none; + border: solid 1px #CDCDCD; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + background: #292929; + color: white; + font-size: 10px!important; + padding: 3px; + z-index: 9999; +} + +.jvectormap-zoomin, .jvectormap-zoomout { + position: absolute; + left: 10px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + background: #292929; + padding: 5px; + color: white; + cursor: pointer; + line-height: 10px; + text-align: center; + font-weight: bold; +} + +.jvectormap-zoomin { + top: 10px; +} + +.jvectormap-zoomout { + top: 35px; +} \ No newline at end of file diff --git a/public/assets/css/morris/morris.css b/public/assets/css/morris/morris.css new file mode 100755 index 00000000..ed0b490c --- /dev/null +++ b/public/assets/css/morris/morris.css @@ -0,0 +1,2 @@ +.morris-hover{position:absolute;z-index:1090;}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#f9f9f9;background:rgba(0, 0, 0, 0.8);border:solid 2px rgba(0, 0, 0, 0.9);font-weight: 600;font-size:14px;text-align:center;}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0;} +.morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0;} diff --git a/public/assets/css/phpci.css b/public/assets/css/phpci.css index faff0ad0..06aa9163 100644 --- a/public/assets/css/phpci.css +++ b/public/assets/css/phpci.css @@ -44,31 +44,7 @@ h1 { } -.build-info-panel { -} - - .build-info-panel h1.panel-title { - border: 0; - font-size: 2em; - font-weight: bold; - padding: 0; - } - - .build-info-panel h1.panel-title span { - font-weight: normal; - } - - .build-info-panel img { - border: 1px solid #fff; - border-radius: 50%; - box-shadow: 2px 2px 2px rgba(0,0,0,0.1); - margin: 7px 15px 15px 7px; - } - - .build-info-panel #build-info { - margin-left: 90px; - } #loading { background: #246; diff --git a/public/assets/css/timepicker/bootstrap-timepicker.css b/public/assets/css/timepicker/bootstrap-timepicker.css new file mode 100755 index 00000000..873e0c72 --- /dev/null +++ b/public/assets/css/timepicker/bootstrap-timepicker.css @@ -0,0 +1,121 @@ +/*! + * Timepicker Component for Twitter Bootstrap + * + * Copyright 2013 Joris de Wit + * + * Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +.bootstrap-timepicker { + position: relative; +} +.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu { + left: auto; + right: 0; +} +.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:before { + left: auto; + right: 12px; +} +.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:after { + left: auto; + right: 13px; +} +.bootstrap-timepicker .add-on { + cursor: pointer; +} +.bootstrap-timepicker .add-on i { + display: inline-block; + width: 16px; + height: 16px; +} +.bootstrap-timepicker-widget.dropdown-menu { + padding: 2px 3px 2px 2px; +} +.bootstrap-timepicker-widget.dropdown-menu.open { + display: inline-block; +} +.bootstrap-timepicker-widget.dropdown-menu:before { + border-bottom: 7px solid rgba(0, 0, 0, 0.2); + border-left: 7px solid transparent; + border-right: 7px solid transparent; + content: ""; + display: inline-block; + left: 9px; + position: absolute; + top: -7px; +} +.bootstrap-timepicker-widget.dropdown-menu:after { + border-bottom: 6px solid #FFFFFF; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + content: ""; + display: inline-block; + left: 10px; + position: absolute; + top: -6px; +} +.bootstrap-timepicker-widget a.btn, +.bootstrap-timepicker-widget input { + border-radius: 4px; +} +.bootstrap-timepicker-widget table { + width: 100%; + margin: 0; +} +.bootstrap-timepicker-widget table td { + text-align: center; + height: 30px; + margin: 0; + padding: 2px; +} +.bootstrap-timepicker-widget table td:not(.separator) { + min-width: 30px; +} +.bootstrap-timepicker-widget table td span { + width: 100%; +} +.bootstrap-timepicker-widget table td a { + border: 1px transparent solid; + width: 100%; + display: inline-block; + margin: 0; + padding: 8px 0; + outline: 0; + color: #333; +} +.bootstrap-timepicker-widget table td a:hover { + text-decoration: none; + background-color: #eee; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + border-color: #ddd; +} +.bootstrap-timepicker-widget table td a i { + margin-top: 2px; +} +.bootstrap-timepicker-widget table td input { + width: 25px; + margin: 0; + text-align: center; +} +.bootstrap-timepicker-widget .modal-content { + padding: 4px; +} +@media (min-width: 767px) { + .bootstrap-timepicker-widget.modal { + width: 200px; + margin-left: -100px; + } +} +@media (max-width: 767px) { + .bootstrap-timepicker { + width: 100%; + } + .bootstrap-timepicker .dropdown-menu { + width: 100%; + } +} diff --git a/public/assets/css/timepicker/bootstrap-timepicker.min.css b/public/assets/css/timepicker/bootstrap-timepicker.min.css new file mode 100755 index 00000000..b59d6f76 --- /dev/null +++ b/public/assets/css/timepicker/bootstrap-timepicker.min.css @@ -0,0 +1,10 @@ +/*! + * Timepicker Component for Twitter Bootstrap + * + * Copyright 2013 Joris de Wit + * + * Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */.bootstrap-timepicker{position:relative}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu{left:auto;right:0}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:before{left:auto;right:12px}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:after{left:auto;right:13px}.bootstrap-timepicker .add-on{cursor:pointer}.bootstrap-timepicker .add-on i{display:inline-block;width:16px;height:16px}.bootstrap-timepicker-widget.dropdown-menu{padding:2px 3px 2px 2px}.bootstrap-timepicker-widget.dropdown-menu.open{display:inline-block}.bootstrap-timepicker-widget.dropdown-menu:before{border-bottom:7px solid rgba(0,0,0,0.2);border-left:7px solid transparent;border-right:7px solid transparent;content:"";display:inline-block;left:9px;position:absolute;top:-7px}.bootstrap-timepicker-widget.dropdown-menu:after{border-bottom:6px solid #fff;border-left:6px solid transparent;border-right:6px solid transparent;content:"";display:inline-block;left:10px;position:absolute;top:-6px}.bootstrap-timepicker-widget a.btn,.bootstrap-timepicker-widget input{border-radius:4px}.bootstrap-timepicker-widget table{width:100%;margin:0}.bootstrap-timepicker-widget table td{text-align:center;height:30px;margin:0;padding:2px}.bootstrap-timepicker-widget table td:not(.separator){min-width:30px}.bootstrap-timepicker-widget table td span{width:100%}.bootstrap-timepicker-widget table td a{border:1px transparent solid;width:100%;display:inline-block;margin:0;padding:8px 0;outline:0;color:#333}.bootstrap-timepicker-widget table td a:hover{text-decoration:none;background-color:#eee;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border-color:#ddd}.bootstrap-timepicker-widget table td a i{margin-top:2px}.bootstrap-timepicker-widget table td input{width:25px;margin:0;text-align:center}.bootstrap-timepicker-widget .modal-content{padding:4px}@media(min-width:767px){.bootstrap-timepicker-widget.modal{width:200px;margin-left:-100px}}@media(max-width:767px){.bootstrap-timepicker{width:100%}.bootstrap-timepicker .dropdown-menu{width:100%}} \ No newline at end of file diff --git a/public/assets/fonts/glyphicons-halflings-regular.eot b/public/assets/fonts/glyphicons-halflings-regular.eot index 4a4ca865..423bd5d3 100755 Binary files a/public/assets/fonts/glyphicons-halflings-regular.eot and b/public/assets/fonts/glyphicons-halflings-regular.eot differ diff --git a/public/assets/fonts/glyphicons-halflings-regular.svg b/public/assets/fonts/glyphicons-halflings-regular.svg index e3e2dc73..44694887 100755 --- a/public/assets/fonts/glyphicons-halflings-regular.svg +++ b/public/assets/fonts/glyphicons-halflings-regular.svg @@ -28,12 +28,12 @@ - - + + - + @@ -46,7 +46,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -71,14 +71,14 @@ - - + + - + @@ -93,10 +93,10 @@ - + - + @@ -110,13 +110,13 @@ - - - + + + - - - + + + @@ -127,14 +127,14 @@ - - + + - - + + @@ -148,33 +148,33 @@ - - + + - - + + - - - - - - - - + + + + + + + + - - - - + + + + - - + + @@ -187,15 +187,15 @@ - + - - + + @@ -204,11 +204,11 @@ - + - - + + @@ -221,9 +221,9 @@ - - + + - + \ No newline at end of file diff --git a/public/assets/fonts/glyphicons-halflings-regular.ttf b/public/assets/fonts/glyphicons-halflings-regular.ttf index 67fa00bf..a498ef4e 100755 Binary files a/public/assets/fonts/glyphicons-halflings-regular.ttf and b/public/assets/fonts/glyphicons-halflings-regular.ttf differ diff --git a/public/assets/fonts/glyphicons-halflings-regular.woff b/public/assets/fonts/glyphicons-halflings-regular.woff index 8c54182a..d83c539b 100755 Binary files a/public/assets/fonts/glyphicons-halflings-regular.woff and b/public/assets/fonts/glyphicons-halflings-regular.woff differ diff --git a/public/assets/img/ajax-loader.gif b/public/assets/img/ajax-loader.gif new file mode 100755 index 00000000..b8d06f66 Binary files /dev/null and b/public/assets/img/ajax-loader.gif differ diff --git a/public/assets/img/ajax-loader1.gif b/public/assets/img/ajax-loader1.gif new file mode 100755 index 00000000..cc70a7a8 Binary files /dev/null and b/public/assets/img/ajax-loader1.gif differ diff --git a/public/assets/img/avatar.png b/public/assets/img/avatar.png new file mode 100755 index 00000000..0ef6233d Binary files /dev/null and b/public/assets/img/avatar.png differ diff --git a/public/assets/img/avatar04.png b/public/assets/img/avatar04.png new file mode 100755 index 00000000..63fa709b Binary files /dev/null and b/public/assets/img/avatar04.png differ diff --git a/public/assets/img/avatar2.png b/public/assets/img/avatar2.png new file mode 100755 index 00000000..5330c223 Binary files /dev/null and b/public/assets/img/avatar2.png differ diff --git a/public/assets/img/avatar3.png b/public/assets/img/avatar3.png new file mode 100755 index 00000000..b1afb21b Binary files /dev/null and b/public/assets/img/avatar3.png differ diff --git a/public/assets/img/avatar5.png b/public/assets/img/avatar5.png new file mode 100755 index 00000000..29ce6343 Binary files /dev/null and b/public/assets/img/avatar5.png differ diff --git a/public/assets/img/blur-background04.jpg b/public/assets/img/blur-background04.jpg new file mode 100755 index 00000000..c2ad9ea1 Binary files /dev/null and b/public/assets/img/blur-background04.jpg differ diff --git a/public/assets/img/blur-background08.jpg b/public/assets/img/blur-background08.jpg new file mode 100755 index 00000000..de91f6cc Binary files /dev/null and b/public/assets/img/blur-background08.jpg differ diff --git a/public/assets/img/blur-background09.jpg b/public/assets/img/blur-background09.jpg new file mode 100755 index 00000000..0da84072 Binary files /dev/null and b/public/assets/img/blur-background09.jpg differ diff --git a/public/assets/img/bootstrap-colorpicker/alpha-horizontal.png b/public/assets/img/bootstrap-colorpicker/alpha-horizontal.png new file mode 100755 index 00000000..d0a65c08 Binary files /dev/null and b/public/assets/img/bootstrap-colorpicker/alpha-horizontal.png differ diff --git a/public/assets/img/bootstrap-colorpicker/alpha.png b/public/assets/img/bootstrap-colorpicker/alpha.png new file mode 100755 index 00000000..38043f1c Binary files /dev/null and b/public/assets/img/bootstrap-colorpicker/alpha.png differ diff --git a/public/assets/img/bootstrap-colorpicker/hue-horizontal.png b/public/assets/img/bootstrap-colorpicker/hue-horizontal.png new file mode 100755 index 00000000..a0d9add8 Binary files /dev/null and b/public/assets/img/bootstrap-colorpicker/hue-horizontal.png differ diff --git a/public/assets/img/bootstrap-colorpicker/hue.png b/public/assets/img/bootstrap-colorpicker/hue.png new file mode 100755 index 00000000..d89560e9 Binary files /dev/null and b/public/assets/img/bootstrap-colorpicker/hue.png differ diff --git a/public/assets/img/bootstrap-colorpicker/saturation.png b/public/assets/img/bootstrap-colorpicker/saturation.png new file mode 100755 index 00000000..594ae50e Binary files /dev/null and b/public/assets/img/bootstrap-colorpicker/saturation.png differ diff --git a/public/assets/img/credit/american-express.png b/public/assets/img/credit/american-express.png new file mode 100755 index 00000000..fbe9ce2c Binary files /dev/null and b/public/assets/img/credit/american-express.png differ diff --git a/public/assets/img/credit/cirrus.png b/public/assets/img/credit/cirrus.png new file mode 100755 index 00000000..03d2bd6a Binary files /dev/null and b/public/assets/img/credit/cirrus.png differ diff --git a/public/assets/img/credit/mastercard.png b/public/assets/img/credit/mastercard.png new file mode 100755 index 00000000..f709adba Binary files /dev/null and b/public/assets/img/credit/mastercard.png differ diff --git a/public/assets/img/credit/mestro.png b/public/assets/img/credit/mestro.png new file mode 100755 index 00000000..c22ddeaf Binary files /dev/null and b/public/assets/img/credit/mestro.png differ diff --git a/public/assets/img/credit/paypal.png b/public/assets/img/credit/paypal.png new file mode 100755 index 00000000..a7e1458f Binary files /dev/null and b/public/assets/img/credit/paypal.png differ diff --git a/public/assets/img/credit/paypal2.png b/public/assets/img/credit/paypal2.png new file mode 100755 index 00000000..b0ca241b Binary files /dev/null and b/public/assets/img/credit/paypal2.png differ diff --git a/public/assets/img/credit/visa.png b/public/assets/img/credit/visa.png new file mode 100755 index 00000000..7099cdf4 Binary files /dev/null and b/public/assets/img/credit/visa.png differ diff --git a/public/assets/img/icons.png b/public/assets/img/icons.png new file mode 100755 index 00000000..1663a0bd Binary files /dev/null and b/public/assets/img/icons.png differ diff --git a/public/assets/img/sprite-skin-flat.png b/public/assets/img/sprite-skin-flat.png new file mode 100755 index 00000000..3055db77 Binary files /dev/null and b/public/assets/img/sprite-skin-flat.png differ diff --git a/public/assets/img/sprite-skin-nice.png b/public/assets/img/sprite-skin-nice.png new file mode 100755 index 00000000..d62f8188 Binary files /dev/null and b/public/assets/img/sprite-skin-nice.png differ diff --git a/public/assets/img/user-bg.png b/public/assets/img/user-bg.png new file mode 100755 index 00000000..75e1b46c Binary files /dev/null and b/public/assets/img/user-bg.png differ diff --git a/public/assets/img/user.jpg b/public/assets/img/user.jpg new file mode 100755 index 00000000..b4f104f2 Binary files /dev/null and b/public/assets/img/user.jpg differ diff --git a/public/assets/img/user2.jpg b/public/assets/img/user2.jpg new file mode 100755 index 00000000..cb2d3639 Binary files /dev/null and b/public/assets/img/user2.jpg differ diff --git a/public/assets/js/AdminLTE/app.js b/public/assets/js/AdminLTE/app.js new file mode 100755 index 00000000..a2154e7e --- /dev/null +++ b/public/assets/js/AdminLTE/app.js @@ -0,0 +1,1054 @@ +/*! + * Author: Abdullah A Almsaeed + * Date: 4 Jan 2014 + * Description: + * This file should be included in all pages + !**/ + +/* + * Global variables. If you change any of these vars, don't forget + * to change the values in the less files! + */ +var left_side_width = 220; //Sidebar width in pixels + +$(function() { + "use strict"; + + //Enable sidebar toggle + $("[data-toggle='offcanvas']").click(function(e) { + e.preventDefault(); + + //If window is small enough, enable sidebar push menu + if ($(window).width() <= 992) { + $('.row-offcanvas').toggleClass('active'); + $('.left-side').removeClass("collapse-left"); + $(".right-side").removeClass("strech"); + $('.row-offcanvas').toggleClass("relative"); + } else { + //Else, enable content streching + $('.left-side').toggleClass("collapse-left"); + $(".right-side").toggleClass("strech"); + } + }); + + //Add hover support for touch devices + $('.btn').bind('touchstart', function() { + $(this).addClass('hover'); + }).bind('touchend', function() { + $(this).removeClass('hover'); + }); + + //Activate tooltips + $("[data-toggle='tooltip']").tooltip(); + + /* + * Add collapse and remove events to boxes + */ + $("[data-widget='collapse']").click(function() { + //Find the box parent + var box = $(this).parents(".box").first(); + //Find the body and the footer + var bf = box.find(".box-body, .box-footer"); + if (!box.hasClass("collapsed-box")) { + box.addClass("collapsed-box"); + //Convert minus into plus + $(this).children(".fa-minus").removeClass("fa-minus").addClass("fa-plus"); + bf.slideUp(); + } else { + box.removeClass("collapsed-box"); + //Convert plus into minus + $(this).children(".fa-plus").removeClass("fa-plus").addClass("fa-minus"); + bf.slideDown(); + } + }); + + /* + * ADD SLIMSCROLL TO THE TOP NAV DROPDOWNS + * --------------------------------------- + */ + $(".navbar .menu").slimscroll({ + height: "200px", + alwaysVisible: false, + size: "3px" + }).css("width", "100%"); + + /* + * INITIALIZE BUTTON TOGGLE + * ------------------------ + */ + $('.btn-group[data-toggle="btn-toggle"]').each(function() { + var group = $(this); + $(this).find(".btn").click(function(e) { + group.find(".btn.active").removeClass("active"); + $(this).addClass("active"); + e.preventDefault(); + }); + + }); + + $("[data-widget='remove']").click(function() { + //Find the box parent + var box = $(this).parents(".box").first(); + box.slideUp(); + }); + + /* Sidebar tree view */ + $(".sidebar .treeview").tree(); + + /* + * Make sure that the sidebar is streched full height + * --------------------------------------------- + * We are gonna assign a min-height value every time the + * wrapper gets resized and upon page load. We will use + * Ben Alman's method for detecting the resize event. + * + **/ + function _fix() { + //Get window height and the wrapper height + var height = $(window).height() - $("body > .header").height() - ($("body > .footer").outerHeight() || 0); + $(".wrapper").css("min-height", height + "px"); + var content = $(".wrapper").height(); + //If the wrapper height is greater than the window + if (content > height) + //then set sidebar height to the wrapper + $(".left-side, html, body").css("min-height", content + "px"); + else { + //Otherwise, set the sidebar to the height of the window + $(".left-side, html, body").css("min-height", height + "px"); + } + } + //Fire upon load + _fix(); + //Fire when wrapper is resized + $(".wrapper").resize(function() { + _fix(); + fix_sidebar(); + }); + + //Fix the fixed layout sidebar scroll bug + fix_sidebar(); + + /* + * We are gonna initialize all checkbox and radio inputs to + * iCheck plugin in. + * You can find the documentation at http://fronteed.com/iCheck/ + */ + $("input[type='checkbox']:not(.simple), input[type='radio']:not(.simple)").iCheck({ + checkboxClass: 'icheckbox_minimal', + radioClass: 'iradio_minimal' + }); + +}); +function fix_sidebar() { + //Make sure the body tag has the .fixed class + if (!$("body").hasClass("fixed")) { + return; + } + + //Add slimscroll + $(".sidebar").slimscroll({ + height: ($(window).height() - $(".header").height()) + "px", + color: "rgba(0,0,0,0.2)" + }); +} + +/*END DEMO*/ +$(window).load(function() { + /*! pace 0.4.17 */ + (function() { + var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V = [].slice, W = {}.hasOwnProperty, X = function(a, b) { + function c() { + this.constructor = a + } + for (var d in b) + W.call(b, d) && (a[d] = b[d]); + return c.prototype = b.prototype, a.prototype = new c, a.__super__ = b.prototype, a + }, Y = [].indexOf || function(a) { + for (var b = 0, c = this.length; c > b; b++) + if (b in this && this[b] === a) + return b; + return-1 + }; + for (t = {catchupTime:500, initialRate:.03, minTime:500, ghostTime:500, maxProgressPerFrame:10, easeFactor:1.25, startOnPageLoad:!0, restartOnPushState:!0, restartOnRequestAfter:500, target:"body", elements:{checkInterval:100, selectors:["body"]}, eventLag:{minSamples:10, sampleCount:3, lagThreshold:3}, ajax:{trackMethods:["GET"], trackWebSockets:!1}}, B = function() { + var a; + return null != (a = "undefined" != typeof performance && null !== performance ? "function" == typeof performance.now ? performance.now() : void 0 : void 0) ? a : +new Date + }, D = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame, s = window.cancelAnimationFrame || window.mozCancelAnimationFrame, null == D && (D = function(a) { + return setTimeout(a, 50) + }, s = function(a) { + return clearTimeout(a) + }), F = function(a) { + var b, c; + return b = B(), (c = function() { + var d; + return d = B() - b, d >= 33 ? (b = B(), a(d, function() { + return D(c) + })) : setTimeout(c, 33 - d) + })() + }, E = function() { + var a, b, c; + return c = arguments[0], b = arguments[1], a = 3 <= arguments.length ? V.call(arguments, 2) : [], "function" == typeof c[b] ? c[b].apply(c, a) : c[b] + }, u = function() { + var a, b, c, d, e, f, g; + for (b = arguments[0], d = 2 <= arguments.length?V.call(arguments, 1):[], f = 0, g = d.length; g > f; f++) + if (c = d[f]) + for (a in c) + W.call(c, a) && (e = c[a], null != b[a] && "object" == typeof b[a] && null != e && "object" == typeof e ? u(b[a], e) : b[a] = e); + return b + }, p = function(a) { + var b, c, d, e, f; + for (c = b = 0, e = 0, f = a.length; f > e; e++) + d = a[e], c += Math.abs(d), b++; + return c / b + }, w = function(a, b) { + var c, d, e; + if (null == a && (a = "options"), null == b && (b = !0), e = document.querySelector("[data-pace-" + a + "]")) { + if (c = e.getAttribute("data-pace-" + a), !b) + return c; + try { + return JSON.parse(c) + } catch (f) { + return d = f, "undefined" != typeof console && null !== console ? console.error("Error parsing inline pace options", d) : void 0 + } + } + }, g = function() { + function a() { + } + return a.prototype.on = function(a, b, c, d) { + var e; + return null == d && (d = !1), null == this.bindings && (this.bindings = {}), null == (e = this.bindings)[a] && (e[a] = []), this.bindings[a].push({handler: b, ctx: c, once: d}) + }, a.prototype.once = function(a, b, c) { + return this.on(a, b, c, !0) + }, a.prototype.off = function(a, b) { + var c, d, e; + if (null != (null != (d = this.bindings) ? d[a] : void 0)) { + if (null == b) + return delete this.bindings[a]; + for (c = 0, e = []; c < this.bindings[a].length; ) + this.bindings[a][c].handler === b ? e.push(this.bindings[a].splice(c, 1)) : e.push(c++); + return e + } + }, a.prototype.trigger = function() { + var a, b, c, d, e, f, g, h, i; + if (c = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], null != (g = this.bindings) ? g[c] : void 0) { + for (e = 0, i = []; e < this.bindings[c].length; ) + h = this.bindings[c][e], d = h.handler, b = h.ctx, f = h.once, d.apply(null != b ? b : this, a), f ? i.push(this.bindings[c].splice(e, 1)) : i.push(e++); + return i + } + }, a + }(), null == window.Pace && (window.Pace = {}), u(Pace, g.prototype), C = Pace.options = u({}, t, window.paceOptions, w()), S = ["ajax", "document", "eventLag", "elements"], O = 0, Q = S.length; Q > O; O++) + I = S[O], C[I] === !0 && (C[I] = t[I]); + i = function(a) { + function b() { + return T = b.__super__.constructor.apply(this, arguments) + } + return X(b, a), b + }(Error), b = function() { + function a() { + this.progress = 0 + } + return a.prototype.getElement = function() { + var a; + if (null == this.el) { + if (a = document.querySelector(C.target), !a) + throw new i; + this.el = document.createElement("div"), this.el.className = "pace pace-active", document.body.className = document.body.className.replace("pace-done", ""), document.body.className += " pace-running", this.el.innerHTML = '
      \n
      \n
      \n
      ', null != a.firstChild ? a.insertBefore(this.el, a.firstChild) : a.appendChild(this.el) + } + return this.el + }, a.prototype.finish = function() { + var a; + return a = this.getElement(), a.className = a.className.replace("pace-active", ""), a.className += " pace-inactive", document.body.className = document.body.className.replace("pace-running", ""), document.body.className += " pace-done" + }, a.prototype.update = function(a) { + return this.progress = a, this.render() + }, a.prototype.destroy = function() { + try { + this.getElement().parentNode.removeChild(this.getElement()) + } catch (a) { + i = a + } + return this.el = void 0 + }, a.prototype.render = function() { + var a, b; + return null == document.querySelector(C.target) ? !1 : (a = this.getElement(), a.children[0].style.width = "" + this.progress + "%", (!this.lastRenderedProgress || this.lastRenderedProgress | 0 !== this.progress | 0) && (a.children[0].setAttribute("data-progress-text", "" + (0 | this.progress) + "%"), this.progress >= 100 ? b = "99" : (b = this.progress < 10 ? "0" : "", b += 0 | this.progress), a.children[0].setAttribute("data-progress", "" + b)), this.lastRenderedProgress = this.progress) + }, a.prototype.done = function() { + return this.progress >= 100 + }, a + }(), h = function() { + function a() { + this.bindings = {} + } + return a.prototype.trigger = function(a, b) { + var c, d, e, f, g; + if (null != this.bindings[a]) { + for (f = this.bindings[a], g = [], d = 0, e = f.length; e > d; d++) + c = f[d], g.push(c.call(this, b)); + return g + } + }, a.prototype.on = function(a, b) { + var c; + return null == (c = this.bindings)[a] && (c[a] = []), this.bindings[a].push(b) + }, a + }(), N = window.XMLHttpRequest, M = window.XDomainRequest, L = window.WebSocket, v = function(a, b) { + var c, d, e, f; + f = []; + for (d in b.prototype) + try { + e = b.prototype[d], null == a[d] && "function" != typeof e ? f.push(a[d] = e) : f.push(void 0) + } catch (g) { + c = g + } + return f + }, z = [], Pace.ignore = function() { + var a, b, c; + return b = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], z.unshift("ignore"), c = b.apply(null, a), z.shift(), c + }, Pace.track = function() { + var a, b, c; + return b = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], z.unshift("track"), c = b.apply(null, a), z.shift(), c + }, H = function(a) { + var b; + if (null == a && (a = "GET"), "track" === z[0]) + return"force"; + if (!z.length && C.ajax) { + if ("socket" === a && C.ajax.trackWebSockets) + return!0; + if (b = a.toUpperCase(), Y.call(C.ajax.trackMethods, b) >= 0) + return!0 + } + return!1 + }, j = function(a) { + function b() { + var a, c = this; + b.__super__.constructor.apply(this, arguments), a = function(a) { + var b; + return b = a.open, a.open = function(d, e) { + return H(d) && c.trigger("request", {type: d, url: e, request: a}), b.apply(a, arguments) + } + }, window.XMLHttpRequest = function(b) { + var c; + return c = new N(b), a(c), c + }, v(window.XMLHttpRequest, N), null != M && (window.XDomainRequest = function() { + var b; + return b = new M, a(b), b + }, v(window.XDomainRequest, M)), null != L && C.ajax.trackWebSockets && (window.WebSocket = function(a, b) { + var d; + return d = new L(a, b), H("socket") && c.trigger("request", {type: "socket", url: a, protocols: b, request: d}), d + }, v(window.WebSocket, L)) + } + return X(b, a), b + }(h), P = null, x = function() { + return null == P && (P = new j), P + }, x().on("request", function(b) { + var c, d, e, f; + return f = b.type, e = b.request, Pace.running || C.restartOnRequestAfter === !1 && "force" !== H(f) ? void 0 : (d = arguments, c = C.restartOnRequestAfter || 0, "boolean" == typeof c && (c = 0), setTimeout(function() { + var b, c, g, h, i, j; + if (b = "socket" === f ? e.readyState < 2 : 0 < (h = e.readyState) && 4 > h) { + for (Pace.restart(), i = Pace.sources, j = [], c = 0, g = i.length; g > c; c++) { + if (I = i[c], I instanceof a) { + I.watch.apply(I, d); + break + } + j.push(void 0) + } + return j + } + }, c)) + }), a = function() { + function a() { + var a = this; + this.elements = [], x().on("request", function() { + return a.watch.apply(a, arguments) + }) + } + return a.prototype.watch = function(a) { + var b, c, d; + return d = a.type, b = a.request, c = "socket" === d ? new m(b) : new n(b), this.elements.push(c) + }, a + }(), n = function() { + function a(a) { + var b, c, d, e, f, g, h = this; + if (this.progress = 0, null != window.ProgressEvent) + for (c = null, a.addEventListener("progress", function(a) { + return h.progress = a.lengthComputable ? 100 * a.loaded / a.total : h.progress + (100 - h.progress) / 2 + }), g = ["load", "abort", "timeout", "error"], d = 0, e = g.length; e > d; d++) + b = g[d], a.addEventListener(b, function() { + return h.progress = 100 + }); + else + f = a.onreadystatechange, a.onreadystatechange = function() { + var b; + return 0 === (b = a.readyState) || 4 === b ? h.progress = 100 : 3 === a.readyState && (h.progress = 50), "function" == typeof f ? f.apply(null, arguments) : void 0 + } + } + return a + }(), m = function() { + function a(a) { + var b, c, d, e, f = this; + for (this.progress = 0, e = ["error", "open"], c = 0, d = e.length; d > c; c++) + b = e[c], a.addEventListener(b, function() { + return f.progress = 100 + }) + } + return a + }(), d = function() { + function a(a) { + var b, c, d, f; + for (null == a && (a = {}), this.elements = [], null == a.selectors && (a.selectors = []), f = a.selectors, c = 0, d = f.length; d > c; c++) + b = f[c], this.elements.push(new e(b)) + } + return a + }(), e = function() { + function a(a) { + this.selector = a, this.progress = 0, this.check() + } + return a.prototype.check = function() { + var a = this; + return document.querySelector(this.selector) ? this.done() : setTimeout(function() { + return a.check() + }, C.elements.checkInterval) + }, a.prototype.done = function() { + return this.progress = 100 + }, a + }(), c = function() { + function a() { + var a, b, c = this; + this.progress = null != (b = this.states[document.readyState]) ? b : 100, a = document.onreadystatechange, document.onreadystatechange = function() { + return null != c.states[document.readyState] && (c.progress = c.states[document.readyState]), "function" == typeof a ? a.apply(null, arguments) : void 0 + } + } + return a.prototype.states = {loading: 0, interactive: 50, complete: 100}, a + }(), f = function() { + function a() { + var a, b, c, d, e, f = this; + this.progress = 0, a = 0, e = [], d = 0, c = B(), b = setInterval(function() { + var g; + return g = B() - c - 50, c = B(), e.push(g), e.length > C.eventLag.sampleCount && e.shift(), a = p(e), ++d >= C.eventLag.minSamples && a < C.eventLag.lagThreshold ? (f.progress = 100, clearInterval(b)) : f.progress = 100 * (3 / (a + 3)) + }, 50) + } + return a + }(), l = function() { + function a(a) { + this.source = a, this.last = this.sinceLastUpdate = 0, this.rate = C.initialRate, this.catchup = 0, this.progress = this.lastProgress = 0, null != this.source && (this.progress = E(this.source, "progress")) + } + return a.prototype.tick = function(a, b) { + var c; + return null == b && (b = E(this.source, "progress")), b >= 100 && (this.done = !0), b === this.last ? this.sinceLastUpdate += a : (this.sinceLastUpdate && (this.rate = (b - this.last) / this.sinceLastUpdate), this.catchup = (b - this.progress) / C.catchupTime, this.sinceLastUpdate = 0, this.last = b), b > this.progress && (this.progress += this.catchup * a), c = 1 - Math.pow(this.progress / 100, C.easeFactor), this.progress += c * this.rate * a, this.progress = Math.min(this.lastProgress + C.maxProgressPerFrame, this.progress), this.progress = Math.max(0, this.progress), this.progress = Math.min(100, this.progress), this.lastProgress = this.progress, this.progress + }, a + }(), J = null, G = null, q = null, K = null, o = null, r = null, Pace.running = !1, y = function() { + return C.restartOnPushState ? Pace.restart() : void 0 + }, null != window.history.pushState && (R = window.history.pushState, window.history.pushState = function() { + return y(), R.apply(window.history, arguments) + }), null != window.history.replaceState && (U = window.history.replaceState, window.history.replaceState = function() { + return y(), U.apply(window.history, arguments) + }), k = {ajax: a, elements: d, document: c, eventLag: f}, (A = function() { + var a, c, d, e, f, g, h, i; + for (Pace.sources = J = [], g = ["ajax", "elements", "document", "eventLag"], c = 0, e = g.length; e > c; c++) + a = g[c], C[a] !== !1 && J.push(new k[a](C[a])); + for (i = null != (h = C.extraSources)?h:[], d = 0, f = i.length; f > d; d++) + I = i[d], J.push(new I(C)); + return Pace.bar = q = new b, G = [], K = new l + })(), Pace.stop = function() { + return Pace.trigger("stop"), Pace.running = !1, q.destroy(), r = !0, null != o && ("function" == typeof s && s(o), o = null), A() + }, Pace.restart = function() { + return Pace.trigger("restart"), Pace.stop(), Pace.start() + }, Pace.go = function() { + return Pace.running = !0, q.render(), r = !1, o = F(function(a, b) { + var c, d, e, f, g, h, i, j, k, m, n, o, p, s, t, u, v; + for (j = 100 - q.progress, d = o = 0, e = !0, h = p = 0, t = J.length; t > p; h = ++p) + for (I = J[h], m = null != G[h]?G[h]:G[h] = [], g = null != (v = I.elements)?v:[I], i = s = 0, u = g.length; u > s; i = ++s) + f = g[i], k = null != m[i] ? m[i] : m[i] = new l(f), e &= k.done, k.done || (d++, o += k.tick(a)); + return c = o / d, q.update(K.tick(a, c)), n = B(), q.done() || e || r ? (q.update(100), Pace.trigger("done"), setTimeout(function() { + return q.finish(), Pace.running = !1, Pace.trigger("hide") + }, Math.max(C.ghostTime, Math.min(C.minTime, B() - n)))) : b() + }) + }, Pace.start = function(a) { + u(C, a), Pace.running = !0; + try { + q.render() + } catch (b) { + i = b + } + return document.querySelector(".pace") ? (Pace.trigger("start"), Pace.go()) : setTimeout(Pace.start, 50) + }, "function" == typeof define && define.amd ? define('theme-app', [], function() { + return Pace + }) : "object" == typeof exports ? module.exports = Pace : C.startOnPageLoad && Pace.start() + }).call(this); +}); + +/* + * BOX REFRESH BUTTON + * ------------------ + * This is a custom plugin to use with the compenet BOX. It allows you to add + * a refresh button to the box. It converts the box's state to a loading state. + * + * USAGE: + * $("#box-widget").boxRefresh( options ); + * */ +(function($) { + "use strict"; + + $.fn.boxRefresh = function(options) { + + // Render options + var settings = $.extend({ + //Refressh button selector + trigger: ".refresh-btn", + //File source to be loaded (e.g: ajax/src.php) + source: "", + //Callbacks + onLoadStart: function(box) { + }, //Right after the button has been clicked + onLoadDone: function(box) { + } //When the source has been loaded + + }, options); + + //The overlay + var overlay = $('
      '); + + return this.each(function() { + //if a source is specified + if (settings.source === "") { + if (console) { + console.log("Please specify a source first - boxRefresh()"); + } + return; + } + //the box + var box = $(this); + //the button + var rBtn = box.find(settings.trigger).first(); + + //On trigger click + rBtn.click(function(e) { + e.preventDefault(); + //Add loading overlay + start(box); + + //Perform ajax call + box.find(".box-body").load(settings.source, function() { + done(box); + }); + + + }); + + }); + + function start(box) { + //Add overlay and loading img + box.append(overlay); + + settings.onLoadStart.call(box); + } + + function done(box) { + //Remove overlay and loading img + box.find(overlay).remove(); + + settings.onLoadDone.call(box); + } + + }; + +})(jQuery); + +/* + * SIDEBAR MENU + * ------------ + * This is a custom plugin for the sidebar menu. It provides a tree view. + * + * Usage: + * $(".sidebar).tree(); + * + * Note: This plugin does not accept any options. Instead, it only requires a class + * added to the element that contains a sub-menu. + * + * When used with the sidebar, for example, it would look something like this: + *
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + + '' + + '' + + '
      ' + + ' ' + + '' + + '
      ' + + '
      ' + + '
      '; + + this.parentEl = (hasOptions && options.parentEl && $(options.parentEl)) || $(this.parentEl); + //the date range picker + this.container = $(DRPTemplate).appendTo(this.parentEl); + + if (hasOptions) { + + if (typeof options.format == 'string') + this.format = options.format; + + if (typeof options.separator == 'string') + this.separator = options.separator; + + if (typeof options.startDate == 'string') + this.startDate = moment(options.startDate, this.format); + + if (typeof options.endDate == 'string') + this.endDate = moment(options.endDate, this.format); + + if (typeof options.minDate == 'string') + this.minDate = moment(options.minDate, this.format); + + if (typeof options.maxDate == 'string') + this.maxDate = moment(options.maxDate, this.format); + + if (typeof options.startDate == 'object') + this.startDate = moment(options.startDate); + + if (typeof options.endDate == 'object') + this.endDate = moment(options.endDate); + + if (typeof options.minDate == 'object') + this.minDate = moment(options.minDate); + + if (typeof options.maxDate == 'object') + this.maxDate = moment(options.maxDate); + + if (typeof options.ranges == 'object') { + for (var range in options.ranges) { + + var start = moment(options.ranges[range][0]); + var end = moment(options.ranges[range][1]); + + // If we have a min/max date set, bound this range + // to it, but only if it would otherwise fall + // outside of the min/max. + if (this.minDate && start.isBefore(this.minDate)) + start = moment(this.minDate); + + if (this.maxDate && end.isAfter(this.maxDate)) + end = moment(this.maxDate); + + // If the end of the range is before the minimum (if min is set) OR + // the start of the range is after the max (also if set) don't display this + // range option. + if ((this.minDate && end.isBefore(this.minDate)) || (this.maxDate && start.isAfter(this.maxDate))) { + continue; + } + + this.ranges[range] = [start, end]; + } + + var list = '
        '; + for (var range in this.ranges) { + list += '
      • ' + range + '
      • '; + } + list += '
      • ' + this.locale.customRangeLabel + '
      • '; + list += '
      '; + this.container.find('.ranges').prepend(list); + } + + if (typeof options.dateLimit == 'object') + this.dateLimit = options.dateLimit; + + // update day names order to firstDay + if (typeof options.locale == 'object') { + + if (typeof options.locale.daysOfWeek == 'object') { + + // Create a copy of daysOfWeek to avoid modification of original + // options object for reusability in multiple daterangepicker instances + this.locale.daysOfWeek = options.locale.daysOfWeek.slice(); + } + + if (typeof options.locale.firstDay == 'number') { + this.locale.firstDay = options.locale.firstDay; + var iterator = options.locale.firstDay; + while (iterator > 0) { + this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()); + iterator--; + } + } + } + + if (typeof options.opens == 'string') + this.opens = options.opens; + + if (typeof options.showWeekNumbers == 'boolean') { + this.showWeekNumbers = options.showWeekNumbers; + } + + if (typeof options.buttonClasses == 'string') { + this.buttonClasses = [options.buttonClasses]; + } + + if (typeof options.buttonClasses == 'object') { + this.buttonClasses = options.buttonClasses; + } + + if (typeof options.showDropdowns == 'boolean') { + this.showDropdowns = options.showDropdowns; + } + + if (typeof options.timePicker == 'boolean') { + this.timePicker = options.timePicker; + } + + if (typeof options.timePickerIncrement == 'number') { + this.timePickerIncrement = options.timePickerIncrement; + } + + if (typeof options.timePicker12Hour == 'boolean') { + this.timePicker12Hour = options.timePicker12Hour; + } + + } + + if (!this.timePicker) { + this.startDate = this.startDate.startOf('day'); + this.endDate = this.endDate.startOf('day'); + } + + //apply CSS classes to buttons + var c = this.container; + $.each(this.buttonClasses, function (idx, val) { + c.find('button').addClass(val); + }); + + if (this.opens == 'right') { + //swap calendar positions + var left = this.container.find('.calendar.left'); + var right = this.container.find('.calendar.right'); + left.removeClass('left').addClass('right'); + right.removeClass('right').addClass('left'); + } + + if (typeof options == 'undefined' || typeof options.ranges == 'undefined') { + this.container.find('.calendar').show(); + this.move(); + } + + if (typeof cb == 'function') + this.cb = cb; + + this.container.addClass('opens' + this.opens); + + //try parse date if in text input + if (!hasOptions || (typeof options.startDate == 'undefined' && typeof options.endDate == 'undefined')) { + if ($(this.element).is('input[type=text]')) { + var val = $(this.element).val(); + var split = val.split(this.separator); + var start, end; + if (split.length == 2) { + start = moment(split[0], this.format); + end = moment(split[1], this.format); + } + if (start != null && end != null) { + this.startDate = start; + this.endDate = end; + } + } + } + + //state + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + + this.leftCalendar = { + month: moment([this.startDate.year(), this.startDate.month(), 1, this.startDate.hour(), this.startDate.minute()]), + calendar: [] + }; + + this.rightCalendar = { + month: moment([this.endDate.year(), this.endDate.month(), 1, this.endDate.hour(), this.endDate.minute()]), + calendar: [] + }; + + //event listeners + this.container.on('mousedown', $.proxy(this.mousedown, this)); + + this.container.find('.calendar') + .on('click', '.prev', $.proxy(this.clickPrev, this)) + .on('click', '.next', $.proxy(this.clickNext, this)) + .on('click', 'td.available', $.proxy(this.clickDate, this)) + .on('mouseenter', 'td.available', $.proxy(this.enterDate, this)) + .on('mouseleave', 'td.available', $.proxy(this.updateFormInputs, this)) + .on('change', 'select.yearselect', $.proxy(this.updateMonthYear, this)) + .on('change', 'select.monthselect', $.proxy(this.updateMonthYear, this)) + .on('change', 'select.hourselect,select.minuteselect,select.ampmselect', $.proxy(this.updateTime, this)); + + this.container.find('.ranges') + .on('click', 'button.applyBtn', $.proxy(this.clickApply, this)) + .on('click', 'button.cancelBtn', $.proxy(this.clickCancel, this)) + .on('click', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.showCalendars, this)) + .on('click', 'li', $.proxy(this.clickRange, this)) + .on('mouseenter', 'li', $.proxy(this.enterRange, this)) + .on('mouseleave', 'li', $.proxy(this.updateFormInputs, this)); + + this.element.on('keyup', $.proxy(this.updateFromControl, this)); + + this.updateView(); + this.updateCalendars(); + + }; + + DateRangePicker.prototype = { + + constructor: DateRangePicker, + + mousedown: function (e) { + e.stopPropagation(); + }, + + updateView: function () { + this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()); + this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()); + this.updateFormInputs(); + }, + + updateFormInputs: function () { + this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.format)); + this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.format)); + + if (this.startDate.isSame(this.endDate) || this.startDate.isBefore(this.endDate)) { + this.container.find('button.applyBtn').removeAttr('disabled'); + } else { + this.container.find('button.applyBtn').attr('disabled', 'disabled'); + } + }, + + updateFromControl: function () { + if (!this.element.is('input')) return; + if (!this.element.val().length) return; + + var dateString = this.element.val().split(this.separator); + var start = moment(dateString[0], this.format); + var end = moment(dateString[1], this.format); + + if (start == null || end == null) return; + if (end.isBefore(start)) return; + + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + + this.startDate = start; + this.endDate = end; + + if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) + this.notify(); + + this.updateCalendars(); + }, + + notify: function () { + this.updateView(); + this.cb(this.startDate, this.endDate); + }, + + move: function () { + var parentOffset = { + top: this.parentEl.offset().top - (this.parentEl.is('body') ? 0 : this.parentEl.scrollTop()), + left: this.parentEl.offset().left - (this.parentEl.is('body') ? 0 : this.parentEl.scrollLeft()) + }; + if (this.opens == 'left') { + this.container.css({ + top: this.element.offset().top + this.element.outerHeight() - parentOffset.top, + right: $(window).width() - this.element.offset().left - this.element.outerWidth() - parentOffset.left, + left: 'auto' + }); + if (this.container.offset().left < 0) { + this.container.css({ + right: 'auto', + left: 9 + }); + } + } else { + this.container.css({ + top: this.element.offset().top + this.element.outerHeight() - parentOffset.top, + left: this.element.offset().left - parentOffset.left, + right: 'auto' + }); + if (this.container.offset().left + this.container.outerWidth() > $(window).width()) { + this.container.css({ + left: 'auto', + right: 0 + }); + } + } + }, + + show: function (e) { + this.container.show(); + this.move(); + + if (e) { + e.stopPropagation(); + e.preventDefault(); + } + + $(document).on('mousedown', $.proxy(this.hide, this)); + this.element.trigger('shown', {target: e.target, picker: this}); + }, + + hide: function (e) { + this.container.hide(); + + if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) + this.notify(); + + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + + $(document).off('mousedown', this.hide); + this.element.trigger('hidden', { picker: this }); + }, + + enterRange: function (e) { + var label = e.target.innerHTML; + if (label == this.locale.customRangeLabel) { + this.updateView(); + } else { + var dates = this.ranges[label]; + this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.format)); + this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.format)); + } + }, + + showCalendars: function() { + this.container.find('.calendar').show(); + this.move(); + }, + + updateInputText: function() { + if (this.element.is('input')) + this.element.val(this.startDate.format(this.format) + this.separator + this.endDate.format(this.format)); + }, + + clickRange: function (e) { + var label = e.target.innerHTML; + if (label == this.locale.customRangeLabel) { + this.showCalendars(); + } else { + var dates = this.ranges[label]; + + this.startDate = dates[0]; + this.endDate = dates[1]; + + if (!this.timePicker) { + this.startDate.startOf('day'); + this.endDate.startOf('day'); + } + + this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()).hour(this.startDate.hour()).minute(this.startDate.minute()); + this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()).hour(this.endDate.hour()).minute(this.endDate.minute()); + this.updateCalendars(); + + this.updateInputText(); + + this.container.find('.calendar').hide(); + this.hide(); + } + }, + + clickPrev: function (e) { + var cal = $(e.target).parents('.calendar'); + if (cal.hasClass('left')) { + this.leftCalendar.month.subtract('month', 1); + } else { + this.rightCalendar.month.subtract('month', 1); + } + this.updateCalendars(); + }, + + clickNext: function (e) { + var cal = $(e.target).parents('.calendar'); + if (cal.hasClass('left')) { + this.leftCalendar.month.add('month', 1); + } else { + this.rightCalendar.month.add('month', 1); + } + this.updateCalendars(); + }, + + enterDate: function (e) { + + var title = $(e.target).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(e.target).parents('.calendar'); + + if (cal.hasClass('left')) { + this.container.find('input[name=daterangepicker_start]').val(this.leftCalendar.calendar[row][col].format(this.format)); + } else { + this.container.find('input[name=daterangepicker_end]').val(this.rightCalendar.calendar[row][col].format(this.format)); + } + + }, + + clickDate: function (e) { + var title = $(e.target).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(e.target).parents('.calendar'); + + if (cal.hasClass('left')) { + var startDate = this.leftCalendar.calendar[row][col]; + var endDate = this.endDate; + if (typeof this.dateLimit == 'object') { + var maxDate = moment(startDate).add(this.dateLimit).startOf('day'); + if (endDate.isAfter(maxDate)) { + endDate = maxDate; + } + } + } else { + var startDate = this.startDate; + var endDate = this.rightCalendar.calendar[row][col]; + if (typeof this.dateLimit == 'object') { + var minDate = moment(endDate).subtract(this.dateLimit).startOf('day'); + if (startDate.isBefore(minDate)) { + startDate = minDate; + } + } + } + + cal.find('td').removeClass('active'); + + if (startDate.isSame(endDate) || startDate.isBefore(endDate)) { + $(e.target).addClass('active'); + this.startDate = startDate; + this.endDate = endDate; + } else if (startDate.isAfter(endDate)) { + $(e.target).addClass('active'); + this.startDate = startDate; + this.endDate = moment(startDate).add('day', 1).startOf('day'); + } + + this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()); + this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()); + this.updateCalendars(); + }, + + clickApply: function (e) { + this.updateInputText(); + this.hide(); + }, + + clickCancel: function (e) { + this.startDate = this.oldStartDate; + this.endDate = this.oldEndDate; + this.updateView(); + this.updateCalendars(); + this.hide(); + }, + + updateMonthYear: function (e) { + + var isLeft = $(e.target).closest('.calendar').hasClass('left'); + var cal = this.container.find('.calendar.left'); + if (!isLeft) + cal = this.container.find('.calendar.right'); + + // Month must be Number for new moment versions + var month = parseInt(cal.find('.monthselect').val(), 10); + var year = cal.find('.yearselect').val(); + + if (isLeft) { + this.leftCalendar.month.month(month).year(year); + } else { + this.rightCalendar.month.month(month).year(year); + } + + this.updateCalendars(); + + }, + + updateTime: function(e) { + + var isLeft = $(e.target).closest('.calendar').hasClass('left'); + var cal = this.container.find('.calendar.left'); + if (!isLeft) + cal = this.container.find('.calendar.right'); + + var hour = parseInt(cal.find('.hourselect').val()); + var minute = parseInt(cal.find('.minuteselect').val()); + + if (this.timePicker12Hour) { + var ampm = cal.find('.ampmselect').val(); + if (ampm == 'PM' && hour < 12) + hour += 12; + if (ampm == 'AM' && hour == 12) + hour = 0; + } + + if (isLeft) { + var start = this.startDate.clone(); + start.hour(hour); + start.minute(minute); + this.startDate = start; + this.leftCalendar.month.hour(hour).minute(minute); + } else { + var end = this.endDate.clone(); + end.hour(hour); + end.minute(minute); + this.endDate = end; + this.rightCalendar.month.hour(hour).minute(minute); + } + + this.updateCalendars(); + + }, + + updateCalendars: function () { + this.leftCalendar.calendar = this.buildCalendar(this.leftCalendar.month.month(), this.leftCalendar.month.year(), this.leftCalendar.month.hour(), this.leftCalendar.month.minute(), 'left'); + this.rightCalendar.calendar = this.buildCalendar(this.rightCalendar.month.month(), this.rightCalendar.month.year(), this.rightCalendar.month.hour(), this.rightCalendar.month.minute(), 'right'); + this.container.find('.calendar.left').html(this.renderCalendar(this.leftCalendar.calendar, this.startDate, this.minDate, this.maxDate)); + this.container.find('.calendar.right').html(this.renderCalendar(this.rightCalendar.calendar, this.endDate, this.startDate, this.maxDate)); + + this.container.find('.ranges li').removeClass('active'); + var customRange = true; + var i = 0; + for (var range in this.ranges) { + if (this.timePicker) { + if (this.startDate.isSame(this.ranges[range][0]) && this.endDate.isSame(this.ranges[range][1])) { + customRange = false; + this.container.find('.ranges li:eq(' + i + ')').addClass('active'); + } + } else { + //ignore times when comparing dates if time picker is not enabled + if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) { + customRange = false; + this.container.find('.ranges li:eq(' + i + ')').addClass('active'); + } + } + i++; + } + if (customRange) + this.container.find('.ranges li:last').addClass('active'); + }, + + buildCalendar: function (month, year, hour, minute, side) { + + var firstDay = moment([year, month, 1]); + var lastMonth = moment(firstDay).subtract('month', 1).month(); + var lastYear = moment(firstDay).subtract('month', 1).year(); + + var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth(); + + var dayOfWeek = firstDay.day(); + + //initialize a 6 rows x 7 columns array for the calendar + var calendar = []; + for (var i = 0; i < 6; i++) { + calendar[i] = []; + } + + //populate the calendar with date objects + var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1; + if (startDay > daysInLastMonth) + startDay -= 7; + + if (dayOfWeek == this.locale.firstDay) + startDay = daysInLastMonth - 6; + + var curDate = moment([lastYear, lastMonth, startDay, 12, minute]); + for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add('hour', 24)) { + if (i > 0 && col % 7 == 0) { + col = 0; + row++; + } + calendar[row][col] = curDate.clone().hour(hour); + curDate.hour(12); + } + + return calendar; + + }, + + renderDropdowns: function (selected, minDate, maxDate) { + var currentMonth = selected.month(); + var monthHtml = '"; + + var currentYear = selected.year(); + var maxYear = (maxDate && maxDate.year()) || (currentYear + 5); + var minYear = (minDate && minDate.year()) || (currentYear - 50); + var yearHtml = ''; + + return monthHtml + yearHtml; + }, + + renderCalendar: function (calendar, selected, minDate, maxDate) { + + var html = '
      '; + html += ''; + html += ''; + html += ''; + + // add empty cell for week number + if (this.showWeekNumbers) + html += ''; + + if (!minDate || minDate.isBefore(calendar[1][1])) { + html += ''; + } else { + html += ''; + } + + var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY"); + + if (this.showDropdowns) { + dateHtml = this.renderDropdowns(calendar[1][1], minDate, maxDate); + } + + html += ''; + if (!maxDate || maxDate.isAfter(calendar[1][1])) { + html += ''; + } else { + html += ''; + } + + html += ''; + html += ''; + + // add week number label + if (this.showWeekNumbers) + html += ''; + + $.each(this.locale.daysOfWeek, function (index, dayOfWeek) { + html += ''; + }); + + html += ''; + html += ''; + html += ''; + + for (var row = 0; row < 6; row++) { + html += ''; + + // add week number + if (this.showWeekNumbers) + html += ''; + + for (var col = 0; col < 7; col++) { + var cname = 'available '; + cname += (calendar[row][col].month() == calendar[1][1].month()) ? '' : 'off'; + + if ((minDate && calendar[row][col].isBefore(minDate)) || (maxDate && calendar[row][col].isAfter(maxDate))) { + cname = ' off disabled '; + } else if (calendar[row][col].format('YYYY-MM-DD') == selected.format('YYYY-MM-DD')) { + cname += ' active '; + if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) { + cname += ' start-date '; + } + if (calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) { + cname += ' end-date '; + } + } else if (calendar[row][col] >= this.startDate && calendar[row][col] <= this.endDate) { + cname += ' in-range '; + if (calendar[row][col].isSame(this.startDate)) { cname += ' start-date '; } + if (calendar[row][col].isSame(this.endDate)) { cname += ' end-date '; } + } + + var title = 'r' + row + 'c' + col; + html += ''; + } + html += ''; + } + + html += ''; + html += '
      ' + dateHtml + '
      ' + this.locale.weekLabel + '' + dayOfWeek + '
      ' + calendar[row][0].week() + '' + calendar[row][col].date() + '
      '; + html += '
      '; + + if (this.timePicker) { + + html += '
      '; + html += ' : '; + + html += ' '; + + if (this.timePicker12Hour) { + html += ''; + } + + html += '
      '; + + } + + return html; + + } + + }; + + $.fn.daterangepicker = function (options, cb) { + this.each(function () { + var el = $(this); + if (!el.data('daterangepicker')) + el.data('daterangepicker', new DateRangePicker(el, options, cb)); + }); + return this; + }; + +}(window.jQuery); diff --git a/public/assets/js/plugins/flot/excanvas.js b/public/assets/js/plugins/flot/excanvas.js new file mode 100755 index 00000000..70a8f25c --- /dev/null +++ b/public/assets/js/plugins/flot/excanvas.js @@ -0,0 +1,1428 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Filling very large shapes (above 5000 points) is buggy. +// * Optimize. There is always room for speed improvements. + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + +(function() { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + function getContext() { + return this.context_ || + (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function() { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + doc.namespaces.add(prefix, urn, '#default#VML'); + } + } + + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px}'; + } + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function(opt_doc) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + + init_: function(doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function(el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1] + ]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.arcScaleX_ = o1.arcScaleX_; + o2.arcScaleY_ = o1.arcScaleY_; + o2.lineScale_ = o1.lineScale_; + } + + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts){ + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + + decToHex[Math.floor(g * 255)] + + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + + var processStyleCache = {}; + + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = {color: str, alpha: alpha}; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 10, + family: 'sans-serif' + }; + + // Internal text style cache + var fontStyleCache = {}; + + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + + var el = document.createElement('div'); + var style = el.style; + try { + style.font = styleString; + } catch (ex) { + // Ignore failures to set to invalid font. + } + + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: style.fontFamily || DEFAULT_STYLE.family + }; + } + + function getComputedStyle(style, element) { + var computedStyle = {}; + + for (var p in style) { + computedStyle[p] = style[p]; + } + + // Compute the size + var canvasFontSize = parseFloat(element.currentStyle.fontSize), + fontSize = parseFloat(style.size); + + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if(style.size.indexOf('%') != -1) { + computedStyle.size = (canvasFontSize / 100) * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / .75; + } else { + computedStyle.size = canvasFontSize; + } + + // Different scaling between normal text and VML text. This was found using + // trial and error to get the same size as non VML text. + computedStyle.size *= 0.981; + + return computedStyle; + } + + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + + style.size + 'px ' + style.family; + } + + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} canvasElement The element that the 2D context should + * be associated with + */ + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + this.font = '10px sans-serif'; + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + + var overlayEl = el.cloneNode(false); + // Use a non transparent background. + overlayEl.style.backgroundColor = 'red'; + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + + this.element_ = el; + this.arcScaleX_ = 1; + this.arcScaleY_ = 1; + this.lineScale_ = 1; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function() { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + + contextPrototype.beginPath = function() { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + }; + + contextPrototype.moveTo = function(aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y}); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function(aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y}); + + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, + aCP2x, aCP2y, + aX, aY) { + var p = getCoords(this, aX, aY); + var cp1 = getCoords(this, aCP1x, aCP1y); + var cp2 = getCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + + // Helper function that takes the already fixed cordinates. + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + + contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + + var cp = getCoords(this, aCPx, aCPy); + var p = getCoords(this, aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + }; + + contextPrototype.arc = function(aX, aY, aRadius, + aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = getCoords(this, aX, aY); + var pStart = getCoords(this, xStart, yStart); + var pEnd = getCoords(this, xEnd, yEnd); + + this.currentPath_.push({type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y}); + + }; + + contextPrototype.rect = function(aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + }; + + contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + + contextPrototype.createRadialGradient = function(aX0, aY0, aR0, + aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + + contextPrototype.drawImage = function(image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + + // to find the original width we overide the width and height + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + + // get the original size + var w = image.width; + var h = image.height; + + // and remove overides + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + + if (arguments.length == 3) { + dx = arguments[1]; + dy = arguments[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (arguments.length == 5) { + dx = arguments[1]; + dy = arguments[2]; + dw = arguments[3]; + dh = arguments[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (arguments.length == 9) { + sx = arguments[1]; + sy = arguments[2]; + sw = arguments[3]; + sh = arguments[4]; + dx = arguments[5]; + dy = arguments[6]; + dw = arguments[7]; + dh = arguments[8]; + } else { + throw Error('Invalid number of arguments'); + } + + var d = getCoords(this, dx, dy); + + var w2 = sw / 2; + var h2 = sh / 2; + + var vmlStr = []; + + var W = 10; + var H = 10; + + // For some reason that I've now forgotten, using divs didn't work + vmlStr.push(' ' , + '', + ''); + + this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); + }; + + contextPrototype.stroke = function(aFill) { + var W = 10; + var H = 10; + // Divide the shape into chunks if it's too long because IE has a limit + // somewhere for how long a VML shape can be. This simple division does + // not work with fills, only strokes, unfortunately. + var chunkSize = 5000; + + var min = {x: null, y: null}; + var max = {x: null, y: null}; + + for (var j = 0; j < this.currentPath_.length; j += chunkSize) { + var lineStr = []; + var lineOpen = false; + + lineStr.push(''); + + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + + lineStr.push(''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + } + }; + + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + + lineStr.push( + '' + ); + } + + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.arcScaleX_; + var arcScaleY = ctx.arcScaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + if (fillStyle instanceof CanvasGradient_) { + // TODO: Gradients transformed with the transformation matrix. + var angle = 0; + var focus = {x: 0, y: 0}; + + // additional offset + var shift = 0; + // scale factor for offset + var expansion = 1; + + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / arcScaleX; + var y0 = fillStyle.y0_ / arcScaleY; + var x1 = fillStyle.x1_ / arcScaleX; + var y1 = fillStyle.y1_ / arcScaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // The angle should be a non-negative number. + if (angle < 0) { + angle += 360; + } + + // Very small angles produce an unexpected result because they are + // converted to a scientific notation string. + if (angle < 1e-6) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + + width /= arcScaleX * Z; + height /= arcScaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + + // We need to sort the color stops in ascending order by offset, + // otherwise IE won't interpret it correctly. + var stops = fillStyle.colors_; + stops.sort(function(cs1, cs2) { + return cs1.offset - cs2.offset; + }); + + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * ctx.globalAlpha; + var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + + // When colors attribute is used, the meanings of opacity and o:opacity2 + // are reversed. + lineStr.push(''); + } else if (fillStyle instanceof CanvasPattern_) { + if (width && height) { + var deltaLeft = -min.x; + var deltaTop = -min.y; + lineStr.push(''); + } + } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + } + } + + contextPrototype.fill = function() { + this.stroke(true); + }; + + contextPrototype.closePath = function() { + this.currentPath_.push({type: 'close'}); + }; + + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + contextPrototype.save = function() { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function() { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && + isFinite(m[1][0]) && isFinite(m[1][1]) && + isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + contextPrototype.translate = function(aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.rotate = function(aRot) { + var c = mc(aRot); + var s = ms(aRot); + + var m1 = [ + [c, s, 0], + [-s, c, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.scale = function(aX, aY) { + this.arcScaleX_ *= aX; + this.arcScaleY_ *= aY; + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { + var m1 = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { + var m = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, m, true); + }; + + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { + var m = this.m_, + delta = 1000, + left = 0, + right = delta, + offset = {x: 0, y: 0}, + lineStr = []; + + var fontStyle = getComputedStyle(processFontStyle(this.font), + this.element_); + + var fontStyleString = buildStyle(fontStyle); + + var elementStyle = this.element_.currentStyle; + var textAlign = this.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + + // 1.75 is an arbitrary number, as there is no info about the text baseline + switch (this.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + + switch(textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + + var d = getCoords(this, x + offset.x, y + offset.y); + + lineStr.push(''); + + if (stroke) { + appendStroke(this, lineStr); + } else { + // TODO: Fix the min and max params. + appendFill(this, lineStr, {x: -left, y: 0}, + {x: right, y: fontStyle.size}); + } + + var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + + m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + + var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + + lineStr.push('', + '', + ''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + + contextPrototype.fillText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + + contextPrototype.strokeText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + + contextPrototype.measureText = function(text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + this.textMeasureEl_.style.font = this.font; + // Don't use innerHTML or innerText because they allow markup/whitespace. + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return {width: this.textMeasureEl_.offsetWidth}; + }; + + /******** STUBS ********/ + contextPrototype.clip = function() { + // TODO: Implement + }; + + contextPrototype.arcTo = function() { + // TODO: Implement + }; + + contextPrototype.createPattern = function(image, repetition) { + return new CanvasPattern_(image, repetition); + }; + + // Gradient / Pattern Stubs + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + + CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({offset: aOffset, + color: aColor.color, + alpha: aColor.alpha}); + }; + + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + + function throwException(s) { + throw new DOMException_(s); + } + + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + + function DOMException_(s) { + this.code = this[s]; + this.message = s +': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; +})(); + +} // if diff --git a/public/assets/js/plugins/flot/excanvas.min.js b/public/assets/js/plugins/flot/excanvas.min.js new file mode 100755 index 00000000..fcf876c7 --- /dev/null +++ b/public/assets/js/plugins/flot/excanvas.min.js @@ -0,0 +1 @@ +if(!document.createElement("canvas").getContext){(function(){var ab=Math;var n=ab.round;var l=ab.sin;var A=ab.cos;var H=ab.abs;var N=ab.sqrt;var d=10;var f=d/2;var z=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];function y(){return this.context_||(this.context_=new D(this))}var t=Array.prototype.slice;function g(j,m,p){var i=t.call(arguments,2);return function(){return j.apply(m,i.concat(t.call(arguments)))}}function af(i){return String(i).replace(/&/g,"&").replace(/"/g,""")}function Y(m,j,i){if(!m.namespaces[j]){m.namespaces.add(j,i,"#default#VML")}}function R(j){Y(j,"g_vml_","urn:schemas-microsoft-com:vml");Y(j,"g_o_","urn:schemas-microsoft-com:office:office");if(!j.styleSheets.ex_canvas_){var i=j.createStyleSheet();i.owningElement.id="ex_canvas_";i.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}R(document);var e={init:function(i){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",g(this.init_,this,j))},init_:function(p){var m=p.getElementsByTagName("canvas");for(var j=0;j1){m--}if(6*m<1){return j+(i-j)*6*m}else{if(2*m<1){return i}else{if(3*m<2){return j+(i-j)*(2/3-m)*6}else{return j}}}}var C={};function F(j){if(j in C){return C[j]}var ag,Z=1;j=String(j);if(j.charAt(0)=="#"){ag=j}else{if(/^rgb/.test(j)){var p=M(j);var ag="#",ah;for(var m=0;m<3;m++){if(p[m].indexOf("%")!=-1){ah=Math.floor(c(p[m])*255)}else{ah=+p[m]}ag+=k[r(ah,0,255)]}Z=+p[3]}else{if(/^hsl/.test(j)){var p=M(j);ag=I(p);Z=p[3]}else{ag=b[j]||j}}}return C[j]={color:ag,alpha:Z}}var o={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var L={};function E(i){if(L[i]){return L[i]}var p=document.createElement("div");var m=p.style;try{m.font=i}catch(j){}return L[i]={style:m.fontStyle||o.style,variant:m.fontVariant||o.variant,weight:m.fontWeight||o.weight,size:m.fontSize||o.size,family:m.fontFamily||o.family}}function u(m,j){var i={};for(var ah in m){i[ah]=m[ah]}var ag=parseFloat(j.currentStyle.fontSize),Z=parseFloat(m.size);if(typeof m.size=="number"){i.size=m.size}else{if(m.size.indexOf("px")!=-1){i.size=Z}else{if(m.size.indexOf("em")!=-1){i.size=ag*Z}else{if(m.size.indexOf("%")!=-1){i.size=(ag/100)*Z}else{if(m.size.indexOf("pt")!=-1){i.size=Z/0.75}else{i.size=ag}}}}}i.size*=0.981;return i}function ac(i){return i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family}var s={butt:"flat",round:"round"};function S(i){return s[i]||"square"}function D(i){this.m_=B();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=d*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=i;var m="width:"+i.clientWidth+"px;height:"+i.clientHeight+"px;overflow:hidden;position:absolute";var j=i.ownerDocument.createElement("div");j.style.cssText=m;i.appendChild(j);var p=j.cloneNode(false);p.style.backgroundColor="red";p.style.filter="alpha(opacity=0)";i.appendChild(p);this.element_=j;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var q=D.prototype;q.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};q.beginPath=function(){this.currentPath_=[]};q.moveTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.lineTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.bezierCurveTo=function(m,j,ak,aj,ai,ag){var i=V(this,ai,ag);var ah=V(this,m,j);var Z=V(this,ak,aj);K(this,ah,Z,i)};function K(i,Z,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:Z.x,cp1y:Z.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}q.quadraticCurveTo=function(ai,m,j,i){var ah=V(this,ai,m);var ag=V(this,j,i);var aj={x:this.currentX_+2/3*(ah.x-this.currentX_),y:this.currentY_+2/3*(ah.y-this.currentY_)};var Z={x:aj.x+(ag.x-this.currentX_)/3,y:aj.y+(ag.y-this.currentY_)/3};K(this,aj,Z,ag)};q.arc=function(al,aj,ak,ag,j,m){ak*=d;var ap=m?"at":"wa";var am=al+A(ag)*ak-f;var ao=aj+l(ag)*ak-f;var i=al+A(j)*ak-f;var an=aj+l(j)*ak-f;if(am==i&&!m){am+=0.125}var Z=V(this,al,aj);var ai=V(this,am,ao);var ah=V(this,i,an);this.currentPath_.push({type:ap,x:Z.x,y:Z.y,radius:ak,xStart:ai.x,yStart:ai.y,xEnd:ah.x,yEnd:ah.y})};q.rect=function(m,j,i,p){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath()};q.strokeRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.stroke();this.currentPath_=Z};q.fillRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.fill();this.currentPath_=Z};q.createLinearGradient=function(j,p,i,m){var Z=new U("gradient");Z.x0_=j;Z.y0_=p;Z.x1_=i;Z.y1_=m;return Z};q.createRadialGradient=function(p,ag,m,j,Z,i){var ah=new U("gradientradial");ah.x0_=p;ah.y0_=ag;ah.r0_=m;ah.x1_=j;ah.y1_=Z;ah.r1_=i;return ah};q.drawImage=function(aq,m){var aj,ah,al,ay,ao,am,at,aA;var ak=aq.runtimeStyle.width;var ap=aq.runtimeStyle.height;aq.runtimeStyle.width="auto";aq.runtimeStyle.height="auto";var ai=aq.width;var aw=aq.height;aq.runtimeStyle.width=ak;aq.runtimeStyle.height=ap;if(arguments.length==3){aj=arguments[1];ah=arguments[2];ao=am=0;at=al=ai;aA=ay=aw}else{if(arguments.length==5){aj=arguments[1];ah=arguments[2];al=arguments[3];ay=arguments[4];ao=am=0;at=ai;aA=aw}else{if(arguments.length==9){ao=arguments[1];am=arguments[2];at=arguments[3];aA=arguments[4];aj=arguments[5];ah=arguments[6];al=arguments[7];ay=arguments[8]}else{throw Error("Invalid number of arguments")}}}var az=V(this,aj,ah);var p=at/2;var j=aA/2;var ax=[];var i=10;var ag=10;ax.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",ax.join(""))};q.stroke=function(ao){var Z=10;var ap=10;var ag=5000;var ai={x:null,y:null};var an={x:null,y:null};for(var aj=0;ajan.x){an.x=m.x}if(ai.y==null||m.yan.y){an.y=m.y}}}am.push(' ">');if(!ao){w(this,am)}else{G(this,am,ai,an)}am.push("");this.element_.insertAdjacentHTML("beforeEnd",am.join(""))}};function w(m,ag){var j=F(m.strokeStyle);var p=j.color;var Z=j.alpha*m.globalAlpha;var i=m.lineScale_*m.lineWidth;if(i<1){Z*=i}ag.push("')}function G(aq,ai,aK,ar){var aj=aq.fillStyle;var aB=aq.arcScaleX_;var aA=aq.arcScaleY_;var j=ar.x-aK.x;var p=ar.y-aK.y;if(aj instanceof U){var an=0;var aF={x:0,y:0};var ax=0;var am=1;if(aj.type_=="gradient"){var al=aj.x0_/aB;var m=aj.y0_/aA;var ak=aj.x1_/aB;var aM=aj.y1_/aA;var aJ=V(aq,al,m);var aI=V(aq,ak,aM);var ag=aI.x-aJ.x;var Z=aI.y-aJ.y;an=Math.atan2(ag,Z)*180/Math.PI;if(an<0){an+=360}if(an<0.000001){an=0}}else{var aJ=V(aq,aj.x0_,aj.y0_);aF={x:(aJ.x-aK.x)/j,y:(aJ.y-aK.y)/p};j/=aB*d;p/=aA*d;var aD=ab.max(j,p);ax=2*aj.r0_/aD;am=2*aj.r1_/aD-ax}var av=aj.colors_;av.sort(function(aN,i){return aN.offset-i.offset});var ap=av.length;var au=av[0].color;var at=av[ap-1].color;var az=av[0].alpha*aq.globalAlpha;var ay=av[ap-1].alpha*aq.globalAlpha;var aE=[];for(var aH=0;aH')}else{if(aj instanceof T){if(j&&p){var ah=-aK.x;var aC=-aK.y;ai.push("')}}else{var aL=F(aq.fillStyle);var aw=aL.color;var aG=aL.alpha*aq.globalAlpha;ai.push('')}}}q.fill=function(){this.stroke(true)};q.closePath=function(){this.currentPath_.push({type:"close"})};function V(j,Z,p){var i=j.m_;return{x:d*(Z*i[0][0]+p*i[1][0]+i[2][0])-f,y:d*(Z*i[0][1]+p*i[1][1]+i[2][1])-f}}q.save=function(){var i={};v(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=J(B(),this.m_)};q.restore=function(){if(this.aStack_.length){v(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function h(i){return isFinite(i[0][0])&&isFinite(i[0][1])&&isFinite(i[1][0])&&isFinite(i[1][1])&&isFinite(i[2][0])&&isFinite(i[2][1])}function aa(j,i,p){if(!h(i)){return}j.m_=i;if(p){var Z=i[0][0]*i[1][1]-i[0][1]*i[1][0];j.lineScale_=N(H(Z))}}q.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];aa(this,J(i,this.m_),false)};q.rotate=function(j){var p=A(j);var m=l(j);var i=[[p,m,0],[-m,p,0],[0,0,1]];aa(this,J(i,this.m_),false)};q.scale=function(m,j){this.arcScaleX_*=m;this.arcScaleY_*=j;var i=[[m,0,0],[0,j,0],[0,0,1]];aa(this,J(i,this.m_),true)};q.transform=function(Z,p,ah,ag,j,i){var m=[[Z,p,0],[ah,ag,0],[j,i,1]];aa(this,J(m,this.m_),true)};q.setTransform=function(ag,Z,ai,ah,p,j){var i=[[ag,Z,0],[ai,ah,0],[p,j,1]];aa(this,i,true)};q.drawText_=function(am,ak,aj,ap,ai){var ao=this.m_,at=1000,j=0,ar=at,ah={x:0,y:0},ag=[];var i=u(E(this.font),this.element_);var p=ac(i);var au=this.element_.currentStyle;var Z=this.textAlign.toLowerCase();switch(Z){case"left":case"center":case"right":break;case"end":Z=au.direction=="ltr"?"right":"left";break;case"start":Z=au.direction=="rtl"?"right":"left";break;default:Z="left"}switch(this.textBaseline){case"hanging":case"top":ah.y=i.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":ah.y=-i.size/2.25;break}switch(Z){case"right":j=at;ar=0.05;break;case"center":j=ar=at/2;break}var aq=V(this,ak+ah.x,aj+ah.y);ag.push('');if(ai){w(this,ag)}else{G(this,ag,{x:-j,y:0},{x:ar,y:i.size})}var an=ao[0][0].toFixed(3)+","+ao[1][0].toFixed(3)+","+ao[0][1].toFixed(3)+","+ao[1][1].toFixed(3)+",0,0";var al=n(aq.x/d)+","+n(aq.y/d);ag.push('','','');this.element_.insertAdjacentHTML("beforeEnd",ag.join(""))};q.fillText=function(m,i,p,j){this.drawText_(m,i,p,j,false)};q.strokeText=function(m,i,p,j){this.drawText_(m,i,p,j,true)};q.measureText=function(m){if(!this.textMeasureEl_){var i='';this.element_.insertAdjacentHTML("beforeEnd",i);this.textMeasureEl_=this.element_.lastChild}var j=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(j.createTextNode(m));return{width:this.textMeasureEl_.offsetWidth}};q.clip=function(){};q.arcTo=function(){};q.createPattern=function(j,i){return new T(j,i)};function U(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}U.prototype.addColorStop=function(j,i){i=F(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function T(j,i){Q(j);switch(i){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=i;break;default:O("SYNTAX_ERR")}this.src_=j.src;this.width_=j.width;this.height_=j.height}function O(i){throw new P(i)}function Q(i){if(!i||i.nodeType!=1||i.tagName!="IMG"){O("TYPE_MISMATCH_ERR")}if(i.readyState!="complete"){O("INVALID_STATE_ERR")}}function P(i){this.code=this[i];this.message=i+": DOM Exception "+this.code}var X=P.prototype=new Error;X.INDEX_SIZE_ERR=1;X.DOMSTRING_SIZE_ERR=2;X.HIERARCHY_REQUEST_ERR=3;X.WRONG_DOCUMENT_ERR=4;X.INVALID_CHARACTER_ERR=5;X.NO_DATA_ALLOWED_ERR=6;X.NO_MODIFICATION_ALLOWED_ERR=7;X.NOT_FOUND_ERR=8;X.NOT_SUPPORTED_ERR=9;X.INUSE_ATTRIBUTE_ERR=10;X.INVALID_STATE_ERR=11;X.SYNTAX_ERR=12;X.INVALID_MODIFICATION_ERR=13;X.NAMESPACE_ERR=14;X.INVALID_ACCESS_ERR=15;X.VALIDATION_ERR=16;X.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=e;CanvasRenderingContext2D=D;CanvasGradient=U;CanvasPattern=T;DOMException=P})()}; \ No newline at end of file diff --git a/public/assets/js/plugins/flot/jquery.colorhelpers.js b/public/assets/js/plugins/flot/jquery.colorhelpers.js new file mode 100755 index 00000000..b2f6dc4e --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.colorhelpers.js @@ -0,0 +1,180 @@ +/* Plugin for jQuery for working with colors. + * + * Version 1.1. + * + * Inspiration from jQuery color animation plugin by John Resig. + * + * Released under the MIT license by Ole Laursen, October 2009. + * + * Examples: + * + * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString() + * var c = $.color.extract($("#mydiv"), 'background-color'); + * console.log(c.r, c.g, c.b, c.a); + * $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)" + * + * Note that .scale() and .add() return the same modified object + * instead of making a new one. + * + * V. 1.1: Fix error handling so e.g. parsing an empty string does + * produce a color rather than just crashing. + */ + +(function($) { + $.color = {}; + + // construct color object with some convenient chainable helpers + $.color.make = function (r, g, b, a) { + var o = {}; + o.r = r || 0; + o.g = g || 0; + o.b = b || 0; + o.a = a != null ? a : 1; + + o.add = function (c, d) { + for (var i = 0; i < c.length; ++i) + o[c.charAt(i)] += d; + return o.normalize(); + }; + + o.scale = function (c, f) { + for (var i = 0; i < c.length; ++i) + o[c.charAt(i)] *= f; + return o.normalize(); + }; + + o.toString = function () { + if (o.a >= 1.0) { + return "rgb("+[o.r, o.g, o.b].join(",")+")"; + } else { + return "rgba("+[o.r, o.g, o.b, o.a].join(",")+")"; + } + }; + + o.normalize = function () { + function clamp(min, value, max) { + return value < min ? min: (value > max ? max: value); + } + + o.r = clamp(0, parseInt(o.r), 255); + o.g = clamp(0, parseInt(o.g), 255); + o.b = clamp(0, parseInt(o.b), 255); + o.a = clamp(0, o.a, 1); + return o; + }; + + o.clone = function () { + return $.color.make(o.r, o.b, o.g, o.a); + }; + + return o.normalize(); + } + + // extract CSS color property from element, going up in the DOM + // if it's "transparent" + $.color.extract = function (elem, css) { + var c; + + do { + c = elem.css(css).toLowerCase(); + // keep going until we find an element that has color, or + // we hit the body or root (have no parent) + if (c != '' && c != 'transparent') + break; + elem = elem.parent(); + } while (elem.length && !$.nodeName(elem.get(0), "body")); + + // catch Safari's way of signalling transparent + if (c == "rgba(0, 0, 0, 0)") + c = "transparent"; + + return $.color.parse(c); + } + + // parse CSS color string (like "rgb(10, 32, 43)" or "#fff"), + // returns color object, if parsing failed, you get black (0, 0, + // 0) out + $.color.parse = function (str) { + var res, m = $.color.make; + + // Look for rgb(num,num,num) + if (res = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str)) + return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10)); + + // Look for rgba(num,num,num,num) + if (res = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str)) + return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10), parseFloat(res[4])); + + // Look for rgb(num%,num%,num%) + if (res = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str)) + return m(parseFloat(res[1])*2.55, parseFloat(res[2])*2.55, parseFloat(res[3])*2.55); + + // Look for rgba(num%,num%,num%,num) + if (res = /rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str)) + return m(parseFloat(res[1])*2.55, parseFloat(res[2])*2.55, parseFloat(res[3])*2.55, parseFloat(res[4])); + + // Look for #a0b1c2 + if (res = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str)) + return m(parseInt(res[1], 16), parseInt(res[2], 16), parseInt(res[3], 16)); + + // Look for #fff + if (res = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str)) + return m(parseInt(res[1]+res[1], 16), parseInt(res[2]+res[2], 16), parseInt(res[3]+res[3], 16)); + + // Otherwise, we're most likely dealing with a named color + var name = $.trim(str).toLowerCase(); + if (name == "transparent") + return m(255, 255, 255, 0); + else { + // default to black + res = lookupColors[name] || [0, 0, 0]; + return m(res[0], res[1], res[2]); + } + } + + var lookupColors = { + aqua:[0,255,255], + azure:[240,255,255], + beige:[245,245,220], + black:[0,0,0], + blue:[0,0,255], + brown:[165,42,42], + cyan:[0,255,255], + darkblue:[0,0,139], + darkcyan:[0,139,139], + darkgrey:[169,169,169], + darkgreen:[0,100,0], + darkkhaki:[189,183,107], + darkmagenta:[139,0,139], + darkolivegreen:[85,107,47], + darkorange:[255,140,0], + darkorchid:[153,50,204], + darkred:[139,0,0], + darksalmon:[233,150,122], + darkviolet:[148,0,211], + fuchsia:[255,0,255], + gold:[255,215,0], + green:[0,128,0], + indigo:[75,0,130], + khaki:[240,230,140], + lightblue:[173,216,230], + lightcyan:[224,255,255], + lightgreen:[144,238,144], + lightgrey:[211,211,211], + lightpink:[255,182,193], + lightyellow:[255,255,224], + lime:[0,255,0], + magenta:[255,0,255], + maroon:[128,0,0], + navy:[0,0,128], + olive:[128,128,0], + orange:[255,165,0], + pink:[255,192,203], + purple:[128,0,128], + violet:[128,0,128], + red:[255,0,0], + silver:[192,192,192], + white:[255,255,255], + yellow:[255,255,0] + }; +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.colorhelpers.min.js b/public/assets/js/plugins/flot/jquery.colorhelpers.min.js new file mode 100755 index 00000000..7f426596 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.colorhelpers.min.js @@ -0,0 +1 @@ +(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery); \ No newline at end of file diff --git a/public/assets/js/plugins/flot/jquery.flot.canvas.js b/public/assets/js/plugins/flot/jquery.flot.canvas.js new file mode 100755 index 00000000..d94b9611 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.canvas.js @@ -0,0 +1,345 @@ +/* Flot plugin for drawing all elements of a plot on the canvas. + +Copyright (c) 2007-2013 IOLA and Ole Laursen. +Licensed under the MIT license. + +Flot normally produces certain elements, like axis labels and the legend, using +HTML elements. This permits greater interactivity and customization, and often +looks better, due to cross-browser canvas text inconsistencies and limitations. + +It can also be desirable to render the plot entirely in canvas, particularly +if the goal is to save it as an image, or if Flot is being used in a context +where the HTML DOM does not exist, as is the case within Node.js. This plugin +switches out Flot's standard drawing operations for canvas-only replacements. + +Currently the plugin supports only axis labels, but it will eventually allow +every element of the plot to be rendered directly to canvas. + +The plugin supports these options: + +{ + canvas: boolean +} + +The "canvas" option controls whether full canvas drawing is enabled, making it +possible to toggle on and off. This is useful when a plot uses HTML text in the +browser, but needs to redraw with canvas text when exporting as an image. + +*/ + +(function($) { + + var options = { + canvas: true + }; + + var render, getTextInfo, addText; + + // Cache the prototype hasOwnProperty for faster access + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + function init(plot, classes) { + + var Canvas = classes.Canvas; + + // We only want to replace the functions once; the second time around + // we would just get our new function back. This whole replacing of + // prototype functions is a disaster, and needs to be changed ASAP. + + if (render == null) { + getTextInfo = Canvas.prototype.getTextInfo, + addText = Canvas.prototype.addText, + render = Canvas.prototype.render; + } + + // Finishes rendering the canvas, including overlaid text + + Canvas.prototype.render = function() { + + if (!plot.getOptions().canvas) { + return render.call(this); + } + + var context = this.context, + cache = this._textCache; + + // For each text layer, render elements marked as active + + context.save(); + context.textBaseline = "middle"; + + for (var layerKey in cache) { + if (hasOwnProperty.call(cache, layerKey)) { + var layerCache = cache[layerKey]; + for (var styleKey in layerCache) { + if (hasOwnProperty.call(layerCache, styleKey)) { + var styleCache = layerCache[styleKey], + updateStyles = true; + for (var key in styleCache) { + if (hasOwnProperty.call(styleCache, key)) { + + var info = styleCache[key], + positions = info.positions, + lines = info.lines; + + // Since every element at this level of the cache have the + // same font and fill styles, we can just change them once + // using the values from the first element. + + if (updateStyles) { + context.fillStyle = info.font.color; + context.font = info.font.definition; + updateStyles = false; + } + + for (var i = 0, position; position = positions[i]; i++) { + if (position.active) { + for (var j = 0, line; line = position.lines[j]; j++) { + context.fillText(lines[j].text, line[0], line[1]); + } + } else { + positions.splice(i--, 1); + } + } + + if (positions.length == 0) { + delete styleCache[key]; + } + } + } + } + } + } + } + + context.restore(); + }; + + // Creates (if necessary) and returns a text info object. + // + // When the canvas option is set, the object looks like this: + // + // { + // width: Width of the text's bounding box. + // height: Height of the text's bounding box. + // positions: Array of positions at which this text is drawn. + // lines: [{ + // height: Height of this line. + // widths: Width of this line. + // text: Text on this line. + // }], + // font: { + // definition: Canvas font property string. + // color: Color of the text. + // }, + // } + // + // The positions array contains objects that look like this: + // + // { + // active: Flag indicating whether the text should be visible. + // lines: Array of [x, y] coordinates at which to draw the line. + // x: X coordinate at which to draw the text. + // y: Y coordinate at which to draw the text. + // } + + Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) { + + if (!plot.getOptions().canvas) { + return getTextInfo.call(this, layer, text, font, angle, width); + } + + var textStyle, layerCache, styleCache, info; + + // Cast the value to a string, in case we were given a number + + text = "" + text; + + // If the font is a font-spec object, generate a CSS definition + + if (typeof font === "object") { + textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px " + font.family; + } else { + textStyle = font; + } + + // Retrieve (or create) the cache for the text's layer and styles + + layerCache = this._textCache[layer]; + + if (layerCache == null) { + layerCache = this._textCache[layer] = {}; + } + + styleCache = layerCache[textStyle]; + + if (styleCache == null) { + styleCache = layerCache[textStyle] = {}; + } + + info = styleCache[text]; + + if (info == null) { + + var context = this.context; + + // If the font was provided as CSS, create a div with those + // classes and examine it to generate a canvas font spec. + + if (typeof font !== "object") { + + var element = $("
       
      ") + .css("position", "absolute") + .addClass(typeof font === "string" ? font : null) + .appendTo(this.getTextLayer(layer)); + + font = { + lineHeight: element.height(), + style: element.css("font-style"), + variant: element.css("font-variant"), + weight: element.css("font-weight"), + family: element.css("font-family"), + color: element.css("color") + }; + + // Setting line-height to 1, without units, sets it equal + // to the font-size, even if the font-size is abstract, + // like 'smaller'. This enables us to read the real size + // via the element's height, working around browsers that + // return the literal 'smaller' value. + + font.size = element.css("line-height", 1).height(); + + element.remove(); + } + + textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px " + font.family; + + // Create a new info object, initializing the dimensions to + // zero so we can count them up line-by-line. + + info = styleCache[text] = { + width: 0, + height: 0, + positions: [], + lines: [], + font: { + definition: textStyle, + color: font.color + } + }; + + context.save(); + context.font = textStyle; + + // Canvas can't handle multi-line strings; break on various + // newlines, including HTML brs, to build a list of lines. + // Note that we could split directly on regexps, but IE < 9 is + // broken; revisit when we drop IE 7/8 support. + + var lines = (text + "").replace(/
      |\r\n|\r/g, "\n").split("\n"); + + for (var i = 0; i < lines.length; ++i) { + + var lineText = lines[i], + measured = context.measureText(lineText); + + info.width = Math.max(measured.width, info.width); + info.height += font.lineHeight; + + info.lines.push({ + text: lineText, + width: measured.width, + height: font.lineHeight + }); + } + + context.restore(); + } + + return info; + }; + + // Adds a text string to the canvas text overlay. + + Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) { + + if (!plot.getOptions().canvas) { + return addText.call(this, layer, x, y, text, font, angle, width, halign, valign); + } + + var info = this.getTextInfo(layer, text, font, angle, width), + positions = info.positions, + lines = info.lines; + + // Text is drawn with baseline 'middle', which we need to account + // for by adding half a line's height to the y position. + + y += info.height / lines.length / 2; + + // Tweak the initial y-position to match vertical alignment + + if (valign == "middle") { + y = Math.round(y - info.height / 2); + } else if (valign == "bottom") { + y = Math.round(y - info.height); + } else { + y = Math.round(y); + } + + // FIXME: LEGACY BROWSER FIX + // AFFECTS: Opera < 12.00 + + // Offset the y coordinate, since Opera is off pretty + // consistently compared to the other browsers. + + if (!!(window.opera && window.opera.version().split(".")[0] < 12)) { + y -= 2; + } + + // Determine whether this text already exists at this position. + // If so, mark it for inclusion in the next render pass. + + for (var i = 0, position; position = positions[i]; i++) { + if (position.x == x && position.y == y) { + position.active = true; + return; + } + } + + // If the text doesn't exist at this position, create a new entry + + position = { + active: true, + lines: [], + x: x, + y: y + }; + + positions.push(position); + + // Fill in the x & y positions of each line, adjusting them + // individually for horizontal alignment. + + for (var i = 0, line; line = lines[i]; i++) { + if (halign == "center") { + position.lines.push([Math.round(x - line.width / 2), y]); + } else if (halign == "right") { + position.lines.push([Math.round(x - line.width), y]); + } else { + position.lines.push([Math.round(x), y]); + } + y += line.height; + } + }; + } + + $.plot.plugins.push({ + init: init, + options: options, + name: "canvas", + version: "1.0" + }); + +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.canvas.min.js b/public/assets/js/plugins/flot/jquery.flot.canvas.min.js new file mode 100755 index 00000000..826d2177 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.canvas.min.js @@ -0,0 +1 @@ +(function($){var options={canvas:true};var render,getTextInfo,addText;var hasOwnProperty=Object.prototype.hasOwnProperty;function init(plot,classes){var Canvas=classes.Canvas;if(render==null){getTextInfo=Canvas.prototype.getTextInfo,addText=Canvas.prototype.addText,render=Canvas.prototype.render}Canvas.prototype.render=function(){if(!plot.getOptions().canvas){return render.call(this)}var context=this.context,cache=this._textCache;context.save();context.textBaseline="middle";for(var layerKey in cache){if(hasOwnProperty.call(cache,layerKey)){var layerCache=cache[layerKey];for(var styleKey in layerCache){if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey],updateStyles=true;for(var key in styleCache){if(hasOwnProperty.call(styleCache,key)){var info=styleCache[key],positions=info.positions,lines=info.lines;if(updateStyles){context.fillStyle=info.font.color;context.font=info.font.definition;updateStyles=false}for(var i=0,position;position=positions[i];i++){if(position.active){for(var j=0,line;line=position.lines[j];j++){context.fillText(lines[j].text,line[0],line[1])}}else{positions.splice(i--,1)}}if(positions.length==0){delete styleCache[key]}}}}}}}context.restore()};Canvas.prototype.getTextInfo=function(layer,text,font,angle,width){if(!plot.getOptions().canvas){return getTextInfo.call(this,layer,text,font,angle,width)}var textStyle,layerCache,styleCache,info;text=""+text;if(typeof font==="object"){textStyle=font.style+" "+font.variant+" "+font.weight+" "+font.size+"px "+font.family}else{textStyle=font}layerCache=this._textCache[layer];if(layerCache==null){layerCache=this._textCache[layer]={}}styleCache=layerCache[textStyle];if(styleCache==null){styleCache=layerCache[textStyle]={}}info=styleCache[text];if(info==null){var context=this.context;if(typeof font!=="object"){var element=$("
       
      ").css("position","absolute").addClass(typeof font==="string"?font:null).appendTo(this.getTextLayer(layer));font={lineHeight:element.height(),style:element.css("font-style"),variant:element.css("font-variant"),weight:element.css("font-weight"),family:element.css("font-family"),color:element.css("color")};font.size=element.css("line-height",1).height();element.remove()}textStyle=font.style+" "+font.variant+" "+font.weight+" "+font.size+"px "+font.family;info=styleCache[text]={width:0,height:0,positions:[],lines:[],font:{definition:textStyle,color:font.color}};context.save();context.font=textStyle;var lines=(text+"").replace(/
      |\r\n|\r/g,"\n").split("\n");for(var i=0;i index) + index = categories[v]; + + return index + 1; + } + + function categoriesTickGenerator(axis) { + var res = []; + for (var label in axis.categories) { + var v = axis.categories[label]; + if (v >= axis.min && v <= axis.max) + res.push([v, label]); + } + + res.sort(function (a, b) { return a[0] - b[0]; }); + + return res; + } + + function setupCategoriesForAxis(series, axis, datapoints) { + if (series[axis].options.mode != "categories") + return; + + if (!series[axis].categories) { + // parse options + var c = {}, o = series[axis].options.categories || {}; + if ($.isArray(o)) { + for (var i = 0; i < o.length; ++i) + c[o[i]] = i; + } + else { + for (var v in o) + c[v] = o[v]; + } + + series[axis].categories = c; + } + + // fix ticks + if (!series[axis].options.ticks) + series[axis].options.ticks = categoriesTickGenerator; + + transformPointsOnAxis(datapoints, axis, series[axis].categories); + } + + function transformPointsOnAxis(datapoints, axis, categories) { + // go through the points, transforming them + var points = datapoints.points, + ps = datapoints.pointsize, + format = datapoints.format, + formatColumn = axis.charAt(0), + index = getNextIndex(categories); + + for (var i = 0; i < points.length; i += ps) { + if (points[i] == null) + continue; + + for (var m = 0; m < ps; ++m) { + var val = points[i + m]; + + if (val == null || !format[m][formatColumn]) + continue; + + if (!(val in categories)) { + categories[val] = index; + ++index; + } + + points[i + m] = categories[val]; + } + } + } + + function processDatapoints(plot, series, datapoints) { + setupCategoriesForAxis(series, "xaxis", datapoints); + setupCategoriesForAxis(series, "yaxis", datapoints); + } + + function init(plot) { + plot.hooks.processRawData.push(processRawData); + plot.hooks.processDatapoints.push(processDatapoints); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: 'categories', + version: '1.0' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.categories.min.js b/public/assets/js/plugins/flot/jquery.flot.categories.min.js new file mode 100755 index 00000000..552dd90a --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.categories.min.js @@ -0,0 +1 @@ +(function($){var options={xaxis:{categories:null},yaxis:{categories:null}};function processRawData(plot,series,data,datapoints){var xCategories=series.xaxis.options.mode=="categories",yCategories=series.yaxis.options.mode=="categories";if(!(xCategories||yCategories))return;var format=datapoints.format;if(!format){var s=series;format=[];format.push({x:true,number:true,required:true});format.push({y:true,number:true,required:true});if(s.bars.show||s.lines.show&&s.lines.fill){var autoscale=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);format.push({y:true,number:true,required:false,defaultValue:0,autoscale:autoscale});if(s.bars.horizontal){delete format[format.length-1].y;format[format.length-1].x=true}}datapoints.format=format}for(var m=0;mindex)index=categories[v];return index+1}function categoriesTickGenerator(axis){var res=[];for(var label in axis.categories){var v=axis.categories[label];if(v>=axis.min&&v<=axis.max)res.push([v,label])}res.sort(function(a,b){return a[0]-b[0]});return res}function setupCategoriesForAxis(series,axis,datapoints){if(series[axis].options.mode!="categories")return;if(!series[axis].categories){var c={},o=series[axis].options.categories||{};if($.isArray(o)){for(var i=0;i ax[1].max || y < ax[1].min || upper < ax[0].min || lower > ax[0].max) + continue; + if (err[e].err == 'y') + if (x > ax[0].max || x < ax[0].min || upper < ax[1].min || lower > ax[1].max) + continue; + + // prevent errorbars getting out of the canvas + var drawUpper = true, + drawLower = true; + + if (upper > minmax[1]) { + drawUpper = false; + upper = minmax[1]; + } + if (lower < minmax[0]) { + drawLower = false; + lower = minmax[0]; + } + + //sanity check, in case some inverted axis hack is applied to flot + if ((err[e].err == 'x' && invertX) || (err[e].err == 'y' && invertY)) { + //swap coordinates + var tmp = lower; + lower = upper; + upper = tmp; + tmp = drawLower; + drawLower = drawUpper; + drawUpper = tmp; + tmp = minmax[0]; + minmax[0] = minmax[1]; + minmax[1] = tmp; + } + + // convert to pixels + x = ax[0].p2c(x), + y = ax[1].p2c(y), + upper = ax[e].p2c(upper); + lower = ax[e].p2c(lower); + minmax[0] = ax[e].p2c(minmax[0]); + minmax[1] = ax[e].p2c(minmax[1]); + + //same style as points by default + var lw = err[e].lineWidth ? err[e].lineWidth : s.points.lineWidth, + sw = s.points.shadowSize != null ? s.points.shadowSize : s.shadowSize; + + //shadow as for points + if (lw > 0 && sw > 0) { + var w = sw / 2; + ctx.lineWidth = w; + ctx.strokeStyle = "rgba(0,0,0,0.1)"; + drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w + w/2, minmax); + + ctx.strokeStyle = "rgba(0,0,0,0.2)"; + drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w/2, minmax); + } + + ctx.strokeStyle = err[e].color? err[e].color: s.color; + ctx.lineWidth = lw; + //draw it + drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, 0, minmax); + } + } + } + } + + function drawError(ctx,err,x,y,upper,lower,drawUpper,drawLower,radius,offset,minmax){ + + //shadow offset + y += offset; + upper += offset; + lower += offset; + + // error bar - avoid plotting over circles + if (err.err == 'x'){ + if (upper > x + radius) drawPath(ctx, [[upper,y],[Math.max(x + radius,minmax[0]),y]]); + else drawUpper = false; + if (lower < x - radius) drawPath(ctx, [[Math.min(x - radius,minmax[1]),y],[lower,y]] ); + else drawLower = false; + } + else { + if (upper < y - radius) drawPath(ctx, [[x,upper],[x,Math.min(y - radius,minmax[0])]] ); + else drawUpper = false; + if (lower > y + radius) drawPath(ctx, [[x,Math.max(y + radius,minmax[1])],[x,lower]] ); + else drawLower = false; + } + + //internal radius value in errorbar, allows to plot radius 0 points and still keep proper sized caps + //this is a way to get errorbars on lines without visible connecting dots + radius = err.radius != null? err.radius: radius; + + // upper cap + if (drawUpper) { + if (err.upperCap == '-'){ + if (err.err=='x') drawPath(ctx, [[upper,y - radius],[upper,y + radius]] ); + else drawPath(ctx, [[x - radius,upper],[x + radius,upper]] ); + } else if ($.isFunction(err.upperCap)){ + if (err.err=='x') err.upperCap(ctx, upper, y, radius); + else err.upperCap(ctx, x, upper, radius); + } + } + // lower cap + if (drawLower) { + if (err.lowerCap == '-'){ + if (err.err=='x') drawPath(ctx, [[lower,y - radius],[lower,y + radius]] ); + else drawPath(ctx, [[x - radius,lower],[x + radius,lower]] ); + } else if ($.isFunction(err.lowerCap)){ + if (err.err=='x') err.lowerCap(ctx, lower, y, radius); + else err.lowerCap(ctx, x, lower, radius); + } + } + } + + function drawPath(ctx, pts){ + ctx.beginPath(); + ctx.moveTo(pts[0][0], pts[0][1]); + for (var p=1; p < pts.length; p++) + ctx.lineTo(pts[p][0], pts[p][1]); + ctx.stroke(); + } + + function draw(plot, ctx){ + var plotOffset = plot.getPlotOffset(); + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + $.each(plot.getData(), function (i, s) { + if (s.points.errorbars && (s.points.xerr.show || s.points.yerr.show)) + drawSeriesErrors(plot, ctx, s); + }); + ctx.restore(); + } + + function init(plot) { + plot.hooks.processRawData.push(processRawData); + plot.hooks.draw.push(draw); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: 'errorbars', + version: '1.0' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.errorbars.min.js b/public/assets/js/plugins/flot/jquery.flot.errorbars.min.js new file mode 100755 index 00000000..a7bd0422 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.errorbars.min.js @@ -0,0 +1 @@ +(function($){var options={series:{points:{errorbars:null,xerr:{err:"x",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null},yerr:{err:"y",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null}}}};function processRawData(plot,series,data,datapoints){if(!series.points.errorbars)return;var format=[{x:true,number:true,required:true},{y:true,number:true,required:true}];var errors=series.points.errorbars;if(errors=="x"||errors=="xy"){if(series.points.xerr.asymmetric){format.push({x:true,number:true,required:true});format.push({x:true,number:true,required:true})}else format.push({x:true,number:true,required:true})}if(errors=="y"||errors=="xy"){if(series.points.yerr.asymmetric){format.push({y:true,number:true,required:true});format.push({y:true,number:true,required:true})}else format.push({y:true,number:true,required:true})}datapoints.format=format}function parseErrors(series,i){var points=series.datapoints.points;var exl=null,exu=null,eyl=null,eyu=null;var xerr=series.points.xerr,yerr=series.points.yerr;var eb=series.points.errorbars;if(eb=="x"||eb=="xy"){if(xerr.asymmetric){exl=points[i+2];exu=points[i+3];if(eb=="xy")if(yerr.asymmetric){eyl=points[i+4];eyu=points[i+5]}else eyl=points[i+4]}else{exl=points[i+2];if(eb=="xy")if(yerr.asymmetric){eyl=points[i+3];eyu=points[i+4]}else eyl=points[i+3]}}else if(eb=="y")if(yerr.asymmetric){eyl=points[i+2];eyu=points[i+3]}else eyl=points[i+2];if(exu==null)exu=exl;if(eyu==null)eyu=eyl;var errRanges=[exl,exu,eyl,eyu];if(!xerr.show){errRanges[0]=null;errRanges[1]=null}if(!yerr.show){errRanges[2]=null;errRanges[3]=null}return errRanges}function drawSeriesErrors(plot,ctx,s){var points=s.datapoints.points,ps=s.datapoints.pointsize,ax=[s.xaxis,s.yaxis],radius=s.points.radius,err=[s.points.xerr,s.points.yerr];var invertX=false;if(ax[0].p2c(ax[0].max)ax[1].max||yax[0].max)continue;if(err[e].err=="y")if(x>ax[0].max||xax[1].max)continue;var drawUpper=true,drawLower=true;if(upper>minmax[1]){drawUpper=false;upper=minmax[1]}if(lower0&&sw>0){var w=sw/2;ctx.lineWidth=w;ctx.strokeStyle="rgba(0,0,0,0.1)";drawError(ctx,err[e],x,y,upper,lower,drawUpper,drawLower,radius,w+w/2,minmax);ctx.strokeStyle="rgba(0,0,0,0.2)";drawError(ctx,err[e],x,y,upper,lower,drawUpper,drawLower,radius,w/2,minmax)}ctx.strokeStyle=err[e].color?err[e].color:s.color;ctx.lineWidth=lw;drawError(ctx,err[e],x,y,upper,lower,drawUpper,drawLower,radius,0,minmax)}}}}function drawError(ctx,err,x,y,upper,lower,drawUpper,drawLower,radius,offset,minmax){y+=offset;upper+=offset;lower+=offset;if(err.err=="x"){if(upper>x+radius)drawPath(ctx,[[upper,y],[Math.max(x+radius,minmax[0]),y]]);else drawUpper=false;if(lowery+radius)drawPath(ctx,[[x,Math.max(y+radius,minmax[1])],[x,lower]]);else drawLower=false}radius=err.radius!=null?err.radius:radius;if(drawUpper){if(err.upperCap=="-"){if(err.err=="x")drawPath(ctx,[[upper,y-radius],[upper,y+radius]]);else drawPath(ctx,[[x-radius,upper],[x+radius,upper]])}else if($.isFunction(err.upperCap)){if(err.err=="x")err.upperCap(ctx,upper,y,radius);else err.upperCap(ctx,x,upper,radius)}}if(drawLower){if(err.lowerCap=="-"){if(err.err=="x")drawPath(ctx,[[lower,y-radius],[lower,y+radius]]);else drawPath(ctx,[[x-radius,lower],[x+radius,lower]])}else if($.isFunction(err.lowerCap)){if(err.err=="x")err.lowerCap(ctx,lower,y,radius);else err.lowerCap(ctx,x,lower,radius)}}}function drawPath(ctx,pts){ctx.beginPath();ctx.moveTo(pts[0][0],pts[0][1]);for(var p=1;p= allseries.length ) { + return null; + } + return allseries[ s.fillBetween ]; + } + + return null; + } + + function computeFillBottoms( plot, s, datapoints ) { + + if ( s.fillBetween == null ) { + return; + } + + var other = findBottomSeries( s, plot.getData() ); + + if ( !other ) { + return; + } + + var ps = datapoints.pointsize, + points = datapoints.points, + otherps = other.datapoints.pointsize, + otherpoints = other.datapoints.points, + newpoints = [], + px, py, intery, qx, qy, bottom, + withlines = s.lines.show, + withbottom = ps > 2 && datapoints.format[2].y, + withsteps = withlines && s.lines.steps, + fromgap = true, + i = 0, + j = 0, + l, m; + + while ( true ) { + + if ( i >= points.length ) { + break; + } + + l = newpoints.length; + + if ( points[ i ] == null ) { + + // copy gaps + + for ( m = 0; m < ps; ++m ) { + newpoints.push( points[ i + m ] ); + } + + i += ps; + + } else if ( j >= otherpoints.length ) { + + // for lines, we can't use the rest of the points + + if ( !withlines ) { + for ( m = 0; m < ps; ++m ) { + newpoints.push( points[ i + m ] ); + } + } + + i += ps; + + } else if ( otherpoints[ j ] == null ) { + + // oops, got a gap + + for ( m = 0; m < ps; ++m ) { + newpoints.push( null ); + } + + fromgap = true; + j += otherps; + + } else { + + // cases where we actually got two points + + px = points[ i ]; + py = points[ i + 1 ]; + qx = otherpoints[ j ]; + qy = otherpoints[ j + 1 ]; + bottom = 0; + + if ( px === qx ) { + + for ( m = 0; m < ps; ++m ) { + newpoints.push( points[ i + m ] ); + } + + //newpoints[ l + 1 ] += qy; + bottom = qy; + + i += ps; + j += otherps; + + } else if ( px > qx ) { + + // we got past point below, might need to + // insert interpolated extra point + + if ( withlines && i > 0 && points[ i - ps ] != null ) { + intery = py + ( points[ i - ps + 1 ] - py ) * ( qx - px ) / ( points[ i - ps ] - px ); + newpoints.push( qx ); + newpoints.push( intery ); + for ( m = 2; m < ps; ++m ) { + newpoints.push( points[ i + m ] ); + } + bottom = qy; + } + + j += otherps; + + } else { // px < qx + + // if we come from a gap, we just skip this point + + if ( fromgap && withlines ) { + i += ps; + continue; + } + + for ( m = 0; m < ps; ++m ) { + newpoints.push( points[ i + m ] ); + } + + // we might be able to interpolate a point below, + // this can give us a better y + + if ( withlines && j > 0 && otherpoints[ j - otherps ] != null ) { + bottom = qy + ( otherpoints[ j - otherps + 1 ] - qy ) * ( px - qx ) / ( otherpoints[ j - otherps ] - qx ); + } + + //newpoints[l + 1] += bottom; + + i += ps; + } + + fromgap = false; + + if ( l !== newpoints.length && withbottom ) { + newpoints[ l + 2 ] = bottom; + } + } + + // maintain the line steps invariant + + if ( withsteps && l !== newpoints.length && l > 0 && + newpoints[ l ] !== null && + newpoints[ l ] !== newpoints[ l - ps ] && + newpoints[ l + 1 ] !== newpoints[ l - ps + 1 ] ) { + for (m = 0; m < ps; ++m) { + newpoints[ l + ps + m ] = newpoints[ l + m ]; + } + newpoints[ l + 1 ] = newpoints[ l - ps + 1 ]; + } + } + + datapoints.points = newpoints; + } + + plot.hooks.processDatapoints.push( computeFillBottoms ); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: "fillbetween", + version: "1.0" + }); + +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.fillbetween.min.js b/public/assets/js/plugins/flot/jquery.flot.fillbetween.min.js new file mode 100755 index 00000000..5bdad05f --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.fillbetween.min.js @@ -0,0 +1 @@ +(function($){var options={series:{fillBetween:null}};function init(plot){function findBottomSeries(s,allseries){var i;for(i=0;i=allseries.length){return null}return allseries[s.fillBetween]}return null}function computeFillBottoms(plot,s,datapoints){if(s.fillBetween==null){return}var other=findBottomSeries(s,plot.getData());if(!other){return}var ps=datapoints.pointsize,points=datapoints.points,otherps=other.datapoints.pointsize,otherpoints=other.datapoints.points,newpoints=[],px,py,intery,qx,qy,bottom,withlines=s.lines.show,withbottom=ps>2&&datapoints.format[2].y,withsteps=withlines&&s.lines.steps,fromgap=true,i=0,j=0,l,m;while(true){if(i>=points.length){break}l=newpoints.length;if(points[i]==null){for(m=0;m=otherpoints.length){if(!withlines){for(m=0;mqx){if(withlines&&i>0&&points[i-ps]!=null){intery=py+(points[i-ps+1]-py)*(qx-px)/(points[i-ps]-px);newpoints.push(qx);newpoints.push(intery);for(m=2;m0&&otherpoints[j-otherps]!=null){bottom=qy+(otherpoints[j-otherps+1]-qy)*(px-qx)/(otherpoints[j-otherps]-qx)}i+=ps}fromgap=false;if(l!==newpoints.length&&withbottom){newpoints[l+2]=bottom}}if(withsteps&&l!==newpoints.length&&l>0&&newpoints[l]!==null&&newpoints[l]!==newpoints[l-ps]&&newpoints[l+1]!==newpoints[l-ps+1]){for(m=0;m').load(handler).error(handler).attr('src', url); + }); + }; + + function drawSeries(plot, ctx, series) { + var plotOffset = plot.getPlotOffset(); + + if (!series.images || !series.images.show) + return; + + var points = series.datapoints.points, + ps = series.datapoints.pointsize; + + for (var i = 0; i < points.length; i += ps) { + var img = points[i], + x1 = points[i + 1], y1 = points[i + 2], + x2 = points[i + 3], y2 = points[i + 4], + xaxis = series.xaxis, yaxis = series.yaxis, + tmp; + + // actually we should check img.complete, but it + // appears to be a somewhat unreliable indicator in + // IE6 (false even after load event) + if (!img || img.width <= 0 || img.height <= 0) + continue; + + if (x1 > x2) { + tmp = x2; + x2 = x1; + x1 = tmp; + } + if (y1 > y2) { + tmp = y2; + y2 = y1; + y1 = tmp; + } + + // if the anchor is at the center of the pixel, expand the + // image by 1/2 pixel in each direction + if (series.images.anchor == "center") { + tmp = 0.5 * (x2-x1) / (img.width - 1); + x1 -= tmp; + x2 += tmp; + tmp = 0.5 * (y2-y1) / (img.height - 1); + y1 -= tmp; + y2 += tmp; + } + + // clip + if (x1 == x2 || y1 == y2 || + x1 >= xaxis.max || x2 <= xaxis.min || + y1 >= yaxis.max || y2 <= yaxis.min) + continue; + + var sx1 = 0, sy1 = 0, sx2 = img.width, sy2 = img.height; + if (x1 < xaxis.min) { + sx1 += (sx2 - sx1) * (xaxis.min - x1) / (x2 - x1); + x1 = xaxis.min; + } + + if (x2 > xaxis.max) { + sx2 += (sx2 - sx1) * (xaxis.max - x2) / (x2 - x1); + x2 = xaxis.max; + } + + if (y1 < yaxis.min) { + sy2 += (sy1 - sy2) * (yaxis.min - y1) / (y2 - y1); + y1 = yaxis.min; + } + + if (y2 > yaxis.max) { + sy1 += (sy1 - sy2) * (yaxis.max - y2) / (y2 - y1); + y2 = yaxis.max; + } + + x1 = xaxis.p2c(x1); + x2 = xaxis.p2c(x2); + y1 = yaxis.p2c(y1); + y2 = yaxis.p2c(y2); + + // the transformation may have swapped us + if (x1 > x2) { + tmp = x2; + x2 = x1; + x1 = tmp; + } + if (y1 > y2) { + tmp = y2; + y2 = y1; + y1 = tmp; + } + + tmp = ctx.globalAlpha; + ctx.globalAlpha *= series.images.alpha; + ctx.drawImage(img, + sx1, sy1, sx2 - sx1, sy2 - sy1, + x1 + plotOffset.left, y1 + plotOffset.top, + x2 - x1, y2 - y1); + ctx.globalAlpha = tmp; + } + } + + function processRawData(plot, series, data, datapoints) { + if (!series.images.show) + return; + + // format is Image, x1, y1, x2, y2 (opposite corners) + datapoints.format = [ + { required: true }, + { x: true, number: true, required: true }, + { y: true, number: true, required: true }, + { x: true, number: true, required: true }, + { y: true, number: true, required: true } + ]; + } + + function init(plot) { + plot.hooks.processRawData.push(processRawData); + plot.hooks.drawSeries.push(drawSeries); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: 'image', + version: '1.1' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.image.min.js b/public/assets/js/plugins/flot/jquery.flot.image.min.js new file mode 100755 index 00000000..60600241 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.image.min.js @@ -0,0 +1 @@ +(function($){var options={series:{images:{show:false,alpha:1,anchor:"corner"}}};$.plot.image={};$.plot.image.loadDataImages=function(series,options,callback){var urls=[],points=[];var defaultShow=options.series.images.show;$.each(series,function(i,s){if(!(defaultShow||s.images.show))return;if(s.data)s=s.data;$.each(s,function(i,p){if(typeof p[0]=="string"){urls.push(p[0]);points.push(p)}})});$.plot.image.load(urls,function(loadedImages){$.each(points,function(i,p){var url=p[0];if(loadedImages[url])p[0]=loadedImages[url]});callback()})};$.plot.image.load=function(urls,callback){var missing=urls.length,loaded={};if(missing==0)callback({});$.each(urls,function(i,url){var handler=function(){--missing;loaded[url]=this;if(missing==0)callback(loaded)};$("").load(handler).error(handler).attr("src",url)})};function drawSeries(plot,ctx,series){var plotOffset=plot.getPlotOffset();if(!series.images||!series.images.show)return;var points=series.datapoints.points,ps=series.datapoints.pointsize;for(var i=0;ix2){tmp=x2;x2=x1;x1=tmp}if(y1>y2){tmp=y2;y2=y1;y1=tmp}if(series.images.anchor=="center"){tmp=.5*(x2-x1)/(img.width-1);x1-=tmp;x2+=tmp;tmp=.5*(y2-y1)/(img.height-1);y1-=tmp;y2+=tmp}if(x1==x2||y1==y2||x1>=xaxis.max||x2<=xaxis.min||y1>=yaxis.max||y2<=yaxis.min)continue;var sx1=0,sy1=0,sx2=img.width,sy2=img.height;if(x1xaxis.max){sx2+=(sx2-sx1)*(xaxis.max-x2)/(x2-x1);x2=xaxis.max}if(y1yaxis.max){sy1+=(sy1-sy2)*(yaxis.max-y2)/(y2-y1);y2=yaxis.max}x1=xaxis.p2c(x1);x2=xaxis.p2c(x2);y1=yaxis.p2c(y1);y2=yaxis.p2c(y2);if(x1>x2){tmp=x2;x2=x1;x1=tmp}if(y1>y2){tmp=y2;y2=y1;y1=tmp}tmp=ctx.globalAlpha;ctx.globalAlpha*=series.images.alpha;ctx.drawImage(img,sx1,sy1,sx2-sx1,sy2-sy1,x1+plotOffset.left,y1+plotOffset.top,x2-x1,y2-y1);ctx.globalAlpha=tmp}}function processRawData(plot,series,data,datapoints){if(!series.images.show)return;datapoints.format=[{required:true},{x:true,number:true,required:true},{y:true,number:true,required:true},{x:true,number:true,required:true},{y:true,number:true,required:true}]}function init(plot){plot.hooks.processRawData.push(processRawData);plot.hooks.drawSeries.push(drawSeries)}$.plot.plugins.push({init:init,options:options,name:"image",version:"1.1"})})(jQuery); \ No newline at end of file diff --git a/public/assets/js/plugins/flot/jquery.flot.js b/public/assets/js/plugins/flot/jquery.flot.js new file mode 100755 index 00000000..965e78ef --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.js @@ -0,0 +1,3137 @@ +/* Javascript plotting library for jQuery, version 0.8.2. + +Copyright (c) 2007-2013 IOLA and Ole Laursen. +Licensed under the MIT license. + +*/ + +// first an inline dependency, jquery.colorhelpers.js, we inline it here +// for convenience + +/* Plugin for jQuery for working with colors. + * + * Version 1.1. + * + * Inspiration from jQuery color animation plugin by John Resig. + * + * Released under the MIT license by Ole Laursen, October 2009. + * + * Examples: + * + * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString() + * var c = $.color.extract($("#mydiv"), 'background-color'); + * console.log(c.r, c.g, c.b, c.a); + * $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)" + * + * Note that .scale() and .add() return the same modified object + * instead of making a new one. + * + * V. 1.1: Fix error handling so e.g. parsing an empty string does + * produce a color rather than just crashing. + */ +(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery); + +// the actual Flot code +(function($) { + + // Cache the prototype hasOwnProperty for faster access + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + /////////////////////////////////////////////////////////////////////////// + // The Canvas object is a wrapper around an HTML5 tag. + // + // @constructor + // @param {string} cls List of classes to apply to the canvas. + // @param {element} container Element onto which to append the canvas. + // + // Requiring a container is a little iffy, but unfortunately canvas + // operations don't work unless the canvas is attached to the DOM. + + function Canvas(cls, container) { + + var element = container.children("." + cls)[0]; + + if (element == null) { + + element = document.createElement("canvas"); + element.className = cls; + + $(element).css({ direction: "ltr", position: "absolute", left: 0, top: 0 }) + .appendTo(container); + + // If HTML5 Canvas isn't available, fall back to [Ex|Flash]canvas + + if (!element.getContext) { + if (window.G_vmlCanvasManager) { + element = window.G_vmlCanvasManager.initElement(element); + } else { + throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode."); + } + } + } + + this.element = element; + + var context = this.context = element.getContext("2d"); + + // Determine the screen's ratio of physical to device-independent + // pixels. This is the ratio between the canvas width that the browser + // advertises and the number of pixels actually present in that space. + + // The iPhone 4, for example, has a device-independent width of 320px, + // but its screen is actually 640px wide. It therefore has a pixel + // ratio of 2, while most normal devices have a ratio of 1. + + var devicePixelRatio = window.devicePixelRatio || 1, + backingStoreRatio = + context.webkitBackingStorePixelRatio || + context.mozBackingStorePixelRatio || + context.msBackingStorePixelRatio || + context.oBackingStorePixelRatio || + context.backingStorePixelRatio || 1; + + this.pixelRatio = devicePixelRatio / backingStoreRatio; + + // Size the canvas to match the internal dimensions of its container + + this.resize(container.width(), container.height()); + + // Collection of HTML div layers for text overlaid onto the canvas + + this.textContainer = null; + this.text = {}; + + // Cache of text fragments and metrics, so we can avoid expensively + // re-calculating them when the plot is re-rendered in a loop. + + this._textCache = {}; + } + + // Resizes the canvas to the given dimensions. + // + // @param {number} width New width of the canvas, in pixels. + // @param {number} width New height of the canvas, in pixels. + + Canvas.prototype.resize = function(width, height) { + + if (width <= 0 || height <= 0) { + throw new Error("Invalid dimensions for plot, width = " + width + ", height = " + height); + } + + var element = this.element, + context = this.context, + pixelRatio = this.pixelRatio; + + // Resize the canvas, increasing its density based on the display's + // pixel ratio; basically giving it more pixels without increasing the + // size of its element, to take advantage of the fact that retina + // displays have that many more pixels in the same advertised space. + + // Resizing should reset the state (excanvas seems to be buggy though) + + if (this.width != width) { + element.width = width * pixelRatio; + element.style.width = width + "px"; + this.width = width; + } + + if (this.height != height) { + element.height = height * pixelRatio; + element.style.height = height + "px"; + this.height = height; + } + + // Save the context, so we can reset in case we get replotted. The + // restore ensure that we're really back at the initial state, and + // should be safe even if we haven't saved the initial state yet. + + context.restore(); + context.save(); + + // Scale the coordinate space to match the display density; so even though we + // may have twice as many pixels, we still want lines and other drawing to + // appear at the same size; the extra pixels will just make them crisper. + + context.scale(pixelRatio, pixelRatio); + }; + + // Clears the entire canvas area, not including any overlaid HTML text + + Canvas.prototype.clear = function() { + this.context.clearRect(0, 0, this.width, this.height); + }; + + // Finishes rendering the canvas, including managing the text overlay. + + Canvas.prototype.render = function() { + + var cache = this._textCache; + + // For each text layer, add elements marked as active that haven't + // already been rendered, and remove those that are no longer active. + + for (var layerKey in cache) { + if (hasOwnProperty.call(cache, layerKey)) { + + var layer = this.getTextLayer(layerKey), + layerCache = cache[layerKey]; + + layer.hide(); + + for (var styleKey in layerCache) { + if (hasOwnProperty.call(layerCache, styleKey)) { + var styleCache = layerCache[styleKey]; + for (var key in styleCache) { + if (hasOwnProperty.call(styleCache, key)) { + + var positions = styleCache[key].positions; + + for (var i = 0, position; position = positions[i]; i++) { + if (position.active) { + if (!position.rendered) { + layer.append(position.element); + position.rendered = true; + } + } else { + positions.splice(i--, 1); + if (position.rendered) { + position.element.detach(); + } + } + } + + if (positions.length == 0) { + delete styleCache[key]; + } + } + } + } + } + + layer.show(); + } + } + }; + + // Creates (if necessary) and returns the text overlay container. + // + // @param {string} classes String of space-separated CSS classes used to + // uniquely identify the text layer. + // @return {object} The jQuery-wrapped text-layer div. + + Canvas.prototype.getTextLayer = function(classes) { + + var layer = this.text[classes]; + + // Create the text layer if it doesn't exist + + if (layer == null) { + + // Create the text layer container, if it doesn't exist + + if (this.textContainer == null) { + this.textContainer = $("
      ") + .css({ + position: "absolute", + top: 0, + left: 0, + bottom: 0, + right: 0, + 'font-size': "smaller", + color: "#545454" + }) + .insertAfter(this.element); + } + + layer = this.text[classes] = $("
      ") + .addClass(classes) + .css({ + position: "absolute", + top: 0, + left: 0, + bottom: 0, + right: 0 + }) + .appendTo(this.textContainer); + } + + return layer; + }; + + // Creates (if necessary) and returns a text info object. + // + // The object looks like this: + // + // { + // width: Width of the text's wrapper div. + // height: Height of the text's wrapper div. + // element: The jQuery-wrapped HTML div containing the text. + // positions: Array of positions at which this text is drawn. + // } + // + // The positions array contains objects that look like this: + // + // { + // active: Flag indicating whether the text should be visible. + // rendered: Flag indicating whether the text is currently visible. + // element: The jQuery-wrapped HTML div containing the text. + // x: X coordinate at which to draw the text. + // y: Y coordinate at which to draw the text. + // } + // + // Each position after the first receives a clone of the original element. + // + // The idea is that that the width, height, and general 'identity' of the + // text is constant no matter where it is placed; the placements are a + // secondary property. + // + // Canvas maintains a cache of recently-used text info objects; getTextInfo + // either returns the cached element or creates a new entry. + // + // @param {string} layer A string of space-separated CSS classes uniquely + // identifying the layer containing this text. + // @param {string} text Text string to retrieve info for. + // @param {(string|object)=} font Either a string of space-separated CSS + // classes or a font-spec object, defining the text's font and style. + // @param {number=} angle Angle at which to rotate the text, in degrees. + // Angle is currently unused, it will be implemented in the future. + // @param {number=} width Maximum width of the text before it wraps. + // @return {object} a text info object. + + Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) { + + var textStyle, layerCache, styleCache, info; + + // Cast the value to a string, in case we were given a number or such + + text = "" + text; + + // If the font is a font-spec object, generate a CSS font definition + + if (typeof font === "object") { + textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px/" + font.lineHeight + "px " + font.family; + } else { + textStyle = font; + } + + // Retrieve (or create) the cache for the text's layer and styles + + layerCache = this._textCache[layer]; + + if (layerCache == null) { + layerCache = this._textCache[layer] = {}; + } + + styleCache = layerCache[textStyle]; + + if (styleCache == null) { + styleCache = layerCache[textStyle] = {}; + } + + info = styleCache[text]; + + // If we can't find a matching element in our cache, create a new one + + if (info == null) { + + var element = $("
      ").html(text) + .css({ + position: "absolute", + 'max-width': width, + top: -9999 + }) + .appendTo(this.getTextLayer(layer)); + + if (typeof font === "object") { + element.css({ + font: textStyle, + color: font.color + }); + } else if (typeof font === "string") { + element.addClass(font); + } + + info = styleCache[text] = { + width: element.outerWidth(true), + height: element.outerHeight(true), + element: element, + positions: [] + }; + + element.detach(); + } + + return info; + }; + + // Adds a text string to the canvas text overlay. + // + // The text isn't drawn immediately; it is marked as rendering, which will + // result in its addition to the canvas on the next render pass. + // + // @param {string} layer A string of space-separated CSS classes uniquely + // identifying the layer containing this text. + // @param {number} x X coordinate at which to draw the text. + // @param {number} y Y coordinate at which to draw the text. + // @param {string} text Text string to draw. + // @param {(string|object)=} font Either a string of space-separated CSS + // classes or a font-spec object, defining the text's font and style. + // @param {number=} angle Angle at which to rotate the text, in degrees. + // Angle is currently unused, it will be implemented in the future. + // @param {number=} width Maximum width of the text before it wraps. + // @param {string=} halign Horizontal alignment of the text; either "left", + // "center" or "right". + // @param {string=} valign Vertical alignment of the text; either "top", + // "middle" or "bottom". + + Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) { + + var info = this.getTextInfo(layer, text, font, angle, width), + positions = info.positions; + + // Tweak the div's position to match the text's alignment + + if (halign == "center") { + x -= info.width / 2; + } else if (halign == "right") { + x -= info.width; + } + + if (valign == "middle") { + y -= info.height / 2; + } else if (valign == "bottom") { + y -= info.height; + } + + // Determine whether this text already exists at this position. + // If so, mark it for inclusion in the next render pass. + + for (var i = 0, position; position = positions[i]; i++) { + if (position.x == x && position.y == y) { + position.active = true; + return; + } + } + + // If the text doesn't exist at this position, create a new entry + + // For the very first position we'll re-use the original element, + // while for subsequent ones we'll clone it. + + position = { + active: true, + rendered: false, + element: positions.length ? info.element.clone() : info.element, + x: x, + y: y + }; + + positions.push(position); + + // Move the element to its final position within the container + + position.element.css({ + top: Math.round(y), + left: Math.round(x), + 'text-align': halign // In case the text wraps + }); + }; + + // Removes one or more text strings from the canvas text overlay. + // + // If no parameters are given, all text within the layer is removed. + // + // Note that the text is not immediately removed; it is simply marked as + // inactive, which will result in its removal on the next render pass. + // This avoids the performance penalty for 'clear and redraw' behavior, + // where we potentially get rid of all text on a layer, but will likely + // add back most or all of it later, as when redrawing axes, for example. + // + // @param {string} layer A string of space-separated CSS classes uniquely + // identifying the layer containing this text. + // @param {number=} x X coordinate of the text. + // @param {number=} y Y coordinate of the text. + // @param {string=} text Text string to remove. + // @param {(string|object)=} font Either a string of space-separated CSS + // classes or a font-spec object, defining the text's font and style. + // @param {number=} angle Angle at which the text is rotated, in degrees. + // Angle is currently unused, it will be implemented in the future. + + Canvas.prototype.removeText = function(layer, x, y, text, font, angle) { + if (text == null) { + var layerCache = this._textCache[layer]; + if (layerCache != null) { + for (var styleKey in layerCache) { + if (hasOwnProperty.call(layerCache, styleKey)) { + var styleCache = layerCache[styleKey]; + for (var key in styleCache) { + if (hasOwnProperty.call(styleCache, key)) { + var positions = styleCache[key].positions; + for (var i = 0, position; position = positions[i]; i++) { + position.active = false; + } + } + } + } + } + } + } else { + var positions = this.getTextInfo(layer, text, font, angle).positions; + for (var i = 0, position; position = positions[i]; i++) { + if (position.x == x && position.y == y) { + position.active = false; + } + } + } + }; + + /////////////////////////////////////////////////////////////////////////// + // The top-level container for the entire plot. + + function Plot(placeholder, data_, options_, plugins) { + // data is on the form: + // [ series1, series2 ... ] + // where series is either just the data as [ [x1, y1], [x2, y2], ... ] + // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... } + + var series = [], + options = { + // the color theme used for graphs + colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"], + legend: { + show: true, + noColumns: 1, // number of colums in legend table + labelFormatter: null, // fn: string -> string + labelBoxBorderColor: "#ccc", // border color for the little label boxes + container: null, // container (as jQuery object) to put legend in, null means default on top of graph + position: "ne", // position of default legend container within plot + margin: 5, // distance from grid edge to default legend container within plot + backgroundColor: null, // null means auto-detect + backgroundOpacity: 0.85, // set to 0 to avoid background + sorted: null // default to no legend sorting + }, + xaxis: { + show: null, // null = auto-detect, true = always, false = never + position: "bottom", // or "top" + mode: null, // null or "time" + font: null, // null (derived from CSS in placeholder) or object like { size: 11, lineHeight: 13, style: "italic", weight: "bold", family: "sans-serif", variant: "small-caps" } + color: null, // base color, labels, ticks + tickColor: null, // possibly different color of ticks, e.g. "rgba(0,0,0,0.15)" + transform: null, // null or f: number -> number to transform axis + inverseTransform: null, // if transform is set, this should be the inverse function + min: null, // min. value to show, null means set automatically + max: null, // max. value to show, null means set automatically + autoscaleMargin: null, // margin in % to add if auto-setting min/max + ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks + tickFormatter: null, // fn: number -> string + labelWidth: null, // size of tick labels in pixels + labelHeight: null, + reserveSpace: null, // whether to reserve space even if axis isn't shown + tickLength: null, // size in pixels of ticks, or "full" for whole line + alignTicksWithAxis: null, // axis number or null for no sync + tickDecimals: null, // no. of decimals, null means auto + tickSize: null, // number or [number, "unit"] + minTickSize: null // number or [number, "unit"] + }, + yaxis: { + autoscaleMargin: 0.02, + position: "left" // or "right" + }, + xaxes: [], + yaxes: [], + series: { + points: { + show: false, + radius: 3, + lineWidth: 2, // in pixels + fill: true, + fillColor: "#ffffff", + symbol: "circle" // or callback + }, + lines: { + // we don't put in show: false so we can see + // whether lines were actively disabled + lineWidth: 2, // in pixels + fill: false, + fillColor: null, + steps: false + // Omit 'zero', so we can later default its value to + // match that of the 'fill' option. + }, + bars: { + show: false, + lineWidth: 2, // in pixels + barWidth: 1, // in units of the x axis + fill: true, + fillColor: null, + align: "left", // "left", "right", or "center" + horizontal: false, + zero: true + }, + shadowSize: 3, + highlightColor: null + }, + grid: { + show: true, + aboveData: false, + color: "#545454", // primary color used for outline and labels + backgroundColor: null, // null for transparent, else color + borderColor: null, // set if different from the grid color + tickColor: null, // color for the ticks, e.g. "rgba(0,0,0,0.15)" + margin: 0, // distance from the canvas edge to the grid + labelMargin: 5, // in pixels + axisMargin: 8, // in pixels + borderWidth: 2, // in pixels + minBorderMargin: null, // in pixels, null means taken from points radius + markings: null, // array of ranges or fn: axes -> array of ranges + markingsColor: "#f4f4f4", + markingsLineWidth: 2, + // interactive stuff + clickable: false, + hoverable: false, + autoHighlight: true, // highlight in case mouse is near + mouseActiveRadius: 10 // how far the mouse can be away to activate an item + }, + interaction: { + redrawOverlayInterval: 1000/60 // time between updates, -1 means in same flow + }, + hooks: {} + }, + surface = null, // the canvas for the plot itself + overlay = null, // canvas for interactive stuff on top of plot + eventHolder = null, // jQuery object that events should be bound to + ctx = null, octx = null, + xaxes = [], yaxes = [], + plotOffset = { left: 0, right: 0, top: 0, bottom: 0}, + plotWidth = 0, plotHeight = 0, + hooks = { + processOptions: [], + processRawData: [], + processDatapoints: [], + processOffset: [], + drawBackground: [], + drawSeries: [], + draw: [], + bindEvents: [], + drawOverlay: [], + shutdown: [] + }, + plot = this; + + // public functions + plot.setData = setData; + plot.setupGrid = setupGrid; + plot.draw = draw; + plot.getPlaceholder = function() { return placeholder; }; + plot.getCanvas = function() { return surface.element; }; + plot.getPlotOffset = function() { return plotOffset; }; + plot.width = function () { return plotWidth; }; + plot.height = function () { return plotHeight; }; + plot.offset = function () { + var o = eventHolder.offset(); + o.left += plotOffset.left; + o.top += plotOffset.top; + return o; + }; + plot.getData = function () { return series; }; + plot.getAxes = function () { + var res = {}, i; + $.each(xaxes.concat(yaxes), function (_, axis) { + if (axis) + res[axis.direction + (axis.n != 1 ? axis.n : "") + "axis"] = axis; + }); + return res; + }; + plot.getXAxes = function () { return xaxes; }; + plot.getYAxes = function () { return yaxes; }; + plot.c2p = canvasToAxisCoords; + plot.p2c = axisToCanvasCoords; + plot.getOptions = function () { return options; }; + plot.highlight = highlight; + plot.unhighlight = unhighlight; + plot.triggerRedrawOverlay = triggerRedrawOverlay; + plot.pointOffset = function(point) { + return { + left: parseInt(xaxes[axisNumber(point, "x") - 1].p2c(+point.x) + plotOffset.left, 10), + top: parseInt(yaxes[axisNumber(point, "y") - 1].p2c(+point.y) + plotOffset.top, 10) + }; + }; + plot.shutdown = shutdown; + plot.destroy = function () { + shutdown(); + placeholder.removeData("plot").empty(); + + series = []; + options = null; + surface = null; + overlay = null; + eventHolder = null; + ctx = null; + octx = null; + xaxes = []; + yaxes = []; + hooks = null; + highlights = []; + plot = null; + }; + plot.resize = function () { + var width = placeholder.width(), + height = placeholder.height(); + surface.resize(width, height); + overlay.resize(width, height); + }; + + // public attributes + plot.hooks = hooks; + + // initialize + initPlugins(plot); + parseOptions(options_); + setupCanvases(); + setData(data_); + setupGrid(); + draw(); + bindEvents(); + + + function executeHooks(hook, args) { + args = [plot].concat(args); + for (var i = 0; i < hook.length; ++i) + hook[i].apply(this, args); + } + + function initPlugins() { + + // References to key classes, allowing plugins to modify them + + var classes = { + Canvas: Canvas + }; + + for (var i = 0; i < plugins.length; ++i) { + var p = plugins[i]; + p.init(plot, classes); + if (p.options) + $.extend(true, options, p.options); + } + } + + function parseOptions(opts) { + + $.extend(true, options, opts); + + // $.extend merges arrays, rather than replacing them. When less + // colors are provided than the size of the default palette, we + // end up with those colors plus the remaining defaults, which is + // not expected behavior; avoid it by replacing them here. + + if (opts && opts.colors) { + options.colors = opts.colors; + } + + if (options.xaxis.color == null) + options.xaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString(); + if (options.yaxis.color == null) + options.yaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString(); + + if (options.xaxis.tickColor == null) // grid.tickColor for back-compatibility + options.xaxis.tickColor = options.grid.tickColor || options.xaxis.color; + if (options.yaxis.tickColor == null) // grid.tickColor for back-compatibility + options.yaxis.tickColor = options.grid.tickColor || options.yaxis.color; + + if (options.grid.borderColor == null) + options.grid.borderColor = options.grid.color; + if (options.grid.tickColor == null) + options.grid.tickColor = $.color.parse(options.grid.color).scale('a', 0.22).toString(); + + // Fill in defaults for axis options, including any unspecified + // font-spec fields, if a font-spec was provided. + + // If no x/y axis options were provided, create one of each anyway, + // since the rest of the code assumes that they exist. + + var i, axisOptions, axisCount, + fontSize = placeholder.css("font-size"), + fontSizeDefault = fontSize ? +fontSize.replace("px", "") : 13, + fontDefaults = { + style: placeholder.css("font-style"), + size: Math.round(0.8 * fontSizeDefault), + variant: placeholder.css("font-variant"), + weight: placeholder.css("font-weight"), + family: placeholder.css("font-family") + }; + + axisCount = options.xaxes.length || 1; + for (i = 0; i < axisCount; ++i) { + + axisOptions = options.xaxes[i]; + if (axisOptions && !axisOptions.tickColor) { + axisOptions.tickColor = axisOptions.color; + } + + axisOptions = $.extend(true, {}, options.xaxis, axisOptions); + options.xaxes[i] = axisOptions; + + if (axisOptions.font) { + axisOptions.font = $.extend({}, fontDefaults, axisOptions.font); + if (!axisOptions.font.color) { + axisOptions.font.color = axisOptions.color; + } + if (!axisOptions.font.lineHeight) { + axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15); + } + } + } + + axisCount = options.yaxes.length || 1; + for (i = 0; i < axisCount; ++i) { + + axisOptions = options.yaxes[i]; + if (axisOptions && !axisOptions.tickColor) { + axisOptions.tickColor = axisOptions.color; + } + + axisOptions = $.extend(true, {}, options.yaxis, axisOptions); + options.yaxes[i] = axisOptions; + + if (axisOptions.font) { + axisOptions.font = $.extend({}, fontDefaults, axisOptions.font); + if (!axisOptions.font.color) { + axisOptions.font.color = axisOptions.color; + } + if (!axisOptions.font.lineHeight) { + axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15); + } + } + } + + // backwards compatibility, to be removed in future + if (options.xaxis.noTicks && options.xaxis.ticks == null) + options.xaxis.ticks = options.xaxis.noTicks; + if (options.yaxis.noTicks && options.yaxis.ticks == null) + options.yaxis.ticks = options.yaxis.noTicks; + if (options.x2axis) { + options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis); + options.xaxes[1].position = "top"; + } + if (options.y2axis) { + options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis); + options.yaxes[1].position = "right"; + } + if (options.grid.coloredAreas) + options.grid.markings = options.grid.coloredAreas; + if (options.grid.coloredAreasColor) + options.grid.markingsColor = options.grid.coloredAreasColor; + if (options.lines) + $.extend(true, options.series.lines, options.lines); + if (options.points) + $.extend(true, options.series.points, options.points); + if (options.bars) + $.extend(true, options.series.bars, options.bars); + if (options.shadowSize != null) + options.series.shadowSize = options.shadowSize; + if (options.highlightColor != null) + options.series.highlightColor = options.highlightColor; + + // save options on axes for future reference + for (i = 0; i < options.xaxes.length; ++i) + getOrCreateAxis(xaxes, i + 1).options = options.xaxes[i]; + for (i = 0; i < options.yaxes.length; ++i) + getOrCreateAxis(yaxes, i + 1).options = options.yaxes[i]; + + // add hooks from options + for (var n in hooks) + if (options.hooks[n] && options.hooks[n].length) + hooks[n] = hooks[n].concat(options.hooks[n]); + + executeHooks(hooks.processOptions, [options]); + } + + function setData(d) { + series = parseData(d); + fillInSeriesOptions(); + processData(); + } + + function parseData(d) { + var res = []; + for (var i = 0; i < d.length; ++i) { + var s = $.extend(true, {}, options.series); + + if (d[i].data != null) { + s.data = d[i].data; // move the data instead of deep-copy + delete d[i].data; + + $.extend(true, s, d[i]); + + d[i].data = s.data; + } + else + s.data = d[i]; + res.push(s); + } + + return res; + } + + function axisNumber(obj, coord) { + var a = obj[coord + "axis"]; + if (typeof a == "object") // if we got a real axis, extract number + a = a.n; + if (typeof a != "number") + a = 1; // default to first axis + return a; + } + + function allAxes() { + // return flat array without annoying null entries + return $.grep(xaxes.concat(yaxes), function (a) { return a; }); + } + + function canvasToAxisCoords(pos) { + // return an object with x/y corresponding to all used axes + var res = {}, i, axis; + for (i = 0; i < xaxes.length; ++i) { + axis = xaxes[i]; + if (axis && axis.used) + res["x" + axis.n] = axis.c2p(pos.left); + } + + for (i = 0; i < yaxes.length; ++i) { + axis = yaxes[i]; + if (axis && axis.used) + res["y" + axis.n] = axis.c2p(pos.top); + } + + if (res.x1 !== undefined) + res.x = res.x1; + if (res.y1 !== undefined) + res.y = res.y1; + + return res; + } + + function axisToCanvasCoords(pos) { + // get canvas coords from the first pair of x/y found in pos + var res = {}, i, axis, key; + + for (i = 0; i < xaxes.length; ++i) { + axis = xaxes[i]; + if (axis && axis.used) { + key = "x" + axis.n; + if (pos[key] == null && axis.n == 1) + key = "x"; + + if (pos[key] != null) { + res.left = axis.p2c(pos[key]); + break; + } + } + } + + for (i = 0; i < yaxes.length; ++i) { + axis = yaxes[i]; + if (axis && axis.used) { + key = "y" + axis.n; + if (pos[key] == null && axis.n == 1) + key = "y"; + + if (pos[key] != null) { + res.top = axis.p2c(pos[key]); + break; + } + } + } + + return res; + } + + function getOrCreateAxis(axes, number) { + if (!axes[number - 1]) + axes[number - 1] = { + n: number, // save the number for future reference + direction: axes == xaxes ? "x" : "y", + options: $.extend(true, {}, axes == xaxes ? options.xaxis : options.yaxis) + }; + + return axes[number - 1]; + } + + function fillInSeriesOptions() { + + var neededColors = series.length, maxIndex = -1, i; + + // Subtract the number of series that already have fixed colors or + // color indexes from the number that we still need to generate. + + for (i = 0; i < series.length; ++i) { + var sc = series[i].color; + if (sc != null) { + neededColors--; + if (typeof sc == "number" && sc > maxIndex) { + maxIndex = sc; + } + } + } + + // If any of the series have fixed color indexes, then we need to + // generate at least as many colors as the highest index. + + if (neededColors <= maxIndex) { + neededColors = maxIndex + 1; + } + + // Generate all the colors, using first the option colors and then + // variations on those colors once they're exhausted. + + var c, colors = [], colorPool = options.colors, + colorPoolSize = colorPool.length, variation = 0; + + for (i = 0; i < neededColors; i++) { + + c = $.color.parse(colorPool[i % colorPoolSize] || "#666"); + + // Each time we exhaust the colors in the pool we adjust + // a scaling factor used to produce more variations on + // those colors. The factor alternates negative/positive + // to produce lighter/darker colors. + + // Reset the variation after every few cycles, or else + // it will end up producing only white or black colors. + + if (i % colorPoolSize == 0 && i) { + if (variation >= 0) { + if (variation < 0.5) { + variation = -variation - 0.2; + } else variation = 0; + } else variation = -variation; + } + + colors[i] = c.scale('rgb', 1 + variation); + } + + // Finalize the series options, filling in their colors + + var colori = 0, s; + for (i = 0; i < series.length; ++i) { + s = series[i]; + + // assign colors + if (s.color == null) { + s.color = colors[colori].toString(); + ++colori; + } + else if (typeof s.color == "number") + s.color = colors[s.color].toString(); + + // turn on lines automatically in case nothing is set + if (s.lines.show == null) { + var v, show = true; + for (v in s) + if (s[v] && s[v].show) { + show = false; + break; + } + if (show) + s.lines.show = true; + } + + // If nothing was provided for lines.zero, default it to match + // lines.fill, since areas by default should extend to zero. + + if (s.lines.zero == null) { + s.lines.zero = !!s.lines.fill; + } + + // setup axes + s.xaxis = getOrCreateAxis(xaxes, axisNumber(s, "x")); + s.yaxis = getOrCreateAxis(yaxes, axisNumber(s, "y")); + } + } + + function processData() { + var topSentry = Number.POSITIVE_INFINITY, + bottomSentry = Number.NEGATIVE_INFINITY, + fakeInfinity = Number.MAX_VALUE, + i, j, k, m, length, + s, points, ps, x, y, axis, val, f, p, + data, format; + + function updateAxis(axis, min, max) { + if (min < axis.datamin && min != -fakeInfinity) + axis.datamin = min; + if (max > axis.datamax && max != fakeInfinity) + axis.datamax = max; + } + + $.each(allAxes(), function (_, axis) { + // init axis + axis.datamin = topSentry; + axis.datamax = bottomSentry; + axis.used = false; + }); + + for (i = 0; i < series.length; ++i) { + s = series[i]; + s.datapoints = { points: [] }; + + executeHooks(hooks.processRawData, [ s, s.data, s.datapoints ]); + } + + // first pass: clean and copy data + for (i = 0; i < series.length; ++i) { + s = series[i]; + + data = s.data; + format = s.datapoints.format; + + if (!format) { + format = []; + // find out how to copy + format.push({ x: true, number: true, required: true }); + format.push({ y: true, number: true, required: true }); + + if (s.bars.show || (s.lines.show && s.lines.fill)) { + var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero)); + format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale }); + if (s.bars.horizontal) { + delete format[format.length - 1].y; + format[format.length - 1].x = true; + } + } + + s.datapoints.format = format; + } + + if (s.datapoints.pointsize != null) + continue; // already filled in + + s.datapoints.pointsize = format.length; + + ps = s.datapoints.pointsize; + points = s.datapoints.points; + + var insertSteps = s.lines.show && s.lines.steps; + s.xaxis.used = s.yaxis.used = true; + + for (j = k = 0; j < data.length; ++j, k += ps) { + p = data[j]; + + var nullify = p == null; + if (!nullify) { + for (m = 0; m < ps; ++m) { + val = p[m]; + f = format[m]; + + if (f) { + if (f.number && val != null) { + val = +val; // convert to number + if (isNaN(val)) + val = null; + else if (val == Infinity) + val = fakeInfinity; + else if (val == -Infinity) + val = -fakeInfinity; + } + + if (val == null) { + if (f.required) + nullify = true; + + if (f.defaultValue != null) + val = f.defaultValue; + } + } + + points[k + m] = val; + } + } + + if (nullify) { + for (m = 0; m < ps; ++m) { + val = points[k + m]; + if (val != null) { + f = format[m]; + // extract min/max info + if (f.autoscale !== false) { + if (f.x) { + updateAxis(s.xaxis, val, val); + } + if (f.y) { + updateAxis(s.yaxis, val, val); + } + } + } + points[k + m] = null; + } + } + else { + // a little bit of line specific stuff that + // perhaps shouldn't be here, but lacking + // better means... + if (insertSteps && k > 0 + && points[k - ps] != null + && points[k - ps] != points[k] + && points[k - ps + 1] != points[k + 1]) { + // copy the point to make room for a middle point + for (m = 0; m < ps; ++m) + points[k + ps + m] = points[k + m]; + + // middle point has same y + points[k + 1] = points[k - ps + 1]; + + // we've added a point, better reflect that + k += ps; + } + } + } + } + + // give the hooks a chance to run + for (i = 0; i < series.length; ++i) { + s = series[i]; + + executeHooks(hooks.processDatapoints, [ s, s.datapoints]); + } + + // second pass: find datamax/datamin for auto-scaling + for (i = 0; i < series.length; ++i) { + s = series[i]; + points = s.datapoints.points; + ps = s.datapoints.pointsize; + format = s.datapoints.format; + + var xmin = topSentry, ymin = topSentry, + xmax = bottomSentry, ymax = bottomSentry; + + for (j = 0; j < points.length; j += ps) { + if (points[j] == null) + continue; + + for (m = 0; m < ps; ++m) { + val = points[j + m]; + f = format[m]; + if (!f || f.autoscale === false || val == fakeInfinity || val == -fakeInfinity) + continue; + + if (f.x) { + if (val < xmin) + xmin = val; + if (val > xmax) + xmax = val; + } + if (f.y) { + if (val < ymin) + ymin = val; + if (val > ymax) + ymax = val; + } + } + } + + if (s.bars.show) { + // make sure we got room for the bar on the dancing floor + var delta; + + switch (s.bars.align) { + case "left": + delta = 0; + break; + case "right": + delta = -s.bars.barWidth; + break; + default: + delta = -s.bars.barWidth / 2; + } + + if (s.bars.horizontal) { + ymin += delta; + ymax += delta + s.bars.barWidth; + } + else { + xmin += delta; + xmax += delta + s.bars.barWidth; + } + } + + updateAxis(s.xaxis, xmin, xmax); + updateAxis(s.yaxis, ymin, ymax); + } + + $.each(allAxes(), function (_, axis) { + if (axis.datamin == topSentry) + axis.datamin = null; + if (axis.datamax == bottomSentry) + axis.datamax = null; + }); + } + + function setupCanvases() { + + // Make sure the placeholder is clear of everything except canvases + // from a previous plot in this container that we'll try to re-use. + + placeholder.css("padding", 0) // padding messes up the positioning + .children().filter(function(){ + return !$(this).hasClass("flot-overlay") && !$(this).hasClass('flot-base'); + }).remove(); + + if (placeholder.css("position") == 'static') + placeholder.css("position", "relative"); // for positioning labels and overlay + + surface = new Canvas("flot-base", placeholder); + overlay = new Canvas("flot-overlay", placeholder); // overlay canvas for interactive features + + ctx = surface.context; + octx = overlay.context; + + // define which element we're listening for events on + eventHolder = $(overlay.element).unbind(); + + // If we're re-using a plot object, shut down the old one + + var existing = placeholder.data("plot"); + + if (existing) { + existing.shutdown(); + overlay.clear(); + } + + // save in case we get replotted + placeholder.data("plot", plot); + } + + function bindEvents() { + // bind events + if (options.grid.hoverable) { + eventHolder.mousemove(onMouseMove); + + // Use bind, rather than .mouseleave, because we officially + // still support jQuery 1.2.6, which doesn't define a shortcut + // for mouseenter or mouseleave. This was a bug/oversight that + // was fixed somewhere around 1.3.x. We can return to using + // .mouseleave when we drop support for 1.2.6. + + eventHolder.bind("mouseleave", onMouseLeave); + } + + if (options.grid.clickable) + eventHolder.click(onClick); + + executeHooks(hooks.bindEvents, [eventHolder]); + } + + function shutdown() { + if (redrawTimeout) + clearTimeout(redrawTimeout); + + eventHolder.unbind("mousemove", onMouseMove); + eventHolder.unbind("mouseleave", onMouseLeave); + eventHolder.unbind("click", onClick); + + executeHooks(hooks.shutdown, [eventHolder]); + } + + function setTransformationHelpers(axis) { + // set helper functions on the axis, assumes plot area + // has been computed already + + function identity(x) { return x; } + + var s, m, t = axis.options.transform || identity, + it = axis.options.inverseTransform; + + // precompute how much the axis is scaling a point + // in canvas space + if (axis.direction == "x") { + s = axis.scale = plotWidth / Math.abs(t(axis.max) - t(axis.min)); + m = Math.min(t(axis.max), t(axis.min)); + } + else { + s = axis.scale = plotHeight / Math.abs(t(axis.max) - t(axis.min)); + s = -s; + m = Math.max(t(axis.max), t(axis.min)); + } + + // data point to canvas coordinate + if (t == identity) // slight optimization + axis.p2c = function (p) { return (p - m) * s; }; + else + axis.p2c = function (p) { return (t(p) - m) * s; }; + // canvas coordinate to data point + if (!it) + axis.c2p = function (c) { return m + c / s; }; + else + axis.c2p = function (c) { return it(m + c / s); }; + } + + function measureTickLabels(axis) { + + var opts = axis.options, + ticks = axis.ticks || [], + labelWidth = opts.labelWidth || 0, + labelHeight = opts.labelHeight || 0, + maxWidth = labelWidth || (axis.direction == "x" ? Math.floor(surface.width / (ticks.length || 1)) : null), + legacyStyles = axis.direction + "Axis " + axis.direction + axis.n + "Axis", + layer = "flot-" + axis.direction + "-axis flot-" + axis.direction + axis.n + "-axis " + legacyStyles, + font = opts.font || "flot-tick-label tickLabel"; + + for (var i = 0; i < ticks.length; ++i) { + + var t = ticks[i]; + + if (!t.label) + continue; + + var info = surface.getTextInfo(layer, t.label, font, null, maxWidth); + + labelWidth = Math.max(labelWidth, info.width); + labelHeight = Math.max(labelHeight, info.height); + } + + axis.labelWidth = opts.labelWidth || labelWidth; + axis.labelHeight = opts.labelHeight || labelHeight; + } + + function allocateAxisBoxFirstPhase(axis) { + // find the bounding box of the axis by looking at label + // widths/heights and ticks, make room by diminishing the + // plotOffset; this first phase only looks at one + // dimension per axis, the other dimension depends on the + // other axes so will have to wait + + var lw = axis.labelWidth, + lh = axis.labelHeight, + pos = axis.options.position, + isXAxis = axis.direction === "x", + tickLength = axis.options.tickLength, + axisMargin = options.grid.axisMargin, + padding = options.grid.labelMargin, + innermost = true, + outermost = true, + first = true, + found = false; + + // Determine the axis's position in its direction and on its side + + $.each(isXAxis ? xaxes : yaxes, function(i, a) { + if (a && a.reserveSpace) { + if (a === axis) { + found = true; + } else if (a.options.position === pos) { + if (found) { + outermost = false; + } else { + innermost = false; + } + } + if (!found) { + first = false; + } + } + }); + + // The outermost axis on each side has no margin + + if (outermost) { + axisMargin = 0; + } + + // The ticks for the first axis in each direction stretch across + + if (tickLength == null) { + tickLength = first ? "full" : 5; + } + + if (!isNaN(+tickLength)) + padding += +tickLength; + + if (isXAxis) { + lh += padding; + + if (pos == "bottom") { + plotOffset.bottom += lh + axisMargin; + axis.box = { top: surface.height - plotOffset.bottom, height: lh }; + } + else { + axis.box = { top: plotOffset.top + axisMargin, height: lh }; + plotOffset.top += lh + axisMargin; + } + } + else { + lw += padding; + + if (pos == "left") { + axis.box = { left: plotOffset.left + axisMargin, width: lw }; + plotOffset.left += lw + axisMargin; + } + else { + plotOffset.right += lw + axisMargin; + axis.box = { left: surface.width - plotOffset.right, width: lw }; + } + } + + // save for future reference + axis.position = pos; + axis.tickLength = tickLength; + axis.box.padding = padding; + axis.innermost = innermost; + } + + function allocateAxisBoxSecondPhase(axis) { + // now that all axis boxes have been placed in one + // dimension, we can set the remaining dimension coordinates + if (axis.direction == "x") { + axis.box.left = plotOffset.left - axis.labelWidth / 2; + axis.box.width = surface.width - plotOffset.left - plotOffset.right + axis.labelWidth; + } + else { + axis.box.top = plotOffset.top - axis.labelHeight / 2; + axis.box.height = surface.height - plotOffset.bottom - plotOffset.top + axis.labelHeight; + } + } + + function adjustLayoutForThingsStickingOut() { + // possibly adjust plot offset to ensure everything stays + // inside the canvas and isn't clipped off + + var minMargin = options.grid.minBorderMargin, + axis, i; + + // check stuff from the plot (FIXME: this should just read + // a value from the series, otherwise it's impossible to + // customize) + if (minMargin == null) { + minMargin = 0; + for (i = 0; i < series.length; ++i) + minMargin = Math.max(minMargin, 2 * (series[i].points.radius + series[i].points.lineWidth/2)); + } + + var margins = { + left: minMargin, + right: minMargin, + top: minMargin, + bottom: minMargin + }; + + // check axis labels, note we don't check the actual + // labels but instead use the overall width/height to not + // jump as much around with replots + $.each(allAxes(), function (_, axis) { + if (axis.reserveSpace && axis.ticks && axis.ticks.length) { + var lastTick = axis.ticks[axis.ticks.length - 1]; + if (axis.direction === "x") { + margins.left = Math.max(margins.left, axis.labelWidth / 2); + if (lastTick.v <= axis.max) { + margins.right = Math.max(margins.right, axis.labelWidth / 2); + } + } else { + margins.bottom = Math.max(margins.bottom, axis.labelHeight / 2); + if (lastTick.v <= axis.max) { + margins.top = Math.max(margins.top, axis.labelHeight / 2); + } + } + } + }); + + plotOffset.left = Math.ceil(Math.max(margins.left, plotOffset.left)); + plotOffset.right = Math.ceil(Math.max(margins.right, plotOffset.right)); + plotOffset.top = Math.ceil(Math.max(margins.top, plotOffset.top)); + plotOffset.bottom = Math.ceil(Math.max(margins.bottom, plotOffset.bottom)); + } + + function setupGrid() { + var i, axes = allAxes(), showGrid = options.grid.show; + + // Initialize the plot's offset from the edge of the canvas + + for (var a in plotOffset) { + var margin = options.grid.margin || 0; + plotOffset[a] = typeof margin == "number" ? margin : margin[a] || 0; + } + + executeHooks(hooks.processOffset, [plotOffset]); + + // If the grid is visible, add its border width to the offset + + for (var a in plotOffset) { + if(typeof(options.grid.borderWidth) == "object") { + plotOffset[a] += showGrid ? options.grid.borderWidth[a] : 0; + } + else { + plotOffset[a] += showGrid ? options.grid.borderWidth : 0; + } + } + + // init axes + $.each(axes, function (_, axis) { + axis.show = axis.options.show; + if (axis.show == null) + axis.show = axis.used; // by default an axis is visible if it's got data + + axis.reserveSpace = axis.show || axis.options.reserveSpace; + + setRange(axis); + }); + + if (showGrid) { + + var allocatedAxes = $.grep(axes, function (axis) { return axis.reserveSpace; }); + + $.each(allocatedAxes, function (_, axis) { + // make the ticks + setupTickGeneration(axis); + setTicks(axis); + snapRangeToTicks(axis, axis.ticks); + // find labelWidth/Height for axis + measureTickLabels(axis); + }); + + // with all dimensions calculated, we can compute the + // axis bounding boxes, start from the outside + // (reverse order) + for (i = allocatedAxes.length - 1; i >= 0; --i) + allocateAxisBoxFirstPhase(allocatedAxes[i]); + + // make sure we've got enough space for things that + // might stick out + adjustLayoutForThingsStickingOut(); + + $.each(allocatedAxes, function (_, axis) { + allocateAxisBoxSecondPhase(axis); + }); + } + + plotWidth = surface.width - plotOffset.left - plotOffset.right; + plotHeight = surface.height - plotOffset.bottom - plotOffset.top; + + // now we got the proper plot dimensions, we can compute the scaling + $.each(axes, function (_, axis) { + setTransformationHelpers(axis); + }); + + if (showGrid) { + drawAxisLabels(); + } + + insertLegend(); + } + + function setRange(axis) { + var opts = axis.options, + min = +(opts.min != null ? opts.min : axis.datamin), + max = +(opts.max != null ? opts.max : axis.datamax), + delta = max - min; + + if (delta == 0.0) { + // degenerate case + var widen = max == 0 ? 1 : 0.01; + + if (opts.min == null) + min -= widen; + // always widen max if we couldn't widen min to ensure we + // don't fall into min == max which doesn't work + if (opts.max == null || opts.min != null) + max += widen; + } + else { + // consider autoscaling + var margin = opts.autoscaleMargin; + if (margin != null) { + if (opts.min == null) { + min -= delta * margin; + // make sure we don't go below zero if all values + // are positive + if (min < 0 && axis.datamin != null && axis.datamin >= 0) + min = 0; + } + if (opts.max == null) { + max += delta * margin; + if (max > 0 && axis.datamax != null && axis.datamax <= 0) + max = 0; + } + } + } + axis.min = min; + axis.max = max; + } + + function setupTickGeneration(axis) { + var opts = axis.options; + + // estimate number of ticks + var noTicks; + if (typeof opts.ticks == "number" && opts.ticks > 0) + noTicks = opts.ticks; + else + // heuristic based on the model a*sqrt(x) fitted to + // some data points that seemed reasonable + noTicks = 0.3 * Math.sqrt(axis.direction == "x" ? surface.width : surface.height); + + var delta = (axis.max - axis.min) / noTicks, + dec = -Math.floor(Math.log(delta) / Math.LN10), + maxDec = opts.tickDecimals; + + if (maxDec != null && dec > maxDec) { + dec = maxDec; + } + + var magn = Math.pow(10, -dec), + norm = delta / magn, // norm is between 1.0 and 10.0 + size; + + if (norm < 1.5) { + size = 1; + } else if (norm < 3) { + size = 2; + // special case for 2.5, requires an extra decimal + if (norm > 2.25 && (maxDec == null || dec + 1 <= maxDec)) { + size = 2.5; + ++dec; + } + } else if (norm < 7.5) { + size = 5; + } else { + size = 10; + } + + size *= magn; + + if (opts.minTickSize != null && size < opts.minTickSize) { + size = opts.minTickSize; + } + + axis.delta = delta; + axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec); + axis.tickSize = opts.tickSize || size; + + // Time mode was moved to a plug-in in 0.8, but since so many people use this + // we'll add an especially friendly make sure they remembered to include it. + + if (opts.mode == "time" && !axis.tickGenerator) { + throw new Error("Time mode requires the flot.time plugin."); + } + + // Flot supports base-10 axes; any other mode else is handled by a plug-in, + // like flot.time.js. + + if (!axis.tickGenerator) { + + axis.tickGenerator = function (axis) { + + var ticks = [], + start = floorInBase(axis.min, axis.tickSize), + i = 0, + v = Number.NaN, + prev; + + do { + prev = v; + v = start + i * axis.tickSize; + ticks.push(v); + ++i; + } while (v < axis.max && v != prev); + return ticks; + }; + + axis.tickFormatter = function (value, axis) { + + var factor = axis.tickDecimals ? Math.pow(10, axis.tickDecimals) : 1; + var formatted = "" + Math.round(value * factor) / factor; + + // If tickDecimals was specified, ensure that we have exactly that + // much precision; otherwise default to the value's own precision. + + if (axis.tickDecimals != null) { + var decimal = formatted.indexOf("."); + var precision = decimal == -1 ? 0 : formatted.length - decimal - 1; + if (precision < axis.tickDecimals) { + return (precision ? formatted : formatted + ".") + ("" + factor).substr(1, axis.tickDecimals - precision); + } + } + + return formatted; + }; + } + + if ($.isFunction(opts.tickFormatter)) + axis.tickFormatter = function (v, axis) { return "" + opts.tickFormatter(v, axis); }; + + if (opts.alignTicksWithAxis != null) { + var otherAxis = (axis.direction == "x" ? xaxes : yaxes)[opts.alignTicksWithAxis - 1]; + if (otherAxis && otherAxis.used && otherAxis != axis) { + // consider snapping min/max to outermost nice ticks + var niceTicks = axis.tickGenerator(axis); + if (niceTicks.length > 0) { + if (opts.min == null) + axis.min = Math.min(axis.min, niceTicks[0]); + if (opts.max == null && niceTicks.length > 1) + axis.max = Math.max(axis.max, niceTicks[niceTicks.length - 1]); + } + + axis.tickGenerator = function (axis) { + // copy ticks, scaled to this axis + var ticks = [], v, i; + for (i = 0; i < otherAxis.ticks.length; ++i) { + v = (otherAxis.ticks[i].v - otherAxis.min) / (otherAxis.max - otherAxis.min); + v = axis.min + v * (axis.max - axis.min); + ticks.push(v); + } + return ticks; + }; + + // we might need an extra decimal since forced + // ticks don't necessarily fit naturally + if (!axis.mode && opts.tickDecimals == null) { + var extraDec = Math.max(0, -Math.floor(Math.log(axis.delta) / Math.LN10) + 1), + ts = axis.tickGenerator(axis); + + // only proceed if the tick interval rounded + // with an extra decimal doesn't give us a + // zero at end + if (!(ts.length > 1 && /\..*0$/.test((ts[1] - ts[0]).toFixed(extraDec)))) + axis.tickDecimals = extraDec; + } + } + } + } + + function setTicks(axis) { + var oticks = axis.options.ticks, ticks = []; + if (oticks == null || (typeof oticks == "number" && oticks > 0)) + ticks = axis.tickGenerator(axis); + else if (oticks) { + if ($.isFunction(oticks)) + // generate the ticks + ticks = oticks(axis); + else + ticks = oticks; + } + + // clean up/labelify the supplied ticks, copy them over + var i, v; + axis.ticks = []; + for (i = 0; i < ticks.length; ++i) { + var label = null; + var t = ticks[i]; + if (typeof t == "object") { + v = +t[0]; + if (t.length > 1) + label = t[1]; + } + else + v = +t; + if (label == null) + label = axis.tickFormatter(v, axis); + if (!isNaN(v)) + axis.ticks.push({ v: v, label: label }); + } + } + + function snapRangeToTicks(axis, ticks) { + if (axis.options.autoscaleMargin && ticks.length > 0) { + // snap to ticks + if (axis.options.min == null) + axis.min = Math.min(axis.min, ticks[0].v); + if (axis.options.max == null && ticks.length > 1) + axis.max = Math.max(axis.max, ticks[ticks.length - 1].v); + } + } + + function draw() { + + surface.clear(); + + executeHooks(hooks.drawBackground, [ctx]); + + var grid = options.grid; + + // draw background, if any + if (grid.show && grid.backgroundColor) + drawBackground(); + + if (grid.show && !grid.aboveData) { + drawGrid(); + } + + for (var i = 0; i < series.length; ++i) { + executeHooks(hooks.drawSeries, [ctx, series[i]]); + drawSeries(series[i]); + } + + executeHooks(hooks.draw, [ctx]); + + if (grid.show && grid.aboveData) { + drawGrid(); + } + + surface.render(); + + // A draw implies that either the axes or data have changed, so we + // should probably update the overlay highlights as well. + + triggerRedrawOverlay(); + } + + function extractRange(ranges, coord) { + var axis, from, to, key, axes = allAxes(); + + for (var i = 0; i < axes.length; ++i) { + axis = axes[i]; + if (axis.direction == coord) { + key = coord + axis.n + "axis"; + if (!ranges[key] && axis.n == 1) + key = coord + "axis"; // support x1axis as xaxis + if (ranges[key]) { + from = ranges[key].from; + to = ranges[key].to; + break; + } + } + } + + // backwards-compat stuff - to be removed in future + if (!ranges[key]) { + axis = coord == "x" ? xaxes[0] : yaxes[0]; + from = ranges[coord + "1"]; + to = ranges[coord + "2"]; + } + + // auto-reverse as an added bonus + if (from != null && to != null && from > to) { + var tmp = from; + from = to; + to = tmp; + } + + return { from: from, to: to, axis: axis }; + } + + function drawBackground() { + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + ctx.fillStyle = getColorOrGradient(options.grid.backgroundColor, plotHeight, 0, "rgba(255, 255, 255, 0)"); + ctx.fillRect(0, 0, plotWidth, plotHeight); + ctx.restore(); + } + + function drawGrid() { + var i, axes, bw, bc; + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + // draw markings + var markings = options.grid.markings; + if (markings) { + if ($.isFunction(markings)) { + axes = plot.getAxes(); + // xmin etc. is backwards compatibility, to be + // removed in the future + axes.xmin = axes.xaxis.min; + axes.xmax = axes.xaxis.max; + axes.ymin = axes.yaxis.min; + axes.ymax = axes.yaxis.max; + + markings = markings(axes); + } + + for (i = 0; i < markings.length; ++i) { + var m = markings[i], + xrange = extractRange(m, "x"), + yrange = extractRange(m, "y"); + + // fill in missing + if (xrange.from == null) + xrange.from = xrange.axis.min; + if (xrange.to == null) + xrange.to = xrange.axis.max; + if (yrange.from == null) + yrange.from = yrange.axis.min; + if (yrange.to == null) + yrange.to = yrange.axis.max; + + // clip + if (xrange.to < xrange.axis.min || xrange.from > xrange.axis.max || + yrange.to < yrange.axis.min || yrange.from > yrange.axis.max) + continue; + + xrange.from = Math.max(xrange.from, xrange.axis.min); + xrange.to = Math.min(xrange.to, xrange.axis.max); + yrange.from = Math.max(yrange.from, yrange.axis.min); + yrange.to = Math.min(yrange.to, yrange.axis.max); + + if (xrange.from == xrange.to && yrange.from == yrange.to) + continue; + + // then draw + xrange.from = xrange.axis.p2c(xrange.from); + xrange.to = xrange.axis.p2c(xrange.to); + yrange.from = yrange.axis.p2c(yrange.from); + yrange.to = yrange.axis.p2c(yrange.to); + + if (xrange.from == xrange.to || yrange.from == yrange.to) { + // draw line + ctx.beginPath(); + ctx.strokeStyle = m.color || options.grid.markingsColor; + ctx.lineWidth = m.lineWidth || options.grid.markingsLineWidth; + ctx.moveTo(xrange.from, yrange.from); + ctx.lineTo(xrange.to, yrange.to); + ctx.stroke(); + } + else { + // fill area + ctx.fillStyle = m.color || options.grid.markingsColor; + ctx.fillRect(xrange.from, yrange.to, + xrange.to - xrange.from, + yrange.from - yrange.to); + } + } + } + + // draw the ticks + axes = allAxes(); + bw = options.grid.borderWidth; + + for (var j = 0; j < axes.length; ++j) { + var axis = axes[j], box = axis.box, + t = axis.tickLength, x, y, xoff, yoff; + if (!axis.show || axis.ticks.length == 0) + continue; + + ctx.lineWidth = 1; + + // find the edges + if (axis.direction == "x") { + x = 0; + if (t == "full") + y = (axis.position == "top" ? 0 : plotHeight); + else + y = box.top - plotOffset.top + (axis.position == "top" ? box.height : 0); + } + else { + y = 0; + if (t == "full") + x = (axis.position == "left" ? 0 : plotWidth); + else + x = box.left - plotOffset.left + (axis.position == "left" ? box.width : 0); + } + + // draw tick bar + if (!axis.innermost) { + ctx.strokeStyle = axis.options.color; + ctx.beginPath(); + xoff = yoff = 0; + if (axis.direction == "x") + xoff = plotWidth + 1; + else + yoff = plotHeight + 1; + + if (ctx.lineWidth == 1) { + if (axis.direction == "x") { + y = Math.floor(y) + 0.5; + } else { + x = Math.floor(x) + 0.5; + } + } + + ctx.moveTo(x, y); + ctx.lineTo(x + xoff, y + yoff); + ctx.stroke(); + } + + // draw ticks + + ctx.strokeStyle = axis.options.tickColor; + + ctx.beginPath(); + for (i = 0; i < axis.ticks.length; ++i) { + var v = axis.ticks[i].v; + + xoff = yoff = 0; + + if (isNaN(v) || v < axis.min || v > axis.max + // skip those lying on the axes if we got a border + || (t == "full" + && ((typeof bw == "object" && bw[axis.position] > 0) || bw > 0) + && (v == axis.min || v == axis.max))) + continue; + + if (axis.direction == "x") { + x = axis.p2c(v); + yoff = t == "full" ? -plotHeight : t; + + if (axis.position == "top") + yoff = -yoff; + } + else { + y = axis.p2c(v); + xoff = t == "full" ? -plotWidth : t; + + if (axis.position == "left") + xoff = -xoff; + } + + if (ctx.lineWidth == 1) { + if (axis.direction == "x") + x = Math.floor(x) + 0.5; + else + y = Math.floor(y) + 0.5; + } + + ctx.moveTo(x, y); + ctx.lineTo(x + xoff, y + yoff); + } + + ctx.stroke(); + } + + + // draw border + if (bw) { + // If either borderWidth or borderColor is an object, then draw the border + // line by line instead of as one rectangle + bc = options.grid.borderColor; + if(typeof bw == "object" || typeof bc == "object") { + if (typeof bw !== "object") { + bw = {top: bw, right: bw, bottom: bw, left: bw}; + } + if (typeof bc !== "object") { + bc = {top: bc, right: bc, bottom: bc, left: bc}; + } + + if (bw.top > 0) { + ctx.strokeStyle = bc.top; + ctx.lineWidth = bw.top; + ctx.beginPath(); + ctx.moveTo(0 - bw.left, 0 - bw.top/2); + ctx.lineTo(plotWidth, 0 - bw.top/2); + ctx.stroke(); + } + + if (bw.right > 0) { + ctx.strokeStyle = bc.right; + ctx.lineWidth = bw.right; + ctx.beginPath(); + ctx.moveTo(plotWidth + bw.right / 2, 0 - bw.top); + ctx.lineTo(plotWidth + bw.right / 2, plotHeight); + ctx.stroke(); + } + + if (bw.bottom > 0) { + ctx.strokeStyle = bc.bottom; + ctx.lineWidth = bw.bottom; + ctx.beginPath(); + ctx.moveTo(plotWidth + bw.right, plotHeight + bw.bottom / 2); + ctx.lineTo(0, plotHeight + bw.bottom / 2); + ctx.stroke(); + } + + if (bw.left > 0) { + ctx.strokeStyle = bc.left; + ctx.lineWidth = bw.left; + ctx.beginPath(); + ctx.moveTo(0 - bw.left/2, plotHeight + bw.bottom); + ctx.lineTo(0- bw.left/2, 0); + ctx.stroke(); + } + } + else { + ctx.lineWidth = bw; + ctx.strokeStyle = options.grid.borderColor; + ctx.strokeRect(-bw/2, -bw/2, plotWidth + bw, plotHeight + bw); + } + } + + ctx.restore(); + } + + function drawAxisLabels() { + + $.each(allAxes(), function (_, axis) { + var box = axis.box, + legacyStyles = axis.direction + "Axis " + axis.direction + axis.n + "Axis", + layer = "flot-" + axis.direction + "-axis flot-" + axis.direction + axis.n + "-axis " + legacyStyles, + font = axis.options.font || "flot-tick-label tickLabel", + tick, x, y, halign, valign; + + // Remove text before checking for axis.show and ticks.length; + // otherwise plugins, like flot-tickrotor, that draw their own + // tick labels will end up with both theirs and the defaults. + + surface.removeText(layer); + + if (!axis.show || axis.ticks.length == 0) + return; + + for (var i = 0; i < axis.ticks.length; ++i) { + + tick = axis.ticks[i]; + if (!tick.label || tick.v < axis.min || tick.v > axis.max) + continue; + + if (axis.direction == "x") { + halign = "center"; + x = plotOffset.left + axis.p2c(tick.v); + if (axis.position == "bottom") { + y = box.top + box.padding; + } else { + y = box.top + box.height - box.padding; + valign = "bottom"; + } + } else { + valign = "middle"; + y = plotOffset.top + axis.p2c(tick.v); + if (axis.position == "left") { + x = box.left + box.width - box.padding; + halign = "right"; + } else { + x = box.left + box.padding; + } + } + + surface.addText(layer, x, y, tick.label, font, null, null, halign, valign); + } + }); + } + + function drawSeries(series) { + if (series.lines.show) + drawSeriesLines(series); + if (series.bars.show) + drawSeriesBars(series); + if (series.points.show) + drawSeriesPoints(series); + } + + function drawSeriesLines(series) { + function plotLine(datapoints, xoffset, yoffset, axisx, axisy) { + var points = datapoints.points, + ps = datapoints.pointsize, + prevx = null, prevy = null; + + ctx.beginPath(); + for (var i = ps; i < points.length; i += ps) { + var x1 = points[i - ps], y1 = points[i - ps + 1], + x2 = points[i], y2 = points[i + 1]; + + if (x1 == null || x2 == null) + continue; + + // clip with ymin + if (y1 <= y2 && y1 < axisy.min) { + if (y2 < axisy.min) + continue; // line segment is outside + // compute new intersection point + x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.min; + } + else if (y2 <= y1 && y2 < axisy.min) { + if (y1 < axisy.min) + continue; + x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.min; + } + + // clip with ymax + if (y1 >= y2 && y1 > axisy.max) { + if (y2 > axisy.max) + continue; + x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.max; + } + else if (y2 >= y1 && y2 > axisy.max) { + if (y1 > axisy.max) + continue; + x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.max; + } + + // clip with xmin + if (x1 <= x2 && x1 < axisx.min) { + if (x2 < axisx.min) + continue; + y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.min; + } + else if (x2 <= x1 && x2 < axisx.min) { + if (x1 < axisx.min) + continue; + y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.min; + } + + // clip with xmax + if (x1 >= x2 && x1 > axisx.max) { + if (x2 > axisx.max) + continue; + y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.max; + } + else if (x2 >= x1 && x2 > axisx.max) { + if (x1 > axisx.max) + continue; + y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.max; + } + + if (x1 != prevx || y1 != prevy) + ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset); + + prevx = x2; + prevy = y2; + ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset); + } + ctx.stroke(); + } + + function plotLineArea(datapoints, axisx, axisy) { + var points = datapoints.points, + ps = datapoints.pointsize, + bottom = Math.min(Math.max(0, axisy.min), axisy.max), + i = 0, top, areaOpen = false, + ypos = 1, segmentStart = 0, segmentEnd = 0; + + // we process each segment in two turns, first forward + // direction to sketch out top, then once we hit the + // end we go backwards to sketch the bottom + while (true) { + if (ps > 0 && i > points.length + ps) + break; + + i += ps; // ps is negative if going backwards + + var x1 = points[i - ps], + y1 = points[i - ps + ypos], + x2 = points[i], y2 = points[i + ypos]; + + if (areaOpen) { + if (ps > 0 && x1 != null && x2 == null) { + // at turning point + segmentEnd = i; + ps = -ps; + ypos = 2; + continue; + } + + if (ps < 0 && i == segmentStart + ps) { + // done with the reverse sweep + ctx.fill(); + areaOpen = false; + ps = -ps; + ypos = 1; + i = segmentStart = segmentEnd + ps; + continue; + } + } + + if (x1 == null || x2 == null) + continue; + + // clip x values + + // clip with xmin + if (x1 <= x2 && x1 < axisx.min) { + if (x2 < axisx.min) + continue; + y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.min; + } + else if (x2 <= x1 && x2 < axisx.min) { + if (x1 < axisx.min) + continue; + y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.min; + } + + // clip with xmax + if (x1 >= x2 && x1 > axisx.max) { + if (x2 > axisx.max) + continue; + y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.max; + } + else if (x2 >= x1 && x2 > axisx.max) { + if (x1 > axisx.max) + continue; + y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.max; + } + + if (!areaOpen) { + // open area + ctx.beginPath(); + ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom)); + areaOpen = true; + } + + // now first check the case where both is outside + if (y1 >= axisy.max && y2 >= axisy.max) { + ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max)); + ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max)); + continue; + } + else if (y1 <= axisy.min && y2 <= axisy.min) { + ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min)); + ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min)); + continue; + } + + // else it's a bit more complicated, there might + // be a flat maxed out rectangle first, then a + // triangular cutout or reverse; to find these + // keep track of the current x values + var x1old = x1, x2old = x2; + + // clip the y values, without shortcutting, we + // go through all cases in turn + + // clip with ymin + if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) { + x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.min; + } + else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) { + x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.min; + } + + // clip with ymax + if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) { + x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.max; + } + else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) { + x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.max; + } + + // if the x value was changed we got a rectangle + // to fill + if (x1 != x1old) { + ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1)); + // it goes to (x1, y1), but we fill that below + } + + // fill triangular section, this sometimes result + // in redundant points if (x1, y1) hasn't changed + // from previous line to, but we just ignore that + ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1)); + ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2)); + + // fill the other rectangle if it's there + if (x2 != x2old) { + ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2)); + ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2)); + } + } + } + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + ctx.lineJoin = "round"; + + var lw = series.lines.lineWidth, + sw = series.shadowSize; + // FIXME: consider another form of shadow when filling is turned on + if (lw > 0 && sw > 0) { + // draw shadow as a thick and thin line with transparency + ctx.lineWidth = sw; + ctx.strokeStyle = "rgba(0,0,0,0.1)"; + // position shadow at angle from the mid of line + var angle = Math.PI/18; + plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis); + ctx.lineWidth = sw/2; + plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis); + } + + ctx.lineWidth = lw; + ctx.strokeStyle = series.color; + var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight); + if (fillStyle) { + ctx.fillStyle = fillStyle; + plotLineArea(series.datapoints, series.xaxis, series.yaxis); + } + + if (lw > 0) + plotLine(series.datapoints, 0, 0, series.xaxis, series.yaxis); + ctx.restore(); + } + + function drawSeriesPoints(series) { + function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) { + var points = datapoints.points, ps = datapoints.pointsize; + + for (var i = 0; i < points.length; i += ps) { + var x = points[i], y = points[i + 1]; + if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) + continue; + + ctx.beginPath(); + x = axisx.p2c(x); + y = axisy.p2c(y) + offset; + if (symbol == "circle") + ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false); + else + symbol(ctx, x, y, radius, shadow); + ctx.closePath(); + + if (fillStyle) { + ctx.fillStyle = fillStyle; + ctx.fill(); + } + ctx.stroke(); + } + } + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + var lw = series.points.lineWidth, + sw = series.shadowSize, + radius = series.points.radius, + symbol = series.points.symbol; + + // If the user sets the line width to 0, we change it to a very + // small value. A line width of 0 seems to force the default of 1. + // Doing the conditional here allows the shadow setting to still be + // optional even with a lineWidth of 0. + + if( lw == 0 ) + lw = 0.0001; + + if (lw > 0 && sw > 0) { + // draw shadow in two steps + var w = sw / 2; + ctx.lineWidth = w; + ctx.strokeStyle = "rgba(0,0,0,0.1)"; + plotPoints(series.datapoints, radius, null, w + w/2, true, + series.xaxis, series.yaxis, symbol); + + ctx.strokeStyle = "rgba(0,0,0,0.2)"; + plotPoints(series.datapoints, radius, null, w/2, true, + series.xaxis, series.yaxis, symbol); + } + + ctx.lineWidth = lw; + ctx.strokeStyle = series.color; + plotPoints(series.datapoints, radius, + getFillStyle(series.points, series.color), 0, false, + series.xaxis, series.yaxis, symbol); + ctx.restore(); + } + + function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) { + var left, right, bottom, top, + drawLeft, drawRight, drawTop, drawBottom, + tmp; + + // in horizontal mode, we start the bar from the left + // instead of from the bottom so it appears to be + // horizontal rather than vertical + if (horizontal) { + drawBottom = drawRight = drawTop = true; + drawLeft = false; + left = b; + right = x; + top = y + barLeft; + bottom = y + barRight; + + // account for negative bars + if (right < left) { + tmp = right; + right = left; + left = tmp; + drawLeft = true; + drawRight = false; + } + } + else { + drawLeft = drawRight = drawTop = true; + drawBottom = false; + left = x + barLeft; + right = x + barRight; + bottom = b; + top = y; + + // account for negative bars + if (top < bottom) { + tmp = top; + top = bottom; + bottom = tmp; + drawBottom = true; + drawTop = false; + } + } + + // clip + if (right < axisx.min || left > axisx.max || + top < axisy.min || bottom > axisy.max) + return; + + if (left < axisx.min) { + left = axisx.min; + drawLeft = false; + } + + if (right > axisx.max) { + right = axisx.max; + drawRight = false; + } + + if (bottom < axisy.min) { + bottom = axisy.min; + drawBottom = false; + } + + if (top > axisy.max) { + top = axisy.max; + drawTop = false; + } + + left = axisx.p2c(left); + bottom = axisy.p2c(bottom); + right = axisx.p2c(right); + top = axisy.p2c(top); + + // fill the bar + if (fillStyleCallback) { + c.fillStyle = fillStyleCallback(bottom, top); + c.fillRect(left, top, right - left, bottom - top) + } + + // draw outline + if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) { + c.beginPath(); + + // FIXME: inline moveTo is buggy with excanvas + c.moveTo(left, bottom); + if (drawLeft) + c.lineTo(left, top); + else + c.moveTo(left, top); + if (drawTop) + c.lineTo(right, top); + else + c.moveTo(right, top); + if (drawRight) + c.lineTo(right, bottom); + else + c.moveTo(right, bottom); + if (drawBottom) + c.lineTo(left, bottom); + else + c.moveTo(left, bottom); + c.stroke(); + } + } + + function drawSeriesBars(series) { + function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) { + var points = datapoints.points, ps = datapoints.pointsize; + + for (var i = 0; i < points.length; i += ps) { + if (points[i] == null) + continue; + drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth); + } + } + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + // FIXME: figure out a way to add shadows (for instance along the right edge) + ctx.lineWidth = series.bars.lineWidth; + ctx.strokeStyle = series.color; + + var barLeft; + + switch (series.bars.align) { + case "left": + barLeft = 0; + break; + case "right": + barLeft = -series.bars.barWidth; + break; + default: + barLeft = -series.bars.barWidth / 2; + } + + var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null; + plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, fillStyleCallback, series.xaxis, series.yaxis); + ctx.restore(); + } + + function getFillStyle(filloptions, seriesColor, bottom, top) { + var fill = filloptions.fill; + if (!fill) + return null; + + if (filloptions.fillColor) + return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor); + + var c = $.color.parse(seriesColor); + c.a = typeof fill == "number" ? fill : 0.4; + c.normalize(); + return c.toString(); + } + + function insertLegend() { + + if (options.legend.container != null) { + $(options.legend.container).html(""); + } else { + placeholder.find(".legend").remove(); + } + + if (!options.legend.show) { + return; + } + + var fragments = [], entries = [], rowStarted = false, + lf = options.legend.labelFormatter, s, label; + + // Build a list of legend entries, with each having a label and a color + + for (var i = 0; i < series.length; ++i) { + s = series[i]; + if (s.label) { + label = lf ? lf(s.label, s) : s.label; + if (label) { + entries.push({ + label: label, + color: s.color + }); + } + } + } + + // Sort the legend using either the default or a custom comparator + + if (options.legend.sorted) { + if ($.isFunction(options.legend.sorted)) { + entries.sort(options.legend.sorted); + } else if (options.legend.sorted == "reverse") { + entries.reverse(); + } else { + var ascending = options.legend.sorted != "descending"; + entries.sort(function(a, b) { + return a.label == b.label ? 0 : ( + (a.label < b.label) != ascending ? 1 : -1 // Logical XOR + ); + }); + } + } + + // Generate markup for the list of entries, in their final order + + for (var i = 0; i < entries.length; ++i) { + + var entry = entries[i]; + + if (i % options.legend.noColumns == 0) { + if (rowStarted) + fragments.push(''); + fragments.push(''); + rowStarted = true; + } + + fragments.push( + '
      ' + + '' + entry.label + '' + ); + } + + if (rowStarted) + fragments.push(''); + + if (fragments.length == 0) + return; + + var table = '' + fragments.join("") + '
      '; + if (options.legend.container != null) + $(options.legend.container).html(table); + else { + var pos = "", + p = options.legend.position, + m = options.legend.margin; + if (m[0] == null) + m = [m, m]; + if (p.charAt(0) == "n") + pos += 'top:' + (m[1] + plotOffset.top) + 'px;'; + else if (p.charAt(0) == "s") + pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;'; + if (p.charAt(1) == "e") + pos += 'right:' + (m[0] + plotOffset.right) + 'px;'; + else if (p.charAt(1) == "w") + pos += 'left:' + (m[0] + plotOffset.left) + 'px;'; + var legend = $('
      ' + table.replace('style="', 'style="position:absolute;' + pos +';') + '
      ').appendTo(placeholder); + if (options.legend.backgroundOpacity != 0.0) { + // put in the transparent background + // separately to avoid blended labels and + // label boxes + var c = options.legend.backgroundColor; + if (c == null) { + c = options.grid.backgroundColor; + if (c && typeof c == "string") + c = $.color.parse(c); + else + c = $.color.extract(legend, 'background-color'); + c.a = 1; + c = c.toString(); + } + var div = legend.children(); + $('
      ').prependTo(legend).css('opacity', options.legend.backgroundOpacity); + } + } + } + + + // interactive features + + var highlights = [], + redrawTimeout = null; + + // returns the data item the mouse is over, or null if none is found + function findNearbyItem(mouseX, mouseY, seriesFilter) { + var maxDistance = options.grid.mouseActiveRadius, + smallestDistance = maxDistance * maxDistance + 1, + item = null, foundPoint = false, i, j, ps; + + for (i = series.length - 1; i >= 0; --i) { + if (!seriesFilter(series[i])) + continue; + + var s = series[i], + axisx = s.xaxis, + axisy = s.yaxis, + points = s.datapoints.points, + mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster + my = axisy.c2p(mouseY), + maxx = maxDistance / axisx.scale, + maxy = maxDistance / axisy.scale; + + ps = s.datapoints.pointsize; + // with inverse transforms, we can't use the maxx/maxy + // optimization, sadly + if (axisx.options.inverseTransform) + maxx = Number.MAX_VALUE; + if (axisy.options.inverseTransform) + maxy = Number.MAX_VALUE; + + if (s.lines.show || s.points.show) { + for (j = 0; j < points.length; j += ps) { + var x = points[j], y = points[j + 1]; + if (x == null) + continue; + + // For points and lines, the cursor must be within a + // certain distance to the data point + if (x - mx > maxx || x - mx < -maxx || + y - my > maxy || y - my < -maxy) + continue; + + // We have to calculate distances in pixels, not in + // data units, because the scales of the axes may be different + var dx = Math.abs(axisx.p2c(x) - mouseX), + dy = Math.abs(axisy.p2c(y) - mouseY), + dist = dx * dx + dy * dy; // we save the sqrt + + // use <= to ensure last point takes precedence + // (last generally means on top of) + if (dist < smallestDistance) { + smallestDistance = dist; + item = [i, j / ps]; + } + } + } + + if (s.bars.show && !item) { // no other point can be nearby + + var barLeft, barRight; + + switch (s.bars.align) { + case "left": + barLeft = 0; + break; + case "right": + barLeft = -s.bars.barWidth; + break; + default: + barLeft = -s.bars.barWidth / 2; + } + + barRight = barLeft + s.bars.barWidth; + + for (j = 0; j < points.length; j += ps) { + var x = points[j], y = points[j + 1], b = points[j + 2]; + if (x == null) + continue; + + // for a bar graph, the cursor must be inside the bar + if (series[i].bars.horizontal ? + (mx <= Math.max(b, x) && mx >= Math.min(b, x) && + my >= y + barLeft && my <= y + barRight) : + (mx >= x + barLeft && mx <= x + barRight && + my >= Math.min(b, y) && my <= Math.max(b, y))) + item = [i, j / ps]; + } + } + } + + if (item) { + i = item[0]; + j = item[1]; + ps = series[i].datapoints.pointsize; + + return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps), + dataIndex: j, + series: series[i], + seriesIndex: i }; + } + + return null; + } + + function onMouseMove(e) { + if (options.grid.hoverable) + triggerClickHoverEvent("plothover", e, + function (s) { return s["hoverable"] != false; }); + } + + function onMouseLeave(e) { + if (options.grid.hoverable) + triggerClickHoverEvent("plothover", e, + function (s) { return false; }); + } + + function onClick(e) { + triggerClickHoverEvent("plotclick", e, + function (s) { return s["clickable"] != false; }); + } + + // trigger click or hover event (they send the same parameters + // so we share their code) + function triggerClickHoverEvent(eventname, event, seriesFilter) { + var offset = eventHolder.offset(), + canvasX = event.pageX - offset.left - plotOffset.left, + canvasY = event.pageY - offset.top - plotOffset.top, + pos = canvasToAxisCoords({ left: canvasX, top: canvasY }); + + pos.pageX = event.pageX; + pos.pageY = event.pageY; + + var item = findNearbyItem(canvasX, canvasY, seriesFilter); + + if (item) { + // fill in mouse pos for any listeners out there + item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left, 10); + item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top, 10); + } + + if (options.grid.autoHighlight) { + // clear auto-highlights + for (var i = 0; i < highlights.length; ++i) { + var h = highlights[i]; + if (h.auto == eventname && + !(item && h.series == item.series && + h.point[0] == item.datapoint[0] && + h.point[1] == item.datapoint[1])) + unhighlight(h.series, h.point); + } + + if (item) + highlight(item.series, item.datapoint, eventname); + } + + placeholder.trigger(eventname, [ pos, item ]); + } + + function triggerRedrawOverlay() { + var t = options.interaction.redrawOverlayInterval; + if (t == -1) { // skip event queue + drawOverlay(); + return; + } + + if (!redrawTimeout) + redrawTimeout = setTimeout(drawOverlay, t); + } + + function drawOverlay() { + redrawTimeout = null; + + // draw highlights + octx.save(); + overlay.clear(); + octx.translate(plotOffset.left, plotOffset.top); + + var i, hi; + for (i = 0; i < highlights.length; ++i) { + hi = highlights[i]; + + if (hi.series.bars.show) + drawBarHighlight(hi.series, hi.point); + else + drawPointHighlight(hi.series, hi.point); + } + octx.restore(); + + executeHooks(hooks.drawOverlay, [octx]); + } + + function highlight(s, point, auto) { + if (typeof s == "number") + s = series[s]; + + if (typeof point == "number") { + var ps = s.datapoints.pointsize; + point = s.datapoints.points.slice(ps * point, ps * (point + 1)); + } + + var i = indexOfHighlight(s, point); + if (i == -1) { + highlights.push({ series: s, point: point, auto: auto }); + + triggerRedrawOverlay(); + } + else if (!auto) + highlights[i].auto = false; + } + + function unhighlight(s, point) { + if (s == null && point == null) { + highlights = []; + triggerRedrawOverlay(); + return; + } + + if (typeof s == "number") + s = series[s]; + + if (typeof point == "number") { + var ps = s.datapoints.pointsize; + point = s.datapoints.points.slice(ps * point, ps * (point + 1)); + } + + var i = indexOfHighlight(s, point); + if (i != -1) { + highlights.splice(i, 1); + + triggerRedrawOverlay(); + } + } + + function indexOfHighlight(s, p) { + for (var i = 0; i < highlights.length; ++i) { + var h = highlights[i]; + if (h.series == s && h.point[0] == p[0] + && h.point[1] == p[1]) + return i; + } + return -1; + } + + function drawPointHighlight(series, point) { + var x = point[0], y = point[1], + axisx = series.xaxis, axisy = series.yaxis, + highlightColor = (typeof series.highlightColor === "string") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString(); + + if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) + return; + + var pointRadius = series.points.radius + series.points.lineWidth / 2; + octx.lineWidth = pointRadius; + octx.strokeStyle = highlightColor; + var radius = 1.5 * pointRadius; + x = axisx.p2c(x); + y = axisy.p2c(y); + + octx.beginPath(); + if (series.points.symbol == "circle") + octx.arc(x, y, radius, 0, 2 * Math.PI, false); + else + series.points.symbol(octx, x, y, radius, false); + octx.closePath(); + octx.stroke(); + } + + function drawBarHighlight(series, point) { + var highlightColor = (typeof series.highlightColor === "string") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString(), + fillStyle = highlightColor, + barLeft; + + switch (series.bars.align) { + case "left": + barLeft = 0; + break; + case "right": + barLeft = -series.bars.barWidth; + break; + default: + barLeft = -series.bars.barWidth / 2; + } + + octx.lineWidth = series.bars.lineWidth; + octx.strokeStyle = highlightColor; + + drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth, + function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth); + } + + function getColorOrGradient(spec, bottom, top, defaultColor) { + if (typeof spec == "string") + return spec; + else { + // assume this is a gradient spec; IE currently only + // supports a simple vertical gradient properly, so that's + // what we support too + var gradient = ctx.createLinearGradient(0, top, 0, bottom); + + for (var i = 0, l = spec.colors.length; i < l; ++i) { + var c = spec.colors[i]; + if (typeof c != "string") { + var co = $.color.parse(defaultColor); + if (c.brightness != null) + co = co.scale('rgb', c.brightness); + if (c.opacity != null) + co.a *= c.opacity; + c = co.toString(); + } + gradient.addColorStop(i / (l - 1), c); + } + + return gradient; + } + } + } + + // Add the plot function to the top level of the jQuery object + + $.plot = function(placeholder, data, options) { + //var t0 = new Date(); + var plot = new Plot($(placeholder), data, options, $.plot.plugins); + //(window.console ? console.log : alert)("time used (msecs): " + ((new Date()).getTime() - t0.getTime())); + return plot; + }; + + $.plot.version = "0.8.2"; + + $.plot.plugins = []; + + // Also add the plot function as a chainable property + + $.fn.plot = function(data, options) { + return this.each(function() { + $.plot(this, data, options); + }); + }; + + // round to nearby lower multiple of base + function floorInBase(n, base) { + return base * Math.floor(n / base); + } + +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.min.js b/public/assets/js/plugins/flot/jquery.flot.min.js new file mode 100755 index 00000000..9620fc00 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.min.js @@ -0,0 +1,2 @@ +(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function($){var hasOwnProperty=Object.prototype.hasOwnProperty;function Canvas(cls,container){var element=container.children("."+cls)[0];if(element==null){element=document.createElement("canvas");element.className=cls;$(element).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(container);if(!element.getContext){if(window.G_vmlCanvasManager){element=window.G_vmlCanvasManager.initElement(element)}else{throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.")}}}this.element=element;var context=this.context=element.getContext("2d");var devicePixelRatio=window.devicePixelRatio||1,backingStoreRatio=context.webkitBackingStorePixelRatio||context.mozBackingStorePixelRatio||context.msBackingStorePixelRatio||context.oBackingStorePixelRatio||context.backingStorePixelRatio||1;this.pixelRatio=devicePixelRatio/backingStoreRatio;this.resize(container.width(),container.height());this.textContainer=null;this.text={};this._textCache={}}Canvas.prototype.resize=function(width,height){if(width<=0||height<=0){throw new Error("Invalid dimensions for plot, width = "+width+", height = "+height)}var element=this.element,context=this.context,pixelRatio=this.pixelRatio;if(this.width!=width){element.width=width*pixelRatio;element.style.width=width+"px";this.width=width}if(this.height!=height){element.height=height*pixelRatio;element.style.height=height+"px";this.height=height}context.restore();context.save();context.scale(pixelRatio,pixelRatio)};Canvas.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};Canvas.prototype.render=function(){var cache=this._textCache;for(var layerKey in cache){if(hasOwnProperty.call(cache,layerKey)){var layer=this.getTextLayer(layerKey),layerCache=cache[layerKey];layer.hide();for(var styleKey in layerCache){if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache){if(hasOwnProperty.call(styleCache,key)){var positions=styleCache[key].positions;for(var i=0,position;position=positions[i];i++){if(position.active){if(!position.rendered){layer.append(position.element);position.rendered=true}}else{positions.splice(i--,1);if(position.rendered){position.element.detach()}}}if(positions.length==0){delete styleCache[key]}}}}}layer.show()}}};Canvas.prototype.getTextLayer=function(classes){var layer=this.text[classes];if(layer==null){if(this.textContainer==null){this.textContainer=$("
      ").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)}layer=this.text[classes]=$("
      ").addClass(classes).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)}return layer};Canvas.prototype.getTextInfo=function(layer,text,font,angle,width){var textStyle,layerCache,styleCache,info;text=""+text;if(typeof font==="object"){textStyle=font.style+" "+font.variant+" "+font.weight+" "+font.size+"px/"+font.lineHeight+"px "+font.family}else{textStyle=font}layerCache=this._textCache[layer];if(layerCache==null){layerCache=this._textCache[layer]={}}styleCache=layerCache[textStyle];if(styleCache==null){styleCache=layerCache[textStyle]={}}info=styleCache[text];if(info==null){var element=$("
      ").html(text).css({position:"absolute","max-width":width,top:-9999}).appendTo(this.getTextLayer(layer));if(typeof font==="object"){element.css({font:textStyle,color:font.color})}else if(typeof font==="string"){element.addClass(font)}info=styleCache[text]={width:element.outerWidth(true),height:element.outerHeight(true),element:element,positions:[]};element.detach()}return info};Canvas.prototype.addText=function(layer,x,y,text,font,angle,width,halign,valign){var info=this.getTextInfo(layer,text,font,angle,width),positions=info.positions;if(halign=="center"){x-=info.width/2}else if(halign=="right"){x-=info.width}if(valign=="middle"){y-=info.height/2}else if(valign=="bottom"){y-=info.height}for(var i=0,position;position=positions[i];i++){if(position.x==x&&position.y==y){position.active=true;return}}position={active:true,rendered:false,element:positions.length?info.element.clone():info.element,x:x,y:y};positions.push(position);position.element.css({top:Math.round(y),left:Math.round(x),"text-align":halign})};Canvas.prototype.removeText=function(layer,x,y,text,font,angle){if(text==null){var layerCache=this._textCache[layer];if(layerCache!=null){for(var styleKey in layerCache){if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache){if(hasOwnProperty.call(styleCache,key)){var positions=styleCache[key].positions;for(var i=0,position;position=positions[i];i++){position.active=false}}}}}}}else{var positions=this.getTextInfo(layer,text,font,angle).positions;for(var i=0,position;position=positions[i];i++){if(position.x==x&&position.y==y){position.active=false}}}};function Plot(placeholder,data_,options_,plugins){var series=[],options={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false,zero:true},shadowSize:3,highlightColor:null},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},surface=null,overlay=null,eventHolder=null,ctx=null,octx=null,xaxes=[],yaxes=[],plotOffset={left:0,right:0,top:0,bottom:0},plotWidth=0,plotHeight=0,hooks={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},plot=this;plot.setData=setData;plot.setupGrid=setupGrid;plot.draw=draw;plot.getPlaceholder=function(){return placeholder};plot.getCanvas=function(){return surface.element};plot.getPlotOffset=function(){return plotOffset};plot.width=function(){return plotWidth};plot.height=function(){return plotHeight};plot.offset=function(){var o=eventHolder.offset();o.left+=plotOffset.left;o.top+=plotOffset.top;return o};plot.getData=function(){return series};plot.getAxes=function(){var res={},i;$.each(xaxes.concat(yaxes),function(_,axis){if(axis)res[axis.direction+(axis.n!=1?axis.n:"")+"axis"]=axis});return res};plot.getXAxes=function(){return xaxes};plot.getYAxes=function(){return yaxes};plot.c2p=canvasToAxisCoords;plot.p2c=axisToCanvasCoords;plot.getOptions=function(){return options};plot.highlight=highlight;plot.unhighlight=unhighlight;plot.triggerRedrawOverlay=triggerRedrawOverlay;plot.pointOffset=function(point){return{left:parseInt(xaxes[axisNumber(point,"x")-1].p2c(+point.x)+plotOffset.left,10),top:parseInt(yaxes[axisNumber(point,"y")-1].p2c(+point.y)+plotOffset.top,10)}};plot.shutdown=shutdown;plot.destroy=function(){shutdown();placeholder.removeData("plot").empty();series=[];options=null;surface=null;overlay=null;eventHolder=null;ctx=null;octx=null;xaxes=[];yaxes=[];hooks=null;highlights=[];plot=null};plot.resize=function(){var width=placeholder.width(),height=placeholder.height();surface.resize(width,height);overlay.resize(width,height)};plot.hooks=hooks;initPlugins(plot);parseOptions(options_);setupCanvases();setData(data_);setupGrid();draw();bindEvents();function executeHooks(hook,args){args=[plot].concat(args);for(var i=0;imaxIndex){maxIndex=sc}}}if(neededColors<=maxIndex){neededColors=maxIndex+1}var c,colors=[],colorPool=options.colors,colorPoolSize=colorPool.length,variation=0;for(i=0;i=0){if(variation<.5){variation=-variation-.2}else variation=0}else variation=-variation}colors[i]=c.scale("rgb",1+variation)}var colori=0,s;for(i=0;iaxis.datamax&&max!=fakeInfinity)axis.datamax=max}$.each(allAxes(),function(_,axis){axis.datamin=topSentry;axis.datamax=bottomSentry;axis.used=false});for(i=0;i0&&points[k-ps]!=null&&points[k-ps]!=points[k]&&points[k-ps+1]!=points[k+1]){for(m=0;mxmax)xmax=val}if(f.y){if(valymax)ymax=val}}}if(s.bars.show){var delta;switch(s.bars.align){case"left":delta=0;break;case"right":delta=-s.bars.barWidth;break;default:delta=-s.bars.barWidth/2}if(s.bars.horizontal){ymin+=delta;ymax+=delta+s.bars.barWidth}else{xmin+=delta;xmax+=delta+s.bars.barWidth}}updateAxis(s.xaxis,xmin,xmax);updateAxis(s.yaxis,ymin,ymax)}$.each(allAxes(),function(_,axis){if(axis.datamin==topSentry)axis.datamin=null;if(axis.datamax==bottomSentry)axis.datamax=null})}function setupCanvases(){placeholder.css("padding",0).children().filter(function(){return!$(this).hasClass("flot-overlay")&&!$(this).hasClass("flot-base")}).remove();if(placeholder.css("position")=="static")placeholder.css("position","relative");surface=new Canvas("flot-base",placeholder);overlay=new Canvas("flot-overlay",placeholder);ctx=surface.context;octx=overlay.context;eventHolder=$(overlay.element).unbind();var existing=placeholder.data("plot");if(existing){existing.shutdown();overlay.clear()}placeholder.data("plot",plot)}function bindEvents(){if(options.grid.hoverable){eventHolder.mousemove(onMouseMove);eventHolder.bind("mouseleave",onMouseLeave)}if(options.grid.clickable)eventHolder.click(onClick);executeHooks(hooks.bindEvents,[eventHolder])}function shutdown(){if(redrawTimeout)clearTimeout(redrawTimeout);eventHolder.unbind("mousemove",onMouseMove);eventHolder.unbind("mouseleave",onMouseLeave);eventHolder.unbind("click",onClick);executeHooks(hooks.shutdown,[eventHolder])}function setTransformationHelpers(axis){function identity(x){return x}var s,m,t=axis.options.transform||identity,it=axis.options.inverseTransform;if(axis.direction=="x"){s=axis.scale=plotWidth/Math.abs(t(axis.max)-t(axis.min));m=Math.min(t(axis.max),t(axis.min))}else{s=axis.scale=plotHeight/Math.abs(t(axis.max)-t(axis.min));s=-s;m=Math.max(t(axis.max),t(axis.min))}if(t==identity)axis.p2c=function(p){return(p-m)*s};else axis.p2c=function(p){return(t(p)-m)*s};if(!it)axis.c2p=function(c){return m+c/s};else axis.c2p=function(c){return it(m+c/s)}}function measureTickLabels(axis){var opts=axis.options,ticks=axis.ticks||[],labelWidth=opts.labelWidth||0,labelHeight=opts.labelHeight||0,maxWidth=labelWidth||(axis.direction=="x"?Math.floor(surface.width/(ticks.length||1)):null),legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=opts.font||"flot-tick-label tickLabel";for(var i=0;i=0;--i)allocateAxisBoxFirstPhase(allocatedAxes[i]);adjustLayoutForThingsStickingOut();$.each(allocatedAxes,function(_,axis){allocateAxisBoxSecondPhase(axis)})}plotWidth=surface.width-plotOffset.left-plotOffset.right;plotHeight=surface.height-plotOffset.bottom-plotOffset.top;$.each(axes,function(_,axis){setTransformationHelpers(axis)});if(showGrid){drawAxisLabels()}insertLegend()}function setRange(axis){var opts=axis.options,min=+(opts.min!=null?opts.min:axis.datamin),max=+(opts.max!=null?opts.max:axis.datamax),delta=max-min;if(delta==0){var widen=max==0?1:.01;if(opts.min==null)min-=widen;if(opts.max==null||opts.min!=null)max+=widen}else{var margin=opts.autoscaleMargin;if(margin!=null){if(opts.min==null){min-=delta*margin;if(min<0&&axis.datamin!=null&&axis.datamin>=0)min=0}if(opts.max==null){max+=delta*margin;if(max>0&&axis.datamax!=null&&axis.datamax<=0)max=0}}}axis.min=min;axis.max=max}function setupTickGeneration(axis){var opts=axis.options;var noTicks;if(typeof opts.ticks=="number"&&opts.ticks>0)noTicks=opts.ticks;else noTicks=.3*Math.sqrt(axis.direction=="x"?surface.width:surface.height);var delta=(axis.max-axis.min)/noTicks,dec=-Math.floor(Math.log(delta)/Math.LN10),maxDec=opts.tickDecimals;if(maxDec!=null&&dec>maxDec){dec=maxDec}var magn=Math.pow(10,-dec),norm=delta/magn,size;if(norm<1.5){size=1}else if(norm<3){size=2;if(norm>2.25&&(maxDec==null||dec+1<=maxDec)){size=2.5;++dec}}else if(norm<7.5){size=5}else{size=10}size*=magn;if(opts.minTickSize!=null&&size0){if(opts.min==null)axis.min=Math.min(axis.min,niceTicks[0]);if(opts.max==null&&niceTicks.length>1)axis.max=Math.max(axis.max,niceTicks[niceTicks.length-1])}axis.tickGenerator=function(axis){var ticks=[],v,i;for(i=0;i1&&/\..*0$/.test((ts[1]-ts[0]).toFixed(extraDec))))axis.tickDecimals=extraDec}}}}function setTicks(axis){var oticks=axis.options.ticks,ticks=[];if(oticks==null||typeof oticks=="number"&&oticks>0)ticks=axis.tickGenerator(axis);else if(oticks){if($.isFunction(oticks))ticks=oticks(axis);else ticks=oticks}var i,v;axis.ticks=[];for(i=0;i1)label=t[1]}else v=+t;if(label==null)label=axis.tickFormatter(v,axis);if(!isNaN(v))axis.ticks.push({v:v,label:label})}}function snapRangeToTicks(axis,ticks){if(axis.options.autoscaleMargin&&ticks.length>0){if(axis.options.min==null)axis.min=Math.min(axis.min,ticks[0].v);if(axis.options.max==null&&ticks.length>1)axis.max=Math.max(axis.max,ticks[ticks.length-1].v)}}function draw(){surface.clear();executeHooks(hooks.drawBackground,[ctx]);var grid=options.grid;if(grid.show&&grid.backgroundColor)drawBackground();if(grid.show&&!grid.aboveData){drawGrid()}for(var i=0;ito){var tmp=from;from=to;to=tmp}return{from:from,to:to,axis:axis}}function drawBackground(){ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.fillStyle=getColorOrGradient(options.grid.backgroundColor,plotHeight,0,"rgba(255, 255, 255, 0)");ctx.fillRect(0,0,plotWidth,plotHeight);ctx.restore()}function drawGrid(){var i,axes,bw,bc;ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var markings=options.grid.markings;if(markings){if($.isFunction(markings)){axes=plot.getAxes();axes.xmin=axes.xaxis.min;axes.xmax=axes.xaxis.max;axes.ymin=axes.yaxis.min;axes.ymax=axes.yaxis.max;markings=markings(axes)}for(i=0;ixrange.axis.max||yrange.toyrange.axis.max)continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max); +yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);if(xrange.from==xrange.to&&yrange.from==yrange.to)continue;xrange.from=xrange.axis.p2c(xrange.from);xrange.to=xrange.axis.p2c(xrange.to);yrange.from=yrange.axis.p2c(yrange.from);yrange.to=yrange.axis.p2c(yrange.to);if(xrange.from==xrange.to||yrange.from==yrange.to){ctx.beginPath();ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.lineWidth=m.lineWidth||options.grid.markingsLineWidth;ctx.moveTo(xrange.from,yrange.from);ctx.lineTo(xrange.to,yrange.to);ctx.stroke()}else{ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to)}}}axes=allAxes();bw=options.grid.borderWidth;for(var j=0;jaxis.max||t=="full"&&(typeof bw=="object"&&bw[axis.position]>0||bw>0)&&(v==axis.min||v==axis.max))continue;if(axis.direction=="x"){x=axis.p2c(v);yoff=t=="full"?-plotHeight:t;if(axis.position=="top")yoff=-yoff}else{y=axis.p2c(v);xoff=t=="full"?-plotWidth:t;if(axis.position=="left")xoff=-xoff}if(ctx.lineWidth==1){if(axis.direction=="x")x=Math.floor(x)+.5;else y=Math.floor(y)+.5}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff)}ctx.stroke()}if(bw){bc=options.grid.borderColor;if(typeof bw=="object"||typeof bc=="object"){if(typeof bw!=="object"){bw={top:bw,right:bw,bottom:bw,left:bw}}if(typeof bc!=="object"){bc={top:bc,right:bc,bottom:bc,left:bc}}if(bw.top>0){ctx.strokeStyle=bc.top;ctx.lineWidth=bw.top;ctx.beginPath();ctx.moveTo(0-bw.left,0-bw.top/2);ctx.lineTo(plotWidth,0-bw.top/2);ctx.stroke()}if(bw.right>0){ctx.strokeStyle=bc.right;ctx.lineWidth=bw.right;ctx.beginPath();ctx.moveTo(plotWidth+bw.right/2,0-bw.top);ctx.lineTo(plotWidth+bw.right/2,plotHeight);ctx.stroke()}if(bw.bottom>0){ctx.strokeStyle=bc.bottom;ctx.lineWidth=bw.bottom;ctx.beginPath();ctx.moveTo(plotWidth+bw.right,plotHeight+bw.bottom/2);ctx.lineTo(0,plotHeight+bw.bottom/2);ctx.stroke()}if(bw.left>0){ctx.strokeStyle=bc.left;ctx.lineWidth=bw.left;ctx.beginPath();ctx.moveTo(0-bw.left/2,plotHeight+bw.bottom);ctx.lineTo(0-bw.left/2,0);ctx.stroke()}}else{ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw)}}ctx.restore()}function drawAxisLabels(){$.each(allAxes(),function(_,axis){var box=axis.box,legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=axis.options.font||"flot-tick-label tickLabel",tick,x,y,halign,valign;surface.removeText(layer);if(!axis.show||axis.ticks.length==0)return;for(var i=0;iaxis.max)continue;if(axis.direction=="x"){halign="center";x=plotOffset.left+axis.p2c(tick.v);if(axis.position=="bottom"){y=box.top+box.padding}else{y=box.top+box.height-box.padding;valign="bottom"}}else{valign="middle";y=plotOffset.top+axis.p2c(tick.v);if(axis.position=="left"){x=box.left+box.width-box.padding;halign="right"}else{x=box.left+box.padding}}surface.addText(layer,x,y,tick.label,font,null,null,halign,valign)}})}function drawSeries(series){if(series.lines.show)drawSeriesLines(series);if(series.bars.show)drawSeriesBars(series);if(series.points.show)drawSeriesPoints(series)}function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i=y2&&y1>axisy.max){if(y2>axisy.max)continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max}else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max)continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max}if(x1<=x2&&x1=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max}if(x1!=prevx||y1!=prevy)ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset);prevx=x2;prevy=y2;ctx.lineTo(axisx.p2c(x2)+xoffset,axisy.p2c(y2)+yoffset)}ctx.stroke()}function plotLineArea(datapoints,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,bottom=Math.min(Math.max(0,axisy.min),axisy.max),i=0,top,areaOpen=false,ypos=1,segmentStart=0,segmentEnd=0;while(true){if(ps>0&&i>points.length+ps)break;i+=ps;var x1=points[i-ps],y1=points[i-ps+ypos],x2=points[i],y2=points[i+ypos];if(areaOpen){if(ps>0&&x1!=null&&x2==null){segmentEnd=i;ps=-ps;ypos=2;continue}if(ps<0&&i==segmentStart+ps){ctx.fill();areaOpen=false;ps=-ps;ypos=1;i=segmentStart=segmentEnd+ps;continue}}if(x1==null||x2==null)continue;if(x1<=x2&&x1=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max}if(!areaOpen){ctx.beginPath();ctx.moveTo(axisx.p2c(x1),axisy.p2c(bottom));areaOpen=true}if(y1>=axisy.max&&y2>=axisy.max){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.max));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.max));continue}else if(y1<=axisy.min&&y2<=axisy.min){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.min));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.min));continue}var x1old=x1,x2old=x2;if(y1<=y2&&y1=axisy.min){x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min}else if(y2<=y1&&y2=axisy.min){x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min}if(y1>=y2&&y1>axisy.max&&y2<=axisy.max){x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max}else if(y2>=y1&&y2>axisy.max&&y1<=axisy.max){x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max}if(x1!=x1old){ctx.lineTo(axisx.p2c(x1old),axisy.p2c(y1))}ctx.lineTo(axisx.p2c(x1),axisy.p2c(y1));ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));if(x2!=x2old){ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));ctx.lineTo(axisx.p2c(x2old),axisy.p2c(y2))}}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.lineJoin="round";var lw=series.lines.lineWidth,sw=series.shadowSize;if(lw>0&&sw>0){ctx.lineWidth=sw;ctx.strokeStyle="rgba(0,0,0,0.1)";var angle=Math.PI/18;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/2),Math.cos(angle)*(lw/2+sw/2),series.xaxis,series.yaxis);ctx.lineWidth=sw/2;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/4),Math.cos(angle)*(lw/2+sw/4),series.xaxis,series.yaxis)}ctx.lineWidth=lw;ctx.strokeStyle=series.color;var fillStyle=getFillStyle(series.lines,series.color,0,plotHeight);if(fillStyle){ctx.fillStyle=fillStyle;plotLineArea(series.datapoints,series.xaxis,series.yaxis)}if(lw>0)plotLine(series.datapoints,0,0,series.xaxis,series.yaxis);ctx.restore()}function drawSeriesPoints(series){function plotPoints(datapoints,radius,fillStyle,offset,shadow,axisx,axisy,symbol){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;iaxisx.max||yaxisy.max)continue;ctx.beginPath();x=axisx.p2c(x);y=axisy.p2c(y)+offset;if(symbol=="circle")ctx.arc(x,y,radius,0,shadow?Math.PI:Math.PI*2,false);else symbol(ctx,x,y,radius,shadow);ctx.closePath();if(fillStyle){ctx.fillStyle=fillStyle;ctx.fill()}ctx.stroke()}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var lw=series.points.lineWidth,sw=series.shadowSize,radius=series.points.radius,symbol=series.points.symbol;if(lw==0)lw=1e-4;if(lw>0&&sw>0){var w=sw/2;ctx.lineWidth=w;ctx.strokeStyle="rgba(0,0,0,0.1)";plotPoints(series.datapoints,radius,null,w+w/2,true,series.xaxis,series.yaxis,symbol);ctx.strokeStyle="rgba(0,0,0,0.2)";plotPoints(series.datapoints,radius,null,w/2,true,series.xaxis,series.yaxis,symbol)}ctx.lineWidth=lw;ctx.strokeStyle=series.color;plotPoints(series.datapoints,radius,getFillStyle(series.points,series.color),0,false,series.xaxis,series.yaxis,symbol);ctx.restore()}function drawBar(x,y,b,barLeft,barRight,fillStyleCallback,axisx,axisy,c,horizontal,lineWidth){var left,right,bottom,top,drawLeft,drawRight,drawTop,drawBottom,tmp;if(horizontal){drawBottom=drawRight=drawTop=true;drawLeft=false;left=b;right=x;top=y+barLeft;bottom=y+barRight;if(rightaxisx.max||topaxisy.max)return;if(leftaxisx.max){right=axisx.max;drawRight=false}if(bottomaxisy.max){top=axisy.max;drawTop=false}left=axisx.p2c(left);bottom=axisy.p2c(bottom);right=axisx.p2c(right);top=axisy.p2c(top);if(fillStyleCallback){c.fillStyle=fillStyleCallback(bottom,top);c.fillRect(left,top,right-left,bottom-top)}if(lineWidth>0&&(drawLeft||drawRight||drawTop||drawBottom)){c.beginPath();c.moveTo(left,bottom);if(drawLeft)c.lineTo(left,top);else c.moveTo(left,top);if(drawTop)c.lineTo(right,top);else c.moveTo(right,top);if(drawRight)c.lineTo(right,bottom);else c.moveTo(right,bottom);if(drawBottom)c.lineTo(left,bottom);else c.moveTo(left,bottom);c.stroke()}}function drawSeriesBars(series){function plotBars(datapoints,barLeft,barRight,fillStyleCallback,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;i");fragments.push("");rowStarted=true}fragments.push('
      '+''+entry.label+"")}if(rowStarted)fragments.push("");if(fragments.length==0)return;var table=''+fragments.join("")+"
      ";if(options.legend.container!=null)$(options.legend.container).html(table);else{var pos="",p=options.legend.position,m=options.legend.margin;if(m[0]==null)m=[m,m];if(p.charAt(0)=="n")pos+="top:"+(m[1]+plotOffset.top)+"px;";else if(p.charAt(0)=="s")pos+="bottom:"+(m[1]+plotOffset.bottom)+"px;";if(p.charAt(1)=="e")pos+="right:"+(m[0]+plotOffset.right)+"px;";else if(p.charAt(1)=="w")pos+="left:"+(m[0]+plotOffset.left)+"px;";var legend=$('
      '+table.replace('style="','style="position:absolute;'+pos+";")+"
      ").appendTo(placeholder);if(options.legend.backgroundOpacity!=0){var c=options.legend.backgroundColor;if(c==null){c=options.grid.backgroundColor;if(c&&typeof c=="string")c=$.color.parse(c);else c=$.color.extract(legend,"background-color");c.a=1;c=c.toString()}var div=legend.children();$('
      ').prependTo(legend).css("opacity",options.legend.backgroundOpacity)}}}var highlights=[],redrawTimeout=null;function findNearbyItem(mouseX,mouseY,seriesFilter){var maxDistance=options.grid.mouseActiveRadius,smallestDistance=maxDistance*maxDistance+1,item=null,foundPoint=false,i,j,ps;for(i=series.length-1;i>=0;--i){if(!seriesFilter(series[i]))continue;var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,mx=axisx.c2p(mouseX),my=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;ps=s.datapoints.pointsize;if(axisx.options.inverseTransform)maxx=Number.MAX_VALUE;if(axisy.options.inverseTransform)maxy=Number.MAX_VALUE;if(s.lines.show||s.points.show){for(j=0;jmaxx||x-mx<-maxx||y-my>maxy||y-my<-maxy)continue;var dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy;if(dist=Math.min(b,x)&&my>=y+barLeft&&my<=y+barRight:mx>=x+barLeft&&mx<=x+barRight&&my>=Math.min(b,y)&&my<=Math.max(b,y))item=[i,j/ps]}}}if(item){i=item[0];j=item[1];ps=series[i].datapoints.pointsize;return{datapoint:series[i].datapoints.points.slice(j*ps,(j+1)*ps),dataIndex:j,series:series[i],seriesIndex:i}}return null}function onMouseMove(e){if(options.grid.hoverable)triggerClickHoverEvent("plothover",e,function(s){return s["hoverable"]!=false})}function onMouseLeave(e){if(options.grid.hoverable)triggerClickHoverEvent("plothover",e,function(s){return false})}function onClick(e){triggerClickHoverEvent("plotclick",e,function(s){return s["clickable"]!=false})}function triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top,pos=canvasToAxisCoords({left:canvasX,top:canvasY});pos.pageX=event.pageX;pos.pageY=event.pageY;var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item){item.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left,10);item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top,10)}if(options.grid.autoHighlight){for(var i=0;iaxisx.max||yaxisy.max)return;var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius;octx.strokeStyle=highlightColor;var radius=1.5*pointRadius;x=axisx.p2c(x);y=axisy.p2c(y);octx.beginPath();if(series.points.symbol=="circle")octx.arc(x,y,radius,0,2*Math.PI,false);else series.points.symbol(octx,x,y,radius,false);octx.closePath();octx.stroke()}function drawBarHighlight(series,point){var highlightColor=typeof series.highlightColor==="string"?series.highlightColor:$.color.parse(series.color).scale("a",.5).toString(),fillStyle=highlightColor,barLeft;switch(series.bars.align){case"left":barLeft=0;break;case"right":barLeft=-series.bars.barWidth;break;default:barLeft=-series.bars.barWidth/2}octx.lineWidth=series.bars.lineWidth;octx.strokeStyle=highlightColor;drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,function(){return fillStyle},series.xaxis,series.yaxis,octx,series.bars.horizontal,series.bars.lineWidth)}function getColorOrGradient(spec,bottom,top,defaultColor){if(typeof spec=="string")return spec;else{var gradient=ctx.createLinearGradient(0,top,0,bottom);for(var i=0,l=spec.colors.length;i0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY) max) { + // make sure min < max + var tmp = min; + min = max; + max = tmp; + } + + //Check that we are in panRange + if (pr) { + if (pr[0] != null && min < pr[0]) { + min = pr[0]; + } + if (pr[1] != null && max > pr[1]) { + max = pr[1]; + } + } + + var range = max - min; + if (zr && + ((zr[0] != null && range < zr[0]) || + (zr[1] != null && range > zr[1]))) + return; + + opts.min = min; + opts.max = max; + }); + + plot.setupGrid(); + plot.draw(); + + if (!args.preventEvent) + plot.getPlaceholder().trigger("plotzoom", [ plot, args ]); + }; + + plot.pan = function (args) { + var delta = { + x: +args.left, + y: +args.top + }; + + if (isNaN(delta.x)) + delta.x = 0; + if (isNaN(delta.y)) + delta.y = 0; + + $.each(plot.getAxes(), function (_, axis) { + var opts = axis.options, + min, max, d = delta[axis.direction]; + + min = axis.c2p(axis.p2c(axis.min) + d), + max = axis.c2p(axis.p2c(axis.max) + d); + + var pr = opts.panRange; + if (pr === false) // no panning on this axis + return; + + if (pr) { + // check whether we hit the wall + if (pr[0] != null && pr[0] > min) { + d = pr[0] - min; + min += d; + max += d; + } + + if (pr[1] != null && pr[1] < max) { + d = pr[1] - max; + min += d; + max += d; + } + } + + opts.min = min; + opts.max = max; + }); + + plot.setupGrid(); + plot.draw(); + + if (!args.preventEvent) + plot.getPlaceholder().trigger("plotpan", [ plot, args ]); + }; + + function shutdown(plot, eventHolder) { + eventHolder.unbind(plot.getOptions().zoom.trigger, onZoomClick); + eventHolder.unbind("mousewheel", onMouseWheel); + eventHolder.unbind("dragstart", onDragStart); + eventHolder.unbind("drag", onDrag); + eventHolder.unbind("dragend", onDragEnd); + if (panTimeout) + clearTimeout(panTimeout); + } + + plot.hooks.bindEvents.push(bindEvents); + plot.hooks.shutdown.push(shutdown); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: 'navigate', + version: '1.3' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.navigate.min.js b/public/assets/js/plugins/flot/jquery.flot.navigate.min.js new file mode 100755 index 00000000..a69a9399 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.navigate.min.js @@ -0,0 +1 @@ +(function(a){function e(h){var k,j=this,l=h.data||{};if(l.elem)j=h.dragTarget=l.elem,h.dragProxy=d.proxy||j,h.cursorOffsetX=l.pageX-l.left,h.cursorOffsetY=l.pageY-l.top,h.offsetX=h.pageX-h.cursorOffsetX,h.offsetY=h.pageY-h.cursorOffsetY;else if(d.dragging||l.which>0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY)max){var tmp=min;min=max;max=tmp}if(pr){if(pr[0]!=null&&minpr[1]){max=pr[1]}}var range=max-min;if(zr&&(zr[0]!=null&&rangezr[1]))return;opts.min=min;opts.max=max});plot.setupGrid();plot.draw();if(!args.preventEvent)plot.getPlaceholder().trigger("plotzoom",[plot,args])};plot.pan=function(args){var delta={x:+args.left,y:+args.top};if(isNaN(delta.x))delta.x=0;if(isNaN(delta.y))delta.y=0;$.each(plot.getAxes(),function(_,axis){var opts=axis.options,min,max,d=delta[axis.direction];min=axis.c2p(axis.p2c(axis.min)+d),max=axis.c2p(axis.p2c(axis.max)+d);var pr=opts.panRange;if(pr===false)return;if(pr){if(pr[0]!=null&&pr[0]>min){d=pr[0]-min;min+=d;max+=d}if(pr[1]!=null&&pr[1] 1) { + options.series.pie.tilt = 1; + } else if (options.series.pie.tilt < 0) { + options.series.pie.tilt = 0; + } + } + }); + + plot.hooks.bindEvents.push(function(plot, eventHolder) { + var options = plot.getOptions(); + if (options.series.pie.show) { + if (options.grid.hoverable) { + eventHolder.unbind("mousemove").mousemove(onMouseMove); + } + if (options.grid.clickable) { + eventHolder.unbind("click").click(onClick); + } + } + }); + + plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) { + var options = plot.getOptions(); + if (options.series.pie.show) { + processDatapoints(plot, series, data, datapoints); + } + }); + + plot.hooks.drawOverlay.push(function(plot, octx) { + var options = plot.getOptions(); + if (options.series.pie.show) { + drawOverlay(plot, octx); + } + }); + + plot.hooks.draw.push(function(plot, newCtx) { + var options = plot.getOptions(); + if (options.series.pie.show) { + draw(plot, newCtx); + } + }); + + function processDatapoints(plot, series, datapoints) { + if (!processed) { + processed = true; + canvas = plot.getCanvas(); + target = $(canvas).parent(); + options = plot.getOptions(); + plot.setData(combine(plot.getData())); + } + } + + function combine(data) { + + var total = 0, + combined = 0, + numCombined = 0, + color = options.series.pie.combine.color, + newdata = []; + + // Fix up the raw data from Flot, ensuring the data is numeric + + for (var i = 0; i < data.length; ++i) { + + var value = data[i].data; + + // If the data is an array, we'll assume that it's a standard + // Flot x-y pair, and are concerned only with the second value. + + // Note how we use the original array, rather than creating a + // new one; this is more efficient and preserves any extra data + // that the user may have stored in higher indexes. + + if ($.isArray(value) && value.length == 1) { + value = value[0]; + } + + if ($.isArray(value)) { + // Equivalent to $.isNumeric() but compatible with jQuery < 1.7 + if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) { + value[1] = +value[1]; + } else { + value[1] = 0; + } + } else if (!isNaN(parseFloat(value)) && isFinite(value)) { + value = [1, +value]; + } else { + value = [1, 0]; + } + + data[i].data = [value]; + } + + // Sum up all the slices, so we can calculate percentages for each + + for (var i = 0; i < data.length; ++i) { + total += data[i].data[0][1]; + } + + // Count the number of slices with percentages below the combine + // threshold; if it turns out to be just one, we won't combine. + + for (var i = 0; i < data.length; ++i) { + var value = data[i].data[0][1]; + if (value / total <= options.series.pie.combine.threshold) { + combined += value; + numCombined++; + if (!color) { + color = data[i].color; + } + } + } + + for (var i = 0; i < data.length; ++i) { + var value = data[i].data[0][1]; + if (numCombined < 2 || value / total > options.series.pie.combine.threshold) { + newdata.push({ + data: [[1, value]], + color: data[i].color, + label: data[i].label, + angle: value * Math.PI * 2 / total, + percent: value / (total / 100) + }); + } + } + + if (numCombined > 1) { + newdata.push({ + data: [[1, combined]], + color: color, + label: options.series.pie.combine.label, + angle: combined * Math.PI * 2 / total, + percent: combined / (total / 100) + }); + } + + return newdata; + } + + function draw(plot, newCtx) { + + if (!target) { + return; // if no series were passed + } + + var canvasWidth = plot.getPlaceholder().width(), + canvasHeight = plot.getPlaceholder().height(), + legendWidth = target.children().filter(".legend").children().width() || 0; + + ctx = newCtx; + + // WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE! + + // When combining smaller slices into an 'other' slice, we need to + // add a new series. Since Flot gives plugins no way to modify the + // list of series, the pie plugin uses a hack where the first call + // to processDatapoints results in a call to setData with the new + // list of series, then subsequent processDatapoints do nothing. + + // The plugin-global 'processed' flag is used to control this hack; + // it starts out false, and is set to true after the first call to + // processDatapoints. + + // Unfortunately this turns future setData calls into no-ops; they + // call processDatapoints, the flag is true, and nothing happens. + + // To fix this we'll set the flag back to false here in draw, when + // all series have been processed, so the next sequence of calls to + // processDatapoints once again starts out with a slice-combine. + // This is really a hack; in 0.9 we need to give plugins a proper + // way to modify series before any processing begins. + + processed = false; + + // calculate maximum radius and center point + + maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2; + centerTop = canvasHeight / 2 + options.series.pie.offset.top; + centerLeft = canvasWidth / 2; + + if (options.series.pie.offset.left == "auto") { + if (options.legend.position.match("w")) { + centerLeft += legendWidth / 2; + } else { + centerLeft -= legendWidth / 2; + } + if (centerLeft < maxRadius) { + centerLeft = maxRadius; + } else if (centerLeft > canvasWidth - maxRadius) { + centerLeft = canvasWidth - maxRadius; + } + } else { + centerLeft += options.series.pie.offset.left; + } + + var slices = plot.getData(), + attempts = 0; + + // Keep shrinking the pie's radius until drawPie returns true, + // indicating that all the labels fit, or we try too many times. + + do { + if (attempts > 0) { + maxRadius *= REDRAW_SHRINK; + } + attempts += 1; + clear(); + if (options.series.pie.tilt <= 0.8) { + drawShadow(); + } + } while (!drawPie() && attempts < REDRAW_ATTEMPTS) + + if (attempts >= REDRAW_ATTEMPTS) { + clear(); + target.prepend("
      Could not draw pie with labels contained inside canvas
      "); + } + + if (plot.setSeries && plot.insertLegend) { + plot.setSeries(slices); + plot.insertLegend(); + } + + // we're actually done at this point, just defining internal functions at this point + + function clear() { + ctx.clearRect(0, 0, canvasWidth, canvasHeight); + target.children().filter(".pieLabel, .pieLabelBackground").remove(); + } + + function drawShadow() { + + var shadowLeft = options.series.pie.shadow.left; + var shadowTop = options.series.pie.shadow.top; + var edge = 10; + var alpha = options.series.pie.shadow.alpha; + var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius; + + if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) { + return; // shadow would be outside canvas, so don't draw it + } + + ctx.save(); + ctx.translate(shadowLeft,shadowTop); + ctx.globalAlpha = alpha; + ctx.fillStyle = "#000"; + + // center and rotate to starting position + + ctx.translate(centerLeft,centerTop); + ctx.scale(1, options.series.pie.tilt); + + //radius -= edge; + + for (var i = 1; i <= edge; i++) { + ctx.beginPath(); + ctx.arc(0, 0, radius, 0, Math.PI * 2, false); + ctx.fill(); + radius -= i; + } + + ctx.restore(); + } + + function drawPie() { + + var startAngle = Math.PI * options.series.pie.startAngle; + var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius; + + // center and rotate to starting position + + ctx.save(); + ctx.translate(centerLeft,centerTop); + ctx.scale(1, options.series.pie.tilt); + //ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera + + // draw slices + + ctx.save(); + var currentAngle = startAngle; + for (var i = 0; i < slices.length; ++i) { + slices[i].startAngle = currentAngle; + drawSlice(slices[i].angle, slices[i].color, true); + } + ctx.restore(); + + // draw slice outlines + + if (options.series.pie.stroke.width > 0) { + ctx.save(); + ctx.lineWidth = options.series.pie.stroke.width; + currentAngle = startAngle; + for (var i = 0; i < slices.length; ++i) { + drawSlice(slices[i].angle, options.series.pie.stroke.color, false); + } + ctx.restore(); + } + + // draw donut hole + + drawDonutHole(ctx); + + ctx.restore(); + + // Draw the labels, returning true if they fit within the plot + + if (options.series.pie.label.show) { + return drawLabels(); + } else return true; + + function drawSlice(angle, color, fill) { + + if (angle <= 0 || isNaN(angle)) { + return; + } + + if (fill) { + ctx.fillStyle = color; + } else { + ctx.strokeStyle = color; + ctx.lineJoin = "round"; + } + + ctx.beginPath(); + if (Math.abs(angle - Math.PI * 2) > 0.000000001) { + ctx.moveTo(0, 0); // Center of the pie + } + + //ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera + ctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false); + ctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false); + ctx.closePath(); + //ctx.rotate(angle); // This doesn't work properly in Opera + currentAngle += angle; + + if (fill) { + ctx.fill(); + } else { + ctx.stroke(); + } + } + + function drawLabels() { + + var currentAngle = startAngle; + var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius; + + for (var i = 0; i < slices.length; ++i) { + if (slices[i].percent >= options.series.pie.label.threshold * 100) { + if (!drawLabel(slices[i], currentAngle, i)) { + return false; + } + } + currentAngle += slices[i].angle; + } + + return true; + + function drawLabel(slice, startAngle, index) { + + if (slice.data[0][1] == 0) { + return true; + } + + // format label text + + var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter; + + if (lf) { + text = lf(slice.label, slice); + } else { + text = slice.label; + } + + if (plf) { + text = plf(text, slice); + } + + var halfAngle = ((startAngle + slice.angle) + startAngle) / 2; + var x = centerLeft + Math.round(Math.cos(halfAngle) * radius); + var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt; + + var html = "" + text + ""; + target.append(html); + + var label = target.children("#pieLabel" + index); + var labelTop = (y - label.height() / 2); + var labelLeft = (x - label.width() / 2); + + label.css("top", labelTop); + label.css("left", labelLeft); + + // check to make sure that the label is not outside the canvas + + if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) { + return false; + } + + if (options.series.pie.label.background.opacity != 0) { + + // put in the transparent background separately to avoid blended labels and label boxes + + var c = options.series.pie.label.background.color; + + if (c == null) { + c = slice.color; + } + + var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;"; + $("
      ") + .css("opacity", options.series.pie.label.background.opacity) + .insertBefore(label); + } + + return true; + } // end individual label function + } // end drawLabels function + } // end drawPie function + } // end draw function + + // Placed here because it needs to be accessed from multiple locations + + function drawDonutHole(layer) { + if (options.series.pie.innerRadius > 0) { + + // subtract the center + + layer.save(); + var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius; + layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color + layer.beginPath(); + layer.fillStyle = options.series.pie.stroke.color; + layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false); + layer.fill(); + layer.closePath(); + layer.restore(); + + // add inner stroke + + layer.save(); + layer.beginPath(); + layer.strokeStyle = options.series.pie.stroke.color; + layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false); + layer.stroke(); + layer.closePath(); + layer.restore(); + + // TODO: add extra shadow inside hole (with a mask) if the pie is tilted. + } + } + + //-- Additional Interactive related functions -- + + function isPointInPoly(poly, pt) { + for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) + ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1])) + && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) + && (c = !c); + return c; + } + + function findNearbySlice(mouseX, mouseY) { + + var slices = plot.getData(), + options = plot.getOptions(), + radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius, + x, y; + + for (var i = 0; i < slices.length; ++i) { + + var s = slices[i]; + + if (s.pie.show) { + + ctx.save(); + ctx.beginPath(); + ctx.moveTo(0, 0); // Center of the pie + //ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here. + ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false); + ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false); + ctx.closePath(); + x = mouseX - centerLeft; + y = mouseY - centerTop; + + if (ctx.isPointInPath) { + if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) { + ctx.restore(); + return { + datapoint: [s.percent, s.data], + dataIndex: 0, + series: s, + seriesIndex: i + }; + } + } else { + + // excanvas for IE doesn;t support isPointInPath, this is a workaround. + + var p1X = radius * Math.cos(s.startAngle), + p1Y = radius * Math.sin(s.startAngle), + p2X = radius * Math.cos(s.startAngle + s.angle / 4), + p2Y = radius * Math.sin(s.startAngle + s.angle / 4), + p3X = radius * Math.cos(s.startAngle + s.angle / 2), + p3Y = radius * Math.sin(s.startAngle + s.angle / 2), + p4X = radius * Math.cos(s.startAngle + s.angle / 1.5), + p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5), + p5X = radius * Math.cos(s.startAngle + s.angle), + p5Y = radius * Math.sin(s.startAngle + s.angle), + arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]], + arrPoint = [x, y]; + + // TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt? + + if (isPointInPoly(arrPoly, arrPoint)) { + ctx.restore(); + return { + datapoint: [s.percent, s.data], + dataIndex: 0, + series: s, + seriesIndex: i + }; + } + } + + ctx.restore(); + } + } + + return null; + } + + function onMouseMove(e) { + triggerClickHoverEvent("plothover", e); + } + + function onClick(e) { + triggerClickHoverEvent("plotclick", e); + } + + // trigger click or hover event (they send the same parameters so we share their code) + + function triggerClickHoverEvent(eventname, e) { + + var offset = plot.offset(); + var canvasX = parseInt(e.pageX - offset.left); + var canvasY = parseInt(e.pageY - offset.top); + var item = findNearbySlice(canvasX, canvasY); + + if (options.grid.autoHighlight) { + + // clear auto-highlights + + for (var i = 0; i < highlights.length; ++i) { + var h = highlights[i]; + if (h.auto == eventname && !(item && h.series == item.series)) { + unhighlight(h.series); + } + } + } + + // highlight the slice + + if (item) { + highlight(item.series, eventname); + } + + // trigger any hover bind events + + var pos = { pageX: e.pageX, pageY: e.pageY }; + target.trigger(eventname, [pos, item]); + } + + function highlight(s, auto) { + //if (typeof s == "number") { + // s = series[s]; + //} + + var i = indexOfHighlight(s); + + if (i == -1) { + highlights.push({ series: s, auto: auto }); + plot.triggerRedrawOverlay(); + } else if (!auto) { + highlights[i].auto = false; + } + } + + function unhighlight(s) { + if (s == null) { + highlights = []; + plot.triggerRedrawOverlay(); + } + + //if (typeof s == "number") { + // s = series[s]; + //} + + var i = indexOfHighlight(s); + + if (i != -1) { + highlights.splice(i, 1); + plot.triggerRedrawOverlay(); + } + } + + function indexOfHighlight(s) { + for (var i = 0; i < highlights.length; ++i) { + var h = highlights[i]; + if (h.series == s) + return i; + } + return -1; + } + + function drawOverlay(plot, octx) { + + var options = plot.getOptions(); + + var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius; + + octx.save(); + octx.translate(centerLeft, centerTop); + octx.scale(1, options.series.pie.tilt); + + for (var i = 0; i < highlights.length; ++i) { + drawHighlight(highlights[i].series); + } + + drawDonutHole(octx); + + octx.restore(); + + function drawHighlight(series) { + + if (series.angle <= 0 || isNaN(series.angle)) { + return; + } + + //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString(); + octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor + octx.beginPath(); + if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) { + octx.moveTo(0, 0); // Center of the pie + } + octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false); + octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false); + octx.closePath(); + octx.fill(); + } + } + } // end init (plugin body) + + // define pie specific options and their default values + + var options = { + series: { + pie: { + show: false, + radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value) + innerRadius: 0, /* for donut */ + startAngle: 3/2, + tilt: 1, + shadow: { + left: 5, // shadow left offset + top: 15, // shadow top offset + alpha: 0.02 // shadow alpha + }, + offset: { + top: 0, + left: "auto" + }, + stroke: { + color: "#fff", + width: 1 + }, + label: { + show: "auto", + formatter: function(label, slice) { + return "
      " + label + "
      " + Math.round(slice.percent) + "%
      "; + }, // formatter function + radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value) + background: { + color: null, + opacity: 0 + }, + threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow) + }, + combine: { + threshold: -1, // percentage at which to combine little slices into one larger slice + color: null, // color to give the new slice (auto-generated if null) + label: "Other" // label to give the new slice + }, + highlight: { + //color: "#fff", // will add this functionality once parseColor is available + opacity: 0.5 + } + } + } + }; + + $.plot.plugins.push({ + init: init, + options: options, + name: "pie", + version: "1.1" + }); + +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.pie.min.js b/public/assets/js/plugins/flot/jquery.flot.pie.min.js new file mode 100755 index 00000000..88ffc9c9 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.pie.min.js @@ -0,0 +1 @@ +(function($){var REDRAW_ATTEMPTS=10;var REDRAW_SHRINK=.95;function init(plot){var canvas=null,target=null,options=null,maxRadius=null,centerLeft=null,centerTop=null,processed=false,ctx=null;var highlights=[];plot.hooks.processOptions.push(function(plot,options){if(options.series.pie.show){options.grid.show=false;if(options.series.pie.label.show=="auto"){if(options.legend.show){options.series.pie.label.show=false}else{options.series.pie.label.show=true}}if(options.series.pie.radius=="auto"){if(options.series.pie.label.show){options.series.pie.radius=3/4}else{options.series.pie.radius=1}}if(options.series.pie.tilt>1){options.series.pie.tilt=1}else if(options.series.pie.tilt<0){options.series.pie.tilt=0}}});plot.hooks.bindEvents.push(function(plot,eventHolder){var options=plot.getOptions();if(options.series.pie.show){if(options.grid.hoverable){eventHolder.unbind("mousemove").mousemove(onMouseMove)}if(options.grid.clickable){eventHolder.unbind("click").click(onClick)}}});plot.hooks.processDatapoints.push(function(plot,series,data,datapoints){var options=plot.getOptions();if(options.series.pie.show){processDatapoints(plot,series,data,datapoints)}});plot.hooks.drawOverlay.push(function(plot,octx){var options=plot.getOptions();if(options.series.pie.show){drawOverlay(plot,octx)}});plot.hooks.draw.push(function(plot,newCtx){var options=plot.getOptions();if(options.series.pie.show){draw(plot,newCtx)}});function processDatapoints(plot,series,datapoints){if(!processed){processed=true;canvas=plot.getCanvas();target=$(canvas).parent();options=plot.getOptions();plot.setData(combine(plot.getData()))}}function combine(data){var total=0,combined=0,numCombined=0,color=options.series.pie.combine.color,newdata=[];for(var i=0;ioptions.series.pie.combine.threshold){newdata.push({data:[[1,value]],color:data[i].color,label:data[i].label,angle:value*Math.PI*2/total,percent:value/(total/100)})}}if(numCombined>1){newdata.push({data:[[1,combined]],color:color,label:options.series.pie.combine.label,angle:combined*Math.PI*2/total,percent:combined/(total/100)})}return newdata}function draw(plot,newCtx){if(!target){return}var canvasWidth=plot.getPlaceholder().width(),canvasHeight=plot.getPlaceholder().height(),legendWidth=target.children().filter(".legend").children().width()||0;ctx=newCtx;processed=false;maxRadius=Math.min(canvasWidth,canvasHeight/options.series.pie.tilt)/2;centerTop=canvasHeight/2+options.series.pie.offset.top;centerLeft=canvasWidth/2;if(options.series.pie.offset.left=="auto"){if(options.legend.position.match("w")){centerLeft+=legendWidth/2}else{centerLeft-=legendWidth/2}if(centerLeftcanvasWidth-maxRadius){centerLeft=canvasWidth-maxRadius}}else{centerLeft+=options.series.pie.offset.left}var slices=plot.getData(),attempts=0;do{if(attempts>0){maxRadius*=REDRAW_SHRINK}attempts+=1;clear();if(options.series.pie.tilt<=.8){drawShadow()}}while(!drawPie()&&attempts=REDRAW_ATTEMPTS){clear();target.prepend("
      Could not draw pie with labels contained inside canvas
      ")}if(plot.setSeries&&plot.insertLegend){plot.setSeries(slices);plot.insertLegend()}function clear(){ctx.clearRect(0,0,canvasWidth,canvasHeight);target.children().filter(".pieLabel, .pieLabelBackground").remove()}function drawShadow(){var shadowLeft=options.series.pie.shadow.left;var shadowTop=options.series.pie.shadow.top;var edge=10;var alpha=options.series.pie.shadow.alpha;var radius=options.series.pie.radius>1?options.series.pie.radius:maxRadius*options.series.pie.radius;if(radius>=canvasWidth/2-shadowLeft||radius*options.series.pie.tilt>=canvasHeight/2-shadowTop||radius<=edge){return}ctx.save();ctx.translate(shadowLeft,shadowTop);ctx.globalAlpha=alpha;ctx.fillStyle="#000";ctx.translate(centerLeft,centerTop);ctx.scale(1,options.series.pie.tilt);for(var i=1;i<=edge;i++){ctx.beginPath();ctx.arc(0,0,radius,0,Math.PI*2,false);ctx.fill();radius-=i}ctx.restore()}function drawPie(){var startAngle=Math.PI*options.series.pie.startAngle;var radius=options.series.pie.radius>1?options.series.pie.radius:maxRadius*options.series.pie.radius;ctx.save();ctx.translate(centerLeft,centerTop);ctx.scale(1,options.series.pie.tilt);ctx.save();var currentAngle=startAngle;for(var i=0;i0){ctx.save();ctx.lineWidth=options.series.pie.stroke.width;currentAngle=startAngle;for(var i=0;i1e-9){ctx.moveTo(0,0)}ctx.arc(0,0,radius,currentAngle,currentAngle+angle/2,false);ctx.arc(0,0,radius,currentAngle+angle/2,currentAngle+angle,false);ctx.closePath();currentAngle+=angle;if(fill){ctx.fill()}else{ctx.stroke()}}function drawLabels(){var currentAngle=startAngle;var radius=options.series.pie.label.radius>1?options.series.pie.label.radius:maxRadius*options.series.pie.label.radius;for(var i=0;i=options.series.pie.label.threshold*100){if(!drawLabel(slices[i],currentAngle,i)){return false}}currentAngle+=slices[i].angle}return true;function drawLabel(slice,startAngle,index){if(slice.data[0][1]==0){return true}var lf=options.legend.labelFormatter,text,plf=options.series.pie.label.formatter;if(lf){text=lf(slice.label,slice)}else{text=slice.label}if(plf){text=plf(text,slice)}var halfAngle=(startAngle+slice.angle+startAngle)/2;var x=centerLeft+Math.round(Math.cos(halfAngle)*radius);var y=centerTop+Math.round(Math.sin(halfAngle)*radius)*options.series.pie.tilt;var html=""+text+"";target.append(html);var label=target.children("#pieLabel"+index);var labelTop=y-label.height()/2;var labelLeft=x-label.width()/2;label.css("top",labelTop);label.css("left",labelLeft);if(0-labelTop>0||0-labelLeft>0||canvasHeight-(labelTop+label.height())<0||canvasWidth-(labelLeft+label.width())<0){return false}if(options.series.pie.label.background.opacity!=0){var c=options.series.pie.label.background.color;if(c==null){c=slice.color}var pos="top:"+labelTop+"px;left:"+labelLeft+"px;";$("
      ").css("opacity",options.series.pie.label.background.opacity).insertBefore(label)}return true}}}}function drawDonutHole(layer){if(options.series.pie.innerRadius>0){layer.save();var innerRadius=options.series.pie.innerRadius>1?options.series.pie.innerRadius:maxRadius*options.series.pie.innerRadius;layer.globalCompositeOperation="destination-out";layer.beginPath();layer.fillStyle=options.series.pie.stroke.color;layer.arc(0,0,innerRadius,0,Math.PI*2,false);layer.fill();layer.closePath();layer.restore();layer.save();layer.beginPath();layer.strokeStyle=options.series.pie.stroke.color;layer.arc(0,0,innerRadius,0,Math.PI*2,false);layer.stroke();layer.closePath();layer.restore()}}function isPointInPoly(poly,pt){for(var c=false,i=-1,l=poly.length,j=l-1;++i1?options.series.pie.radius:maxRadius*options.series.pie.radius,x,y;for(var i=0;i1?options.series.pie.radius:maxRadius*options.series.pie.radius;octx.save();octx.translate(centerLeft,centerTop);octx.scale(1,options.series.pie.tilt);for(var i=0;i1e-9){octx.moveTo(0,0)}octx.arc(0,0,radius,series.startAngle,series.startAngle+series.angle/2,false);octx.arc(0,0,radius,series.startAngle+series.angle/2,series.startAngle+series.angle,false);octx.closePath();octx.fill()}}}var options={series:{pie:{show:false,radius:"auto",innerRadius:0,startAngle:3/2,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(label,slice){return"
      "+label+"
      "+Math.round(slice.percent)+"%
      "},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};$.plot.plugins.push({init:init,options:options,name:"pie",version:"1.1"})})(jQuery); \ No newline at end of file diff --git a/public/assets/js/plugins/flot/jquery.flot.resize.js b/public/assets/js/plugins/flot/jquery.flot.resize.js new file mode 100755 index 00000000..44e04f8f --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.resize.js @@ -0,0 +1,60 @@ +/* Flot plugin for automatically redrawing plots as the placeholder resizes. + +Copyright (c) 2007-2013 IOLA and Ole Laursen. +Licensed under the MIT license. + +It works by listening for changes on the placeholder div (through the jQuery +resize event plugin) - if the size changes, it will redraw the plot. + +There are no options. If you need to disable the plugin for some plots, you +can just fix the size of their placeholders. + +*/ + +/* Inline dependency: + * jQuery resize event - v1.1 - 3/14/2010 + * http://benalman.com/projects/jquery-resize-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ + +(function($,t,n){function p(){for(var n=r.length-1;n>=0;n--){var o=$(r[n]);if(o[0]==t||o.is(":visible")){var h=o.width(),d=o.height(),v=o.data(a);!v||h===v.w&&d===v.h?i[f]=i[l]:(i[f]=i[c],o.trigger(u,[v.w=h,v.h=d]))}else v=o.data(a),v.w=0,v.h=0}s!==null&&(s=t.requestAnimationFrame(p))}var r=[],i=$.resize=$.extend($.resize,{}),s,o="setTimeout",u="resize",a=u+"-special-event",f="delay",l="pendingDelay",c="activeDelay",h="throttleWindow";i[l]=250,i[c]=20,i[f]=i[l],i[h]=!0,$.event.special[u]={setup:function(){if(!i[h]&&this[o])return!1;var t=$(this);r.push(this),t.data(a,{w:t.width(),h:t.height()}),r.length===1&&(s=n,p())},teardown:function(){if(!i[h]&&this[o])return!1;var t=$(this);for(var n=r.length-1;n>=0;n--)if(r[n]==this){r.splice(n,1);break}t.removeData(a),r.length||(cancelAnimationFrame(s),s=null)},add:function(t){function s(t,i,s){var o=$(this),u=o.data(a);u.w=i!==n?i:o.width(),u.h=s!==n?s:o.height(),r.apply(this,arguments)}if(!i[h]&&this[o])return!1;var r;if($.isFunction(t))return r=t,s;r=t.handler,t.handler=s}},t.requestAnimationFrame||(t.requestAnimationFrame=function(){return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e,n){return t.setTimeout(e,i[f])}}()),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(){return t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout}())})(jQuery,this); + +(function ($) { + var options = { }; // no options + + function init(plot) { + function onResize() { + var placeholder = plot.getPlaceholder(); + + // somebody might have hidden us and we can't plot + // when we don't have the dimensions + if (placeholder.width() == 0 || placeholder.height() == 0) + return; + + plot.resize(); + plot.setupGrid(); + plot.draw(); + } + + function bindEvents(plot, eventHolder) { + plot.getPlaceholder().resize(onResize); + } + + function shutdown(plot, eventHolder) { + plot.getPlaceholder().unbind("resize", onResize); + } + + plot.hooks.bindEvents.push(bindEvents); + plot.hooks.shutdown.push(shutdown); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: 'resize', + version: '1.0' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.resize.min.js b/public/assets/js/plugins/flot/jquery.flot.resize.min.js new file mode 100755 index 00000000..29838425 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.resize.min.js @@ -0,0 +1 @@ +(function($,t,n){function p(){for(var n=r.length-1;n>=0;n--){var o=$(r[n]);if(o[0]==t||o.is(":visible")){var h=o.width(),d=o.height(),v=o.data(a);!v||h===v.w&&d===v.h?i[f]=i[l]:(i[f]=i[c],o.trigger(u,[v.w=h,v.h=d]))}else v=o.data(a),v.w=0,v.h=0}s!==null&&(s=t.requestAnimationFrame(p))}var r=[],i=$.resize=$.extend($.resize,{}),s,o="setTimeout",u="resize",a=u+"-special-event",f="delay",l="pendingDelay",c="activeDelay",h="throttleWindow";i[l]=250,i[c]=20,i[f]=i[l],i[h]=!0,$.event.special[u]={setup:function(){if(!i[h]&&this[o])return!1;var t=$(this);r.push(this),t.data(a,{w:t.width(),h:t.height()}),r.length===1&&(s=n,p())},teardown:function(){if(!i[h]&&this[o])return!1;var t=$(this);for(var n=r.length-1;n>=0;n--)if(r[n]==this){r.splice(n,1);break}t.removeData(a),r.length||(cancelAnimationFrame(s),s=null)},add:function(t){function s(t,i,s){var o=$(this),u=o.data(a);u.w=i!==n?i:o.width(),u.h=s!==n?s:o.height(),r.apply(this,arguments)}if(!i[h]&&this[o])return!1;var r;if($.isFunction(t))return r=t,s;r=t.handler,t.handler=s}},t.requestAnimationFrame||(t.requestAnimationFrame=function(){return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e,n){return t.setTimeout(e,i[f])}}()),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(){return t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout}())})(jQuery,this);(function($){var options={};function init(plot){function onResize(){var placeholder=plot.getPlaceholder();if(placeholder.width()==0||placeholder.height()==0)return;plot.resize();plot.setupGrid();plot.draw()}function bindEvents(plot,eventHolder){plot.getPlaceholder().resize(onResize)}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}plot.hooks.bindEvents.push(bindEvents);plot.hooks.shutdown.push(shutdown)}$.plot.plugins.push({init:init,options:options,name:"resize",version:"1.0"})})(jQuery); \ No newline at end of file diff --git a/public/assets/js/plugins/flot/jquery.flot.selection.js b/public/assets/js/plugins/flot/jquery.flot.selection.js new file mode 100755 index 00000000..f8fa668f --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.selection.js @@ -0,0 +1,360 @@ +/* Flot plugin for selecting regions of a plot. + +Copyright (c) 2007-2013 IOLA and Ole Laursen. +Licensed under the MIT license. + +The plugin supports these options: + +selection: { + mode: null or "x" or "y" or "xy", + color: color, + shape: "round" or "miter" or "bevel", + minSize: number of pixels +} + +Selection support is enabled by setting the mode to one of "x", "y" or "xy". +In "x" mode, the user will only be able to specify the x range, similarly for +"y" mode. For "xy", the selection becomes a rectangle where both ranges can be +specified. "color" is color of the selection (if you need to change the color +later on, you can get to it with plot.getOptions().selection.color). "shape" +is the shape of the corners of the selection. + +"minSize" is the minimum size a selection can be in pixels. This value can +be customized to determine the smallest size a selection can be and still +have the selection rectangle be displayed. When customizing this value, the +fact that it refers to pixels, not axis units must be taken into account. +Thus, for example, if there is a bar graph in time mode with BarWidth set to 1 +minute, setting "minSize" to 1 will not make the minimum selection size 1 +minute, but rather 1 pixel. Note also that setting "minSize" to 0 will prevent +"plotunselected" events from being fired when the user clicks the mouse without +dragging. + +When selection support is enabled, a "plotselected" event will be emitted on +the DOM element you passed into the plot function. The event handler gets a +parameter with the ranges selected on the axes, like this: + + placeholder.bind( "plotselected", function( event, ranges ) { + alert("You selected " + ranges.xaxis.from + " to " + ranges.xaxis.to) + // similar for yaxis - with multiple axes, the extra ones are in + // x2axis, x3axis, ... + }); + +The "plotselected" event is only fired when the user has finished making the +selection. A "plotselecting" event is fired during the process with the same +parameters as the "plotselected" event, in case you want to know what's +happening while it's happening, + +A "plotunselected" event with no arguments is emitted when the user clicks the +mouse to remove the selection. As stated above, setting "minSize" to 0 will +destroy this behavior. + +The plugin allso adds the following methods to the plot object: + +- setSelection( ranges, preventEvent ) + + Set the selection rectangle. The passed in ranges is on the same form as + returned in the "plotselected" event. If the selection mode is "x", you + should put in either an xaxis range, if the mode is "y" you need to put in + an yaxis range and both xaxis and yaxis if the selection mode is "xy", like + this: + + setSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } }); + + setSelection will trigger the "plotselected" event when called. If you don't + want that to happen, e.g. if you're inside a "plotselected" handler, pass + true as the second parameter. If you are using multiple axes, you can + specify the ranges on any of those, e.g. as x2axis/x3axis/... instead of + xaxis, the plugin picks the first one it sees. + +- clearSelection( preventEvent ) + + Clear the selection rectangle. Pass in true to avoid getting a + "plotunselected" event. + +- getSelection() + + Returns the current selection in the same format as the "plotselected" + event. If there's currently no selection, the function returns null. + +*/ + +(function ($) { + function init(plot) { + var selection = { + first: { x: -1, y: -1}, second: { x: -1, y: -1}, + show: false, + active: false + }; + + // FIXME: The drag handling implemented here should be + // abstracted out, there's some similar code from a library in + // the navigation plugin, this should be massaged a bit to fit + // the Flot cases here better and reused. Doing this would + // make this plugin much slimmer. + var savedhandlers = {}; + + var mouseUpHandler = null; + + function onMouseMove(e) { + if (selection.active) { + updateSelection(e); + + plot.getPlaceholder().trigger("plotselecting", [ getSelection() ]); + } + } + + function onMouseDown(e) { + if (e.which != 1) // only accept left-click + return; + + // cancel out any text selections + document.body.focus(); + + // prevent text selection and drag in old-school browsers + if (document.onselectstart !== undefined && savedhandlers.onselectstart == null) { + savedhandlers.onselectstart = document.onselectstart; + document.onselectstart = function () { return false; }; + } + if (document.ondrag !== undefined && savedhandlers.ondrag == null) { + savedhandlers.ondrag = document.ondrag; + document.ondrag = function () { return false; }; + } + + setSelectionPos(selection.first, e); + + selection.active = true; + + // this is a bit silly, but we have to use a closure to be + // able to whack the same handler again + mouseUpHandler = function (e) { onMouseUp(e); }; + + $(document).one("mouseup", mouseUpHandler); + } + + function onMouseUp(e) { + mouseUpHandler = null; + + // revert drag stuff for old-school browsers + if (document.onselectstart !== undefined) + document.onselectstart = savedhandlers.onselectstart; + if (document.ondrag !== undefined) + document.ondrag = savedhandlers.ondrag; + + // no more dragging + selection.active = false; + updateSelection(e); + + if (selectionIsSane()) + triggerSelectedEvent(); + else { + // this counts as a clear + plot.getPlaceholder().trigger("plotunselected", [ ]); + plot.getPlaceholder().trigger("plotselecting", [ null ]); + } + + return false; + } + + function getSelection() { + if (!selectionIsSane()) + return null; + + if (!selection.show) return null; + + var r = {}, c1 = selection.first, c2 = selection.second; + $.each(plot.getAxes(), function (name, axis) { + if (axis.used) { + var p1 = axis.c2p(c1[axis.direction]), p2 = axis.c2p(c2[axis.direction]); + r[name] = { from: Math.min(p1, p2), to: Math.max(p1, p2) }; + } + }); + return r; + } + + function triggerSelectedEvent() { + var r = getSelection(); + + plot.getPlaceholder().trigger("plotselected", [ r ]); + + // backwards-compat stuff, to be removed in future + if (r.xaxis && r.yaxis) + plot.getPlaceholder().trigger("selected", [ { x1: r.xaxis.from, y1: r.yaxis.from, x2: r.xaxis.to, y2: r.yaxis.to } ]); + } + + function clamp(min, value, max) { + return value < min ? min: (value > max ? max: value); + } + + function setSelectionPos(pos, e) { + var o = plot.getOptions(); + var offset = plot.getPlaceholder().offset(); + var plotOffset = plot.getPlotOffset(); + pos.x = clamp(0, e.pageX - offset.left - plotOffset.left, plot.width()); + pos.y = clamp(0, e.pageY - offset.top - plotOffset.top, plot.height()); + + if (o.selection.mode == "y") + pos.x = pos == selection.first ? 0 : plot.width(); + + if (o.selection.mode == "x") + pos.y = pos == selection.first ? 0 : plot.height(); + } + + function updateSelection(pos) { + if (pos.pageX == null) + return; + + setSelectionPos(selection.second, pos); + if (selectionIsSane()) { + selection.show = true; + plot.triggerRedrawOverlay(); + } + else + clearSelection(true); + } + + function clearSelection(preventEvent) { + if (selection.show) { + selection.show = false; + plot.triggerRedrawOverlay(); + if (!preventEvent) + plot.getPlaceholder().trigger("plotunselected", [ ]); + } + } + + // function taken from markings support in Flot + function extractRange(ranges, coord) { + var axis, from, to, key, axes = plot.getAxes(); + + for (var k in axes) { + axis = axes[k]; + if (axis.direction == coord) { + key = coord + axis.n + "axis"; + if (!ranges[key] && axis.n == 1) + key = coord + "axis"; // support x1axis as xaxis + if (ranges[key]) { + from = ranges[key].from; + to = ranges[key].to; + break; + } + } + } + + // backwards-compat stuff - to be removed in future + if (!ranges[key]) { + axis = coord == "x" ? plot.getXAxes()[0] : plot.getYAxes()[0]; + from = ranges[coord + "1"]; + to = ranges[coord + "2"]; + } + + // auto-reverse as an added bonus + if (from != null && to != null && from > to) { + var tmp = from; + from = to; + to = tmp; + } + + return { from: from, to: to, axis: axis }; + } + + function setSelection(ranges, preventEvent) { + var axis, range, o = plot.getOptions(); + + if (o.selection.mode == "y") { + selection.first.x = 0; + selection.second.x = plot.width(); + } + else { + range = extractRange(ranges, "x"); + + selection.first.x = range.axis.p2c(range.from); + selection.second.x = range.axis.p2c(range.to); + } + + if (o.selection.mode == "x") { + selection.first.y = 0; + selection.second.y = plot.height(); + } + else { + range = extractRange(ranges, "y"); + + selection.first.y = range.axis.p2c(range.from); + selection.second.y = range.axis.p2c(range.to); + } + + selection.show = true; + plot.triggerRedrawOverlay(); + if (!preventEvent && selectionIsSane()) + triggerSelectedEvent(); + } + + function selectionIsSane() { + var minSize = plot.getOptions().selection.minSize; + return Math.abs(selection.second.x - selection.first.x) >= minSize && + Math.abs(selection.second.y - selection.first.y) >= minSize; + } + + plot.clearSelection = clearSelection; + plot.setSelection = setSelection; + plot.getSelection = getSelection; + + plot.hooks.bindEvents.push(function(plot, eventHolder) { + var o = plot.getOptions(); + if (o.selection.mode != null) { + eventHolder.mousemove(onMouseMove); + eventHolder.mousedown(onMouseDown); + } + }); + + + plot.hooks.drawOverlay.push(function (plot, ctx) { + // draw selection + if (selection.show && selectionIsSane()) { + var plotOffset = plot.getPlotOffset(); + var o = plot.getOptions(); + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + var c = $.color.parse(o.selection.color); + + ctx.strokeStyle = c.scale('a', 0.8).toString(); + ctx.lineWidth = 1; + ctx.lineJoin = o.selection.shape; + ctx.fillStyle = c.scale('a', 0.4).toString(); + + var x = Math.min(selection.first.x, selection.second.x) + 0.5, + y = Math.min(selection.first.y, selection.second.y) + 0.5, + w = Math.abs(selection.second.x - selection.first.x) - 1, + h = Math.abs(selection.second.y - selection.first.y) - 1; + + ctx.fillRect(x, y, w, h); + ctx.strokeRect(x, y, w, h); + + ctx.restore(); + } + }); + + plot.hooks.shutdown.push(function (plot, eventHolder) { + eventHolder.unbind("mousemove", onMouseMove); + eventHolder.unbind("mousedown", onMouseDown); + + if (mouseUpHandler) + $(document).unbind("mouseup", mouseUpHandler); + }); + + } + + $.plot.plugins.push({ + init: init, + options: { + selection: { + mode: null, // one of null, "x", "y" or "xy" + color: "#e8cfac", + shape: "round", // one of "round", "miter", or "bevel" + minSize: 5 // minimum number of pixels + } + }, + name: 'selection', + version: '1.1' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.selection.min.js b/public/assets/js/plugins/flot/jquery.flot.selection.min.js new file mode 100755 index 00000000..6e319781 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.selection.min.js @@ -0,0 +1 @@ +(function($){function init(plot){var selection={first:{x:-1,y:-1},second:{x:-1,y:-1},show:false,active:false};var savedhandlers={};var mouseUpHandler=null;function onMouseMove(e){if(selection.active){updateSelection(e);plot.getPlaceholder().trigger("plotselecting",[getSelection()])}}function onMouseDown(e){if(e.which!=1)return;document.body.focus();if(document.onselectstart!==undefined&&savedhandlers.onselectstart==null){savedhandlers.onselectstart=document.onselectstart;document.onselectstart=function(){return false}}if(document.ondrag!==undefined&&savedhandlers.ondrag==null){savedhandlers.ondrag=document.ondrag;document.ondrag=function(){return false}}setSelectionPos(selection.first,e);selection.active=true;mouseUpHandler=function(e){onMouseUp(e)};$(document).one("mouseup",mouseUpHandler)}function onMouseUp(e){mouseUpHandler=null;if(document.onselectstart!==undefined)document.onselectstart=savedhandlers.onselectstart;if(document.ondrag!==undefined)document.ondrag=savedhandlers.ondrag;selection.active=false;updateSelection(e);if(selectionIsSane())triggerSelectedEvent();else{plot.getPlaceholder().trigger("plotunselected",[]);plot.getPlaceholder().trigger("plotselecting",[null])}return false}function getSelection(){if(!selectionIsSane())return null;if(!selection.show)return null;var r={},c1=selection.first,c2=selection.second;$.each(plot.getAxes(),function(name,axis){if(axis.used){var p1=axis.c2p(c1[axis.direction]),p2=axis.c2p(c2[axis.direction]);r[name]={from:Math.min(p1,p2),to:Math.max(p1,p2)}}});return r}function triggerSelectedEvent(){var r=getSelection();plot.getPlaceholder().trigger("plotselected",[r]);if(r.xaxis&&r.yaxis)plot.getPlaceholder().trigger("selected",[{x1:r.xaxis.from,y1:r.yaxis.from,x2:r.xaxis.to,y2:r.yaxis.to}])}function clamp(min,value,max){return valuemax?max:value}function setSelectionPos(pos,e){var o=plot.getOptions();var offset=plot.getPlaceholder().offset();var plotOffset=plot.getPlotOffset();pos.x=clamp(0,e.pageX-offset.left-plotOffset.left,plot.width());pos.y=clamp(0,e.pageY-offset.top-plotOffset.top,plot.height());if(o.selection.mode=="y")pos.x=pos==selection.first?0:plot.width();if(o.selection.mode=="x")pos.y=pos==selection.first?0:plot.height()}function updateSelection(pos){if(pos.pageX==null)return;setSelectionPos(selection.second,pos);if(selectionIsSane()){selection.show=true;plot.triggerRedrawOverlay()}else clearSelection(true)}function clearSelection(preventEvent){if(selection.show){selection.show=false;plot.triggerRedrawOverlay();if(!preventEvent)plot.getPlaceholder().trigger("plotunselected",[])}}function extractRange(ranges,coord){var axis,from,to,key,axes=plot.getAxes();for(var k in axes){axis=axes[k];if(axis.direction==coord){key=coord+axis.n+"axis";if(!ranges[key]&&axis.n==1)key=coord+"axis";if(ranges[key]){from=ranges[key].from;to=ranges[key].to;break}}}if(!ranges[key]){axis=coord=="x"?plot.getXAxes()[0]:plot.getYAxes()[0];from=ranges[coord+"1"];to=ranges[coord+"2"]}if(from!=null&&to!=null&&from>to){var tmp=from;from=to;to=tmp}return{from:from,to:to,axis:axis}}function setSelection(ranges,preventEvent){var axis,range,o=plot.getOptions();if(o.selection.mode=="y"){selection.first.x=0;selection.second.x=plot.width()}else{range=extractRange(ranges,"x");selection.first.x=range.axis.p2c(range.from);selection.second.x=range.axis.p2c(range.to)}if(o.selection.mode=="x"){selection.first.y=0;selection.second.y=plot.height()}else{range=extractRange(ranges,"y");selection.first.y=range.axis.p2c(range.from);selection.second.y=range.axis.p2c(range.to)}selection.show=true;plot.triggerRedrawOverlay();if(!preventEvent&&selectionIsSane())triggerSelectedEvent()}function selectionIsSane(){var minSize=plot.getOptions().selection.minSize;return Math.abs(selection.second.x-selection.first.x)>=minSize&&Math.abs(selection.second.y-selection.first.y)>=minSize}plot.clearSelection=clearSelection;plot.setSelection=setSelection;plot.getSelection=getSelection;plot.hooks.bindEvents.push(function(plot,eventHolder){var o=plot.getOptions();if(o.selection.mode!=null){eventHolder.mousemove(onMouseMove);eventHolder.mousedown(onMouseDown)}});plot.hooks.drawOverlay.push(function(plot,ctx){if(selection.show&&selectionIsSane()){var plotOffset=plot.getPlotOffset();var o=plot.getOptions();ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var c=$.color.parse(o.selection.color);ctx.strokeStyle=c.scale("a",.8).toString();ctx.lineWidth=1;ctx.lineJoin=o.selection.shape;ctx.fillStyle=c.scale("a",.4).toString();var x=Math.min(selection.first.x,selection.second.x)+.5,y=Math.min(selection.first.y,selection.second.y)+.5,w=Math.abs(selection.second.x-selection.first.x)-1,h=Math.abs(selection.second.y-selection.first.y)-1;ctx.fillRect(x,y,w,h);ctx.strokeRect(x,y,w,h);ctx.restore()}});plot.hooks.shutdown.push(function(plot,eventHolder){eventHolder.unbind("mousemove",onMouseMove);eventHolder.unbind("mousedown",onMouseDown);if(mouseUpHandler)$(document).unbind("mouseup",mouseUpHandler)})}$.plot.plugins.push({init:init,options:{selection:{mode:null,color:"#e8cfac",shape:"round",minSize:5}},name:"selection",version:"1.1"})})(jQuery); \ No newline at end of file diff --git a/public/assets/js/plugins/flot/jquery.flot.stack.js b/public/assets/js/plugins/flot/jquery.flot.stack.js new file mode 100755 index 00000000..c01de67d --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.stack.js @@ -0,0 +1,188 @@ +/* Flot plugin for stacking data sets rather than overlyaing them. + +Copyright (c) 2007-2013 IOLA and Ole Laursen. +Licensed under the MIT license. + +The plugin assumes the data is sorted on x (or y if stacking horizontally). +For line charts, it is assumed that if a line has an undefined gap (from a +null point), then the line above it should have the same gap - insert zeros +instead of "null" if you want another behaviour. This also holds for the start +and end of the chart. Note that stacking a mix of positive and negative values +in most instances doesn't make sense (so it looks weird). + +Two or more series are stacked when their "stack" attribute is set to the same +key (which can be any number or string or just "true"). To specify the default +stack, you can set the stack option like this: + + series: { + stack: null/false, true, or a key (number/string) + } + +You can also specify it for a single series, like this: + + $.plot( $("#placeholder"), [{ + data: [ ... ], + stack: true + }]) + +The stacking order is determined by the order of the data series in the array +(later series end up on top of the previous). + +Internally, the plugin modifies the datapoints in each series, adding an +offset to the y value. For line series, extra data points are inserted through +interpolation. If there's a second y value, it's also adjusted (e.g for bar +charts or filled areas). + +*/ + +(function ($) { + var options = { + series: { stack: null } // or number/string + }; + + function init(plot) { + function findMatchingSeries(s, allseries) { + var res = null; + for (var i = 0; i < allseries.length; ++i) { + if (s == allseries[i]) + break; + + if (allseries[i].stack == s.stack) + res = allseries[i]; + } + + return res; + } + + function stackData(plot, s, datapoints) { + if (s.stack == null || s.stack === false) + return; + + var other = findMatchingSeries(s, plot.getData()); + if (!other) + return; + + var ps = datapoints.pointsize, + points = datapoints.points, + otherps = other.datapoints.pointsize, + otherpoints = other.datapoints.points, + newpoints = [], + px, py, intery, qx, qy, bottom, + withlines = s.lines.show, + horizontal = s.bars.horizontal, + withbottom = ps > 2 && (horizontal ? datapoints.format[2].x : datapoints.format[2].y), + withsteps = withlines && s.lines.steps, + fromgap = true, + keyOffset = horizontal ? 1 : 0, + accumulateOffset = horizontal ? 0 : 1, + i = 0, j = 0, l, m; + + while (true) { + if (i >= points.length) + break; + + l = newpoints.length; + + if (points[i] == null) { + // copy gaps + for (m = 0; m < ps; ++m) + newpoints.push(points[i + m]); + i += ps; + } + else if (j >= otherpoints.length) { + // for lines, we can't use the rest of the points + if (!withlines) { + for (m = 0; m < ps; ++m) + newpoints.push(points[i + m]); + } + i += ps; + } + else if (otherpoints[j] == null) { + // oops, got a gap + for (m = 0; m < ps; ++m) + newpoints.push(null); + fromgap = true; + j += otherps; + } + else { + // cases where we actually got two points + px = points[i + keyOffset]; + py = points[i + accumulateOffset]; + qx = otherpoints[j + keyOffset]; + qy = otherpoints[j + accumulateOffset]; + bottom = 0; + + if (px == qx) { + for (m = 0; m < ps; ++m) + newpoints.push(points[i + m]); + + newpoints[l + accumulateOffset] += qy; + bottom = qy; + + i += ps; + j += otherps; + } + else if (px > qx) { + // we got past point below, might need to + // insert interpolated extra point + if (withlines && i > 0 && points[i - ps] != null) { + intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px); + newpoints.push(qx); + newpoints.push(intery + qy); + for (m = 2; m < ps; ++m) + newpoints.push(points[i + m]); + bottom = qy; + } + + j += otherps; + } + else { // px < qx + if (fromgap && withlines) { + // if we come from a gap, we just skip this point + i += ps; + continue; + } + + for (m = 0; m < ps; ++m) + newpoints.push(points[i + m]); + + // we might be able to interpolate a point below, + // this can give us a better y + if (withlines && j > 0 && otherpoints[j - otherps] != null) + bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx); + + newpoints[l + accumulateOffset] += bottom; + + i += ps; + } + + fromgap = false; + + if (l != newpoints.length && withbottom) + newpoints[l + 2] += bottom; + } + + // maintain the line steps invariant + if (withsteps && l != newpoints.length && l > 0 + && newpoints[l] != null + && newpoints[l] != newpoints[l - ps] + && newpoints[l + 1] != newpoints[l - ps + 1]) { + for (m = 0; m < ps; ++m) + newpoints[l + ps + m] = newpoints[l + m]; + newpoints[l + 1] = newpoints[l - ps + 1]; + } + } + + datapoints.points = newpoints; + } + + plot.hooks.processDatapoints.push(stackData); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: 'stack', + version: '1.2' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.stack.min.js b/public/assets/js/plugins/flot/jquery.flot.stack.min.js new file mode 100755 index 00000000..57785ebd --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.stack.min.js @@ -0,0 +1 @@ +(function($){var options={series:{stack:null}};function init(plot){function findMatchingSeries(s,allseries){var res=null;for(var i=0;i2&&(horizontal?datapoints.format[2].x:datapoints.format[2].y),withsteps=withlines&&s.lines.steps,fromgap=true,keyOffset=horizontal?1:0,accumulateOffset=horizontal?0:1,i=0,j=0,l,m;while(true){if(i>=points.length)break;l=newpoints.length;if(points[i]==null){for(m=0;m=otherpoints.length){if(!withlines){for(m=0;mqx){if(withlines&&i>0&&points[i-ps]!=null){intery=py+(points[i-ps+accumulateOffset]-py)*(qx-px)/(points[i-ps+keyOffset]-px);newpoints.push(qx);newpoints.push(intery+qy);for(m=2;m0&&otherpoints[j-otherps]!=null)bottom=qy+(otherpoints[j-otherps+accumulateOffset]-qy)*(px-qx)/(otherpoints[j-otherps+keyOffset]-qx);newpoints[l+accumulateOffset]+=bottom;i+=ps}fromgap=false;if(l!=newpoints.length&&withbottom)newpoints[l+2]+=bottom}if(withsteps&&l!=newpoints.length&&l>0&&newpoints[l]!=null&&newpoints[l]!=newpoints[l-ps]&&newpoints[l+1]!=newpoints[l-ps+1]){for(m=0;m s = r * sqrt(pi)/2 + var size = radius * Math.sqrt(Math.PI) / 2; + ctx.rect(x - size, y - size, size + size, size + size); + }, + diamond: function (ctx, x, y, radius, shadow) { + // pi * r^2 = 2s^2 => s = r * sqrt(pi/2) + var size = radius * Math.sqrt(Math.PI / 2); + ctx.moveTo(x - size, y); + ctx.lineTo(x, y - size); + ctx.lineTo(x + size, y); + ctx.lineTo(x, y + size); + ctx.lineTo(x - size, y); + }, + triangle: function (ctx, x, y, radius, shadow) { + // pi * r^2 = 1/2 * s^2 * sin (pi / 3) => s = r * sqrt(2 * pi / sin(pi / 3)) + var size = radius * Math.sqrt(2 * Math.PI / Math.sin(Math.PI / 3)); + var height = size * Math.sin(Math.PI / 3); + ctx.moveTo(x - size/2, y + height/2); + ctx.lineTo(x + size/2, y + height/2); + if (!shadow) { + ctx.lineTo(x, y - height/2); + ctx.lineTo(x - size/2, y + height/2); + } + }, + cross: function (ctx, x, y, radius, shadow) { + // pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2 + var size = radius * Math.sqrt(Math.PI) / 2; + ctx.moveTo(x - size, y - size); + ctx.lineTo(x + size, y + size); + ctx.moveTo(x - size, y + size); + ctx.lineTo(x + size, y - size); + } + }; + + var s = series.points.symbol; + if (handlers[s]) + series.points.symbol = handlers[s]; + } + + function init(plot) { + plot.hooks.processDatapoints.push(processRawData); + } + + $.plot.plugins.push({ + init: init, + name: 'symbols', + version: '1.0' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.symbol.min.js b/public/assets/js/plugins/flot/jquery.flot.symbol.min.js new file mode 100755 index 00000000..3eab213e --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.symbol.min.js @@ -0,0 +1 @@ +(function($){function processRawData(plot,series,datapoints){var handlers={square:function(ctx,x,y,radius,shadow){var size=radius*Math.sqrt(Math.PI)/2;ctx.rect(x-size,y-size,size+size,size+size)},diamond:function(ctx,x,y,radius,shadow){var size=radius*Math.sqrt(Math.PI/2);ctx.moveTo(x-size,y);ctx.lineTo(x,y-size);ctx.lineTo(x+size,y);ctx.lineTo(x,y+size);ctx.lineTo(x-size,y)},triangle:function(ctx,x,y,radius,shadow){var size=radius*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3));var height=size*Math.sin(Math.PI/3);ctx.moveTo(x-size/2,y+height/2);ctx.lineTo(x+size/2,y+height/2);if(!shadow){ctx.lineTo(x,y-height/2);ctx.lineTo(x-size/2,y+height/2)}},cross:function(ctx,x,y,radius,shadow){var size=radius*Math.sqrt(Math.PI)/2;ctx.moveTo(x-size,y-size);ctx.lineTo(x+size,y+size);ctx.moveTo(x-size,y+size);ctx.lineTo(x+size,y-size)}};var s=series.points.symbol;if(handlers[s])series.points.symbol=handlers[s]}function init(plot){plot.hooks.processDatapoints.push(processRawData)}$.plot.plugins.push({init:init,name:"symbols",version:"1.0"})})(jQuery); \ No newline at end of file diff --git a/public/assets/js/plugins/flot/jquery.flot.threshold.js b/public/assets/js/plugins/flot/jquery.flot.threshold.js new file mode 100755 index 00000000..2f6e6359 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.threshold.js @@ -0,0 +1,142 @@ +/* Flot plugin for thresholding data. + +Copyright (c) 2007-2013 IOLA and Ole Laursen. +Licensed under the MIT license. + +The plugin supports these options: + + series: { + threshold: { + below: number + color: colorspec + } + } + +It can also be applied to a single series, like this: + + $.plot( $("#placeholder"), [{ + data: [ ... ], + threshold: { ... } + }]) + +An array can be passed for multiple thresholding, like this: + + threshold: [{ + below: number1 + color: color1 + },{ + below: number2 + color: color2 + }] + +These multiple threshold objects can be passed in any order since they are +sorted by the processing function. + +The data points below "below" are drawn with the specified color. This makes +it easy to mark points below 0, e.g. for budget data. + +Internally, the plugin works by splitting the data into two series, above and +below the threshold. The extra series below the threshold will have its label +cleared and the special "originSeries" attribute set to the original series. +You may need to check for this in hover events. + +*/ + +(function ($) { + var options = { + series: { threshold: null } // or { below: number, color: color spec} + }; + + function init(plot) { + function thresholdData(plot, s, datapoints, below, color) { + var ps = datapoints.pointsize, i, x, y, p, prevp, + thresholded = $.extend({}, s); // note: shallow copy + + thresholded.datapoints = { points: [], pointsize: ps, format: datapoints.format }; + thresholded.label = null; + thresholded.color = color; + thresholded.threshold = null; + thresholded.originSeries = s; + thresholded.data = []; + + var origpoints = datapoints.points, + addCrossingPoints = s.lines.show; + + var threspoints = []; + var newpoints = []; + var m; + + for (i = 0; i < origpoints.length; i += ps) { + x = origpoints[i]; + y = origpoints[i + 1]; + + prevp = p; + if (y < below) + p = threspoints; + else + p = newpoints; + + if (addCrossingPoints && prevp != p && x != null + && i > 0 && origpoints[i - ps] != null) { + var interx = x + (below - y) * (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]); + prevp.push(interx); + prevp.push(below); + for (m = 2; m < ps; ++m) + prevp.push(origpoints[i + m]); + + p.push(null); // start new segment + p.push(null); + for (m = 2; m < ps; ++m) + p.push(origpoints[i + m]); + p.push(interx); + p.push(below); + for (m = 2; m < ps; ++m) + p.push(origpoints[i + m]); + } + + p.push(x); + p.push(y); + for (m = 2; m < ps; ++m) + p.push(origpoints[i + m]); + } + + datapoints.points = newpoints; + thresholded.datapoints.points = threspoints; + + if (thresholded.datapoints.points.length > 0) { + var origIndex = $.inArray(s, plot.getData()); + // Insert newly-generated series right after original one (to prevent it from becoming top-most) + plot.getData().splice(origIndex + 1, 0, thresholded); + } + + // FIXME: there are probably some edge cases left in bars + } + + function processThresholds(plot, s, datapoints) { + if (!s.threshold) + return; + + if (s.threshold instanceof Array) { + s.threshold.sort(function(a, b) { + return a.below - b.below; + }); + + $(s.threshold).each(function(i, th) { + thresholdData(plot, s, datapoints, th.below, th.color); + }); + } + else { + thresholdData(plot, s, datapoints, s.threshold.below, s.threshold.color); + } + } + + plot.hooks.processDatapoints.push(processThresholds); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: 'threshold', + version: '1.2' + }); +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.threshold.min.js b/public/assets/js/plugins/flot/jquery.flot.threshold.min.js new file mode 100755 index 00000000..a53849a5 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.threshold.min.js @@ -0,0 +1 @@ +(function($){var options={series:{threshold:null}};function init(plot){function thresholdData(plot,s,datapoints,below,color){var ps=datapoints.pointsize,i,x,y,p,prevp,thresholded=$.extend({},s);thresholded.datapoints={points:[],pointsize:ps,format:datapoints.format};thresholded.label=null;thresholded.color=color;thresholded.threshold=null;thresholded.originSeries=s;thresholded.data=[];var origpoints=datapoints.points,addCrossingPoints=s.lines.show;var threspoints=[];var newpoints=[];var m;for(i=0;i0&&origpoints[i-ps]!=null){var interx=x+(below-y)*(x-origpoints[i-ps])/(y-origpoints[i-ps+1]);prevp.push(interx);prevp.push(below);for(m=2;m0){var origIndex=$.inArray(s,plot.getData());plot.getData().splice(origIndex+1,0,thresholded)}}function processThresholds(plot,s,datapoints){if(!s.threshold)return;if(s.threshold instanceof Array){s.threshold.sort(function(a,b){return a.below-b.below});$(s.threshold).each(function(i,th){thresholdData(plot,s,datapoints,th.below,th.color)})}else{thresholdData(plot,s,datapoints,s.threshold.below,s.threshold.color)}}plot.hooks.processDatapoints.push(processThresholds)}$.plot.plugins.push({init:init,options:options,name:"threshold",version:"1.2"})})(jQuery); \ No newline at end of file diff --git a/public/assets/js/plugins/flot/jquery.flot.time.js b/public/assets/js/plugins/flot/jquery.flot.time.js new file mode 100755 index 00000000..15f52815 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.time.js @@ -0,0 +1,431 @@ +/* Pretty handling of time axes. + +Copyright (c) 2007-2013 IOLA and Ole Laursen. +Licensed under the MIT license. + +Set axis.mode to "time" to enable. See the section "Time series data" in +API.txt for details. + +*/ + +(function($) { + + var options = { + xaxis: { + timezone: null, // "browser" for local to the client or timezone for timezone-js + timeformat: null, // format string to use + twelveHourClock: false, // 12 or 24 time in time mode + monthNames: null // list of names of months + } + }; + + // round to nearby lower multiple of base + + function floorInBase(n, base) { + return base * Math.floor(n / base); + } + + // Returns a string with the date d formatted according to fmt. + // A subset of the Open Group's strftime format is supported. + + function formatDate(d, fmt, monthNames, dayNames) { + + if (typeof d.strftime == "function") { + return d.strftime(fmt); + } + + var leftPad = function(n, pad) { + n = "" + n; + pad = "" + (pad == null ? "0" : pad); + return n.length == 1 ? pad + n : n; + }; + + var r = []; + var escape = false; + var hours = d.getHours(); + var isAM = hours < 12; + + if (monthNames == null) { + monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + } + + if (dayNames == null) { + dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; + } + + var hours12; + + if (hours > 12) { + hours12 = hours - 12; + } else if (hours == 0) { + hours12 = 12; + } else { + hours12 = hours; + } + + for (var i = 0; i < fmt.length; ++i) { + + var c = fmt.charAt(i); + + if (escape) { + switch (c) { + case 'a': c = "" + dayNames[d.getDay()]; break; + case 'b': c = "" + monthNames[d.getMonth()]; break; + case 'd': c = leftPad(d.getDate()); break; + case 'e': c = leftPad(d.getDate(), " "); break; + case 'h': // For back-compat with 0.7; remove in 1.0 + case 'H': c = leftPad(hours); break; + case 'I': c = leftPad(hours12); break; + case 'l': c = leftPad(hours12, " "); break; + case 'm': c = leftPad(d.getMonth() + 1); break; + case 'M': c = leftPad(d.getMinutes()); break; + // quarters not in Open Group's strftime specification + case 'q': + c = "" + (Math.floor(d.getMonth() / 3) + 1); break; + case 'S': c = leftPad(d.getSeconds()); break; + case 'y': c = leftPad(d.getFullYear() % 100); break; + case 'Y': c = "" + d.getFullYear(); break; + case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break; + case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break; + case 'w': c = "" + d.getDay(); break; + } + r.push(c); + escape = false; + } else { + if (c == "%") { + escape = true; + } else { + r.push(c); + } + } + } + + return r.join(""); + } + + // To have a consistent view of time-based data independent of which time + // zone the client happens to be in we need a date-like object independent + // of time zones. This is done through a wrapper that only calls the UTC + // versions of the accessor methods. + + function makeUtcWrapper(d) { + + function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) { + sourceObj[sourceMethod] = function() { + return targetObj[targetMethod].apply(targetObj, arguments); + }; + }; + + var utc = { + date: d + }; + + // support strftime, if found + + if (d.strftime != undefined) { + addProxyMethod(utc, "strftime", d, "strftime"); + } + + addProxyMethod(utc, "getTime", d, "getTime"); + addProxyMethod(utc, "setTime", d, "setTime"); + + var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"]; + + for (var p = 0; p < props.length; p++) { + addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]); + addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]); + } + + return utc; + }; + + // select time zone strategy. This returns a date-like object tied to the + // desired timezone + + function dateGenerator(ts, opts) { + if (opts.timezone == "browser") { + return new Date(ts); + } else if (!opts.timezone || opts.timezone == "utc") { + return makeUtcWrapper(new Date(ts)); + } else if (typeof timezoneJS != "undefined" && typeof timezoneJS.Date != "undefined") { + var d = new timezoneJS.Date(); + // timezone-js is fickle, so be sure to set the time zone before + // setting the time. + d.setTimezone(opts.timezone); + d.setTime(ts); + return d; + } else { + return makeUtcWrapper(new Date(ts)); + } + } + + // map of app. size of time units in milliseconds + + var timeUnitSize = { + "second": 1000, + "minute": 60 * 1000, + "hour": 60 * 60 * 1000, + "day": 24 * 60 * 60 * 1000, + "month": 30 * 24 * 60 * 60 * 1000, + "quarter": 3 * 30 * 24 * 60 * 60 * 1000, + "year": 365.2425 * 24 * 60 * 60 * 1000 + }; + + // the allowed tick sizes, after 1 year we use + // an integer algorithm + + var baseSpec = [ + [1, "second"], [2, "second"], [5, "second"], [10, "second"], + [30, "second"], + [1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"], + [30, "minute"], + [1, "hour"], [2, "hour"], [4, "hour"], + [8, "hour"], [12, "hour"], + [1, "day"], [2, "day"], [3, "day"], + [0.25, "month"], [0.5, "month"], [1, "month"], + [2, "month"] + ]; + + // we don't know which variant(s) we'll need yet, but generating both is + // cheap + + var specMonths = baseSpec.concat([[3, "month"], [6, "month"], + [1, "year"]]); + var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"], + [1, "year"]]); + + function init(plot) { + plot.hooks.processOptions.push(function (plot, options) { + $.each(plot.getAxes(), function(axisName, axis) { + + var opts = axis.options; + + if (opts.mode == "time") { + axis.tickGenerator = function(axis) { + + var ticks = []; + var d = dateGenerator(axis.min, opts); + var minSize = 0; + + // make quarter use a possibility if quarters are + // mentioned in either of these options + + var spec = (opts.tickSize && opts.tickSize[1] === + "quarter") || + (opts.minTickSize && opts.minTickSize[1] === + "quarter") ? specQuarters : specMonths; + + if (opts.minTickSize != null) { + if (typeof opts.tickSize == "number") { + minSize = opts.tickSize; + } else { + minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]]; + } + } + + for (var i = 0; i < spec.length - 1; ++i) { + if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]] + + spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2 + && spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) { + break; + } + } + + var size = spec[i][0]; + var unit = spec[i][1]; + + // special-case the possibility of several years + + if (unit == "year") { + + // if given a minTickSize in years, just use it, + // ensuring that it's an integer + + if (opts.minTickSize != null && opts.minTickSize[1] == "year") { + size = Math.floor(opts.minTickSize[0]); + } else { + + var magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10)); + var norm = (axis.delta / timeUnitSize.year) / magn; + + if (norm < 1.5) { + size = 1; + } else if (norm < 3) { + size = 2; + } else if (norm < 7.5) { + size = 5; + } else { + size = 10; + } + + size *= magn; + } + + // minimum size for years is 1 + + if (size < 1) { + size = 1; + } + } + + axis.tickSize = opts.tickSize || [size, unit]; + var tickSize = axis.tickSize[0]; + unit = axis.tickSize[1]; + + var step = tickSize * timeUnitSize[unit]; + + if (unit == "second") { + d.setSeconds(floorInBase(d.getSeconds(), tickSize)); + } else if (unit == "minute") { + d.setMinutes(floorInBase(d.getMinutes(), tickSize)); + } else if (unit == "hour") { + d.setHours(floorInBase(d.getHours(), tickSize)); + } else if (unit == "month") { + d.setMonth(floorInBase(d.getMonth(), tickSize)); + } else if (unit == "quarter") { + d.setMonth(3 * floorInBase(d.getMonth() / 3, + tickSize)); + } else if (unit == "year") { + d.setFullYear(floorInBase(d.getFullYear(), tickSize)); + } + + // reset smaller components + + d.setMilliseconds(0); + + if (step >= timeUnitSize.minute) { + d.setSeconds(0); + } + if (step >= timeUnitSize.hour) { + d.setMinutes(0); + } + if (step >= timeUnitSize.day) { + d.setHours(0); + } + if (step >= timeUnitSize.day * 4) { + d.setDate(1); + } + if (step >= timeUnitSize.month * 2) { + d.setMonth(floorInBase(d.getMonth(), 3)); + } + if (step >= timeUnitSize.quarter * 2) { + d.setMonth(floorInBase(d.getMonth(), 6)); + } + if (step >= timeUnitSize.year) { + d.setMonth(0); + } + + var carry = 0; + var v = Number.NaN; + var prev; + + do { + + prev = v; + v = d.getTime(); + ticks.push(v); + + if (unit == "month" || unit == "quarter") { + if (tickSize < 1) { + + // a bit complicated - we'll divide the + // month/quarter up but we need to take + // care of fractions so we don't end up in + // the middle of a day + + d.setDate(1); + var start = d.getTime(); + d.setMonth(d.getMonth() + + (unit == "quarter" ? 3 : 1)); + var end = d.getTime(); + d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize); + carry = d.getHours(); + d.setHours(0); + } else { + d.setMonth(d.getMonth() + + tickSize * (unit == "quarter" ? 3 : 1)); + } + } else if (unit == "year") { + d.setFullYear(d.getFullYear() + tickSize); + } else { + d.setTime(v + step); + } + } while (v < axis.max && v != prev); + + return ticks; + }; + + axis.tickFormatter = function (v, axis) { + + var d = dateGenerator(v, axis.options); + + // first check global format + + if (opts.timeformat != null) { + return formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames); + } + + // possibly use quarters if quarters are mentioned in + // any of these places + + var useQuarters = (axis.options.tickSize && + axis.options.tickSize[1] == "quarter") || + (axis.options.minTickSize && + axis.options.minTickSize[1] == "quarter"); + + var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]]; + var span = axis.max - axis.min; + var suffix = (opts.twelveHourClock) ? " %p" : ""; + var hourCode = (opts.twelveHourClock) ? "%I" : "%H"; + var fmt; + + if (t < timeUnitSize.minute) { + fmt = hourCode + ":%M:%S" + suffix; + } else if (t < timeUnitSize.day) { + if (span < 2 * timeUnitSize.day) { + fmt = hourCode + ":%M" + suffix; + } else { + fmt = "%b %d " + hourCode + ":%M" + suffix; + } + } else if (t < timeUnitSize.month) { + fmt = "%b %d"; + } else if ((useQuarters && t < timeUnitSize.quarter) || + (!useQuarters && t < timeUnitSize.year)) { + if (span < timeUnitSize.year) { + fmt = "%b"; + } else { + fmt = "%b %Y"; + } + } else if (useQuarters && t < timeUnitSize.year) { + if (span < timeUnitSize.year) { + fmt = "Q%q"; + } else { + fmt = "Q%q %Y"; + } + } else { + fmt = "%Y"; + } + + var rt = formatDate(d, fmt, opts.monthNames, opts.dayNames); + + return rt; + }; + } + }); + }); + } + + $.plot.plugins.push({ + init: init, + options: options, + name: 'time', + version: '1.0' + }); + + // Time-axis support used to be in Flot core, which exposed the + // formatDate function on the plot object. Various plugins depend + // on the function, so we need to re-expose it here. + + $.plot.formatDate = formatDate; + +})(jQuery); diff --git a/public/assets/js/plugins/flot/jquery.flot.time.min.js b/public/assets/js/plugins/flot/jquery.flot.time.min.js new file mode 100755 index 00000000..aaf319c9 --- /dev/null +++ b/public/assets/js/plugins/flot/jquery.flot.time.min.js @@ -0,0 +1 @@ +(function($){var options={xaxis:{timezone:null,timeformat:null,twelveHourClock:false,monthNames:null}};function floorInBase(n,base){return base*Math.floor(n/base)}function formatDate(d,fmt,monthNames,dayNames){if(typeof d.strftime=="function"){return d.strftime(fmt)}var leftPad=function(n,pad){n=""+n;pad=""+(pad==null?"0":pad);return n.length==1?pad+n:n};var r=[];var escape=false;var hours=d.getHours();var isAM=hours<12;if(monthNames==null){monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}if(dayNames==null){dayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}var hours12;if(hours>12){hours12=hours-12}else if(hours==0){hours12=12}else{hours12=hours}for(var i=0;i=minSize){break}}var size=spec[i][0];var unit=spec[i][1];if(unit=="year"){if(opts.minTickSize!=null&&opts.minTickSize[1]=="year"){size=Math.floor(opts.minTickSize[0])}else{var magn=Math.pow(10,Math.floor(Math.log(axis.delta/timeUnitSize.year)/Math.LN10));var norm=axis.delta/timeUnitSize.year/magn;if(norm<1.5){size=1}else if(norm<3){size=2}else if(norm<7.5){size=5}else{size=10}size*=magn}if(size<1){size=1}}axis.tickSize=opts.tickSize||[size,unit];var tickSize=axis.tickSize[0];unit=axis.tickSize[1];var step=tickSize*timeUnitSize[unit];if(unit=="second"){d.setSeconds(floorInBase(d.getSeconds(),tickSize))}else if(unit=="minute"){d.setMinutes(floorInBase(d.getMinutes(),tickSize))}else if(unit=="hour"){d.setHours(floorInBase(d.getHours(),tickSize))}else if(unit=="month"){d.setMonth(floorInBase(d.getMonth(),tickSize))}else if(unit=="quarter"){d.setMonth(3*floorInBase(d.getMonth()/3,tickSize))}else if(unit=="year"){d.setFullYear(floorInBase(d.getFullYear(),tickSize))}d.setMilliseconds(0);if(step>=timeUnitSize.minute){d.setSeconds(0)}if(step>=timeUnitSize.hour){d.setMinutes(0)}if(step>=timeUnitSize.day){d.setHours(0)}if(step>=timeUnitSize.day*4){d.setDate(1)}if(step>=timeUnitSize.month*2){d.setMonth(floorInBase(d.getMonth(),3))}if(step>=timeUnitSize.quarter*2){d.setMonth(floorInBase(d.getMonth(),6))}if(step>=timeUnitSize.year){d.setMonth(0)}var carry=0;var v=Number.NaN;var prev;do{prev=v;v=d.getTime();ticks.push(v);if(unit=="month"||unit=="quarter"){if(tickSize<1){d.setDate(1);var start=d.getTime();d.setMonth(d.getMonth()+(unit=="quarter"?3:1));var end=d.getTime();d.setTime(v+carry*timeUnitSize.hour+(end-start)*tickSize);carry=d.getHours();d.setHours(0)}else{d.setMonth(d.getMonth()+tickSize*(unit=="quarter"?3:1))}}else if(unit=="year"){d.setFullYear(d.getFullYear()+tickSize)}else{d.setTime(v+step)}}while(v')[_callback]('ifCreated').parent().append(settings.insert); + + // Layer addition + helper = $('').css(layer).appendTo(parent); + + // Finalize customization + self.data(_iCheck, {o: settings, s: self.attr('style')}).css(hide); + !!settings.inheritClass && parent[_add](node.className || ''); + !!settings.inheritID && id && parent.attr('id', _iCheck + '-' + id); + parent.css('position') == 'static' && parent.css('position', 'relative'); + operate(self, true, _update); + + // Label events + if (label.length) { + label.on(_click + '.i mouseover.i mouseout.i ' + _touch, function(event) { + var type = event[_type], + item = $(this); + + // Do nothing if input is disabled + if (!node[_disabled]) { + + // Click + if (type == _click) { + if ($(event.target).is('a')) { + return; + } + operate(self, false, true); + + // Hover state + } else if (labelHover) { + + // mouseout|touchend + if (/ut|nd/.test(type)) { + parent[_remove](hoverClass); + item[_remove](labelHoverClass); + } else { + parent[_add](hoverClass); + item[_add](labelHoverClass); + }; + }; + + if (_mobile) { + event.stopPropagation(); + } else { + return false; + }; + }; + }); + }; + + // Input events + self.on(_click + '.i focus.i blur.i keyup.i keydown.i keypress.i', function(event) { + var type = event[_type], + key = event.keyCode; + + // Click + if (type == _click) { + return false; + + // Keydown + } else if (type == 'keydown' && key == 32) { + if (!(node[_type] == _radio && node[_checked])) { + if (node[_checked]) { + off(self, _checked); + } else { + on(self, _checked); + }; + }; + + return false; + + // Keyup + } else if (type == 'keyup' && node[_type] == _radio) { + !node[_checked] && on(self, _checked); + + // Focus/blur + } else if (/us|ur/.test(type)) { + parent[type == 'blur' ? _remove : _add](focusClass); + }; + }); + + // Helper events + helper.on(_click + ' mousedown mouseup mouseover mouseout ' + _touch, function(event) { + var type = event[_type], + + // mousedown|mouseup + toggle = /wn|up/.test(type) ? activeClass : hoverClass; + + // Do nothing if input is disabled + if (!node[_disabled]) { + + // Click + if (type == _click) { + operate(self, false, true); + + // Active and hover states + } else { + + // State is on + if (/wn|er|in/.test(type)) { + + // mousedown|mouseover|touchbegin + parent[_add](toggle); + + // State is off + } else { + parent[_remove](toggle + ' ' + activeClass); + }; + + // Label hover + if (label.length && labelHover && toggle == hoverClass) { + + // mouseout|touchend + label[/ut|nd/.test(type) ? _remove : _add](labelHoverClass); + }; + }; + + if (_mobile) { + event.stopPropagation(); + } else { + return false; + }; + }; + }); + }); + } else { + return this; + }; + }; + + // Do something with inputs + function operate(input, direct, method) { + var node = input[0], + state = /er/.test(method) ? _indeterminate : /bl/.test(method) ? _disabled : _checked, + active = method == _update ? { + checked: node[_checked], + disabled: node[_disabled], + indeterminate: input.attr(_indeterminate) == 'true' || input.attr(_determinate) == 'false' + } : node[state]; + + // Check, disable or indeterminate + if (/^(ch|di|in)/.test(method) && !active) { + on(input, state); + + // Uncheck, enable or determinate + } else if (/^(un|en|de)/.test(method) && active) { + off(input, state); + + // Update + } else if (method == _update) { + + // Handle states + for (var state in active) { + if (active[state]) { + on(input, state, true); + } else { + off(input, state, true); + }; + }; + + } else if (!direct || method == 'toggle') { + + // Helper or label was clicked + if (!direct) { + input[_callback]('ifClicked'); + }; + + // Toggle checked state + if (active) { + if (node[_type] !== _radio) { + off(input, state); + }; + } else { + on(input, state); + }; + }; + }; + + // Add checked, disabled or indeterminate state + function on(input, state, keep) { + var node = input[0], + parent = input.parent(), + checked = state == _checked, + indeterminate = state == _indeterminate, + disabled = state == _disabled, + callback = indeterminate ? _determinate : checked ? _unchecked : 'enabled', + regular = option(input, callback + capitalize(node[_type])), + specific = option(input, state + capitalize(node[_type])); + + // Prevent unnecessary actions + if (node[state] !== true) { + + // Toggle assigned radio buttons + if (!keep && state == _checked && node[_type] == _radio && node.name) { + var form = input.closest('form'), + inputs = 'input[name="' + node.name + '"]'; + + inputs = form.length ? form.find(inputs) : $(inputs); + + inputs.each(function() { + if (this !== node && $(this).data(_iCheck)) { + off($(this), state); + }; + }); + }; + + // Indeterminate state + if (indeterminate) { + + // Add indeterminate state + node[state] = true; + + // Remove checked state + if (node[_checked]) { + off(input, _checked, 'force'); + }; + + // Checked or disabled state + } else { + + // Add checked or disabled state + if (!keep) { + node[state] = true; + }; + + // Remove indeterminate state + if (checked && node[_indeterminate]) { + off(input, _indeterminate, false); + }; + }; + + // Trigger callbacks + callbacks(input, checked, state, keep); + }; + + // Add proper cursor + if (node[_disabled] && !!option(input, _cursor, true)) { + parent.find('.' + _iCheckHelper).css(_cursor, 'default'); + }; + + // Add state class + parent[_add](specific || option(input, state) || ''); + + // Set ARIA attribute + disabled ? parent.attr('aria-disabled', 'true') : parent.attr('aria-checked', indeterminate ? 'mixed' : 'true'); + + // Remove regular state class + parent[_remove](regular || option(input, callback) || ''); + }; + + // Remove checked, disabled or indeterminate state + function off(input, state, keep) { + var node = input[0], + parent = input.parent(), + checked = state == _checked, + indeterminate = state == _indeterminate, + disabled = state == _disabled, + callback = indeterminate ? _determinate : checked ? _unchecked : 'enabled', + regular = option(input, callback + capitalize(node[_type])), + specific = option(input, state + capitalize(node[_type])); + + // Prevent unnecessary actions + if (node[state] !== false) { + + // Toggle state + if (indeterminate || !keep || keep == 'force') { + node[state] = false; + }; + + // Trigger callbacks + callbacks(input, checked, callback, keep); + }; + + // Add proper cursor + if (!node[_disabled] && !!option(input, _cursor, true)) { + parent.find('.' + _iCheckHelper).css(_cursor, 'pointer'); + }; + + // Remove state class + parent[_remove](specific || option(input, state) || ''); + + // Set ARIA attribute + disabled ? parent.attr('aria-disabled', 'false') : parent.attr('aria-checked', 'false'); + + // Add regular state class + parent[_add](regular || option(input, callback) || ''); + }; + + // Remove all traces + function tidy(input, callback) { + if (input.data(_iCheck)) { + + // Remove everything except input + input.parent().html(input.attr('style', input.data(_iCheck).s || '')); + + // Callback + if (callback) { + input[_callback](callback); + }; + + // Unbind events + input.off('.i').unwrap(); + $(_label + '[for="' + input[0].id + '"]').add(input.closest(_label)).off('.i'); + }; + }; + + // Get some option + function option(input, state, regular) { + if (input.data(_iCheck)) { + return input.data(_iCheck).o[state + (regular ? '' : 'Class')]; + }; + }; + + // Capitalize some string + function capitalize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); + }; + + // Executable handlers + function callbacks(input, checked, callback, keep) { + if (!keep) { + if (checked) { + input[_callback]('ifToggled'); + }; + + input[_callback]('ifChanged')[_callback]('if' + capitalize(callback)); + }; + }; +})(window.jQuery || window.Zepto); diff --git a/public/assets/js/plugins/iCheck/icheck.min.js b/public/assets/js/plugins/iCheck/icheck.min.js new file mode 100755 index 00000000..d2720ed0 --- /dev/null +++ b/public/assets/js/plugins/iCheck/icheck.min.js @@ -0,0 +1,10 @@ +/*! iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */ +(function(h){function F(a,b,d){var c=a[0],e=/er/.test(d)?m:/bl/.test(d)?s:l,f=d==H?{checked:c[l],disabled:c[s],indeterminate:"true"==a.attr(m)||"false"==a.attr(w)}:c[e];if(/^(ch|di|in)/.test(d)&&!f)D(a,e);else if(/^(un|en|de)/.test(d)&&f)t(a,e);else if(d==H)for(e in f)f[e]?D(a,e,!0):t(a,e,!0);else if(!b||"toggle"==d){if(!b)a[p]("ifClicked");f?c[n]!==u&&t(a,e):D(a,e)}}function D(a,b,d){var c=a[0],e=a.parent(),f=b==l,A=b==m,B=b==s,K=A?w:f?E:"enabled",p=k(a,K+x(c[n])),N=k(a,b+x(c[n]));if(!0!==c[b]){if(!d&& +b==l&&c[n]==u&&c.name){var C=a.closest("form"),r='input[name="'+c.name+'"]',r=C.length?C.find(r):h(r);r.each(function(){this!==c&&h(this).data(q)&&t(h(this),b)})}A?(c[b]=!0,c[l]&&t(a,l,"force")):(d||(c[b]=!0),f&&c[m]&&t(a,m,!1));L(a,f,b,d)}c[s]&&k(a,y,!0)&&e.find("."+I).css(y,"default");e[v](N||k(a,b)||"");B?e.attr("aria-disabled","true"):e.attr("aria-checked",A?"mixed":"true");e[z](p||k(a,K)||"")}function t(a,b,d){var c=a[0],e=a.parent(),f=b==l,h=b==m,q=b==s,p=h?w:f?E:"enabled",t=k(a,p+x(c[n])), +u=k(a,b+x(c[n]));if(!1!==c[b]){if(h||!d||"force"==d)c[b]=!1;L(a,f,p,d)}!c[s]&&k(a,y,!0)&&e.find("."+I).css(y,"pointer");e[z](u||k(a,b)||"");q?e.attr("aria-disabled","false"):e.attr("aria-checked","false");e[v](t||k(a,p)||"")}function M(a,b){if(a.data(q)){a.parent().html(a.attr("style",a.data(q).s||""));if(b)a[p](b);a.off(".i").unwrap();h(G+'[for="'+a[0].id+'"]').add(a.closest(G)).off(".i")}}function k(a,b,d){if(a.data(q))return a.data(q).o[b+(d?"":"Class")]}function x(a){return a.charAt(0).toUpperCase()+ +a.slice(1)}function L(a,b,d,c){if(!c){if(b)a[p]("ifToggled");a[p]("ifChanged")[p]("if"+x(d))}}var q="iCheck",I=q+"-helper",u="radio",l="checked",E="un"+l,s="disabled",w="determinate",m="in"+w,H="update",n="type",v="addClass",z="removeClass",p="trigger",G="label",y="cursor",J=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);h.fn[q]=function(a,b){var d='input[type="checkbox"], input[type="'+u+'"]',c=h(),e=function(a){a.each(function(){var a=h(this);c=a.is(d)? +c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),e(this),c.each(function(){var c=h(this);"destroy"==a?M(c,"ifDestroyed"):F(c,!0,a);h.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var f=h.extend({checkedClass:l,disabledClass:s,indeterminateClass:m,labelHover:!0,aria:!1},a),k=f.handle,B=f.hoverClass||"hover",x=f.focusClass||"focus",w=f.activeClass||"active",y=!!f.labelHover,C=f.labelHoverClass|| +"hover",r=(""+f.increaseArea).replace("%","")|0;if("checkbox"==k||k==u)d='input[type="'+k+'"]';-50>r&&(r=-50);e(this);return c.each(function(){var a=h(this);M(a);var c=this,b=c.id,e=-r+"%",d=100+2*r+"%",d={position:"absolute",top:e,left:e,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},e=J?{position:"absolute",visibility:"hidden"}:r?d:{position:"absolute",opacity:0},k="checkbox"==c[n]?f.checkboxClass||"icheckbox":f.radioClass||"i"+u,m=h(G+'[for="'+b+'"]').add(a.closest(G)), +A=!!f.aria,E=q+"-"+Math.random().toString(36).replace("0.",""),g='
      ")[p]("ifCreated").parent().append(f.insert);d=h('').css(d).appendTo(g);a.data(q,{o:f,s:a.attr("style")}).css(e);f.inheritClass&&g[v](c.className||"");f.inheritID&&b&&g.attr("id",q+"-"+b);"static"==g.css("position")&&g.css("position","relative");F(a,!0,H); +if(m.length)m.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(b){var d=b[n],e=h(this);if(!c[s]){if("click"==d){if(h(b.target).is("a"))return;F(a,!1,!0)}else y&&(/ut|nd/.test(d)?(g[z](B),e[z](C)):(g[v](B),e[v](C)));if(J)b.stopPropagation();else return!1}});a.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[n];b=b.keyCode;if("click"==d)return!1;if("keydown"==d&&32==b)return c[n]==u&&c[l]||(c[l]?t(a,l):D(a,l)),!1;if("keyup"==d&&c[n]==u)!c[l]&&D(a,l);else if(/us|ur/.test(d))g["blur"== +d?z:v](x)});d.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(b){var d=b[n],e=/wn|up/.test(d)?w:B;if(!c[s]){if("click"==d)F(a,!1,!0);else{if(/wn|er|in/.test(d))g[v](e);else g[z](e+" "+w);if(m.length&&y&&e==B)m[/ut|nd/.test(d)?z:v](C)}if(J)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto); diff --git a/public/assets/js/plugins/input-mask/jquery.inputmask.date.extensions.js b/public/assets/js/plugins/input-mask/jquery.inputmask.date.extensions.js new file mode 100755 index 00000000..18f76c81 --- /dev/null +++ b/public/assets/js/plugins/input-mask/jquery.inputmask.date.extensions.js @@ -0,0 +1,488 @@ +/* +Input Mask plugin extensions +http://github.com/RobinHerbots/jquery.inputmask +Copyright (c) 2010 - 2014 Robin Herbots +Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) +Version: 0.0.0 + +Optional extensions on the jquery.inputmask base +*/ +(function ($) { + //date & time aliases + $.extend($.inputmask.defaults.definitions, { + 'h': { //hours + validator: "[01][0-9]|2[0-3]", + cardinality: 2, + prevalidator: [{ validator: "[0-2]", cardinality: 1 }] + }, + 's': { //seconds || minutes + validator: "[0-5][0-9]", + cardinality: 2, + prevalidator: [{ validator: "[0-5]", cardinality: 1 }] + }, + 'd': { //basic day + validator: "0[1-9]|[12][0-9]|3[01]", + cardinality: 2, + prevalidator: [{ validator: "[0-3]", cardinality: 1 }] + }, + 'm': { //basic month + validator: "0[1-9]|1[012]", + cardinality: 2, + prevalidator: [{ validator: "[01]", cardinality: 1 }] + }, + 'y': { //basic year + validator: "(19|20)\\d{2}", + cardinality: 4, + prevalidator: [ + { validator: "[12]", cardinality: 1 }, + { validator: "(19|20)", cardinality: 2 }, + { validator: "(19|20)\\d", cardinality: 3 } + ] + } + }); + $.extend($.inputmask.defaults.aliases, { + 'dd/mm/yyyy': { + mask: "1/2/y", + placeholder: "dd/mm/yyyy", + regex: { + val1pre: new RegExp("[0-3]"), //daypre + val1: new RegExp("0[1-9]|[12][0-9]|3[01]"), //day + val2pre: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9]|3[01])" + escapedSeparator + "[01])"); }, //monthpre + val2: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9])" + escapedSeparator + "(0[1-9]|1[012]))|(30" + escapedSeparator + "(0[13-9]|1[012]))|(31" + escapedSeparator + "(0[13578]|1[02]))"); }//month + }, + leapday: "29/02/", + separator: '/', + yearrange: { minyear: 1900, maxyear: 2099 }, + isInYearRange: function (chrs, minyear, maxyear) { + var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length))); + var enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length))); + return (enteredyear != NaN ? minyear <= enteredyear && enteredyear <= maxyear : false) || + (enteredyear2 != NaN ? minyear <= enteredyear2 && enteredyear2 <= maxyear : false); + }, + determinebaseyear: function (minyear, maxyear, hint) { + var currentyear = (new Date()).getFullYear(); + if (minyear > currentyear) return minyear; + if (maxyear < currentyear) { + var maxYearPrefix = maxyear.toString().slice(0, 2); + var maxYearPostfix = maxyear.toString().slice(2, 4); + while (maxyear < maxYearPrefix + hint) { + maxYearPrefix--; + } + var maxxYear = maxYearPrefix + maxYearPostfix; + return minyear > maxxYear ? minyear : maxxYear; + } + + return currentyear; + }, + onKeyUp: function (e, buffer, opts) { + var $input = $(this); + if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) { + var today = new Date(); + $input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString()); + } + }, + definitions: { + '1': { //val1 ~ day or month + validator: function (chrs, buffer, pos, strict, opts) { + var isValid = opts.regex.val1.test(chrs); + if (!strict && !isValid) { + if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { + isValid = opts.regex.val1.test("0" + chrs.charAt(0)); + if (isValid) { + buffer[pos - 1] = "0"; + return { "pos": pos, "c": chrs.charAt(0) }; + } + } + } + return isValid; + }, + cardinality: 2, + prevalidator: [{ + validator: function (chrs, buffer, pos, strict, opts) { + var isValid = opts.regex.val1pre.test(chrs); + if (!strict && !isValid) { + isValid = opts.regex.val1.test("0" + chrs); + if (isValid) { + buffer[pos] = "0"; + pos++; + return { "pos": pos }; + } + } + return isValid; + }, cardinality: 1 + }] + }, + '2': { //val2 ~ day or month + validator: function (chrs, buffer, pos, strict, opts) { + var frontValue = buffer.join('').substr(0, 3); + if (frontValue.indexOf(opts.placeholder[0]) != -1) frontValue = "01" + opts.separator; + var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs); + if (!strict && !isValid) { + if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { + isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0)); + if (isValid) { + buffer[pos - 1] = "0"; + return { "pos": pos, "c": chrs.charAt(0) }; + } + } + } + return isValid; + }, + cardinality: 2, + prevalidator: [{ + validator: function (chrs, buffer, pos, strict, opts) { + var frontValue = buffer.join('').substr(0, 3); + if (frontValue.indexOf(opts.placeholder[0]) != -1) frontValue = "01" + opts.separator; + var isValid = opts.regex.val2pre(opts.separator).test(frontValue + chrs); + if (!strict && !isValid) { + isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs); + if (isValid) { + buffer[pos] = "0"; + pos++; + return { "pos": pos }; + } + } + return isValid; + }, cardinality: 1 + }] + }, + 'y': { //year + validator: function (chrs, buffer, pos, strict, opts) { + if (opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) { + var dayMonthValue = buffer.join('').substr(0, 6); + if (dayMonthValue != opts.leapday) + return true; + else { + var year = parseInt(chrs, 10);//detect leap year + if (year % 4 === 0) + if (year % 100 === 0) + if (year % 400 === 0) + return true; + else return false; + else return true; + else return false; + } + } else return false; + }, + cardinality: 4, + prevalidator: [ + { + validator: function (chrs, buffer, pos, strict, opts) { + var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); + if (!strict && !isValid) { + var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 1); + + isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear); + if (isValid) { + buffer[pos++] = yearPrefix[0]; + return { "pos": pos }; + } + yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 2); + + isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear); + if (isValid) { + buffer[pos++] = yearPrefix[0]; + buffer[pos++] = yearPrefix[1]; + return { "pos": pos }; + } + } + return isValid; + }, + cardinality: 1 + }, + { + validator: function (chrs, buffer, pos, strict, opts) { + var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); + if (!strict && !isValid) { + var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2); + + isValid = opts.isInYearRange(chrs[0] + yearPrefix[1] + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear); + if (isValid) { + buffer[pos++] = yearPrefix[1]; + return { "pos": pos }; + } + + yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2); + if (opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) { + var dayMonthValue = buffer.join('').substr(0, 6); + if (dayMonthValue != opts.leapday) + isValid = true; + else { + var year = parseInt(chrs, 10);//detect leap year + if (year % 4 === 0) + if (year % 100 === 0) + if (year % 400 === 0) + isValid = true; + else isValid = false; + else isValid = true; + else isValid = false; + } + } else isValid = false; + if (isValid) { + buffer[pos - 1] = yearPrefix[0]; + buffer[pos++] = yearPrefix[1]; + buffer[pos++] = chrs[0]; + return { "pos": pos }; + } + } + return isValid; + }, cardinality: 2 + }, + { + validator: function (chrs, buffer, pos, strict, opts) { + return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); + }, cardinality: 3 + } + ] + } + }, + insertMode: false, + autoUnmask: false + }, + 'mm/dd/yyyy': { + placeholder: "mm/dd/yyyy", + alias: "dd/mm/yyyy", //reuse functionality of dd/mm/yyyy alias + regex: { + val2pre: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])"); }, //daypre + val2: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)"); }, //day + val1pre: new RegExp("[01]"), //monthpre + val1: new RegExp("0[1-9]|1[012]") //month + }, + leapday: "02/29/", + onKeyUp: function (e, buffer, opts) { + var $input = $(this); + if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) { + var today = new Date(); + $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()); + } + } + }, + 'yyyy/mm/dd': { + mask: "y/1/2", + placeholder: "yyyy/mm/dd", + alias: "mm/dd/yyyy", + leapday: "/02/29", + onKeyUp: function (e, buffer, opts) { + var $input = $(this); + if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) { + var today = new Date(); + $input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString()); + } + }, + definitions: { + '2': { //val2 ~ day or month + validator: function (chrs, buffer, pos, strict, opts) { + var frontValue = buffer.join('').substr(5, 3); + if (frontValue.indexOf(opts.placeholder[5]) != -1) frontValue = "01" + opts.separator; + var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs); + if (!strict && !isValid) { + if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { + isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0)); + if (isValid) { + buffer[pos - 1] = "0"; + return { "pos": pos, "c": chrs.charAt(0) }; + } + } + } + + //check leap yeap + if (isValid) { + var dayMonthValue = buffer.join('').substr(4, 4) + chrs; + if (dayMonthValue != opts.leapday) + return true; + else { + var year = parseInt(buffer.join('').substr(0, 4), 10); //detect leap year + if (year % 4 === 0) + if (year % 100 === 0) + if (year % 400 === 0) + return true; + else return false; + else return true; + else return false; + } + } + + return isValid; + }, + cardinality: 2, + prevalidator: [{ + validator: function (chrs, buffer, pos, strict, opts) { + var frontValue = buffer.join('').substr(5, 3); + if (frontValue.indexOf(opts.placeholder[5]) != -1) frontValue = "01" + opts.separator; + var isValid = opts.regex.val2pre(opts.separator).test(frontValue + chrs); + if (!strict && !isValid) { + isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs); + if (isValid) { + buffer[pos] = "0"; + pos++; + return { "pos": pos }; + } + } + return isValid; + }, cardinality: 1 + }] + } + } + }, + 'dd.mm.yyyy': { + mask: "1.2.y", + placeholder: "dd.mm.yyyy", + leapday: "29.02.", + separator: '.', + alias: "dd/mm/yyyy" + }, + 'dd-mm-yyyy': { + mask: "1-2-y", + placeholder: "dd-mm-yyyy", + leapday: "29-02-", + separator: '-', + alias: "dd/mm/yyyy" + }, + 'mm.dd.yyyy': { + mask: "1.2.y", + placeholder: "mm.dd.yyyy", + leapday: "02.29.", + separator: '.', + alias: "mm/dd/yyyy" + }, + 'mm-dd-yyyy': { + mask: "1-2-y", + placeholder: "mm-dd-yyyy", + leapday: "02-29-", + separator: '-', + alias: "mm/dd/yyyy" + }, + 'yyyy.mm.dd': { + mask: "y.1.2", + placeholder: "yyyy.mm.dd", + leapday: ".02.29", + separator: '.', + alias: "yyyy/mm/dd" + }, + 'yyyy-mm-dd': { + mask: "y-1-2", + placeholder: "yyyy-mm-dd", + leapday: "-02-29", + separator: '-', + alias: "yyyy/mm/dd" + }, + 'datetime': { + mask: "1/2/y h:s", + placeholder: "dd/mm/yyyy hh:mm", + alias: "dd/mm/yyyy", + regex: { + hrspre: new RegExp("[012]"), //hours pre + hrs24: new RegExp("2[0-9]|1[3-9]"), + hrs: new RegExp("[01][0-9]|2[0-3]"), //hours + ampm: new RegExp("^[a|p|A|P][m|M]") + }, + timeseparator: ':', + hourFormat: "24", // or 12 + definitions: { + 'h': { //hours + validator: function (chrs, buffer, pos, strict, opts) { + var isValid = opts.regex.hrs.test(chrs); + if (!strict && !isValid) { + if (chrs.charAt(1) == opts.timeseparator || "-.:".indexOf(chrs.charAt(1)) != -1) { + isValid = opts.regex.hrs.test("0" + chrs.charAt(0)); + if (isValid) { + buffer[pos - 1] = "0"; + buffer[pos] = chrs.charAt(0); + pos++; + return { "pos": pos }; + } + } + } + + if (isValid && opts.hourFormat !== "24" && opts.regex.hrs24.test(chrs)) { + + var tmp = parseInt(chrs, 10); + + if (tmp == 24) { + buffer[pos + 5] = "a"; + buffer[pos + 6] = "m"; + } else { + buffer[pos + 5] = "p"; + buffer[pos + 6] = "m"; + } + + tmp = tmp - 12; + + if (tmp < 10) { + buffer[pos] = tmp.toString(); + buffer[pos - 1] = "0"; + } else { + buffer[pos] = tmp.toString().charAt(1); + buffer[pos - 1] = tmp.toString().charAt(0); + } + + return { "pos": pos, "c": buffer[pos] }; + } + + return isValid; + }, + cardinality: 2, + prevalidator: [{ + validator: function (chrs, buffer, pos, strict, opts) { + var isValid = opts.regex.hrspre.test(chrs); + if (!strict && !isValid) { + isValid = opts.regex.hrs.test("0" + chrs); + if (isValid) { + buffer[pos] = "0"; + pos++; + return { "pos": pos }; + } + } + return isValid; + }, cardinality: 1 + }] + }, + 't': { //am/pm + validator: function (chrs, buffer, pos, strict, opts) { + return opts.regex.ampm.test(chrs + "m"); + }, + casing: "lower", + cardinality: 1 + } + }, + insertMode: false, + autoUnmask: false + }, + 'datetime12': { + mask: "1/2/y h:s t\\m", + placeholder: "dd/mm/yyyy hh:mm xm", + alias: "datetime", + hourFormat: "12" + }, + 'hh:mm t': { + mask: "h:s t\\m", + placeholder: "hh:mm xm", + alias: "datetime", + hourFormat: "12" + }, + 'h:s t': { + mask: "h:s t\\m", + placeholder: "hh:mm xm", + alias: "datetime", + hourFormat: "12" + }, + 'hh:mm:ss': { + mask: "h:s:s", + autoUnmask: false + }, + 'hh:mm': { + mask: "h:s", + autoUnmask: false + }, + 'date': { + alias: "dd/mm/yyyy" // "mm/dd/yyyy" + }, + 'mm/yyyy': { + mask: "1/y", + placeholder: "mm/yyyy", + leapday: "donotuse", + separator: '/', + alias: "mm/dd/yyyy" + } + }); +})(jQuery); diff --git a/public/assets/js/plugins/input-mask/jquery.inputmask.extensions.js b/public/assets/js/plugins/input-mask/jquery.inputmask.extensions.js new file mode 100755 index 00000000..c89f91ee --- /dev/null +++ b/public/assets/js/plugins/input-mask/jquery.inputmask.extensions.js @@ -0,0 +1,122 @@ +/* +Input Mask plugin extensions +http://github.com/RobinHerbots/jquery.inputmask +Copyright (c) 2010 - 2014 Robin Herbots +Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) +Version: 0.0.0 + +Optional extensions on the jquery.inputmask base +*/ +(function ($) { + //extra definitions + $.extend($.inputmask.defaults.definitions, { + 'A': { + validator: "[A-Za-z]", + cardinality: 1, + casing: "upper" //auto uppercasing + }, + '#': { + validator: "[A-Za-z\u0410-\u044F\u0401\u04510-9]", + cardinality: 1, + casing: "upper" + } + }); + $.extend($.inputmask.defaults.aliases, { + 'url': { + mask: "ir", + placeholder: "", + separator: "", + defaultPrefix: "http://", + regex: { + urlpre1: new RegExp("[fh]"), + urlpre2: new RegExp("(ft|ht)"), + urlpre3: new RegExp("(ftp|htt)"), + urlpre4: new RegExp("(ftp:|http|ftps)"), + urlpre5: new RegExp("(ftp:/|ftps:|http:|https)"), + urlpre6: new RegExp("(ftp://|ftps:/|http:/|https:)"), + urlpre7: new RegExp("(ftp://|ftps://|http://|https:/)"), + urlpre8: new RegExp("(ftp://|ftps://|http://|https://)") + }, + definitions: { + 'i': { + validator: function (chrs, buffer, pos, strict, opts) { + return true; + }, + cardinality: 8, + prevalidator: (function () { + var result = [], prefixLimit = 8; + for (var i = 0; i < prefixLimit; i++) { + result[i] = (function () { + var j = i; + return { + validator: function (chrs, buffer, pos, strict, opts) { + if (opts.regex["urlpre" + (j + 1)]) { + var tmp = chrs, k; + if (((j + 1) - chrs.length) > 0) { + tmp = buffer.join('').substring(0, ((j + 1) - chrs.length)) + "" + tmp; + } + var isValid = opts.regex["urlpre" + (j + 1)].test(tmp); + if (!strict && !isValid) { + pos = pos - j; + for (k = 0; k < opts.defaultPrefix.length; k++) { + buffer[pos] = opts.defaultPrefix[k]; pos++; + } + for (k = 0; k < tmp.length - 1; k++) { + buffer[pos] = tmp[k]; pos++; + } + return { "pos": pos }; + } + return isValid; + } else { + return false; + } + }, cardinality: j + }; + })(); + } + return result; + })() + }, + "r": { + validator: ".", + cardinality: 50 + } + }, + insertMode: false, + autoUnmask: false + }, + "ip": { //ip-address mask + mask: ["[[x]y]z.[[x]y]z.[[x]y]z.x[yz]", "[[x]y]z.[[x]y]z.[[x]y]z.[[x]y][z]"], + definitions: { + 'x': { + validator: "[012]", + cardinality: 1, + definitionSymbol: "i" + }, + 'y': { + validator: function (chrs, buffer, pos, strict, opts) { + if (pos - 1 > -1 && buffer[pos - 1] != ".") + chrs = buffer[pos - 1] + chrs; + else chrs = "0" + chrs; + return new RegExp("2[0-5]|[01][0-9]").test(chrs); + }, + cardinality: 1, + definitionSymbol: "i" + }, + 'z': { + validator: function (chrs, buffer, pos, strict, opts) { + if (pos - 1 > -1 && buffer[pos - 1] != ".") { + chrs = buffer[pos - 1] + chrs; + if (pos - 2 > -1 && buffer[pos - 2] != ".") { + chrs = buffer[pos - 2] + chrs; + } else chrs = "0" + chrs; + } else chrs = "00" + chrs; + return new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs); + }, + cardinality: 1, + definitionSymbol: "i" + } + } + } + }); +})(jQuery); diff --git a/public/assets/js/plugins/input-mask/jquery.inputmask.js b/public/assets/js/plugins/input-mask/jquery.inputmask.js new file mode 100755 index 00000000..cfbbfaa6 --- /dev/null +++ b/public/assets/js/plugins/input-mask/jquery.inputmask.js @@ -0,0 +1,1632 @@ +/** +* @license Input Mask plugin for jquery +* http://github.com/RobinHerbots/jquery.inputmask +* Copyright (c) 2010 - 2014 Robin Herbots +* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) +* Version: 0.0.0 +*/ + +(function ($) { + if ($.fn.inputmask === undefined) { + //helper functions + function isInputEventSupported(eventName) { + var el = document.createElement('input'), + eventName = 'on' + eventName, + isSupported = (eventName in el); + if (!isSupported) { + el.setAttribute(eventName, 'return;'); + isSupported = typeof el[eventName] == 'function'; + } + el = null; + return isSupported; + } + function resolveAlias(aliasStr, options, opts) { + var aliasDefinition = opts.aliases[aliasStr]; + if (aliasDefinition) { + if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias, undefined, opts); //alias is another alias + $.extend(true, opts, aliasDefinition); //merge alias definition in the options + $.extend(true, opts, options); //reapply extra given options + return true; + } + return false; + } + function generateMaskSets(opts) { + var ms = []; + var genmasks = []; //used to keep track of the masks that where processed, to avoid duplicates + function getMaskTemplate(mask) { + if (opts.numericInput) { + mask = mask.split('').reverse().join(''); + } + var escaped = false, outCount = 0, greedy = opts.greedy, repeat = opts.repeat; + if (repeat == "*") greedy = false; + //if (greedy == true && opts.placeholder == "") opts.placeholder = " "; + if (mask.length == 1 && greedy == false && repeat != 0) { opts.placeholder = ""; } //hide placeholder with single non-greedy mask + var singleMask = $.map(mask.split(""), function (element, index) { + var outElem = []; + if (element == opts.escapeChar) { + escaped = true; + } + else if ((element != opts.optionalmarker.start && element != opts.optionalmarker.end) || escaped) { + var maskdef = opts.definitions[element]; + if (maskdef && !escaped) { + for (var i = 0; i < maskdef.cardinality; i++) { + outElem.push(opts.placeholder.charAt((outCount + i) % opts.placeholder.length)); + } + } else { + outElem.push(element); + escaped = false; + } + outCount += outElem.length; + return outElem; + } + }); + + //allocate repetitions + var repeatedMask = singleMask.slice(); + for (var i = 1; i < repeat && greedy; i++) { + repeatedMask = repeatedMask.concat(singleMask.slice()); + } + + return { "mask": repeatedMask, "repeat": repeat, "greedy": greedy }; + } + //test definition => {fn: RegExp/function, cardinality: int, optionality: bool, newBlockMarker: bool, offset: int, casing: null/upper/lower, def: definitionSymbol} + function getTestingChain(mask) { + if (opts.numericInput) { + mask = mask.split('').reverse().join(''); + } + var isOptional = false, escaped = false; + var newBlockMarker = false; //indicates wheter the begin/ending of a block should be indicated + + return $.map(mask.split(""), function (element, index) { + var outElem = []; + + if (element == opts.escapeChar) { + escaped = true; + } else if (element == opts.optionalmarker.start && !escaped) { + isOptional = true; + newBlockMarker = true; + } + else if (element == opts.optionalmarker.end && !escaped) { + isOptional = false; + newBlockMarker = true; + } + else { + var maskdef = opts.definitions[element]; + if (maskdef && !escaped) { + var prevalidators = maskdef["prevalidator"], prevalidatorsL = prevalidators ? prevalidators.length : 0; + for (var i = 1; i < maskdef.cardinality; i++) { + var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator["validator"], cardinality = prevalidator["cardinality"]; + outElem.push({ fn: validator ? typeof validator == 'string' ? new RegExp(validator) : new function () { this.test = validator; } : new RegExp("."), cardinality: cardinality ? cardinality : 1, optionality: isOptional, newBlockMarker: isOptional == true ? newBlockMarker : false, offset: 0, casing: maskdef["casing"], def: maskdef["definitionSymbol"] || element }); + if (isOptional == true) //reset newBlockMarker + newBlockMarker = false; + } + outElem.push({ fn: maskdef.validator ? typeof maskdef.validator == 'string' ? new RegExp(maskdef.validator) : new function () { this.test = maskdef.validator; } : new RegExp("."), cardinality: maskdef.cardinality, optionality: isOptional, newBlockMarker: newBlockMarker, offset: 0, casing: maskdef["casing"], def: maskdef["definitionSymbol"] || element }); + } else { + outElem.push({ fn: null, cardinality: 0, optionality: isOptional, newBlockMarker: newBlockMarker, offset: 0, casing: null, def: element }); + escaped = false; + } + //reset newBlockMarker + newBlockMarker = false; + return outElem; + } + }); + } + function markOptional(maskPart) { //needed for the clearOptionalTail functionality + return opts.optionalmarker.start + maskPart + opts.optionalmarker.end; + } + function splitFirstOptionalEndPart(maskPart) { + var optionalStartMarkers = 0, optionalEndMarkers = 0, mpl = maskPart.length; + for (var i = 0; i < mpl; i++) { + if (maskPart.charAt(i) == opts.optionalmarker.start) { + optionalStartMarkers++; + } + if (maskPart.charAt(i) == opts.optionalmarker.end) { + optionalEndMarkers++; + } + if (optionalStartMarkers > 0 && optionalStartMarkers == optionalEndMarkers) + break; + } + var maskParts = [maskPart.substring(0, i)]; + if (i < mpl) { + maskParts.push(maskPart.substring(i + 1, mpl)); + } + return maskParts; + } + function splitFirstOptionalStartPart(maskPart) { + var mpl = maskPart.length; + for (var i = 0; i < mpl; i++) { + if (maskPart.charAt(i) == opts.optionalmarker.start) { + break; + } + } + var maskParts = [maskPart.substring(0, i)]; + if (i < mpl) { + maskParts.push(maskPart.substring(i + 1, mpl)); + } + return maskParts; + } + function generateMask(maskPrefix, maskPart, metadata) { + var maskParts = splitFirstOptionalEndPart(maskPart); + var newMask, maskTemplate; + + var masks = splitFirstOptionalStartPart(maskParts[0]); + if (masks.length > 1) { + newMask = maskPrefix + masks[0] + markOptional(masks[1]) + (maskParts.length > 1 ? maskParts[1] : ""); + if ($.inArray(newMask, genmasks) == -1 && newMask != "") { + genmasks.push(newMask); + maskTemplate = getMaskTemplate(newMask); + ms.push({ + "mask": newMask, + "_buffer": maskTemplate["mask"], + "buffer": maskTemplate["mask"].slice(), + "tests": getTestingChain(newMask), + "lastValidPosition": -1, + "greedy": maskTemplate["greedy"], + "repeat": maskTemplate["repeat"], + "metadata": metadata + }); + } + newMask = maskPrefix + masks[0] + (maskParts.length > 1 ? maskParts[1] : ""); + if ($.inArray(newMask, genmasks) == -1 && newMask != "") { + genmasks.push(newMask); + maskTemplate = getMaskTemplate(newMask); + ms.push({ + "mask": newMask, + "_buffer": maskTemplate["mask"], + "buffer": maskTemplate["mask"].slice(), + "tests": getTestingChain(newMask), + "lastValidPosition": -1, + "greedy": maskTemplate["greedy"], + "repeat": maskTemplate["repeat"], + "metadata": metadata + }); + } + if (splitFirstOptionalStartPart(masks[1]).length > 1) { //optional contains another optional + generateMask(maskPrefix + masks[0], masks[1] + maskParts[1], metadata); + } + if (maskParts.length > 1 && splitFirstOptionalStartPart(maskParts[1]).length > 1) { + generateMask(maskPrefix + masks[0] + markOptional(masks[1]), maskParts[1], metadata); + generateMask(maskPrefix + masks[0], maskParts[1], metadata); + } + } + else { + newMask = maskPrefix + maskParts; + if ($.inArray(newMask, genmasks) == -1 && newMask != "") { + genmasks.push(newMask); + maskTemplate = getMaskTemplate(newMask); + ms.push({ + "mask": newMask, + "_buffer": maskTemplate["mask"], + "buffer": maskTemplate["mask"].slice(), + "tests": getTestingChain(newMask), + "lastValidPosition": -1, + "greedy": maskTemplate["greedy"], + "repeat": maskTemplate["repeat"], + "metadata": metadata + }); + } + } + + } + + if ($.isFunction(opts.mask)) { //allow mask to be a preprocessing fn - should return a valid mask + opts.mask = opts.mask.call(this, opts); + } + if ($.isArray(opts.mask)) { + $.each(opts.mask, function (ndx, msk) { + if (msk["mask"] != undefined) { + generateMask("", msk["mask"].toString(), msk); + } else + generateMask("", msk.toString()); + }); + } else generateMask("", opts.mask.toString()); + + return opts.greedy ? ms : ms.sort(function (a, b) { return a["mask"].length - b["mask"].length; }); + } + + var msie10 = navigator.userAgent.match(new RegExp("msie 10", "i")) !== null, + iphone = navigator.userAgent.match(new RegExp("iphone", "i")) !== null, + android = navigator.userAgent.match(new RegExp("android.*safari.*", "i")) !== null, + androidchrome = navigator.userAgent.match(new RegExp("android.*chrome.*", "i")) !== null, + pasteEvent = isInputEventSupported('paste') ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange"; + + + //masking scope + //actionObj definition see below + function maskScope(masksets, activeMasksetIndex, opts, actionObj) { + var isRTL = false, + valueOnFocus = getActiveBuffer().join(''), + $el, chromeValueOnInput, + skipKeyPressEvent = false, //Safari 5.1.x - modal dialog fires keypress twice workaround + skipInputEvent = false, //skip when triggered from within inputmask + ignorable = false; + + + //maskset helperfunctions + + function getActiveMaskSet() { + return masksets[activeMasksetIndex]; + } + + function getActiveTests() { + return getActiveMaskSet()['tests']; + } + + function getActiveBufferTemplate() { + return getActiveMaskSet()['_buffer']; + } + + function getActiveBuffer() { + return getActiveMaskSet()['buffer']; + } + + function isValid(pos, c, strict) { //strict true ~ no correction or autofill + strict = strict === true; //always set a value to strict to prevent possible strange behavior in the extensions + + function _isValid(position, activeMaskset, c, strict) { + var testPos = determineTestPosition(position), loopend = c ? 1 : 0, chrs = '', buffer = activeMaskset["buffer"]; + for (var i = activeMaskset['tests'][testPos].cardinality; i > loopend; i--) { + chrs += getBufferElement(buffer, testPos - (i - 1)); + } + + if (c) { + chrs += c; + } + + //return is false or a json object => { pos: ??, c: ??} or true + return activeMaskset['tests'][testPos].fn != null ? + activeMaskset['tests'][testPos].fn.test(chrs, buffer, position, strict, opts) + : (c == getBufferElement(activeMaskset['_buffer'], position, true) || c == opts.skipOptionalPartCharacter) ? + { "refresh": true, c: getBufferElement(activeMaskset['_buffer'], position, true), pos: position } + : false; + } + + function PostProcessResults(maskForwards, results) { + var hasValidActual = false; + $.each(results, function (ndx, rslt) { + hasValidActual = $.inArray(rslt["activeMasksetIndex"], maskForwards) == -1 && rslt["result"] !== false; + if (hasValidActual) return false; + }); + if (hasValidActual) { //strip maskforwards + results = $.map(results, function (rslt, ndx) { + if ($.inArray(rslt["activeMasksetIndex"], maskForwards) == -1) { + return rslt; + } else { + masksets[rslt["activeMasksetIndex"]]["lastValidPosition"] = actualLVP; + } + }); + } else { //keep maskforwards with the least forward + var lowestPos = -1, lowestIndex = -1, rsltValid; + $.each(results, function (ndx, rslt) { + if ($.inArray(rslt["activeMasksetIndex"], maskForwards) != -1 && rslt["result"] !== false & (lowestPos == -1 || lowestPos > rslt["result"]["pos"])) { + lowestPos = rslt["result"]["pos"]; + lowestIndex = rslt["activeMasksetIndex"]; + } + }); + results = $.map(results, function (rslt, ndx) { + if ($.inArray(rslt["activeMasksetIndex"], maskForwards) != -1) { + if (rslt["result"]["pos"] == lowestPos) { + return rslt; + } else if (rslt["result"] !== false) { + for (var i = pos; i < lowestPos; i++) { + rsltValid = _isValid(i, masksets[rslt["activeMasksetIndex"]], masksets[lowestIndex]["buffer"][i], true); + if (rsltValid === false) { + masksets[rslt["activeMasksetIndex"]]["lastValidPosition"] = lowestPos - 1; + break; + } else { + setBufferElement(masksets[rslt["activeMasksetIndex"]]["buffer"], i, masksets[lowestIndex]["buffer"][i], true); + masksets[rslt["activeMasksetIndex"]]["lastValidPosition"] = i; + } + } + //also check check for the lowestpos with the new input + rsltValid = _isValid(lowestPos, masksets[rslt["activeMasksetIndex"]], c, true); + if (rsltValid !== false) { + setBufferElement(masksets[rslt["activeMasksetIndex"]]["buffer"], lowestPos, c, true); + masksets[rslt["activeMasksetIndex"]]["lastValidPosition"] = lowestPos; + } + //console.log("ndx " + rslt["activeMasksetIndex"] + " validate " + masksets[rslt["activeMasksetIndex"]]["buffer"].join('') + " lv " + masksets[rslt["activeMasksetIndex"]]['lastValidPosition']); + return rslt; + } + } + }); + } + return results; + } + + if (strict) { + var result = _isValid(pos, getActiveMaskSet(), c, strict); //only check validity in current mask when validating strict + if (result === true) { + result = { "pos": pos }; //always take a possible corrected maskposition into account + } + return result; + } + + var results = [], result = false, currentActiveMasksetIndex = activeMasksetIndex, + actualBuffer = getActiveBuffer().slice(), actualLVP = getActiveMaskSet()["lastValidPosition"], + actualPrevious = seekPrevious(pos), + maskForwards = []; + $.each(masksets, function (index, value) { + if (typeof (value) == "object") { + activeMasksetIndex = index; + + var maskPos = pos; + var lvp = getActiveMaskSet()['lastValidPosition'], + rsltValid; + if (lvp == actualLVP) { + if ((maskPos - actualLVP) > 1) { + for (var i = lvp == -1 ? 0 : lvp; i < maskPos; i++) { + rsltValid = _isValid(i, getActiveMaskSet(), actualBuffer[i], true); + if (rsltValid === false) { + break; + } else { + setBufferElement(getActiveBuffer(), i, actualBuffer[i], true); + if (rsltValid === true) { + rsltValid = { "pos": i }; //always take a possible corrected maskposition into account + } + var newValidPosition = rsltValid.pos || i; + if (getActiveMaskSet()['lastValidPosition'] < newValidPosition) + getActiveMaskSet()['lastValidPosition'] = newValidPosition; //set new position from isValid + } + } + } + //does the input match on a further position? + if (!isMask(maskPos) && !_isValid(maskPos, getActiveMaskSet(), c, strict)) { + var maxForward = seekNext(maskPos) - maskPos; + for (var fw = 0; fw < maxForward; fw++) { + if (_isValid(++maskPos, getActiveMaskSet(), c, strict) !== false) + break; + } + maskForwards.push(activeMasksetIndex); + //console.log('maskforward ' + activeMasksetIndex + " pos " + pos + " maskPos " + maskPos); + } + } + + if (getActiveMaskSet()['lastValidPosition'] >= actualLVP || activeMasksetIndex == currentActiveMasksetIndex) { + if (maskPos >= 0 && maskPos < getMaskLength()) { + result = _isValid(maskPos, getActiveMaskSet(), c, strict); + if (result !== false) { + if (result === true) { + result = { "pos": maskPos }; //always take a possible corrected maskposition into account + } + var newValidPosition = result.pos || maskPos; + if (getActiveMaskSet()['lastValidPosition'] < newValidPosition) + getActiveMaskSet()['lastValidPosition'] = newValidPosition; //set new position from isValid + } + //console.log("pos " + pos + " ndx " + activeMasksetIndex + " validate " + getActiveBuffer().join('') + " lv " + getActiveMaskSet()['lastValidPosition']); + results.push({ "activeMasksetIndex": index, "result": result }); + } + } + } + }); + activeMasksetIndex = currentActiveMasksetIndex; //reset activeMasksetIndex + + return PostProcessResults(maskForwards, results); //return results of the multiple mask validations + } + + function determineActiveMasksetIndex() { + var currentMasksetIndex = activeMasksetIndex, + highestValid = { "activeMasksetIndex": 0, "lastValidPosition": -1, "next": -1 }; + $.each(masksets, function (index, value) { + if (typeof (value) == "object") { + activeMasksetIndex = index; + if (getActiveMaskSet()['lastValidPosition'] > highestValid['lastValidPosition']) { + highestValid["activeMasksetIndex"] = index; + highestValid["lastValidPosition"] = getActiveMaskSet()['lastValidPosition']; + highestValid["next"] = seekNext(getActiveMaskSet()['lastValidPosition']); + } else if (getActiveMaskSet()['lastValidPosition'] == highestValid['lastValidPosition'] && + (highestValid['next'] == -1 || highestValid['next'] > seekNext(getActiveMaskSet()['lastValidPosition']))) { + highestValid["activeMasksetIndex"] = index; + highestValid["lastValidPosition"] = getActiveMaskSet()['lastValidPosition']; + highestValid["next"] = seekNext(getActiveMaskSet()['lastValidPosition']); + } + } + }); + + activeMasksetIndex = highestValid["lastValidPosition"] != -1 && masksets[currentMasksetIndex]["lastValidPosition"] == highestValid["lastValidPosition"] ? currentMasksetIndex : highestValid["activeMasksetIndex"]; + if (currentMasksetIndex != activeMasksetIndex) { + clearBuffer(getActiveBuffer(), seekNext(highestValid["lastValidPosition"]), getMaskLength()); + getActiveMaskSet()["writeOutBuffer"] = true; + } + $el.data('_inputmask')['activeMasksetIndex'] = activeMasksetIndex; //store the activeMasksetIndex + } + + function isMask(pos) { + var testPos = determineTestPosition(pos); + var test = getActiveTests()[testPos]; + + return test != undefined ? test.fn : false; + } + + function determineTestPosition(pos) { + return pos % getActiveTests().length; + } + + function getMaskLength() { + return opts.getMaskLength(getActiveBufferTemplate(), getActiveMaskSet()['greedy'], getActiveMaskSet()['repeat'], getActiveBuffer(), opts); + } + + //pos: from position + + function seekNext(pos) { + var maskL = getMaskLength(); + if (pos >= maskL) return maskL; + var position = pos; + while (++position < maskL && !isMask(position)) { + } + return position; + } + + //pos: from position + + function seekPrevious(pos) { + var position = pos; + if (position <= 0) return 0; + + while (--position > 0 && !isMask(position)) { + } + ; + return position; + } + + function setBufferElement(buffer, position, element, autoPrepare) { + if (autoPrepare) position = prepareBuffer(buffer, position); + + var test = getActiveTests()[determineTestPosition(position)]; + var elem = element; + if (elem != undefined && test != undefined) { + switch (test.casing) { + case "upper": + elem = element.toUpperCase(); + break; + case "lower": + elem = element.toLowerCase(); + break; + } + } + + buffer[position] = elem; + } + + function getBufferElement(buffer, position, autoPrepare) { + if (autoPrepare) position = prepareBuffer(buffer, position); + return buffer[position]; + } + + //needed to handle the non-greedy mask repetitions + + function prepareBuffer(buffer, position) { + var j; + while (buffer[position] == undefined && buffer.length < getMaskLength()) { + j = 0; + while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer + buffer.push(getActiveBufferTemplate()[j++]); + } + } + + return position; + } + + function writeBuffer(input, buffer, caretPos) { + input._valueSet(buffer.join('')); + if (caretPos != undefined) { + caret(input, caretPos); + } + } + + function clearBuffer(buffer, start, end, stripNomasks) { + for (var i = start, maskL = getMaskLength() ; i < end && i < maskL; i++) { + if (stripNomasks === true) { + if (!isMask(i)) + setBufferElement(buffer, i, ""); + } else + setBufferElement(buffer, i, getBufferElement(getActiveBufferTemplate().slice(), i, true)); + } + } + + function setReTargetPlaceHolder(buffer, pos) { + var testPos = determineTestPosition(pos); + setBufferElement(buffer, pos, getBufferElement(getActiveBufferTemplate(), testPos)); + } + + function getPlaceHolder(pos) { + return opts.placeholder.charAt(pos % opts.placeholder.length); + } + + function checkVal(input, writeOut, strict, nptvl, intelliCheck) { + var inputValue = nptvl != undefined ? nptvl.slice() : truncateInput(input._valueGet()).split(''); + + $.each(masksets, function (ndx, ms) { + if (typeof (ms) == "object") { + ms["buffer"] = ms["_buffer"].slice(); + ms["lastValidPosition"] = -1; + ms["p"] = -1; + } + }); + if (strict !== true) activeMasksetIndex = 0; + if (writeOut) input._valueSet(""); //initial clear + var ml = getMaskLength(); + $.each(inputValue, function (ndx, charCode) { + if (intelliCheck === true) { + var p = getActiveMaskSet()["p"], lvp = p == -1 ? p : seekPrevious(p), + pos = lvp == -1 ? ndx : seekNext(lvp); + if ($.inArray(charCode, getActiveBufferTemplate().slice(lvp + 1, pos)) == -1) { + keypressEvent.call(input, undefined, true, charCode.charCodeAt(0), writeOut, strict, ndx); + } + } else { + keypressEvent.call(input, undefined, true, charCode.charCodeAt(0), writeOut, strict, ndx); + } + }); + + if (strict === true && getActiveMaskSet()["p"] != -1) { + getActiveMaskSet()["lastValidPosition"] = seekPrevious(getActiveMaskSet()["p"]); + } + } + + function escapeRegex(str) { + return $.inputmask.escapeRegex.call(this, str); + } + + function truncateInput(inputValue) { + return inputValue.replace(new RegExp("(" + escapeRegex(getActiveBufferTemplate().join('')) + ")*$"), ""); + } + + function clearOptionalTail(input) { + var buffer = getActiveBuffer(), tmpBuffer = buffer.slice(), testPos, pos; + for (var pos = tmpBuffer.length - 1; pos >= 0; pos--) { + var testPos = determineTestPosition(pos); + if (getActiveTests()[testPos].optionality) { + if (!isMask(pos) || !isValid(pos, buffer[pos], true)) + tmpBuffer.pop(); + else break; + } else break; + } + writeBuffer(input, tmpBuffer); + } + + function unmaskedvalue($input, skipDatepickerCheck) { + if (getActiveTests() && (skipDatepickerCheck === true || !$input.hasClass('hasDatepicker'))) { + //checkVal(input, false, true); + var umValue = $.map(getActiveBuffer(), function (element, index) { + return isMask(index) && isValid(index, element, true) ? element : null; + }); + var unmaskedValue = (isRTL ? umValue.reverse() : umValue).join(''); + return opts.onUnMask != undefined ? opts.onUnMask.call(this, getActiveBuffer().join(''), unmaskedValue) : unmaskedValue; + } else { + return $input[0]._valueGet(); + } + } + + function TranslatePosition(pos) { + if (isRTL && typeof pos == 'number' && (!opts.greedy || opts.placeholder != "")) { + var bffrLght = getActiveBuffer().length; + pos = bffrLght - pos; + } + return pos; + } + + function caret(input, begin, end) { + var npt = input.jquery && input.length > 0 ? input[0] : input, range; + if (typeof begin == 'number') { + begin = TranslatePosition(begin); + end = TranslatePosition(end); + if (!$(input).is(':visible')) { + return; + } + end = (typeof end == 'number') ? end : begin; + npt.scrollLeft = npt.scrollWidth; + if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode + if (npt.setSelectionRange) { + npt.selectionStart = begin; + npt.selectionEnd = android ? begin : end; + + } else if (npt.createTextRange) { + range = npt.createTextRange(); + range.collapse(true); + range.moveEnd('character', end); + range.moveStart('character', begin); + range.select(); + } + } else { + if (!$(input).is(':visible')) { + return { "begin": 0, "end": 0 }; + } + if (npt.setSelectionRange) { + begin = npt.selectionStart; + end = npt.selectionEnd; + } else if (document.selection && document.selection.createRange) { + range = document.selection.createRange(); + begin = 0 - range.duplicate().moveStart('character', -100000); + end = begin + range.text.length; + } + begin = TranslatePosition(begin); + end = TranslatePosition(end); + return { "begin": begin, "end": end }; + } + } + + function isComplete(buffer) { //return true / false / undefined (repeat *) + if (opts.repeat == "*") return undefined; + var complete = false, highestValidPosition = 0, currentActiveMasksetIndex = activeMasksetIndex; + $.each(masksets, function (ndx, ms) { + if (typeof (ms) == "object") { + activeMasksetIndex = ndx; + var aml = seekPrevious(getMaskLength()); + if (ms["lastValidPosition"] >= highestValidPosition && ms["lastValidPosition"] == aml) { + var msComplete = true; + for (var i = 0; i <= aml; i++) { + var mask = isMask(i), testPos = determineTestPosition(i); + if ((mask && (buffer[i] == undefined || buffer[i] == getPlaceHolder(i))) || (!mask && buffer[i] != getActiveBufferTemplate()[testPos])) { + msComplete = false; + break; + } + } + complete = complete || msComplete; + if (complete) //break loop + return false; + } + highestValidPosition = ms["lastValidPosition"]; + } + }); + activeMasksetIndex = currentActiveMasksetIndex; //reset activeMaskset + return complete; + } + + function isSelection(begin, end) { + return isRTL ? (begin - end) > 1 || ((begin - end) == 1 && opts.insertMode) : + (end - begin) > 1 || ((end - begin) == 1 && opts.insertMode); + } + + + //private functions + function installEventRuler(npt) { + var events = $._data(npt).events; + + $.each(events, function (eventType, eventHandlers) { + $.each(eventHandlers, function (ndx, eventHandler) { + if (eventHandler.namespace == "inputmask") { + if (eventHandler.type != "setvalue") { + var handler = eventHandler.handler; + eventHandler.handler = function (e) { + if (this.readOnly || this.disabled) + e.preventDefault; + else + return handler.apply(this, arguments); + }; + } + } + }); + }); + } + + function patchValueProperty(npt) { + var valueProperty; + if (Object.getOwnPropertyDescriptor) + valueProperty = Object.getOwnPropertyDescriptor(npt, "value"); + if (valueProperty && valueProperty.get) { + if (!npt._valueGet) { + var valueGet = valueProperty.get; + var valueSet = valueProperty.set; + npt._valueGet = function () { + return isRTL ? valueGet.call(this).split('').reverse().join('') : valueGet.call(this); + }; + npt._valueSet = function (value) { + valueSet.call(this, isRTL ? value.split('').reverse().join('') : value); + }; + + Object.defineProperty(npt, "value", { + get: function () { + var $self = $(this), inputData = $(this).data('_inputmask'), masksets = inputData['masksets'], + activeMasksetIndex = inputData['activeMasksetIndex']; + return inputData && inputData['opts'].autoUnmask ? $self.inputmask('unmaskedvalue') : valueGet.call(this) != masksets[activeMasksetIndex]['_buffer'].join('') ? valueGet.call(this) : ''; + }, + set: function (value) { + valueSet.call(this, value); + $(this).triggerHandler('setvalue.inputmask'); + } + }); + } + } else if (document.__lookupGetter__ && npt.__lookupGetter__("value")) { + if (!npt._valueGet) { + var valueGet = npt.__lookupGetter__("value"); + var valueSet = npt.__lookupSetter__("value"); + npt._valueGet = function () { + return isRTL ? valueGet.call(this).split('').reverse().join('') : valueGet.call(this); + }; + npt._valueSet = function (value) { + valueSet.call(this, isRTL ? value.split('').reverse().join('') : value); + }; + + npt.__defineGetter__("value", function () { + var $self = $(this), inputData = $(this).data('_inputmask'), masksets = inputData['masksets'], + activeMasksetIndex = inputData['activeMasksetIndex']; + return inputData && inputData['opts'].autoUnmask ? $self.inputmask('unmaskedvalue') : valueGet.call(this) != masksets[activeMasksetIndex]['_buffer'].join('') ? valueGet.call(this) : ''; + }); + npt.__defineSetter__("value", function (value) { + valueSet.call(this, value); + $(this).triggerHandler('setvalue.inputmask'); + }); + } + } else { + if (!npt._valueGet) { + npt._valueGet = function () { return isRTL ? this.value.split('').reverse().join('') : this.value; }; + npt._valueSet = function (value) { this.value = isRTL ? value.split('').reverse().join('') : value; }; + } + if ($.valHooks.text == undefined || $.valHooks.text.inputmaskpatch != true) { + var valueGet = $.valHooks.text && $.valHooks.text.get ? $.valHooks.text.get : function (elem) { return elem.value; }; + var valueSet = $.valHooks.text && $.valHooks.text.set ? $.valHooks.text.set : function (elem, value) { + elem.value = value; + return elem; + }; + + jQuery.extend($.valHooks, { + text: { + get: function (elem) { + var $elem = $(elem); + if ($elem.data('_inputmask')) { + if ($elem.data('_inputmask')['opts'].autoUnmask) + return $elem.inputmask('unmaskedvalue'); + else { + var result = valueGet(elem), + inputData = $elem.data('_inputmask'), masksets = inputData['masksets'], + activeMasksetIndex = inputData['activeMasksetIndex']; + return result != masksets[activeMasksetIndex]['_buffer'].join('') ? result : ''; + } + } else return valueGet(elem); + }, + set: function (elem, value) { + var $elem = $(elem); + var result = valueSet(elem, value); + if ($elem.data('_inputmask')) $elem.triggerHandler('setvalue.inputmask'); + return result; + }, + inputmaskpatch: true + } + }); + } + } + } + + //shift chars to left from start to end and put c at end position if defined + + function shiftL(start, end, c, maskJumps) { + var buffer = getActiveBuffer(); + if (maskJumps !== false) //jumping over nonmask position + while (!isMask(start) && start - 1 >= 0) start--; + for (var i = start; i < end && i < getMaskLength() ; i++) { + if (isMask(i)) { + setReTargetPlaceHolder(buffer, i); + var j = seekNext(i); + var p = getBufferElement(buffer, j); + if (p != getPlaceHolder(j)) { + if (j < getMaskLength() && isValid(i, p, true) !== false && getActiveTests()[determineTestPosition(i)].def == getActiveTests()[determineTestPosition(j)].def) { + setBufferElement(buffer, i, p, true); + } else { + if (isMask(i)) + break; + } + } + } else { + setReTargetPlaceHolder(buffer, i); + } + } + if (c != undefined) + setBufferElement(buffer, seekPrevious(end), c); + + if (getActiveMaskSet()["greedy"] == false) { + var trbuffer = truncateInput(buffer.join('')).split(''); + buffer.length = trbuffer.length; + for (var i = 0, bl = buffer.length; i < bl; i++) { + buffer[i] = trbuffer[i]; + } + if (buffer.length == 0) getActiveMaskSet()["buffer"] = getActiveBufferTemplate().slice(); + } + return start; //return the used start position + } + + function shiftR(start, end, c) { + var buffer = getActiveBuffer(); + if (getBufferElement(buffer, start, true) != getPlaceHolder(start)) { + for (var i = seekPrevious(end) ; i > start && i >= 0; i--) { + if (isMask(i)) { + var j = seekPrevious(i); + var t = getBufferElement(buffer, j); + if (t != getPlaceHolder(j)) { + if (isValid(j, t, true) !== false && getActiveTests()[determineTestPosition(i)].def == getActiveTests()[determineTestPosition(j)].def) { + setBufferElement(buffer, i, t, true); + setReTargetPlaceHolder(buffer, j); + } //else break; + } + } else + setReTargetPlaceHolder(buffer, i); + } + } + if (c != undefined && getBufferElement(buffer, start) == getPlaceHolder(start)) + setBufferElement(buffer, start, c); + var lengthBefore = buffer.length; + if (getActiveMaskSet()["greedy"] == false) { + var trbuffer = truncateInput(buffer.join('')).split(''); + buffer.length = trbuffer.length; + for (var i = 0, bl = buffer.length; i < bl; i++) { + buffer[i] = trbuffer[i]; + } + if (buffer.length == 0) getActiveMaskSet()["buffer"] = getActiveBufferTemplate().slice(); + } + return end - (lengthBefore - buffer.length); //return new start position + } + + ; + + + function HandleRemove(input, k, pos) { + if (opts.numericInput || isRTL) { + switch (k) { + case opts.keyCode.BACKSPACE: + k = opts.keyCode.DELETE; + break; + case opts.keyCode.DELETE: + k = opts.keyCode.BACKSPACE; + break; + } + if (isRTL) { + var pend = pos.end; + pos.end = pos.begin; + pos.begin = pend; + } + } + + var isSelection = true; + if (pos.begin == pos.end) { + var posBegin = k == opts.keyCode.BACKSPACE ? pos.begin - 1 : pos.begin; + if (opts.isNumeric && opts.radixPoint != "" && getActiveBuffer()[posBegin] == opts.radixPoint) { + pos.begin = (getActiveBuffer().length - 1 == posBegin) /* radixPoint is latest? delete it */ ? pos.begin : k == opts.keyCode.BACKSPACE ? posBegin : seekNext(posBegin); + pos.end = pos.begin; + } + isSelection = false; + if (k == opts.keyCode.BACKSPACE) + pos.begin--; + else if (k == opts.keyCode.DELETE) + pos.end++; + } else if (pos.end - pos.begin == 1 && !opts.insertMode) { + isSelection = false; + if (k == opts.keyCode.BACKSPACE) + pos.begin--; + } + + clearBuffer(getActiveBuffer(), pos.begin, pos.end); + + var ml = getMaskLength(); + if (opts.greedy == false) { + shiftL(pos.begin, ml, undefined, !isRTL && (k == opts.keyCode.BACKSPACE && !isSelection)); + } else { + var newpos = pos.begin; + for (var i = pos.begin; i < pos.end; i++) { //seeknext to skip placeholders at start in selection + if (isMask(i) || !isSelection) + newpos = shiftL(pos.begin, ml, undefined, !isRTL && (k == opts.keyCode.BACKSPACE && !isSelection)); + } + if (!isSelection) pos.begin = newpos; + } + var firstMaskPos = seekNext(-1); + clearBuffer(getActiveBuffer(), pos.begin, pos.end, true); + checkVal(input, false, masksets[1] == undefined || firstMaskPos >= pos.end, getActiveBuffer()); + if (getActiveMaskSet()['lastValidPosition'] < firstMaskPos) { + getActiveMaskSet()["lastValidPosition"] = -1; + getActiveMaskSet()["p"] = firstMaskPos; + } else { + getActiveMaskSet()["p"] = pos.begin; + } + } + + function keydownEvent(e) { + //Safari 5.1.x - modal dialog fires keypress twice workaround + skipKeyPressEvent = false; + var input = this, $input = $(input), k = e.keyCode, pos = caret(input); + + //backspace, delete, and escape get special treatment + if (k == opts.keyCode.BACKSPACE || k == opts.keyCode.DELETE || (iphone && k == 127) || e.ctrlKey && k == 88) { //backspace/delete + e.preventDefault(); //stop default action but allow propagation + if (k == 88) valueOnFocus = getActiveBuffer().join(''); + HandleRemove(input, k, pos); + determineActiveMasksetIndex(); + writeBuffer(input, getActiveBuffer(), getActiveMaskSet()["p"]); + if (input._valueGet() == getActiveBufferTemplate().join('')) + $input.trigger('cleared'); + + if (opts.showTooltip) { //update tooltip + $input.prop("title", getActiveMaskSet()["mask"]); + } + } else if (k == opts.keyCode.END || k == opts.keyCode.PAGE_DOWN) { //when END or PAGE_DOWN pressed set position at lastmatch + setTimeout(function () { + var caretPos = seekNext(getActiveMaskSet()["lastValidPosition"]); + if (!opts.insertMode && caretPos == getMaskLength() && !e.shiftKey) caretPos--; + caret(input, e.shiftKey ? pos.begin : caretPos, caretPos); + }, 0); + } else if ((k == opts.keyCode.HOME && !e.shiftKey) || k == opts.keyCode.PAGE_UP) { //Home or page_up + caret(input, 0, e.shiftKey ? pos.begin : 0); + } else if (k == opts.keyCode.ESCAPE || (k == 90 && e.ctrlKey)) { //escape && undo + checkVal(input, true, false, valueOnFocus.split('')); + $input.click(); + } else if (k == opts.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert + opts.insertMode = !opts.insertMode; + caret(input, !opts.insertMode && pos.begin == getMaskLength() ? pos.begin - 1 : pos.begin); + } else if (opts.insertMode == false && !e.shiftKey) { + if (k == opts.keyCode.RIGHT) { + setTimeout(function () { + var caretPos = caret(input); + caret(input, caretPos.begin); + }, 0); + } else if (k == opts.keyCode.LEFT) { + setTimeout(function () { + var caretPos = caret(input); + caret(input, caretPos.begin - 1); + }, 0); + } + } + + var currentCaretPos = caret(input); + if (opts.onKeyDown.call(this, e, getActiveBuffer(), opts) === true) //extra stuff to execute on keydown + caret(input, currentCaretPos.begin, currentCaretPos.end); + ignorable = $.inArray(k, opts.ignorables) != -1; + } + + + function keypressEvent(e, checkval, k, writeOut, strict, ndx) { + //Safari 5.1.x - modal dialog fires keypress twice workaround + if (k == undefined && skipKeyPressEvent) return false; + skipKeyPressEvent = true; + + var input = this, $input = $(input); + + e = e || window.event; + var k = checkval ? k : (e.which || e.charCode || e.keyCode); + + if (checkval !== true && (!(e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable))) { + return true; + } else { + if (k) { + //special treat the decimal separator + if (checkval !== true && k == 46 && e.shiftKey == false && opts.radixPoint == ",") k = 44; + + var pos, results, result, c = String.fromCharCode(k); + if (checkval) { + var pcaret = strict ? ndx : getActiveMaskSet()["lastValidPosition"] + 1; + pos = { begin: pcaret, end: pcaret }; + } else { + pos = caret(input); + } + + //should we clear a possible selection?? + var isSlctn = isSelection(pos.begin, pos.end), redetermineLVP = false, + initialIndex = activeMasksetIndex; + if (isSlctn) { + activeMasksetIndex = initialIndex; + $.each(masksets, function (ndx, lmnt) { //init undobuffer for recovery when not valid + if (typeof (lmnt) == "object") { + activeMasksetIndex = ndx; + getActiveMaskSet()["undoBuffer"] = getActiveBuffer().join(''); + } + }); + HandleRemove(input, opts.keyCode.DELETE, pos); + if (!opts.insertMode) { //preserve some space + $.each(masksets, function (ndx, lmnt) { + if (typeof (lmnt) == "object") { + activeMasksetIndex = ndx; + shiftR(pos.begin, getMaskLength()); + getActiveMaskSet()["lastValidPosition"] = seekNext(getActiveMaskSet()["lastValidPosition"]); + } + }); + } + activeMasksetIndex = initialIndex; //restore index + } + + var radixPosition = getActiveBuffer().join('').indexOf(opts.radixPoint); + if (opts.isNumeric && checkval !== true && radixPosition != -1) { + if (opts.greedy && pos.begin <= radixPosition) { + pos.begin = seekPrevious(pos.begin); + pos.end = pos.begin; + } else if (c == opts.radixPoint) { + pos.begin = radixPosition; + pos.end = pos.begin; + } + } + + + var p = pos.begin; + results = isValid(p, c, strict); + if (strict === true) results = [{ "activeMasksetIndex": activeMasksetIndex, "result": results }]; + var minimalForwardPosition = -1; + $.each(results, function (index, result) { + activeMasksetIndex = result["activeMasksetIndex"]; + getActiveMaskSet()["writeOutBuffer"] = true; + var np = result["result"]; + if (np !== false) { + var refresh = false, buffer = getActiveBuffer(); + if (np !== true) { + refresh = np["refresh"]; //only rewrite buffer from isValid + p = np.pos != undefined ? np.pos : p; //set new position from isValid + c = np.c != undefined ? np.c : c; //set new char from isValid + } + if (refresh !== true) { + if (opts.insertMode == true) { + var lastUnmaskedPosition = getMaskLength(); + var bfrClone = buffer.slice(); + while (getBufferElement(bfrClone, lastUnmaskedPosition, true) != getPlaceHolder(lastUnmaskedPosition) && lastUnmaskedPosition >= p) { + lastUnmaskedPosition = lastUnmaskedPosition == 0 ? -1 : seekPrevious(lastUnmaskedPosition); + } + if (lastUnmaskedPosition >= p) { + shiftR(p, getMaskLength(), c); + //shift the lvp if needed + var lvp = getActiveMaskSet()["lastValidPosition"], nlvp = seekNext(lvp); + if (nlvp != getMaskLength() && lvp >= p && (getBufferElement(getActiveBuffer(), nlvp, true) != getPlaceHolder(nlvp))) { + getActiveMaskSet()["lastValidPosition"] = nlvp; + } + } else getActiveMaskSet()["writeOutBuffer"] = false; + } else setBufferElement(buffer, p, c, true); + if (minimalForwardPosition == -1 || minimalForwardPosition > seekNext(p)) { + minimalForwardPosition = seekNext(p); + } + } else if (!strict) { + var nextPos = p < getMaskLength() ? p + 1 : p; + if (minimalForwardPosition == -1 || minimalForwardPosition > nextPos) { + minimalForwardPosition = nextPos; + } + } + if (minimalForwardPosition > getActiveMaskSet()["p"]) + getActiveMaskSet()["p"] = minimalForwardPosition; //needed for checkval strict + } + }); + + if (strict !== true) { + activeMasksetIndex = initialIndex; + determineActiveMasksetIndex(); + } + if (writeOut !== false) { + $.each(results, function (ndx, rslt) { + if (rslt["activeMasksetIndex"] == activeMasksetIndex) { + result = rslt; + return false; + } + }); + if (result != undefined) { + var self = this; + setTimeout(function () { opts.onKeyValidation.call(self, result["result"], opts); }, 0); + if (getActiveMaskSet()["writeOutBuffer"] && result["result"] !== false) { + var buffer = getActiveBuffer(); + + var newCaretPosition; + if (checkval) { + newCaretPosition = undefined; + } else if (opts.numericInput) { + if (p > radixPosition) { + newCaretPosition = seekPrevious(minimalForwardPosition); + } else if (c == opts.radixPoint) { + newCaretPosition = minimalForwardPosition - 1; + } else newCaretPosition = seekPrevious(minimalForwardPosition - 1); + } else { + newCaretPosition = minimalForwardPosition; + } + + writeBuffer(input, buffer, newCaretPosition); + if (checkval !== true) { + setTimeout(function () { //timeout needed for IE + if (isComplete(buffer) === true) + $input.trigger("complete"); + skipInputEvent = true; + $input.trigger("input"); + }, 0); + } + } else if (isSlctn) { + getActiveMaskSet()["buffer"] = getActiveMaskSet()["undoBuffer"].split(''); + } + } + } + + if (opts.showTooltip) { //update tooltip + $input.prop("title", getActiveMaskSet()["mask"]); + } + + //needed for IE8 and below + if (e) e.preventDefault ? e.preventDefault() : e.returnValue = false; + } + } + } + + function keyupEvent(e) { + var $input = $(this), input = this, k = e.keyCode, buffer = getActiveBuffer(); + + if (androidchrome && k == opts.keyCode.BACKSPACE) { + if (chromeValueOnInput == input._valueGet()) + keydownEvent.call(this, e); + } + + opts.onKeyUp.call(this, e, buffer, opts); //extra stuff to execute on keyup + if (k == opts.keyCode.TAB && opts.showMaskOnFocus) { + if ($input.hasClass('focus.inputmask') && input._valueGet().length == 0) { + buffer = getActiveBufferTemplate().slice(); + writeBuffer(input, buffer); + caret(input, 0); + valueOnFocus = getActiveBuffer().join(''); + } else { + writeBuffer(input, buffer); + if (buffer.join('') == getActiveBufferTemplate().join('') && $.inArray(opts.radixPoint, buffer) != -1) { + caret(input, TranslatePosition(0)); + $input.click(); + } else + caret(input, TranslatePosition(0), TranslatePosition(getMaskLength())); + } + } + } + + function inputEvent(e) { + if (skipInputEvent === true) { + skipInputEvent = false; + return true; + } + var input = this, $input = $(input); + + chromeValueOnInput = getActiveBuffer().join(''); + checkVal(input, false, false); + writeBuffer(input, getActiveBuffer()); + if (isComplete(getActiveBuffer()) === true) + $input.trigger("complete"); + $input.click(); + } + + function mask(el) { + $el = $(el); + if ($el.is(":input")) { + //store tests & original buffer in the input element - used to get the unmasked value + $el.data('_inputmask', { + 'masksets': masksets, + 'activeMasksetIndex': activeMasksetIndex, + 'opts': opts, + 'isRTL': false + }); + + //show tooltip + if (opts.showTooltip) { + $el.prop("title", getActiveMaskSet()["mask"]); + } + + //correct greedy setting if needed + getActiveMaskSet()['greedy'] = getActiveMaskSet()['greedy'] ? getActiveMaskSet()['greedy'] : getActiveMaskSet()['repeat'] == 0; + + //handle maxlength attribute + if ($el.attr("maxLength") != null) //only when the attribute is set + { + var maxLength = $el.prop('maxLength'); + if (maxLength > -1) { //handle *-repeat + $.each(masksets, function (ndx, ms) { + if (typeof (ms) == "object") { + if (ms["repeat"] == "*") { + ms["repeat"] = maxLength; + } + } + }); + } + if (getMaskLength() >= maxLength && maxLength > -1) { //FF sets no defined max length to -1 + if (maxLength < getActiveBufferTemplate().length) getActiveBufferTemplate().length = maxLength; + if (getActiveMaskSet()['greedy'] == false) { + getActiveMaskSet()['repeat'] = Math.round(maxLength / getActiveBufferTemplate().length); + } + $el.prop('maxLength', getMaskLength() * 2); + } + } + + patchValueProperty(el); + + if (opts.numericInput) opts.isNumeric = opts.numericInput; + if (el.dir == "rtl" || (opts.numericInput && opts.rightAlignNumerics) || (opts.isNumeric && opts.rightAlignNumerics)) + $el.css("text-align", "right"); + + if (el.dir == "rtl" || opts.numericInput) { + el.dir = "ltr"; + $el.removeAttr("dir"); + var inputData = $el.data('_inputmask'); + inputData['isRTL'] = true; + $el.data('_inputmask', inputData); + isRTL = true; + } + + //unbind all events - to make sure that no other mask will interfere when re-masking + $el.unbind(".inputmask"); + $el.removeClass('focus.inputmask'); + //bind events + $el.closest('form').bind("submit", function () { //trigger change on submit if any + if (valueOnFocus != getActiveBuffer().join('')) { + $el.change(); + } + }).bind('reset', function () { + setTimeout(function () { + $el.trigger("setvalue"); + }, 0); + }); + $el.bind("mouseenter.inputmask", function () { + var $input = $(this), input = this; + if (!$input.hasClass('focus.inputmask') && opts.showMaskOnHover) { + if (input._valueGet() != getActiveBuffer().join('')) { + writeBuffer(input, getActiveBuffer()); + } + } + }).bind("blur.inputmask", function () { + var $input = $(this), input = this, nptValue = input._valueGet(), buffer = getActiveBuffer(); + $input.removeClass('focus.inputmask'); + if (valueOnFocus != getActiveBuffer().join('')) { + $input.change(); + } + if (opts.clearMaskOnLostFocus && nptValue != '') { + if (nptValue == getActiveBufferTemplate().join('')) + input._valueSet(''); + else { //clearout optional tail of the mask + clearOptionalTail(input); + } + } + if (isComplete(buffer) === false) { + $input.trigger("incomplete"); + if (opts.clearIncomplete) { + $.each(masksets, function (ndx, ms) { + if (typeof (ms) == "object") { + ms["buffer"] = ms["_buffer"].slice(); + ms["lastValidPosition"] = -1; + } + }); + activeMasksetIndex = 0; + if (opts.clearMaskOnLostFocus) + input._valueSet(''); + else { + buffer = getActiveBufferTemplate().slice(); + writeBuffer(input, buffer); + } + } + } + }).bind("focus.inputmask", function () { + var $input = $(this), input = this, nptValue = input._valueGet(); + if (opts.showMaskOnFocus && !$input.hasClass('focus.inputmask') && (!opts.showMaskOnHover || (opts.showMaskOnHover && nptValue == ''))) { + if (input._valueGet() != getActiveBuffer().join('')) { + writeBuffer(input, getActiveBuffer(), seekNext(getActiveMaskSet()["lastValidPosition"])); + } + } + $input.addClass('focus.inputmask'); + valueOnFocus = getActiveBuffer().join(''); + }).bind("mouseleave.inputmask", function () { + var $input = $(this), input = this; + if (opts.clearMaskOnLostFocus) { + if (!$input.hasClass('focus.inputmask') && input._valueGet() != $input.attr("placeholder")) { + if (input._valueGet() == getActiveBufferTemplate().join('') || input._valueGet() == '') + input._valueSet(''); + else { //clearout optional tail of the mask + clearOptionalTail(input); + } + } + } + }).bind("click.inputmask", function () { + var input = this; + setTimeout(function () { + var selectedCaret = caret(input), buffer = getActiveBuffer(); + if (selectedCaret.begin == selectedCaret.end) { + var clickPosition = isRTL ? TranslatePosition(selectedCaret.begin) : selectedCaret.begin, + lvp = getActiveMaskSet()["lastValidPosition"], + lastPosition; + if (opts.isNumeric) { + lastPosition = opts.skipRadixDance === false && opts.radixPoint != "" && $.inArray(opts.radixPoint, buffer) != -1 ? + (opts.numericInput ? seekNext($.inArray(opts.radixPoint, buffer)) : $.inArray(opts.radixPoint, buffer)) : + seekNext(lvp); + } else { + lastPosition = seekNext(lvp); + } + if (clickPosition < lastPosition) { + if (isMask(clickPosition)) + caret(input, clickPosition); + else caret(input, seekNext(clickPosition)); + } else + caret(input, lastPosition); + } + }, 0); + }).bind('dblclick.inputmask', function () { + var input = this; + setTimeout(function () { + caret(input, 0, seekNext(getActiveMaskSet()["lastValidPosition"])); + }, 0); + }).bind(pasteEvent + ".inputmask dragdrop.inputmask drop.inputmask", function (e) { + if (skipInputEvent === true) { + skipInputEvent = false; + return true; + } + var input = this, $input = $(input); + + //paste event for IE8 and lower I guess ;-) + if (e.type == "propertychange" && input._valueGet().length <= getMaskLength()) { + return true; + } + setTimeout(function () { + var pasteValue = opts.onBeforePaste != undefined ? opts.onBeforePaste.call(this, input._valueGet()) : input._valueGet(); + checkVal(input, true, false, pasteValue.split(''), true); + if (isComplete(getActiveBuffer()) === true) + $input.trigger("complete"); + $input.click(); + }, 0); + }).bind('setvalue.inputmask', function () { + var input = this; + checkVal(input, true); + valueOnFocus = getActiveBuffer().join(''); + if (input._valueGet() == getActiveBufferTemplate().join('')) + input._valueSet(''); + }).bind('complete.inputmask', opts.oncomplete + ).bind('incomplete.inputmask', opts.onincomplete + ).bind('cleared.inputmask', opts.oncleared + ).bind("keyup.inputmask", keyupEvent); + + if (androidchrome) { + $el.bind("input.inputmask", inputEvent); + } else { + $el.bind("keydown.inputmask", keydownEvent + ).bind("keypress.inputmask", keypressEvent); + } + + if (msie10) + $el.bind("input.inputmask", inputEvent); + + //apply mask + checkVal(el, true, false); + valueOnFocus = getActiveBuffer().join(''); + // Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame. + var activeElement; + try { + activeElement = document.activeElement; + } catch (e) { + } + if (activeElement === el) { //position the caret when in focus + $el.addClass('focus.inputmask'); + caret(el, seekNext(getActiveMaskSet()["lastValidPosition"])); + } else if (opts.clearMaskOnLostFocus) { + if (getActiveBuffer().join('') == getActiveBufferTemplate().join('')) { + el._valueSet(''); + } else { + clearOptionalTail(el); + } + } else { + writeBuffer(el, getActiveBuffer()); + } + + installEventRuler(el); + } + } + + //action object + if (actionObj != undefined) { + switch (actionObj["action"]) { + case "isComplete": + return isComplete(actionObj["buffer"]); + case "unmaskedvalue": + isRTL = actionObj["$input"].data('_inputmask')['isRTL']; + return unmaskedvalue(actionObj["$input"], actionObj["skipDatepickerCheck"]); + case "mask": + mask(actionObj["el"]); + break; + case "format": + $el = $({}); + $el.data('_inputmask', { + 'masksets': masksets, + 'activeMasksetIndex': activeMasksetIndex, + 'opts': opts, + 'isRTL': opts.numericInput + }); + if (opts.numericInput) { + opts.isNumeric = opts.numericInput; + isRTL = true; + } + + checkVal($el, false, false, actionObj["value"].split(''), true); + return getActiveBuffer().join(''); + } + } + }; + + $.inputmask = { + //options default + defaults: { + placeholder: "_", + optionalmarker: { start: "[", end: "]" }, + quantifiermarker: { start: "{", end: "}" }, + groupmarker: { start: "(", end: ")" }, + escapeChar: "\\", + mask: null, + oncomplete: $.noop, //executes when the mask is complete + onincomplete: $.noop, //executes when the mask is incomplete and focus is lost + oncleared: $.noop, //executes when the mask is cleared + repeat: 0, //repetitions of the mask: * ~ forever, otherwise specify an integer + greedy: true, //true: allocated buffer for the mask and repetitions - false: allocate only if needed + autoUnmask: false, //automatically unmask when retrieving the value with $.fn.val or value if the browser supports __lookupGetter__ or getOwnPropertyDescriptor + clearMaskOnLostFocus: true, + insertMode: true, //insert the input or overwrite the input + clearIncomplete: false, //clear the incomplete input on blur + aliases: {}, //aliases definitions => see jquery.inputmask.extensions.js + onKeyUp: $.noop, //override to implement autocomplete on certain keys for example + onKeyDown: $.noop, //override to implement autocomplete on certain keys for example + onBeforePaste: undefined, //executes before masking the pasted value to allow preprocessing of the pasted value. args => pastedValue => return processedValue + onUnMask: undefined, //executes after unmasking to allow postprocessing of the unmaskedvalue. args => maskedValue, unmaskedValue + showMaskOnFocus: true, //show the mask-placeholder when the input has focus + showMaskOnHover: true, //show the mask-placeholder when hovering the empty input + onKeyValidation: $.noop, //executes on every key-press with the result of isValid. Params: result, opts + skipOptionalPartCharacter: " ", //a character which can be used to skip an optional part of a mask + showTooltip: false, //show the activemask as tooltip + numericInput: false, //numericInput input direction style (input shifts to the left while holding the caret position) + //numeric basic properties + isNumeric: false, //enable numeric features + radixPoint: "", //".", // | "," + skipRadixDance: false, //disable radixpoint caret positioning + rightAlignNumerics: true, //align numerics to the right + //numeric basic properties + definitions: { + '9': { + validator: "[0-9]", + cardinality: 1 + }, + 'a': { + validator: "[A-Za-z\u0410-\u044F\u0401\u0451]", + cardinality: 1 + }, + '*': { + validator: "[A-Za-z\u0410-\u044F\u0401\u04510-9]", + cardinality: 1 + } + }, + keyCode: { + ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91 + }, + //specify keycodes which should not be considered in the keypress event, otherwise the preventDefault will stop their default behavior especially in FF + ignorables: [8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123], + getMaskLength: function (buffer, greedy, repeat, currentBuffer, opts) { + var calculatedLength = buffer.length; + if (!greedy) { + if (repeat == "*") { + calculatedLength = currentBuffer.length + 1; + } else if (repeat > 1) { + calculatedLength += (buffer.length * (repeat - 1)); + } + } + return calculatedLength; + } + }, + escapeRegex: function (str) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + return str.replace(new RegExp('(\\' + specials.join('|\\') + ')', 'gim'), '\\$1'); + }, + format: function (value, options) { + var opts = $.extend(true, {}, $.inputmask.defaults, options); + resolveAlias(opts.alias, options, opts); + return maskScope(generateMaskSets(opts), 0, opts, { "action": "format", "value": value }); + } + }; + + $.fn.inputmask = function (fn, options) { + var opts = $.extend(true, {}, $.inputmask.defaults, options), + masksets, + activeMasksetIndex = 0; + + if (typeof fn === "string") { + switch (fn) { + case "mask": + //resolve possible aliases given by options + resolveAlias(opts.alias, options, opts); + masksets = generateMaskSets(opts); + if (masksets.length == 0) { return this; } + + return this.each(function () { + maskScope($.extend(true, {}, masksets), 0, opts, { "action": "mask", "el": this }); + }); + case "unmaskedvalue": + var $input = $(this), input = this; + if ($input.data('_inputmask')) { + masksets = $input.data('_inputmask')['masksets']; + activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex']; + opts = $input.data('_inputmask')['opts']; + return maskScope(masksets, activeMasksetIndex, opts, { "action": "unmaskedvalue", "$input": $input }); + } else return $input.val(); + case "remove": + return this.each(function () { + var $input = $(this), input = this; + if ($input.data('_inputmask')) { + masksets = $input.data('_inputmask')['masksets']; + activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex']; + opts = $input.data('_inputmask')['opts']; + //writeout the unmaskedvalue + input._valueSet(maskScope(masksets, activeMasksetIndex, opts, { "action": "unmaskedvalue", "$input": $input, "skipDatepickerCheck": true })); + //clear data + $input.removeData('_inputmask'); + //unbind all events + $input.unbind(".inputmask"); + $input.removeClass('focus.inputmask'); + //restore the value property + var valueProperty; + if (Object.getOwnPropertyDescriptor) + valueProperty = Object.getOwnPropertyDescriptor(input, "value"); + if (valueProperty && valueProperty.get) { + if (input._valueGet) { + Object.defineProperty(input, "value", { + get: input._valueGet, + set: input._valueSet + }); + } + } else if (document.__lookupGetter__ && input.__lookupGetter__("value")) { + if (input._valueGet) { + input.__defineGetter__("value", input._valueGet); + input.__defineSetter__("value", input._valueSet); + } + } + try { //try catch needed for IE7 as it does not supports deleting fns + delete input._valueGet; + delete input._valueSet; + } catch (e) { + input._valueGet = undefined; + input._valueSet = undefined; + + } + } + }); + break; + case "getemptymask": //return the default (empty) mask value, usefull for setting the default value in validation + if (this.data('_inputmask')) { + masksets = this.data('_inputmask')['masksets']; + activeMasksetIndex = this.data('_inputmask')['activeMasksetIndex']; + return masksets[activeMasksetIndex]['_buffer'].join(''); + } + else return ""; + case "hasMaskedValue": //check wheter the returned value is masked or not; currently only works reliable when using jquery.val fn to retrieve the value + return this.data('_inputmask') ? !this.data('_inputmask')['opts'].autoUnmask : false; + case "isComplete": + masksets = this.data('_inputmask')['masksets']; + activeMasksetIndex = this.data('_inputmask')['activeMasksetIndex']; + opts = this.data('_inputmask')['opts']; + return maskScope(masksets, activeMasksetIndex, opts, { "action": "isComplete", "buffer": this[0]._valueGet().split('') }); + case "getmetadata": //return mask metadata if exists + if (this.data('_inputmask')) { + masksets = this.data('_inputmask')['masksets']; + activeMasksetIndex = this.data('_inputmask')['activeMasksetIndex']; + return masksets[activeMasksetIndex]['metadata']; + } + else return undefined; + default: + //check if the fn is an alias + if (!resolveAlias(fn, options, opts)) { + //maybe fn is a mask so we try + //set mask + opts.mask = fn; + } + masksets = generateMaskSets(opts); + if (masksets.length == 0) { return this; } + return this.each(function () { + maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts, { "action": "mask", "el": this }); + }); + + break; + } + } else if (typeof fn == "object") { + opts = $.extend(true, {}, $.inputmask.defaults, fn); + + resolveAlias(opts.alias, fn, opts); //resolve aliases + masksets = generateMaskSets(opts); + if (masksets.length == 0) { return this; } + return this.each(function () { + maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts, { "action": "mask", "el": this }); + }); + } else if (fn == undefined) { + //look for data-inputmask atribute - the attribute should only contain optipns + return this.each(function () { + var attrOptions = $(this).attr("data-inputmask"); + if (attrOptions && attrOptions != "") { + try { + attrOptions = attrOptions.replace(new RegExp("'", "g"), '"'); + var dataoptions = $.parseJSON("{" + attrOptions + "}"); + $.extend(true, dataoptions, options); + opts = $.extend(true, {}, $.inputmask.defaults, dataoptions); + resolveAlias(opts.alias, dataoptions, opts); + opts.alias = undefined; + $(this).inputmask(opts); + } catch (ex) { } //need a more relax parseJSON + } + }); + } + }; + } +})(jQuery); diff --git a/public/assets/js/plugins/input-mask/jquery.inputmask.numeric.extensions.js b/public/assets/js/plugins/input-mask/jquery.inputmask.numeric.extensions.js new file mode 100755 index 00000000..2efb33f4 --- /dev/null +++ b/public/assets/js/plugins/input-mask/jquery.inputmask.numeric.extensions.js @@ -0,0 +1,177 @@ +/* +Input Mask plugin extensions +http://github.com/RobinHerbots/jquery.inputmask +Copyright (c) 2010 - 2014 Robin Herbots +Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) +Version: 0.0.0 + +Optional extensions on the jquery.inputmask base +*/ +(function ($) { + //number aliases + $.extend($.inputmask.defaults.aliases, { + 'decimal': { + mask: "~", + placeholder: "", + repeat: "*", + greedy: false, + numericInput: false, + isNumeric: true, + digits: "*", //number of fractionalDigits + groupSeparator: "",//",", // | "." + radixPoint: ".", + groupSize: 3, + autoGroup: false, + allowPlus: true, + allowMinus: true, + //todo + integerDigits: "*", //number of integerDigits + defaultValue: "", + prefix: "", + suffix: "", + + //todo + getMaskLength: function (buffer, greedy, repeat, currentBuffer, opts) { //custom getMaskLength to take the groupSeparator into account + var calculatedLength = buffer.length; + + if (!greedy) { + if (repeat == "*") { + calculatedLength = currentBuffer.length + 1; + } else if (repeat > 1) { + calculatedLength += (buffer.length * (repeat - 1)); + } + } + + var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator); + var escapedRadixPoint = $.inputmask.escapeRegex.call(this, opts.radixPoint); + var currentBufferStr = currentBuffer.join(''), strippedBufferStr = currentBufferStr.replace(new RegExp(escapedGroupSeparator, "g"), "").replace(new RegExp(escapedRadixPoint), ""), + groupOffset = currentBufferStr.length - strippedBufferStr.length; + return calculatedLength + groupOffset; + }, + postFormat: function (buffer, pos, reformatOnly, opts) { + if (opts.groupSeparator == "") return pos; + var cbuf = buffer.slice(), + radixPos = $.inArray(opts.radixPoint, buffer); + if (!reformatOnly) { + cbuf.splice(pos, 0, "?"); //set position indicator + } + var bufVal = cbuf.join(''); + if (opts.autoGroup || (reformatOnly && bufVal.indexOf(opts.groupSeparator) != -1)) { + var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator); + bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), ''); + var radixSplit = bufVal.split(opts.radixPoint); + bufVal = radixSplit[0]; + var reg = new RegExp('([-\+]?[\\d\?]+)([\\d\?]{' + opts.groupSize + '})'); + while (reg.test(bufVal)) { + bufVal = bufVal.replace(reg, '$1' + opts.groupSeparator + '$2'); + bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator); + } + if (radixSplit.length > 1) + bufVal += opts.radixPoint + radixSplit[1]; + } + buffer.length = bufVal.length; //align the length + for (var i = 0, l = bufVal.length; i < l; i++) { + buffer[i] = bufVal.charAt(i); + } + var newPos = $.inArray("?", buffer); + if (!reformatOnly) buffer.splice(newPos, 1); + + return reformatOnly ? pos : newPos; + }, + regex: { + number: function (opts) { + var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator); + var escapedRadixPoint = $.inputmask.escapeRegex.call(this, opts.radixPoint); + var digitExpression = isNaN(opts.digits) ? opts.digits : '{0,' + opts.digits + '}'; + var signedExpression = opts.allowPlus || opts.allowMinus ? "[" + (opts.allowPlus ? "\+" : "") + (opts.allowMinus ? "-" : "") + "]?" : ""; + return new RegExp("^" + signedExpression + "(\\d+|\\d{1," + opts.groupSize + "}((" + escapedGroupSeparator + "\\d{" + opts.groupSize + "})?)+)(" + escapedRadixPoint + "\\d" + digitExpression + ")?$"); + } + }, + onKeyDown: function (e, buffer, opts) { + var $input = $(this), input = this; + if (e.keyCode == opts.keyCode.TAB) { + var radixPosition = $.inArray(opts.radixPoint, buffer); + if (radixPosition != -1) { + var masksets = $input.data('_inputmask')['masksets']; + var activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex']; + for (var i = 1; i <= opts.digits && i < opts.getMaskLength(masksets[activeMasksetIndex]["_buffer"], masksets[activeMasksetIndex]["greedy"], masksets[activeMasksetIndex]["repeat"], buffer, opts) ; i++) { + if (buffer[radixPosition + i] == undefined || buffer[radixPosition + i] == "") buffer[radixPosition + i] = "0"; + } + input._valueSet(buffer.join('')); + } + } else if (e.keyCode == opts.keyCode.DELETE || e.keyCode == opts.keyCode.BACKSPACE) { + opts.postFormat(buffer, 0, true, opts); + input._valueSet(buffer.join('')); + return true; + } + }, + definitions: { + '~': { //real number + validator: function (chrs, buffer, pos, strict, opts) { + if (chrs == "") return false; + if (!strict && pos <= 1 && buffer[0] === '0' && new RegExp("[\\d-]").test(chrs) && buffer.join('').length == 1) { //handle first char + buffer[0] = ""; + return { "pos": 0 }; + } + + var cbuf = strict ? buffer.slice(0, pos) : buffer.slice(); + + cbuf.splice(pos, 0, chrs); + var bufferStr = cbuf.join(''); + + //strip groupseparator + var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator); + bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), ''); + + var isValid = opts.regex.number(opts).test(bufferStr); + if (!isValid) { + //let's help the regex a bit + bufferStr += "0"; + isValid = opts.regex.number(opts).test(bufferStr); + if (!isValid) { + //make a valid group + var lastGroupSeparator = bufferStr.lastIndexOf(opts.groupSeparator); + for (var i = bufferStr.length - lastGroupSeparator; i <= 3; i++) { + bufferStr += "0"; + } + + isValid = opts.regex.number(opts).test(bufferStr); + if (!isValid && !strict) { + if (chrs == opts.radixPoint) { + isValid = opts.regex.number(opts).test("0" + bufferStr + "0"); + if (isValid) { + buffer[pos] = "0"; + pos++; + return { "pos": pos }; + } + } + } + } + } + + if (isValid != false && !strict && chrs != opts.radixPoint) { + var newPos = opts.postFormat(buffer, pos, false, opts); + return { "pos": newPos }; + } + + return isValid; + }, + cardinality: 1, + prevalidator: null + } + }, + insertMode: true, + autoUnmask: false + }, + 'integer': { + regex: { + number: function (opts) { + var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator); + var signedExpression = opts.allowPlus || opts.allowMinus ? "[" + (opts.allowPlus ? "\+" : "") + (opts.allowMinus ? "-" : "") + "]?" : ""; + return new RegExp("^" + signedExpression + "(\\d+|\\d{1," + opts.groupSize + "}((" + escapedGroupSeparator + "\\d{" + opts.groupSize + "})?)+)$"); + } + }, + alias: "decimal" + } + }); +})(jQuery); diff --git a/public/assets/js/plugins/input-mask/jquery.inputmask.phone.extensions.js b/public/assets/js/plugins/input-mask/jquery.inputmask.phone.extensions.js new file mode 100755 index 00000000..554d4ef1 --- /dev/null +++ b/public/assets/js/plugins/input-mask/jquery.inputmask.phone.extensions.js @@ -0,0 +1,50 @@ +/* +Input Mask plugin extensions +http://github.com/RobinHerbots/jquery.inputmask +Copyright (c) 2010 - 2014 Robin Herbots +Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) +Version: 0.0.0 + +Phone extension. +When using this extension make sure you specify the correct url to get the masks + + $(selector).inputmask("phone", { + url: "Scripts/jquery.inputmask/phone-codes/phone-codes.json", + onKeyValidation: function () { //show some metadata in the console + console.log($(this).inputmask("getmetadata")["name_en"]); + } + }); + + +*/ +(function ($) { + $.extend($.inputmask.defaults.aliases, { + 'phone': { + url: "phone-codes/phone-codes.json", + mask: function (opts) { + opts.definitions = { + 'p': { + validator: function () { return false; }, + cardinality: 1 + }, + '#': { + validator: "[0-9]", + cardinality: 1 + } + }; + var maskList = []; + $.ajax({ + url: opts.url, + async: false, + dataType: 'json', + success: function (response) { + maskList = response; + } + }); + + maskList.splice(0, 0, "+p(ppp)ppp-pppp"); + return maskList; + } + } + }); +})(jQuery); diff --git a/public/assets/js/plugins/input-mask/jquery.inputmask.regex.extensions.js b/public/assets/js/plugins/input-mask/jquery.inputmask.regex.extensions.js new file mode 100755 index 00000000..c5bc30f3 --- /dev/null +++ b/public/assets/js/plugins/input-mask/jquery.inputmask.regex.extensions.js @@ -0,0 +1,170 @@ +/* +Input Mask plugin extensions +http://github.com/RobinHerbots/jquery.inputmask +Copyright (c) 2010 - 2014 Robin Herbots +Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) +Version: 0.0.0 + +Regex extensions on the jquery.inputmask base +Allows for using regular expressions as a mask +*/ +(function ($) { + $.extend($.inputmask.defaults.aliases, { // $(selector).inputmask("Regex", { regex: "[0-9]*"} + 'Regex': { + mask: "r", + greedy: false, + repeat: "*", + regex: null, + regexTokens: null, + //Thx to https://github.com/slevithan/regex-colorizer for the tokenizer regex + tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, + quantifierFilter: /[0-9]+[^,]/, + definitions: { + 'r': { + validator: function (chrs, buffer, pos, strict, opts) { + function regexToken() { + this.matches = []; + this.isGroup = false; + this.isQuantifier = false; + this.isLiteral = false; + } + function analyseRegex() { + var currentToken = new regexToken(), match, m, opengroups = []; + + opts.regexTokens = []; + + // The tokenizer regex does most of the tokenization grunt work + while (match = opts.tokenizer.exec(opts.regex)) { + m = match[0]; + switch (m.charAt(0)) { + case "[": // Character class + case "\\": // Escape or backreference + if (opengroups.length > 0) { + opengroups[opengroups.length - 1]["matches"].push(m); + } else { + currentToken.matches.push(m); + } + break; + case "(": // Group opening + if (!currentToken.isGroup && currentToken.matches.length > 0) + opts.regexTokens.push(currentToken); + currentToken = new regexToken(); + currentToken.isGroup = true; + opengroups.push(currentToken); + break; + case ")": // Group closing + var groupToken = opengroups.pop(); + if (opengroups.length > 0) { + opengroups[opengroups.length - 1]["matches"].push(groupToken); + } else { + opts.regexTokens.push(groupToken); + currentToken = new regexToken(); + } + break; + case "{": //Quantifier + var quantifier = new regexToken(); + quantifier.isQuantifier = true; + quantifier.matches.push(m); + if (opengroups.length > 0) { + opengroups[opengroups.length - 1]["matches"].push(quantifier); + } else { + currentToken.matches.push(quantifier); + } + break; + default: + // Vertical bar (alternator) + // ^ or $ anchor + // Dot (.) + // Literal character sequence + var literal = new regexToken(); + literal.isLiteral = true; + literal.matches.push(m); + if (opengroups.length > 0) { + opengroups[opengroups.length - 1]["matches"].push(literal); + } else { + currentToken.matches.push(literal); + } + } + } + + if (currentToken.matches.length > 0) + opts.regexTokens.push(currentToken); + }; + + function validateRegexToken(token, fromGroup) { + var isvalid = false; + if (fromGroup) { + regexPart += "("; + openGroupCount++; + } + for (var mndx = 0; mndx < token["matches"].length; mndx++) { + var matchToken = token["matches"][mndx]; + if (matchToken["isGroup"] == true) { + isvalid = validateRegexToken(matchToken, true); + } else if (matchToken["isQuantifier"] == true) { + matchToken = matchToken["matches"][0]; + var quantifierMax = opts.quantifierFilter.exec(matchToken)[0].replace("}", ""); + var testExp = regexPart + "{1," + quantifierMax + "}"; //relax quantifier validation + for (var j = 0; j < openGroupCount; j++) { + testExp += ")"; + } + var exp = new RegExp("^(" + testExp + ")$"); + isvalid = exp.test(bufferStr); + regexPart += matchToken; + } else if (matchToken["isLiteral"] == true) { + matchToken = matchToken["matches"][0]; + var testExp = regexPart, openGroupCloser = ""; + for (var j = 0; j < openGroupCount; j++) { + openGroupCloser += ")"; + } + for (var k = 0; k < matchToken.length; k++) { //relax literal validation + testExp = (testExp + matchToken[k]).replace(/\|$/, ""); + var exp = new RegExp("^(" + testExp + openGroupCloser + ")$"); + isvalid = exp.test(bufferStr); + if (isvalid) break; + } + regexPart += matchToken; + //console.log(bufferStr + " " + exp + " " + isvalid); + } else { + regexPart += matchToken; + var testExp = regexPart.replace(/\|$/, ""); + for (var j = 0; j < openGroupCount; j++) { + testExp += ")"; + } + var exp = new RegExp("^(" + testExp + ")$"); + isvalid = exp.test(bufferStr); + //console.log(bufferStr + " " + exp + " " + isvalid); + } + if (isvalid) break; + } + + if (fromGroup) { + regexPart += ")"; + openGroupCount--; + } + + return isvalid; + } + + + if (opts.regexTokens == null) { + analyseRegex(); + } + + var cbuffer = buffer.slice(), regexPart = "", isValid = false, openGroupCount = 0; + cbuffer.splice(pos, 0, chrs); + var bufferStr = cbuffer.join(''); + for (var i = 0; i < opts.regexTokens.length; i++) { + var regexToken = opts.regexTokens[i]; + isValid = validateRegexToken(regexToken, regexToken["isGroup"]); + if (isValid) break; + } + + return isValid; + }, + cardinality: 1 + } + } + } + }); +})(jQuery); diff --git a/public/assets/js/plugins/input-mask/phone-codes/phone-be.json b/public/assets/js/plugins/input-mask/phone-codes/phone-be.json new file mode 100755 index 00000000..b510b784 --- /dev/null +++ b/public/assets/js/plugins/input-mask/phone-codes/phone-be.json @@ -0,0 +1,45 @@ +[ + { "mask": "+32(53)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Aalst (Alost)" }, + { "mask": "+32(3)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Antwerpen (Anvers)" }, + { "mask": "+32(63)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Arlon" }, + { "mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ath" }, + { "mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Brugge (Bruges)" }, + { "mask": "+32(2)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Brussel/Bruxelles (Brussels)" }, + { "mask": "+32(71)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Charleroi" }, + { "mask": "+32(60)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Chimay" }, + { "mask": "+32(83)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ciney" }, + { "mask": "+32(52)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Dendermonde" }, + { "mask": "+32(13)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Diest" }, + { "mask": "+32(82)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Dinant" }, + { "mask": "+32(86)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Durbuy" }, + { "mask": "+32(89)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Genk" }, + { "mask": "+32(9)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Gent (Gand)" }, + { "mask": "+32(11)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Hasselt" }, + { "mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Herentals" }, + { "mask": "+32(85)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Huy (Hoei)" }, + { "mask": "+32(64)##-##-##", "cc": "BE", "cd": "Belgium", "city": "La Louvière" }, + { "mask": "+32(16)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Leuven (Louvain)" }, + { "mask": "+32(61)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Libramont" }, + { "mask": "+32(4)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Liège (Luik)" }, + { "mask": "+32(15)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mechelen (Malines)" }, + { "mask": "+32(47#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" }, + { "mask": "+32(48#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" }, + { "mask": "+32(49#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" }, + { "mask": "+32(65)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mons (Bergen)" }, + { "mask": "+32(81)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Namur (Namen)" }, + { "mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nieuwpoort (Nieuport)" }, + { "mask": "+32(54)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ninove" }, + { "mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nivelles (Nijvel)" }, + { "mask": "+32(59)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Oostende (Ostende)" }, + { "mask": "+32(51)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Roeselare (Roulers)" }, + { "mask": "+32(55)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ronse" }, + { "mask": "+32(80)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Stavelot" }, + { "mask": "+32(12)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tongeren (Tongres)" }, + { "mask": "+32(69)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tounai" }, + { "mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Turnhout" }, + { "mask": "+32(87)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Verviers" }, + { "mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Veurne" }, + { "mask": "+32(19)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wareme" }, + { "mask": "+32(10)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wavre (Waver)" }, + { "mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Zeebrugge" } +] \ No newline at end of file diff --git a/public/assets/js/plugins/input-mask/phone-codes/phone-codes.json b/public/assets/js/plugins/input-mask/phone-codes/phone-codes.json new file mode 100755 index 00000000..15bbd3a9 --- /dev/null +++ b/public/assets/js/plugins/input-mask/phone-codes/phone-codes.json @@ -0,0 +1,294 @@ +[ + { "mask": "+247-####", "cc": "AC", "name_en": "Ascension", "desc_en": "", "name_ru": "Остров Вознесения", "desc_ru": "" }, + { "mask": "+376-###-###", "cc": "AD", "name_en": "Andorra", "desc_en": "", "name_ru": "Андорра", "desc_ru": "" }, + { "mask": "+971-5#-###-####", "cc": "AE", "name_en": "United Arab Emirates", "desc_en": "mobile", "name_ru": "Объединенные Арабские Эмираты", "desc_ru": "мобильные" }, + { "mask": "+971-#-###-####", "cc": "AE", "name_en": "United Arab Emirates", "desc_en": "", "name_ru": "Объединенные Арабские Эмираты", "desc_ru": "" }, + { "mask": "+93-##-###-####", "cc": "AF", "name_en": "Afghanistan", "desc_en": "", "name_ru": "Афганистан", "desc_ru": "" }, + { "mask": "+1(268)###-####", "cc": "AG", "name_en": "Antigua & Barbuda", "desc_en": "", "name_ru": "Антигуа и Барбуда", "desc_ru": "" }, + { "mask": "+1(264)###-####", "cc": "AI", "name_en": "Anguilla", "desc_en": "", "name_ru": "Ангилья", "desc_ru": "" }, + { "mask": "+355(###)###-###", "cc": "AL", "name_en": "Albania", "desc_en": "", "name_ru": "Албания", "desc_ru": "" }, + { "mask": "+374-##-###-###", "cc": "AM", "name_en": "Armenia", "desc_en": "", "name_ru": "Армения", "desc_ru": "" }, + { "mask": "+599-###-####", "cc": "AN", "name_en": "Caribbean Netherlands", "desc_en": "", "name_ru": "Карибские Нидерланды", "desc_ru": "" }, + { "mask": "+599-###-####", "cc": "AN", "name_en": "Netherlands Antilles", "desc_en": "", "name_ru": "Нидерландские Антильские острова", "desc_ru": "" }, + { "mask": "+599-9###-####", "cc": "AN", "name_en": "Netherlands Antilles", "desc_en": "Curacao", "name_ru": "Нидерландские Антильские острова", "desc_ru": "Кюрасао" }, + { "mask": "+244(###)###-###", "cc": "AO", "name_en": "Angola", "desc_en": "", "name_ru": "Ангола", "desc_ru": "" }, + { "mask": "+672-1##-###", "cc": "AQ", "name_en": "Australian bases in Antarctica", "desc_en": "", "name_ru": "Австралийская антарктическая база", "desc_ru": "" }, + { "mask": "+54(###)###-####", "cc": "AR", "name_en": "Argentina", "desc_en": "", "name_ru": "Аргентина", "desc_ru": "" }, + { "mask": "+1(684)###-####", "cc": "AS", "name_en": "American Samoa", "desc_en": "", "name_ru": "Американское Самоа", "desc_ru": "" }, + { "mask": "+43(###)###-####", "cc": "AT", "name_en": "Austria", "desc_en": "", "name_ru": "Австрия", "desc_ru": "" }, + { "mask": "+61-#-####-####", "cc": "AU", "name_en": "Australia", "desc_en": "", "name_ru": "Австралия", "desc_ru": "" }, + { "mask": "+297-###-####", "cc": "AW", "name_en": "Aruba", "desc_en": "", "name_ru": "Аруба", "desc_ru": "" }, + { "mask": "+994-##-###-##-##", "cc": "AZ", "name_en": "Azerbaijan", "desc_en": "", "name_ru": "Азербайджан", "desc_ru": "" }, + { "mask": "+387-##-#####", "cc": "BA", "name_en": "Bosnia and Herzegovina", "desc_en": "", "name_ru": "Босния и Герцеговина", "desc_ru": "" }, + { "mask": "+387-##-####", "cc": "BA", "name_en": "Bosnia and Herzegovina", "desc_en": "", "name_ru": "Босния и Герцеговина", "desc_ru": "" }, + { "mask": "+1(246)###-####", "cc": "BB", "name_en": "Barbados", "desc_en": "", "name_ru": "Барбадос", "desc_ru": "" }, + { "mask": "+880-##-###-###", "cc": "BD", "name_en": "Bangladesh", "desc_en": "", "name_ru": "Бангладеш", "desc_ru": "" }, + { "mask": "+32(###)###-###", "cc": "BE", "name_en": "Belgium", "desc_en": "", "name_ru": "Бельгия", "desc_ru": "" }, + { "mask": "+226-##-##-####", "cc": "BF", "name_en": "Burkina Faso", "desc_en": "", "name_ru": "Буркина Фасо", "desc_ru": "" }, + { "mask": "+359(###)###-###", "cc": "BG", "name_en": "Bulgaria", "desc_en": "", "name_ru": "Болгария", "desc_ru": "" }, + { "mask": "+973-####-####", "cc": "BH", "name_en": "Bahrain", "desc_en": "", "name_ru": "Бахрейн", "desc_ru": "" }, + { "mask": "+257-##-##-####", "cc": "BI", "name_en": "Burundi", "desc_en": "", "name_ru": "Бурунди", "desc_ru": "" }, + { "mask": "+229-##-##-####", "cc": "BJ", "name_en": "Benin", "desc_en": "", "name_ru": "Бенин", "desc_ru": "" }, + { "mask": "+1(441)###-####", "cc": "BM", "name_en": "Bermuda", "desc_en": "", "name_ru": "Бермудские острова", "desc_ru": "" }, + { "mask": "+673-###-####", "cc": "BN", "name_en": "Brunei Darussalam", "desc_en": "", "name_ru": "Бруней-Даруссалам", "desc_ru": "" }, + { "mask": "+591-#-###-####", "cc": "BO", "name_en": "Bolivia", "desc_en": "", "name_ru": "Боливия", "desc_ru": "" }, + { "mask": "+55-##-####[#]-####", "cc": "BR", "name_en": "Brazil", "desc_en": "", "name_ru": "Бразилия", "desc_ru": "" }, + { "mask": "+1(242)###-####", "cc": "BS", "name_en": "Bahamas", "desc_en": "", "name_ru": "Багамские Острова", "desc_ru": "" }, + { "mask": "+975-17-###-###", "cc": "BT", "name_en": "Bhutan", "desc_en": "", "name_ru": "Бутан", "desc_ru": "" }, + { "mask": "+975-#-###-###", "cc": "BT", "name_en": "Bhutan", "desc_en": "", "name_ru": "Бутан", "desc_ru": "" }, + { "mask": "+267-##-###-###", "cc": "BW", "name_en": "Botswana", "desc_en": "", "name_ru": "Ботсвана", "desc_ru": "" }, + { "mask": "+375(##)###-##-##", "cc": "BY", "name_en": "Belarus", "desc_en": "", "name_ru": "Беларусь (Белоруссия)", "desc_ru": "" }, + { "mask": "+501-###-####", "cc": "BZ", "name_en": "Belize", "desc_en": "", "name_ru": "Белиз", "desc_ru": "" }, + { "mask": "+243(###)###-###", "cc": "CD", "name_en": "Dem. Rep. Congo", "desc_en": "", "name_ru": "Дем. Респ. Конго (Киншаса)", "desc_ru": "" }, + { "mask": "+236-##-##-####", "cc": "CF", "name_en": "Central African Republic", "desc_en": "", "name_ru": "Центральноафриканская Республика", "desc_ru": "" }, + { "mask": "+242-##-###-####", "cc": "CG", "name_en": "Congo (Brazzaville)", "desc_en": "", "name_ru": "Конго (Браззавиль)", "desc_ru": "" }, + { "mask": "+41-##-###-####", "cc": "CH", "name_en": "Switzerland", "desc_en": "", "name_ru": "Швейцария", "desc_ru": "" }, + { "mask": "+225-##-###-###", "cc": "CI", "name_en": "Cote d’Ivoire (Ivory Coast)", "desc_en": "", "name_ru": "Кот-д’Ивуар", "desc_ru": "" }, + { "mask": "+682-##-###", "cc": "CK", "name_en": "Cook Islands", "desc_en": "", "name_ru": "Острова Кука", "desc_ru": "" }, + { "mask": "+56-#-####-####", "cc": "CL", "name_en": "Chile", "desc_en": "", "name_ru": "Чили", "desc_ru": "" }, + { "mask": "+237-####-####", "cc": "CM", "name_en": "Cameroon", "desc_en": "", "name_ru": "Камерун", "desc_ru": "" }, + { "mask": "+86(###)####-####", "cc": "CN", "name_en": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" }, + { "mask": "+86(###)####-###", "cc": "CN", "name_en": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" }, + { "mask": "+86-##-#####-#####", "cc": "CN", "name_en": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" }, + { "mask": "+57(###)###-####", "cc": "CO", "name_en": "Colombia", "desc_en": "", "name_ru": "Колумбия", "desc_ru": "" }, + { "mask": "+506-####-####", "cc": "CR", "name_en": "Costa Rica", "desc_en": "", "name_ru": "Коста-Рика", "desc_ru": "" }, + { "mask": "+53-#-###-####", "cc": "CU", "name_en": "Cuba", "desc_en": "", "name_ru": "Куба", "desc_ru": "" }, + { "mask": "+238(###)##-##", "cc": "CV", "name_en": "Cape Verde", "desc_en": "", "name_ru": "Кабо-Верде", "desc_ru": "" }, + { "mask": "+599-###-####", "cc": "CW", "name_en": "Curacao", "desc_en": "", "name_ru": "Кюрасао", "desc_ru": "" }, + { "mask": "+357-##-###-###", "cc": "CY", "name_en": "Cyprus", "desc_en": "", "name_ru": "Кипр", "desc_ru": "" }, + { "mask": "+420(###)###-###", "cc": "CZ", "name_en": "Czech Republic", "desc_en": "", "name_ru": "Чехия", "desc_ru": "" }, + { "mask": "+49(####)###-####", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" }, + { "mask": "+49(###)###-####", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" }, + { "mask": "+49(###)##-####", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" }, + { "mask": "+49(###)##-###", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" }, + { "mask": "+49(###)##-##", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" }, + { "mask": "+49-###-###", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" }, + { "mask": "+253-##-##-##-##", "cc": "DJ", "name_en": "Djibouti", "desc_en": "", "name_ru": "Джибути", "desc_ru": "" }, + { "mask": "+45-##-##-##-##", "cc": "DK", "name_en": "Denmark", "desc_en": "", "name_ru": "Дания", "desc_ru": "" }, + { "mask": "+1(767)###-####", "cc": "DM", "name_en": "Dominica", "desc_en": "", "name_ru": "Доминика", "desc_ru": "" }, + { "mask": "+1(809)###-####", "cc": "DO", "name_en": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" }, + { "mask": "+1(829)###-####", "cc": "DO", "name_en": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" }, + { "mask": "+1(849)###-####", "cc": "DO", "name_en": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" }, + { "mask": "+213-##-###-####", "cc": "DZ", "name_en": "Algeria", "desc_en": "", "name_ru": "Алжир", "desc_ru": "" }, + { "mask": "+593-##-###-####", "cc": "EC", "name_en": "Ecuador ", "desc_en": "mobile", "name_ru": "Эквадор ", "desc_ru": "мобильные" }, + { "mask": "+593-#-###-####", "cc": "EC", "name_en": "Ecuador", "desc_en": "", "name_ru": "Эквадор", "desc_ru": "" }, + { "mask": "+372-####-####", "cc": "EE", "name_en": "Estonia ", "desc_en": "mobile", "name_ru": "Эстония ", "desc_ru": "мобильные" }, + { "mask": "+372-###-####", "cc": "EE", "name_en": "Estonia", "desc_en": "", "name_ru": "Эстония", "desc_ru": "" }, + { "mask": "+20(###)###-####", "cc": "EG", "name_en": "Egypt", "desc_en": "", "name_ru": "Египет", "desc_ru": "" }, + { "mask": "+291-#-###-###", "cc": "ER", "name_en": "Eritrea", "desc_en": "", "name_ru": "Эритрея", "desc_ru": "" }, + { "mask": "+34(###)###-###", "cc": "ES", "name_en": "Spain", "desc_en": "", "name_ru": "Испания", "desc_ru": "" }, + { "mask": "+251-##-###-####", "cc": "ET", "name_en": "Ethiopia", "desc_en": "", "name_ru": "Эфиопия", "desc_ru": "" }, + { "mask": "+358(###)###-##-##", "cc": "FI", "name_en": "Finland", "desc_en": "", "name_ru": "Финляндия", "desc_ru": "" }, + { "mask": "+679-##-#####", "cc": "FJ", "name_en": "Fiji", "desc_en": "", "name_ru": "Фиджи", "desc_ru": "" }, + { "mask": "+500-#####", "cc": "FK", "name_en": "Falkland Islands", "desc_en": "", "name_ru": "Фолклендские острова", "desc_ru": "" }, + { "mask": "+691-###-####", "cc": "FM", "name_en": "F.S. Micronesia", "desc_en": "", "name_ru": "Ф.Ш. Микронезии", "desc_ru": "" }, + { "mask": "+298-###-###", "cc": "FO", "name_en": "Faroe Islands", "desc_en": "", "name_ru": "Фарерские острова", "desc_ru": "" }, + { "mask": "+262-#####-####", "cc": "FR", "name_en": "Mayotte", "desc_en": "", "name_ru": "Майотта", "desc_ru": "" }, + { "mask": "+33(###)###-###", "cc": "FR", "name_en": "France", "desc_en": "", "name_ru": "Франция", "desc_ru": "" }, + { "mask": "+508-##-####", "cc": "FR", "name_en": "St Pierre & Miquelon", "desc_en": "", "name_ru": "Сен-Пьер и Микелон", "desc_ru": "" }, + { "mask": "+590(###)###-###", "cc": "FR", "name_en": "Guadeloupe", "desc_en": "", "name_ru": "Гваделупа", "desc_ru": "" }, + { "mask": "+241-#-##-##-##", "cc": "GA", "name_en": "Gabon", "desc_en": "", "name_ru": "Габон", "desc_ru": "" }, + { "mask": "+1(473)###-####", "cc": "GD", "name_en": "Grenada", "desc_en": "", "name_ru": "Гренада", "desc_ru": "" }, + { "mask": "+995(###)###-###", "cc": "GE", "name_en": "Rep. of Georgia", "desc_en": "", "name_ru": "Грузия", "desc_ru": "" }, + { "mask": "+594-#####-####", "cc": "GF", "name_en": "Guiana (French)", "desc_en": "", "name_ru": "Фр. Гвиана", "desc_ru": "" }, + { "mask": "+233(###)###-###", "cc": "GH", "name_en": "Ghana", "desc_en": "", "name_ru": "Гана", "desc_ru": "" }, + { "mask": "+350-###-#####", "cc": "GI", "name_en": "Gibraltar", "desc_en": "", "name_ru": "Гибралтар", "desc_ru": "" }, + { "mask": "+299-##-##-##", "cc": "GL", "name_en": "Greenland", "desc_en": "", "name_ru": "Гренландия", "desc_ru": "" }, + { "mask": "+220(###)##-##", "cc": "GM", "name_en": "Gambia", "desc_en": "", "name_ru": "Гамбия", "desc_ru": "" }, + { "mask": "+224-##-###-###", "cc": "GN", "name_en": "Guinea", "desc_en": "", "name_ru": "Гвинея", "desc_ru": "" }, + { "mask": "+240-##-###-####", "cc": "GQ", "name_en": "Equatorial Guinea", "desc_en": "", "name_ru": "Экваториальная Гвинея", "desc_ru": "" }, + { "mask": "+30(###)###-####", "cc": "GR", "name_en": "Greece", "desc_en": "", "name_ru": "Греция", "desc_ru": "" }, + { "mask": "+502-#-###-####", "cc": "GT", "name_en": "Guatemala", "desc_en": "", "name_ru": "Гватемала", "desc_ru": "" }, + { "mask": "+1(671)###-####", "cc": "GU", "name_en": "Guam", "desc_en": "", "name_ru": "Гуам", "desc_ru": "" }, + { "mask": "+245-#-######", "cc": "GW", "name_en": "Guinea-Bissau", "desc_en": "", "name_ru": "Гвинея-Бисау", "desc_ru": "" }, + { "mask": "+592-###-####", "cc": "GY", "name_en": "Guyana", "desc_en": "", "name_ru": "Гайана", "desc_ru": "" }, + { "mask": "+852-####-####", "cc": "HK", "name_en": "Hong Kong", "desc_en": "", "name_ru": "Гонконг", "desc_ru": "" }, + { "mask": "+504-####-####", "cc": "HN", "name_en": "Honduras", "desc_en": "", "name_ru": "Гондурас", "desc_ru": "" }, + { "mask": "+385-##-###-###", "cc": "HR", "name_en": "Croatia", "desc_en": "", "name_ru": "Хорватия", "desc_ru": "" }, + { "mask": "+509-##-##-####", "cc": "HT", "name_en": "Haiti", "desc_en": "", "name_ru": "Гаити", "desc_ru": "" }, + { "mask": "+36(###)###-###", "cc": "HU", "name_en": "Hungary", "desc_en": "", "name_ru": "Венгрия", "desc_ru": "" }, + { "mask": "+62(8##)###-####", "cc": "ID", "name_en": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" }, + { "mask": "+62-##-###-##", "cc": "ID", "name_en": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" }, + { "mask": "+62-##-###-###", "cc": "ID", "name_en": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" }, + { "mask": "+62-##-###-####", "cc": "ID", "name_en": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" }, + { "mask": "+62(8##)###-###", "cc": "ID", "name_en": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" }, + { "mask": "+62(8##)###-##-###", "cc": "ID", "name_en": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" }, + { "mask": "+353(###)###-###", "cc": "IE", "name_en": "Ireland", "desc_en": "", "name_ru": "Ирландия", "desc_ru": "" }, + { "mask": "+972-5#-###-####", "cc": "IL", "name_en": "Israel ", "desc_en": "mobile", "name_ru": "Израиль ", "desc_ru": "мобильные" }, + { "mask": "+972-#-###-####", "cc": "IL", "name_en": "Israel", "desc_en": "", "name_ru": "Израиль", "desc_ru": "" }, + { "mask": "+91(####)###-###", "cc": "IN", "name_en": "India", "desc_en": "", "name_ru": "Индия", "desc_ru": "" }, + { "mask": "+246-###-####", "cc": "IO", "name_en": "Diego Garcia", "desc_en": "", "name_ru": "Диего-Гарсия", "desc_ru": "" }, + { "mask": "+964(###)###-####", "cc": "IQ", "name_en": "Iraq", "desc_en": "", "name_ru": "Ирак", "desc_ru": "" }, + { "mask": "+98(###)###-####", "cc": "IR", "name_en": "Iran", "desc_en": "", "name_ru": "Иран", "desc_ru": "" }, + { "mask": "+354-###-####", "cc": "IS", "name_en": "Iceland", "desc_en": "", "name_ru": "Исландия", "desc_ru": "" }, + { "mask": "+39(###)####-###", "cc": "IT", "name_en": "Italy", "desc_en": "", "name_ru": "Италия", "desc_ru": "" }, + { "mask": "+1(876)###-####", "cc": "JM", "name_en": "Jamaica", "desc_en": "", "name_ru": "Ямайка", "desc_ru": "" }, + { "mask": "+962-#-####-####", "cc": "JO", "name_en": "Jordan", "desc_en": "", "name_ru": "Иордания", "desc_ru": "" }, + { "mask": "+81-##-####-####", "cc": "JP", "name_en": "Japan ", "desc_en": "mobile", "name_ru": "Япония ", "desc_ru": "мобильные" }, + { "mask": "+81(###)###-###", "cc": "JP", "name_en": "Japan", "desc_en": "", "name_ru": "Япония", "desc_ru": "" }, + { "mask": "+254-###-######", "cc": "KE", "name_en": "Kenya", "desc_en": "", "name_ru": "Кения", "desc_ru": "" }, + { "mask": "+996(###)###-###", "cc": "KG", "name_en": "Kyrgyzstan", "desc_en": "", "name_ru": "Киргизия", "desc_ru": "" }, + { "mask": "+855-##-###-###", "cc": "KH", "name_en": "Cambodia", "desc_en": "", "name_ru": "Камбоджа", "desc_ru": "" }, + { "mask": "+686-##-###", "cc": "KI", "name_en": "Kiribati", "desc_en": "", "name_ru": "Кирибати", "desc_ru": "" }, + { "mask": "+269-##-#####", "cc": "KM", "name_en": "Comoros", "desc_en": "", "name_ru": "Коморы", "desc_ru": "" }, + { "mask": "+1(869)###-####", "cc": "KN", "name_en": "Saint Kitts & Nevis", "desc_en": "", "name_ru": "Сент-Китс и Невис", "desc_ru": "" }, + { "mask": "+850-191-###-####", "cc": "KP", "name_en": "DPR Korea (North) ", "desc_en": "mobile", "name_ru": "Корейская НДР ", "desc_ru": "мобильные" }, + { "mask": "+850-##-###-###", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" }, + { "mask": "+850-###-####-###", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" }, + { "mask": "+850-###-###", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" }, + { "mask": "+850-####-####", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" }, + { "mask": "+850-####-#############", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" }, + { "mask": "+82-##-###-####", "cc": "KR", "name_en": "Korea (South)", "desc_en": "", "name_ru": "Респ. Корея", "desc_ru": "" }, + { "mask": "+965-####-####", "cc": "KW", "name_en": "Kuwait", "desc_en": "", "name_ru": "Кувейт", "desc_ru": "" }, + { "mask": "+1(345)###-####", "cc": "KY", "name_en": "Cayman Islands", "desc_en": "", "name_ru": "Каймановы острова", "desc_ru": "" }, + { "mask": "+7(6##)###-##-##", "cc": "KZ", "name_en": "Kazakhstan", "desc_en": "", "name_ru": "Казахстан", "desc_ru": "" }, + { "mask": "+7(7##)###-##-##", "cc": "KZ", "name_en": "Kazakhstan", "desc_en": "", "name_ru": "Казахстан", "desc_ru": "" }, + { "mask": "+856(20##)###-###", "cc": "LA", "name_en": "Laos ", "desc_en": "mobile", "name_ru": "Лаос ", "desc_ru": "мобильные" }, + { "mask": "+856-##-###-###", "cc": "LA", "name_en": "Laos", "desc_en": "", "name_ru": "Лаос", "desc_ru": "" }, + { "mask": "+961-##-###-###", "cc": "LB", "name_en": "Lebanon ", "desc_en": "mobile", "name_ru": "Ливан ", "desc_ru": "мобильные" }, + { "mask": "+961-#-###-###", "cc": "LB", "name_en": "Lebanon", "desc_en": "", "name_ru": "Ливан", "desc_ru": "" }, + { "mask": "+1(758)###-####", "cc": "LC", "name_en": "Saint Lucia", "desc_en": "", "name_ru": "Сент-Люсия", "desc_ru": "" }, + { "mask": "+423(###)###-####", "cc": "LI", "name_en": "Liechtenstein", "desc_en": "", "name_ru": "Лихтенштейн", "desc_ru": "" }, + { "mask": "+94-##-###-####", "cc": "LK", "name_en": "Sri Lanka", "desc_en": "", "name_ru": "Шри-Ланка", "desc_ru": "" }, + { "mask": "+231-##-###-###", "cc": "LR", "name_en": "Liberia", "desc_en": "", "name_ru": "Либерия", "desc_ru": "" }, + { "mask": "+266-#-###-####", "cc": "LS", "name_en": "Lesotho", "desc_en": "", "name_ru": "Лесото", "desc_ru": "" }, + { "mask": "+370(###)##-###", "cc": "LT", "name_en": "Lithuania", "desc_en": "", "name_ru": "Литва", "desc_ru": "" }, + { "mask": "+352(###)###-###", "cc": "LU", "name_en": "Luxembourg", "desc_en": "", "name_ru": "Люксембург", "desc_ru": "" }, + { "mask": "+371-##-###-###", "cc": "LV", "name_en": "Latvia", "desc_en": "", "name_ru": "Латвия", "desc_ru": "" }, + { "mask": "+218-##-###-###", "cc": "LY", "name_en": "Libya", "desc_en": "", "name_ru": "Ливия", "desc_ru": "" }, + { "mask": "+218-21-###-####", "cc": "LY", "name_en": "Libya", "desc_en": "Tripoli", "name_ru": "Ливия", "desc_ru": "Триполи" }, + { "mask": "+212-##-####-###", "cc": "MA", "name_en": "Morocco", "desc_en": "", "name_ru": "Марокко", "desc_ru": "" }, + { "mask": "+377(###)###-###", "cc": "MC", "name_en": "Monaco", "desc_en": "", "name_ru": "Монако", "desc_ru": "" }, + { "mask": "+377-##-###-###", "cc": "MC", "name_en": "Monaco", "desc_en": "", "name_ru": "Монако", "desc_ru": "" }, + { "mask": "+373-####-####", "cc": "MD", "name_en": "Moldova", "desc_en": "", "name_ru": "Молдова", "desc_ru": "" }, + { "mask": "+382-##-###-###", "cc": "ME", "name_en": "Montenegro", "desc_en": "", "name_ru": "Черногория", "desc_ru": "" }, + { "mask": "+261-##-##-#####", "cc": "MG", "name_en": "Madagascar", "desc_en": "", "name_ru": "Мадагаскар", "desc_ru": "" }, + { "mask": "+692-###-####", "cc": "MH", "name_en": "Marshall Islands", "desc_en": "", "name_ru": "Маршалловы Острова", "desc_ru": "" }, + { "mask": "+389-##-###-###", "cc": "MK", "name_en": "Republic of Macedonia", "desc_en": "", "name_ru": "Респ. Македония", "desc_ru": "" }, + { "mask": "+223-##-##-####", "cc": "ML", "name_en": "Mali", "desc_en": "", "name_ru": "Мали", "desc_ru": "" }, + { "mask": "+95-##-###-###", "cc": "MM", "name_en": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" }, + { "mask": "+95-#-###-###", "cc": "MM", "name_en": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" }, + { "mask": "+95-###-###", "cc": "MM", "name_en": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" }, + { "mask": "+976-##-##-####", "cc": "MN", "name_en": "Mongolia", "desc_en": "", "name_ru": "Монголия", "desc_ru": "" }, + { "mask": "+853-####-####", "cc": "MO", "name_en": "Macau", "desc_en": "", "name_ru": "Макао", "desc_ru": "" }, + { "mask": "+1(670)###-####", "cc": "MP", "name_en": "Northern Mariana Islands", "desc_en": "", "name_ru": "Северные Марианские острова Сайпан", "desc_ru": "" }, + { "mask": "+596(###)##-##-##", "cc": "MQ", "name_en": "Martinique", "desc_en": "", "name_ru": "Мартиника", "desc_ru": "" }, + { "mask": "+222-##-##-####", "cc": "MR", "name_en": "Mauritania", "desc_en": "", "name_ru": "Мавритания", "desc_ru": "" }, + { "mask": "+1(664)###-####", "cc": "MS", "name_en": "Montserrat", "desc_en": "", "name_ru": "Монтсеррат", "desc_ru": "" }, + { "mask": "+356-####-####", "cc": "MT", "name_en": "Malta", "desc_en": "", "name_ru": "Мальта", "desc_ru": "" }, + { "mask": "+230-###-####", "cc": "MU", "name_en": "Mauritius", "desc_en": "", "name_ru": "Маврикий", "desc_ru": "" }, + { "mask": "+960-###-####", "cc": "MV", "name_en": "Maldives", "desc_en": "", "name_ru": "Мальдивские острова", "desc_ru": "" }, + { "mask": "+265-1-###-###", "cc": "MW", "name_en": "Malawi", "desc_en": "Telecom Ltd", "name_ru": "Малави", "desc_ru": "Telecom Ltd" }, + { "mask": "+265-#-####-####", "cc": "MW", "name_en": "Malawi", "desc_en": "", "name_ru": "Малави", "desc_ru": "" }, + { "mask": "+52(###)###-####", "cc": "MX", "name_en": "Mexico", "desc_en": "", "name_ru": "Мексика", "desc_ru": "" }, + { "mask": "+52-##-##-####", "cc": "MX", "name_en": "Mexico", "desc_en": "", "name_ru": "Мексика", "desc_ru": "" }, + { "mask": "+60-##-###-####", "cc": "MY", "name_en": "Malaysia ", "desc_en": "mobile", "name_ru": "Малайзия ", "desc_ru": "мобильные" }, + { "mask": "+60(###)###-###", "cc": "MY", "name_en": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" }, + { "mask": "+60-##-###-###", "cc": "MY", "name_en": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" }, + { "mask": "+60-#-###-###", "cc": "MY", "name_en": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" }, + { "mask": "+258-##-###-###", "cc": "MZ", "name_en": "Mozambique", "desc_en": "", "name_ru": "Мозамбик", "desc_ru": "" }, + { "mask": "+264-##-###-####", "cc": "NA", "name_en": "Namibia", "desc_en": "", "name_ru": "Намибия", "desc_ru": "" }, + { "mask": "+687-##-####", "cc": "NC", "name_en": "New Caledonia", "desc_en": "", "name_ru": "Новая Каледония", "desc_ru": "" }, + { "mask": "+227-##-##-####", "cc": "NE", "name_en": "Niger", "desc_en": "", "name_ru": "Нигер", "desc_ru": "" }, + { "mask": "+672-3##-###", "cc": "NF", "name_en": "Norfolk Island", "desc_en": "", "name_ru": "Норфолк (остров)", "desc_ru": "" }, + { "mask": "+234(###)###-####", "cc": "NG", "name_en": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" }, + { "mask": "+234-##-###-###", "cc": "NG", "name_en": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" }, + { "mask": "+234-##-###-##", "cc": "NG", "name_en": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" }, + { "mask": "+234(###)###-####", "cc": "NG", "name_en": "Nigeria ", "desc_en": "mobile", "name_ru": "Нигерия ", "desc_ru": "мобильные" }, + { "mask": "+505-####-####", "cc": "NI", "name_en": "Nicaragua", "desc_en": "", "name_ru": "Никарагуа", "desc_ru": "" }, + { "mask": "+31-##-###-####", "cc": "NL", "name_en": "Netherlands", "desc_en": "", "name_ru": "Нидерланды", "desc_ru": "" }, + { "mask": "+47(###)##-###", "cc": "NO", "name_en": "Norway", "desc_en": "", "name_ru": "Норвегия", "desc_ru": "" }, + { "mask": "+977-##-###-###", "cc": "NP", "name_en": "Nepal", "desc_en": "", "name_ru": "Непал", "desc_ru": "" }, + { "mask": "+674-###-####", "cc": "NR", "name_en": "Nauru", "desc_en": "", "name_ru": "Науру", "desc_ru": "" }, + { "mask": "+683-####", "cc": "NU", "name_en": "Niue", "desc_en": "", "name_ru": "Ниуэ", "desc_ru": "" }, + { "mask": "+64(###)###-###", "cc": "NZ", "name_en": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" }, + { "mask": "+64-##-###-###", "cc": "NZ", "name_en": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" }, + { "mask": "+64(###)###-####", "cc": "NZ", "name_en": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" }, + { "mask": "+968-##-###-###", "cc": "OM", "name_en": "Oman", "desc_en": "", "name_ru": "Оман", "desc_ru": "" }, + { "mask": "+507-###-####", "cc": "PA", "name_en": "Panama", "desc_en": "", "name_ru": "Панама", "desc_ru": "" }, + { "mask": "+51(###)###-###", "cc": "PE", "name_en": "Peru", "desc_en": "", "name_ru": "Перу", "desc_ru": "" }, + { "mask": "+689-##-##-##", "cc": "PF", "name_en": "French Polynesia", "desc_en": "", "name_ru": "Французская Полинезия (Таити)", "desc_ru": "" }, + { "mask": "+675(###)##-###", "cc": "PG", "name_en": "Papua New Guinea", "desc_en": "", "name_ru": "Папуа-Новая Гвинея", "desc_ru": "" }, + { "mask": "+63(###)###-####", "cc": "PH", "name_en": "Philippines", "desc_en": "", "name_ru": "Филиппины", "desc_ru": "" }, + { "mask": "+92(###)###-####", "cc": "PK", "name_en": "Pakistan", "desc_en": "", "name_ru": "Пакистан", "desc_ru": "" }, + { "mask": "+48(###)###-###", "cc": "PL", "name_en": "Poland", "desc_en": "", "name_ru": "Польша", "desc_ru": "" }, + { "mask": "+970-##-###-####", "cc": "PS", "name_en": "Palestine", "desc_en": "", "name_ru": "Палестина", "desc_ru": "" }, + { "mask": "+351-##-###-####", "cc": "PT", "name_en": "Portugal", "desc_en": "", "name_ru": "Португалия", "desc_ru": "" }, + { "mask": "+680-###-####", "cc": "PW", "name_en": "Palau", "desc_en": "", "name_ru": "Палау", "desc_ru": "" }, + { "mask": "+595(###)###-###", "cc": "PY", "name_en": "Paraguay", "desc_en": "", "name_ru": "Парагвай", "desc_ru": "" }, + { "mask": "+974-####-####", "cc": "QA", "name_en": "Qatar", "desc_en": "", "name_ru": "Катар", "desc_ru": "" }, + { "mask": "+262-#####-####", "cc": "RE", "name_en": "Reunion", "desc_en": "", "name_ru": "Реюньон", "desc_ru": "" }, + { "mask": "+40-##-###-####", "cc": "RO", "name_en": "Romania", "desc_en": "", "name_ru": "Румыния", "desc_ru": "" }, + { "mask": "+381-##-###-####", "cc": "RS", "name_en": "Serbia", "desc_en": "", "name_ru": "Сербия", "desc_ru": "" }, + { "mask": "+7(###)###-##-##", "cc": "RU", "name_en": "Russia", "desc_en": "", "name_ru": "Россия", "desc_ru": "" }, + { "mask": "+250(###)###-###", "cc": "RW", "name_en": "Rwanda", "desc_en": "", "name_ru": "Руанда", "desc_ru": "" }, + { "mask": "+966-5-####-####", "cc": "SA", "name_en": "Saudi Arabia ", "desc_en": "mobile", "name_ru": "Саудовская Аравия ", "desc_ru": "мобильные" }, + { "mask": "+966-#-###-####", "cc": "SA", "name_en": "Saudi Arabia", "desc_en": "", "name_ru": "Саудовская Аравия", "desc_ru": "" }, + { "mask": "+677-###-####", "cc": "SB", "name_en": "Solomon Islands ", "desc_en": "mobile", "name_ru": "Соломоновы Острова ", "desc_ru": "мобильные" }, + { "mask": "+677-#####", "cc": "SB", "name_en": "Solomon Islands", "desc_en": "", "name_ru": "Соломоновы Острова", "desc_ru": "" }, + { "mask": "+248-#-###-###", "cc": "SC", "name_en": "Seychelles", "desc_en": "", "name_ru": "Сейшелы", "desc_ru": "" }, + { "mask": "+249-##-###-####", "cc": "SD", "name_en": "Sudan", "desc_en": "", "name_ru": "Судан", "desc_ru": "" }, + { "mask": "+46-##-###-####", "cc": "SE", "name_en": "Sweden", "desc_en": "", "name_ru": "Швеция", "desc_ru": "" }, + { "mask": "+65-####-####", "cc": "SG", "name_en": "Singapore", "desc_en": "", "name_ru": "Сингапур", "desc_ru": "" }, + { "mask": "+290-####", "cc": "SH", "name_en": "Saint Helena", "desc_en": "", "name_ru": "Остров Святой Елены", "desc_ru": "" }, + { "mask": "+290-####", "cc": "SH", "name_en": "Tristan da Cunha", "desc_en": "", "name_ru": "Тристан-да-Кунья", "desc_ru": "" }, + { "mask": "+386-##-###-###", "cc": "SI", "name_en": "Slovenia", "desc_en": "", "name_ru": "Словения", "desc_ru": "" }, + { "mask": "+421(###)###-###", "cc": "SK", "name_en": "Slovakia", "desc_en": "", "name_ru": "Словакия", "desc_ru": "" }, + { "mask": "+232-##-######", "cc": "SL", "name_en": "Sierra Leone", "desc_en": "", "name_ru": "Сьерра-Леоне", "desc_ru": "" }, + { "mask": "+378-####-######", "cc": "SM", "name_en": "San Marino", "desc_en": "", "name_ru": "Сан-Марино", "desc_ru": "" }, + { "mask": "+221-##-###-####", "cc": "SN", "name_en": "Senegal", "desc_en": "", "name_ru": "Сенегал", "desc_ru": "" }, + { "mask": "+252-##-###-###", "cc": "SO", "name_en": "Somalia", "desc_en": "", "name_ru": "Сомали", "desc_ru": "" }, + { "mask": "+252-#-###-###", "cc": "SO", "name_en": "Somalia", "desc_en": "", "name_ru": "Сомали", "desc_ru": "" }, + { "mask": "+252-#-###-###", "cc": "SO", "name_en": "Somalia ", "desc_en": "mobile", "name_ru": "Сомали ", "desc_ru": "мобильные" }, + { "mask": "+597-###-####", "cc": "SR", "name_en": "Suriname ", "desc_en": "mobile", "name_ru": "Суринам ", "desc_ru": "мобильные" }, + { "mask": "+597-###-###", "cc": "SR", "name_en": "Suriname", "desc_en": "", "name_ru": "Суринам", "desc_ru": "" }, + { "mask": "+211-##-###-####", "cc": "SS", "name_en": "South Sudan", "desc_en": "", "name_ru": "Южный Судан", "desc_ru": "" }, + { "mask": "+239-##-#####", "cc": "ST", "name_en": "Sao Tome and Principe", "desc_en": "", "name_ru": "Сан-Томе и Принсипи", "desc_ru": "" }, + { "mask": "+503-##-##-####", "cc": "SV", "name_en": "El Salvador", "desc_en": "", "name_ru": "Сальвадор", "desc_ru": "" }, + { "mask": "+1(721)###-####", "cc": "SX", "name_en": "Sint Maarten", "desc_en": "", "name_ru": "Синт-Маартен", "desc_ru": "" }, + { "mask": "+963-##-####-###", "cc": "SY", "name_en": "Syrian Arab Republic", "desc_en": "", "name_ru": "Сирийская арабская республика", "desc_ru": "" }, + { "mask": "+268-##-##-####", "cc": "SZ", "name_en": "Swaziland", "desc_en": "", "name_ru": "Свазиленд", "desc_ru": "" }, + { "mask": "+1(649)###-####", "cc": "TC", "name_en": "Turks & Caicos", "desc_en": "", "name_ru": "Тёркс и Кайкос", "desc_ru": "" }, + { "mask": "+235-##-##-##-##", "cc": "TD", "name_en": "Chad", "desc_en": "", "name_ru": "Чад", "desc_ru": "" }, + { "mask": "+228-##-###-###", "cc": "TG", "name_en": "Togo", "desc_en": "", "name_ru": "Того", "desc_ru": "" }, + { "mask": "+66-##-###-####", "cc": "TH", "name_en": "Thailand ", "desc_en": "mobile", "name_ru": "Таиланд ", "desc_ru": "мобильные" }, + { "mask": "+66-##-###-###", "cc": "TH", "name_en": "Thailand", "desc_en": "", "name_ru": "Таиланд", "desc_ru": "" }, + { "mask": "+992-##-###-####", "cc": "TJ", "name_en": "Tajikistan", "desc_en": "", "name_ru": "Таджикистан", "desc_ru": "" }, + { "mask": "+690-####", "cc": "TK", "name_en": "Tokelau", "desc_en": "", "name_ru": "Токелау", "desc_ru": "" }, + { "mask": "+670-###-####", "cc": "TL", "name_en": "East Timor", "desc_en": "", "name_ru": "Восточный Тимор", "desc_ru": "" }, + { "mask": "+670-77#-#####", "cc": "TL", "name_en": "East Timor", "desc_en": "Timor Telecom", "name_ru": "Восточный Тимор", "desc_ru": "Timor Telecom" }, + { "mask": "+670-78#-#####", "cc": "TL", "name_en": "East Timor", "desc_en": "Timor Telecom", "name_ru": "Восточный Тимор", "desc_ru": "Timor Telecom" }, + { "mask": "+993-#-###-####", "cc": "TM", "name_en": "Turkmenistan", "desc_en": "", "name_ru": "Туркменистан", "desc_ru": "" }, + { "mask": "+216-##-###-###", "cc": "TN", "name_en": "Tunisia", "desc_en": "", "name_ru": "Тунис", "desc_ru": "" }, + { "mask": "+676-#####", "cc": "TO", "name_en": "Tonga", "desc_en": "", "name_ru": "Тонга", "desc_ru": "" }, + { "mask": "+90(###)###-####", "cc": "TR", "name_en": "Turkey", "desc_en": "", "name_ru": "Турция", "desc_ru": "" }, + { "mask": "+1(868)###-####", "cc": "TT", "name_en": "Trinidad & Tobago", "desc_en": "", "name_ru": "Тринидад и Тобаго", "desc_ru": "" }, + { "mask": "+688-90####", "cc": "TV", "name_en": "Tuvalu ", "desc_en": "mobile", "name_ru": "Тувалу ", "desc_ru": "мобильные" }, + { "mask": "+688-2####", "cc": "TV", "name_en": "Tuvalu", "desc_en": "", "name_ru": "Тувалу", "desc_ru": "" }, + { "mask": "+886-#-####-####", "cc": "TW", "name_en": "Taiwan", "desc_en": "", "name_ru": "Тайвань", "desc_ru": "" }, + { "mask": "+886-####-####", "cc": "TW", "name_en": "Taiwan", "desc_en": "", "name_ru": "Тайвань", "desc_ru": "" }, + { "mask": "+255-##-###-####", "cc": "TZ", "name_en": "Tanzania", "desc_en": "", "name_ru": "Танзания", "desc_ru": "" }, + { "mask": "+380(##)###-##-##", "cc": "UA", "name_en": "Ukraine", "desc_en": "", "name_ru": "Украина", "desc_ru": "" }, + { "mask": "+256(###)###-###", "cc": "UG", "name_en": "Uganda", "desc_en": "", "name_ru": "Уганда", "desc_ru": "" }, + { "mask": "+44-##-####-####", "cc": "UK", "name_en": "United Kingdom", "desc_en": "", "name_ru": "Великобритания", "desc_ru": "" }, + { "mask": "+598-#-###-##-##", "cc": "UY", "name_en": "Uruguay", "desc_en": "", "name_ru": "Уругвай", "desc_ru": "" }, + { "mask": "+998-##-###-####", "cc": "UZ", "name_en": "Uzbekistan", "desc_en": "", "name_ru": "Узбекистан", "desc_ru": "" }, + { "mask": "+39-6-698-#####", "cc": "VA", "name_en": "Vatican City", "desc_en": "", "name_ru": "Ватикан", "desc_ru": "" }, + { "mask": "+1(784)###-####", "cc": "VC", "name_en": "Saint Vincent & the Grenadines", "desc_en": "", "name_ru": "Сент-Винсент и Гренадины", "desc_ru": "" }, + { "mask": "+58(###)###-####", "cc": "VE", "name_en": "Venezuela", "desc_en": "", "name_ru": "Венесуэла", "desc_ru": "" }, + { "mask": "+1(284)###-####", "cc": "VG", "name_en": "British Virgin Islands", "desc_en": "", "name_ru": "Британские Виргинские острова", "desc_ru": "" }, + { "mask": "+1(340)###-####", "cc": "VI", "name_en": "US Virgin Islands", "desc_en": "", "name_ru": "Американские Виргинские острова", "desc_ru": "" }, + { "mask": "+84-##-####-###", "cc": "VN", "name_en": "Vietnam", "desc_en": "", "name_ru": "Вьетнам", "desc_ru": "" }, + { "mask": "+84(###)####-###", "cc": "VN", "name_en": "Vietnam", "desc_en": "", "name_ru": "Вьетнам", "desc_ru": "" }, + { "mask": "+678-##-#####", "cc": "VU", "name_en": "Vanuatu ", "desc_en": "mobile", "name_ru": "Вануату ", "desc_ru": "мобильные" }, + { "mask": "+678-#####", "cc": "VU", "name_en": "Vanuatu", "desc_en": "", "name_ru": "Вануату", "desc_ru": "" }, + { "mask": "+681-##-####", "cc": "WF", "name_en": "Wallis and Futuna", "desc_en": "", "name_ru": "Уоллис и Футуна", "desc_ru": "" }, + { "mask": "+685-##-####", "cc": "WS", "name_en": "Samoa", "desc_en": "", "name_ru": "Самоа", "desc_ru": "" }, + { "mask": "+967-###-###-###", "cc": "YE", "name_en": "Yemen ", "desc_en": "mobile", "name_ru": "Йемен ", "desc_ru": "мобильные" }, + { "mask": "+967-#-###-###", "cc": "YE", "name_en": "Yemen", "desc_en": "", "name_ru": "Йемен", "desc_ru": "" }, + { "mask": "+967-##-###-###", "cc": "YE", "name_en": "Yemen", "desc_en": "", "name_ru": "Йемен", "desc_ru": "" }, + { "mask": "+27-##-###-####", "cc": "ZA", "name_en": "South Africa", "desc_en": "", "name_ru": "Южно-Африканская Респ.", "desc_ru": "" }, + { "mask": "+260-##-###-####", "cc": "ZM", "name_en": "Zambia", "desc_en": "", "name_ru": "Замбия", "desc_ru": "" }, + { "mask": "+263-#-######", "cc": "ZW", "name_en": "Zimbabwe", "desc_en": "", "name_ru": "Зимбабве", "desc_ru": "" }, + { "mask": "+1(###)###-####", "cc": ["US", "CA"], "name_en": "USA and Canada", "desc_en": "", "name_ru": "США и Канада", "desc_ru": "" } +] diff --git a/public/assets/js/plugins/input-mask/phone-codes/readme.txt b/public/assets/js/plugins/input-mask/phone-codes/readme.txt new file mode 100755 index 00000000..0a170a76 --- /dev/null +++ b/public/assets/js/plugins/input-mask/phone-codes/readme.txt @@ -0,0 +1 @@ +more phone masks can be found at https://github.com/andr-04/inputmask-multi \ No newline at end of file diff --git a/public/assets/js/plugins/ionslider/ion.rangeSlider.min.js b/public/assets/js/plugins/ionslider/ion.rangeSlider.min.js new file mode 100755 index 00000000..f352609f --- /dev/null +++ b/public/assets/js/plugins/ionslider/ion.rangeSlider.min.js @@ -0,0 +1,22 @@ +// Ion.RangeSlider +// version 1.8.2 +// https://github.com/IonDen/ion.rangeSlider +(function(c,X,ea,S){var Y=0,O=function(){var c=S.userAgent,a=/msie\s\d+/i;return 0c)?!0:!1}(),H;try{X.createEvent("TouchEvent"),H=!0}catch(ga){H=!1}var N={init:function(A){return this.each(function(){var a=c.extend({min:10,max:100,from:null,to:null,type:"single",step:1,prefix:"",postfix:"",hasGrid:!1,hideMinMax:!1,hideFromTo:!1,prettify:!0,onChange:null,onLoad:null,onFinish:null},A),d=c(this),u=this;if(!d.data("isActive")){d.data("isActive", +!0);this.pluginCount=Y+=1;d.prop("value")&&(a.min=parseInt(d.prop("value").split(";")[0],10),a.max=parseInt(d.prop("value").split(";")[1],10));"number"!==typeof a.from&&(a.from=a.min);"number"!==typeof a.to&&(a.to=a.max);"number"===typeof d.data("from")&&(a.from=parseFloat(d.data("from")));"number"===typeof d.data("to")&&(a.to=parseFloat(d.data("to")));d.data("step")&&(a.step=parseFloat(d.data("step")));d.data("type")&&(a.type=d.data("type"));d.data("prefix")&&(a.prefix=d.data("prefix"));d.data("postfix")&& +(a.postfix=d.data("postfix"));d.data("hasgrid")&&(a.hasGrid=d.data("hasgrid"));d.data("hideminmax")&&(a.hideMinMax=d.data("hideminmax"));d.data("hidefromto")&&(a.hideFromTo=d.data("hidefromto"));d.data("prettify")&&(a.prettify=d.data("prettify"));a.froma.max&&(a.to=a.max);"double"===a.type&&(a.from>a.to&&(a.from=a.to),a.to';d[0].style.display="none";d.before(N);var w=c("#irs-"+this.pluginCount),C=c(X.body),I=c(ea),l,D,E,x,y,q,r,e,m,s,T,Z,p=!1,t=!1,P=!0,g={},U=0,J=0,K=0,k=0,B=0,L=0,V=0,Q=0,R=0,$=0,n=0;parseInt(a.step,10)!==parseFloat(a.step)&&(n=a.step.toString().split(".")[1],n=Math.pow(10,n.length));this.updateData=function(b){P=!0;a=c.extend(a,b);w.find("*").off();I.off("mouseup.irs"+u.pluginCount);C.off("mouseup.irs"+u.pluginCount);C.off("mousemove.irs"+u.pluginCount);w.html("");aa()}; +this.removeSlider=function(){w.find("*").off();I.off("mouseup.irs"+u.pluginCount);C.off("mouseup.irs"+u.pluginCount);C.off("mousemove.irs"+u.pluginCount);w.html("").remove();d.data("isActive",!1);d.show()};var aa=function(){w.html('01000'); +l=w.find(".irs");D=l.find(".irs-min");E=l.find(".irs-max");x=l.find(".irs-from");y=l.find(".irs-to");q=l.find(".irs-single");Z=w.find(".irs-grid");a.hideMinMax&&(D[0].style.display="none",E[0].style.display="none",K=J=0);a.hideFromTo&&(x[0].style.display="none",y[0].style.display="none",q[0].style.display="none");a.hideMinMax||(D.html(a.prefix+v(a.min)+a.postfix),E.html(a.prefix+v(a.max)+a.postfix),J=D.outerWidth(),K=E.outerWidth());if("single"===a.type){if(l.append(''), +r=l.find(".single"),r.on("mousedown",function(a){a.preventDefault();a.stopPropagation();F(a,c(this),null);t=p=!0;O&&c("*").prop("unselectable",!0)}),H)r.on("touchstart",function(a){a.preventDefault();a.stopPropagation();F(a.originalEvent.touches[0],c(this),null);t=p=!0})}else"double"===a.type&&(l.append(''),e=l.find(".from"),m=l.find(".to"),T=l.find(".irs-diapason"),M(),e.on("mousedown",function(a){a.preventDefault(); +a.stopPropagation();c(this).addClass("last");m.removeClass("last");F(a,c(this),"from");t=p=!0;O&&c("*").prop("unselectable",!0)}),m.on("mousedown",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");e.removeClass("last");F(a,c(this),"to");t=p=!0;O&&c("*").prop("unselectable",!0)}),H&&(e.on("touchstart",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");m.removeClass("last");F(a.originalEvent.touches[0],c(this),"from");t=p=!0}),m.on("touchstart",function(a){a.preventDefault(); +a.stopPropagation();c(this).addClass("last");e.removeClass("last");F(a.originalEvent.touches[0],c(this),"to");t=p=!0})),a.to===a.max&&e.addClass("last"));var b=function(){p&&(p=t=!1,s.removeAttr("id"),s=null,"double"===a.type&&M(),W(),O&&c("*").prop("unselectable",!1))};C.on("mouseup.irs"+u.pluginCount,function(){b()});I.on("mouseup.irs"+u.pluginCount,function(){b()});C.on("mousemove.irs"+u.pluginCount,function(a){p&&(U=a.pageX,ba())});H&&(I.on("touchend",function(){p&&(p=t=!1,s.removeAttr("id"), +s=null,"double"===a.type&&M(),W())}),I.on("touchmove",function(a){p&&(U=a.originalEvent.touches[0].pageX,ba())}));ca();S();a.hasGrid&&fa()},ca=function(){k=l.width();L=r?r.width():e.width();B=k-L},F=function(b,f,c){ca();P=!1;s=f;s.attr("id","irs-active-slider");f=s.offset().left;$=f+(b.pageX-f)-s.position().left;"single"===a.type?V=l.width()-L:"double"===a.type&&("from"===c?(Q=0,R=parseInt(m.css("left"),10)):(Q=parseInt(e.css("left"),10),R=l.width()-L))},M=function(){var a=e.width(),f=c.data(e[0], +"x")||parseInt(e[0].style.left,10)||e.position().left,G=(c.data(m[0],"x")||parseInt(m[0].style.left,10)||m.position().left)-f;T[0].style.left=f+a/2+"px";T[0].style.width=G+"px"},ba=function(){var b=U-$;"single"===a.type?(0>b&&(b=0),b>V&&(b=V)):"double"===a.type&&(bR&&(b=R),M());c.data(s[0],"x",b);W();b=Math.round(b);s[0].style.left=b+"px"},W=function(){var b={fromNumber:0,toNumber:0,fromPers:0,toPers:0,fromX:0,toX:0},f=a.max-a.min,G;"single"===a.type?(b.fromX=c.data(r[0],"x")||parseInt(r[0].style.left, +10)||r.position().left,b.fromPers=b.fromX/B*100,G=f/100*b.fromPers+parseInt(a.min,10),b.fromNumber=Math.round(G/a.step)*a.step,n&&(b.fromNumber=parseInt(b.fromNumber*n,10)/n)):"double"===a.type&&(b.fromX=c.data(e[0],"x")||parseInt(e[0].style.left,10)||e.position().left,b.fromPers=b.fromX/B*100,G=f/100*b.fromPers+parseInt(a.min,10),b.fromNumber=Math.round(G/a.step)*a.step,b.toX=c.data(m[0],"x")||parseInt(m[0].style.left,10)||m.position().left,b.toPers=b.toX/B*100,f=f/100*b.toPers+parseInt(a.min,10), +b.toNumber=Math.round(f/a.step)*a.step,n&&(b.fromNumber=parseInt(b.fromNumber*n,10)/n,b.toNumber=parseInt(b.toNumber*n,10)/n));g=b;da()},S=function(){var b={fromNumber:a.from,toNumber:a.to,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,toX_pure:0},f=a.max-a.min;"single"===a.type?(b.fromPers=(b.fromNumber-a.min)/f*100,b.fromX_pure=B/100*b.fromPers,b.fromX=Math.round(b.fromX_pure),r[0].style.left=b.fromX+"px",c.data(r[0],"x",b.fromX_pure)):"double"===a.type&&(b.fromPers=(b.fromNumber-a.min)/f*100,b.fromX_pure= +B/100*b.fromPers,b.fromX=Math.round(b.fromX_pure),e[0].style.left=b.fromX+"px",c.data(e[0],"x",b.fromX_pure),b.toPers=(b.toNumber-a.min)/f*100,b.toX_pure=B/100*b.toPers,b.toX=Math.round(b.toX_pure),m[0].style.left=b.toX+"px",c.data(m[0],"x",b.toX_pure),M());g=b;da()},da=function(){var b,f,c,z,e,h;h=L/2;"single"===a.type?(a.hideText||(x[0].style.display="none",y[0].style.display="none",c=a.prefix+v(g.fromNumber)+a.postfix,q.html(c),e=q.outerWidth(),h=g.fromX-e/2+h,0>h&&(h=0),h>k-e&&(h=k-e),q[0].style.left= +h+"px",a.hideMinMax||a.hideFromTo||(D[0].style.display=hk-K?"none":"block")),d.attr("value",parseInt(g.fromNumber,10))):"double"===a.type&&(a.hideText||(b=a.prefix+v(g.fromNumber)+a.postfix,f=a.prefix+v(g.toNumber)+a.postfix,c=g.fromNumber!==g.toNumber?a.prefix+v(g.fromNumber)+" \u2014 "+a.prefix+v(g.toNumber)+a.postfix:a.prefix+v(g.fromNumber)+a.postfix,x.html(b),y.html(f),q.html(c),b=x.outerWidth(),f=g.fromX-b/2+h,0>f&&(f=0),f>k-b&&(f=k-b),x[0].style.left= +f+"px",c=y.outerWidth(),z=g.toX-c/2+h,0>z&&(z=0),z>k-c&&(z=k-c),y[0].style.left=z+"px",e=q.outerWidth(),h=g.fromX+(g.toX-g.fromX)/2-e/2+h,0>h&&(h=0),h>k-e&&(h=k-e),q[0].style.left=h+"px",f+bk-K||z+c>k-K?"none":"block")),d.attr("value",parseInt(g.fromNumber, +10)+";"+parseInt(g.toNumber,10)));"function"===typeof a.onChange&&a.onChange.call(this,g);"function"!==typeof a.onFinish||t||P||a.onFinish.call(this,g);"function"===typeof a.onLoad&&!t&&P&&a.onLoad.call(this,g)},fa=function(){w.addClass("irs-with-grid");var b,c="",d=0,d=0,e="";for(b=0;20>=b;b+=1)d=Math.floor(k/20*b),d>=k&&(d=k-1),e+='';for(b=0;4>=b;b+=1)d=Math.floor(k/4*b),d>=k&&(d=k-1),e+='',n?(c=a.min+(a.max-a.min)/4*b,c=c/a.step*a.step,c=parseInt(c*n,10)/n):(c=Math.round(a.min+(a.max-a.min)/4*b),c=Math.round(c/a.step)*a.step,c=v(c)),0===b?e+=''+c+"":4===b?(d-=100,e+=''+c+""):(d-=50,e+=''+c+"");Z.html(e)};aa()}})},update:function(c){return this.each(function(){this.updateData(c)})}, +remove:function(){return this.each(function(){this.removeSlider()})}};c.fn.ionRangeSlider=function(A){if(N[A])return N[A].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof A&&A)c.error("Method "+A+" does not exist for jQuery.ionRangeSlider");else return N.init.apply(this,arguments)}})(jQuery,document,window,navigator); \ No newline at end of file diff --git a/public/assets/js/plugins/jqueryKnob/jquery.knob.js b/public/assets/js/plugins/jqueryKnob/jquery.knob.js new file mode 100755 index 00000000..ddb52736 --- /dev/null +++ b/public/assets/js/plugins/jqueryKnob/jquery.knob.js @@ -0,0 +1,764 @@ +/*!jQuery Knob*/ +/** + * Downward compatible, touchable dial + * + * Version: 1.2.0 (15/07/2012) + * Requires: jQuery v1.7+ + * + * Copyright (c) 2012 Anthony Terrien + * Under MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Thanks to vor, eskimoblood, spiffistan, FabrizioC + */ +(function($) { + + /** + * Kontrol library + */ + "use strict"; + + /** + * Definition of globals and core + */ + var k = {}, // kontrol + max = Math.max, + min = Math.min; + + k.c = {}; + k.c.d = $(document); + k.c.t = function (e) { + return e.originalEvent.touches.length - 1; + }; + + /** + * Kontrol Object + * + * Definition of an abstract UI control + * + * Each concrete component must call this one. + * + * k.o.call(this); + * + */ + k.o = function () { + var s = this; + + this.o = null; // array of options + this.$ = null; // jQuery wrapped element + this.i = null; // mixed HTMLInputElement or array of HTMLInputElement + this.g = null; // deprecated 2D graphics context for 'pre-rendering' + this.v = null; // value ; mixed array or integer + this.cv = null; // change value ; not commited value + this.x = 0; // canvas x position + this.y = 0; // canvas y position + this.w = 0; // canvas width + this.h = 0; // canvas height + this.$c = null; // jQuery canvas element + this.c = null; // rendered canvas context + this.t = 0; // touches index + this.isInit = false; + this.fgColor = null; // main color + this.pColor = null; // previous color + this.dH = null; // draw hook + this.cH = null; // change hook + this.eH = null; // cancel hook + this.rH = null; // release hook + this.scale = 1; // scale factor + this.relative = false; + this.relativeWidth = false; + this.relativeHeight = false; + this.$div = null; // component div + + this.run = function () { + var cf = function (e, conf) { + var k; + for (k in conf) { + s.o[k] = conf[k]; + } + s.init(); + s._configure() + ._draw(); + }; + + if(this.$.data('kontroled')) return; + this.$.data('kontroled', true); + + this.extend(); + this.o = $.extend( + { + // Config + min : this.$.data('min') || 0, + max : this.$.data('max') || 100, + stopper : true, + readOnly : this.$.data('readonly') || (this.$.attr('readonly') == 'readonly'), + + // UI + cursor : (this.$.data('cursor') === true && 30) + || this.$.data('cursor') + || 0, + thickness : ( + this.$.data('thickness') + && Math.max(Math.min(this.$.data('thickness'), 1), 0.01) + ) + || 0.35, + lineCap : this.$.data('linecap') || 'butt', + width : this.$.data('width') || 200, + height : this.$.data('height') || 200, + displayInput : this.$.data('displayinput') == null || this.$.data('displayinput'), + displayPrevious : this.$.data('displayprevious'), + fgColor : this.$.data('fgcolor') || '#87CEEB', + inputColor: this.$.data('inputcolor'), + font: this.$.data('font') || 'Arial', + fontWeight: this.$.data('font-weight') || 'bold', + inline : false, + step : this.$.data('step') || 1, + + // Hooks + draw : null, // function () {} + change : null, // function (value) {} + cancel : null, // function () {} + release : null, // function (value) {} + error : null // function () {} + }, this.o + ); + + // finalize options + if(!this.o.inputColor) { + this.o.inputColor = this.o.fgColor; + } + + // routing value + if(this.$.is('fieldset')) { + + // fieldset = array of integer + this.v = {}; + this.i = this.$.find('input') + this.i.each(function(k) { + var $this = $(this); + s.i[k] = $this; + s.v[k] = $this.val(); + + $this.bind( + 'change keyup' + , function () { + var val = {}; + val[k] = $this.val(); + s.val(val); + } + ); + }); + this.$.find('legend').remove(); + + } else { + + // input = integer + this.i = this.$; + this.v = this.$.val(); + (this.v == '') && (this.v = this.o.min); + + this.$.bind( + 'change keyup' + , function () { + s.val(s._validate(s.$.val())); + } + ); + + } + + (!this.o.displayInput) && this.$.hide(); + + // adds needed DOM elements (canvas, div) + this.$c = $(document.createElement('canvas')); + if (typeof G_vmlCanvasManager !== 'undefined') { + G_vmlCanvasManager.initElement(this.$c[0]); + } + this.c = this.$c[0].getContext ? this.$c[0].getContext('2d') : null; + if (!this.c) { + this.o.error && this.o.error(); + return; + } + + // hdpi support + this.scale = (window.devicePixelRatio || 1) / + ( + this.c.webkitBackingStorePixelRatio || + this.c.mozBackingStorePixelRatio || + this.c.msBackingStorePixelRatio || + this.c.oBackingStorePixelRatio || + this.c.backingStorePixelRatio || 1 + ); + + // detects relative width / height + this.relativeWidth = ((this.o.width % 1 !== 0) + && this.o.width.indexOf('%')); + this.relativeHeight = ((this.o.height % 1 !== 0) + && this.o.height.indexOf('%')); + + this.relative = (this.relativeWidth || this.relativeHeight); + + // wraps all elements in a div + this.$div = $('
      '); + + this.$.wrap(this.$div).before(this.$c); + this.$div = this.$.parent(); + + // computes size and carves the component + this._carve(); + + // prepares props for transaction + if (this.v instanceof Object) { + this.cv = {}; + this.copy(this.v, this.cv); + } else { + this.cv = this.v; + } + + // binds configure event + this.$ + .bind("configure", cf) + .parent() + .bind("configure", cf); + + // finalize init + this._listen() + ._configure() + ._xy() + .init(); + + this.isInit = true; + + // the most important ! + this._draw(); + + return this; + }; + + this._carve = function() { + if(this.relative) { + var w = this.relativeWidth + ? this.$div.parent().width() + * parseInt(this.o.width) / 100 + : this.$div.parent().width(), + h = this.relativeHeight + ? this.$div.parent().height() + * parseInt(this.o.height) / 100 + : this.$div.parent().height(); + + // apply relative + this.w = this.h = Math.min(w, h); + } else { + this.w = this.o.width; + this.h = this.o.height; + } + + // finalize div + this.$div.css({ + 'width': this.w + 'px', + 'height': this.h + 'px' + }); + + // finalize canvas with computed width + this.$c.attr({ + width: this.w, + height: this.h + }); + + // scaling + if (this.scale !== 1) { + this.$c[0].width = this.$c[0].width * this.scale; + this.$c[0].height = this.$c[0].height * this.scale; + this.$c.width(this.w); + this.$c.height(this.h); + } + + return this; + } + + this._draw = function () { + + // canvas pre-rendering + var d = true; + + s.g = s.c; + + s.clear(); + + s.dH + && (d = s.dH()); + + (d !== false) && s.draw(); + + }; + + this._touch = function (e) { + + var touchMove = function (e) { + + var v = s.xy2val( + e.originalEvent.touches[s.t].pageX, + e.originalEvent.touches[s.t].pageY + ); + s.change(s._validate(v)); + s._draw(); + }; + + // get touches index + this.t = k.c.t(e); + + // First touch + touchMove(e); + + // Touch events listeners + k.c.d + .bind("touchmove.k", touchMove) + .bind( + "touchend.k" + , function () { + k.c.d.unbind('touchmove.k touchend.k'); + + if ( + s.rH + && (s.rH(s.cv) === false) + ) return; + + s.val(s.cv); + } + ); + + return this; + }; + + this._mouse = function (e) { + + var mouseMove = function (e) { + var v = s.xy2val(e.pageX, e.pageY); + s.change(s._validate(v)); + s._draw(); + }; + + // First click + mouseMove(e); + + // Mouse events listeners + k.c.d + .bind("mousemove.k", mouseMove) + .bind( + // Escape key cancel current change + "keyup.k" + , function (e) { + if (e.keyCode === 27) { + k.c.d.unbind("mouseup.k mousemove.k keyup.k"); + + if ( + s.eH + && (s.eH() === false) + ) return; + + s.cancel(); + } + } + ) + .bind( + "mouseup.k" + , function (e) { + k.c.d.unbind('mousemove.k mouseup.k keyup.k'); + + if ( + s.rH + && (s.rH(s.cv) === false) + ) return; + + s.val(s.cv); + } + ); + + return this; + }; + + this._xy = function () { + var o = this.$c.offset(); + this.x = o.left; + this.y = o.top; + return this; + }; + + this._listen = function () { + + if (!this.o.readOnly) { + this.$c + .bind( + "mousedown" + , function (e) { + e.preventDefault(); + s._xy()._mouse(e); + } + ) + .bind( + "touchstart" + , function (e) { + e.preventDefault(); + s._xy()._touch(e); + } + ); + + this.listen(); + } else { + this.$.attr('readonly', 'readonly'); + } + + if(this.relative) { + $(window).resize(function() { + s._carve() + .init(); + s._draw(); + }); + } + + return this; + }; + + this._configure = function () { + + // Hooks + if (this.o.draw) this.dH = this.o.draw; + if (this.o.change) this.cH = this.o.change; + if (this.o.cancel) this.eH = this.o.cancel; + if (this.o.release) this.rH = this.o.release; + + if (this.o.displayPrevious) { + this.pColor = this.h2rgba(this.o.fgColor, "0.4"); + this.fgColor = this.h2rgba(this.o.fgColor, "0.6"); + } else { + this.fgColor = this.o.fgColor; + } + + return this; + }; + + this._clear = function () { + this.$c[0].width = this.$c[0].width; + }; + + this._validate = function(v) { + return (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step; + }; + + // Abstract methods + this.listen = function () {}; // on start, one time + this.extend = function () {}; // each time configure triggered + this.init = function () {}; // each time configure triggered + this.change = function (v) {}; // on change + this.val = function (v) {}; // on release + this.xy2val = function (x, y) {}; // + this.draw = function () {}; // on change / on release + this.clear = function () { this._clear(); }; + + // Utils + this.h2rgba = function (h, a) { + var rgb; + h = h.substring(1,7) + rgb = [parseInt(h.substring(0,2),16) + ,parseInt(h.substring(2,4),16) + ,parseInt(h.substring(4,6),16)]; + return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + a + ")"; + }; + + this.copy = function (f, t) { + for (var i in f) { t[i] = f[i]; } + }; + }; + + + /** + * k.Dial + */ + k.Dial = function () { + k.o.call(this); + + this.startAngle = null; + this.xy = null; + this.radius = null; + this.lineWidth = null; + this.cursorExt = null; + this.w2 = null; + this.PI2 = 2*Math.PI; + + this.extend = function () { + this.o = $.extend( + { + bgColor : this.$.data('bgcolor') || '#EEEEEE', + angleOffset : this.$.data('angleoffset') || 0, + angleArc : this.$.data('anglearc') || 360, + inline : true + }, this.o + ); + }; + + this.val = function (v) { + if (null != v) { + this.cv = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v; + this.v = this.cv; + this.$.val(this.v); + this._draw(); + } else { + return this.v; + } + }; + + this.xy2val = function (x, y) { + var a, ret; + + a = Math.atan2( + x - (this.x + this.w2) + , - (y - this.y - this.w2) + ) - this.angleOffset; + + if(this.angleArc != this.PI2 && (a < 0) && (a > -0.5)) { + // if isset angleArc option, set to min if .5 under min + a = 0; + } else if (a < 0) { + a += this.PI2; + } + + ret = ~~ (0.5 + (a * (this.o.max - this.o.min) / this.angleArc)) + + this.o.min; + + this.o.stopper + && (ret = max(min(ret, this.o.max), this.o.min)); + + return ret; + }; + + this.listen = function () { + // bind MouseWheel + var s = this, mwTimerStop, mwTimerRelease, + mw = function (e) { + e.preventDefault(); + + var ori = e.originalEvent + ,deltaX = ori.detail || ori.wheelDeltaX + ,deltaY = ori.detail || ori.wheelDeltaY + ,v = s._validate(s.$.val()) + + (deltaX>0 || deltaY>0 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0); + + v = max(min(v, s.o.max), s.o.min); + + s.val(v); + + if(s.rH) { + // Handle mousewheel stop + clearTimeout(mwTimerStop); + mwTimerStop = setTimeout(function() { + s.rH(v); + mwTimerStop = null; + }, 100); + + // Handle mousewheel releases + if(!mwTimerRelease) { + mwTimerRelease = setTimeout(function() { + if(mwTimerStop) s.rH(v); + mwTimerRelease = null; + }, 200); + } + } + } + , kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step}; + + this.$ + .bind( + "keydown" + ,function (e) { + var kc = e.keyCode; + + // numpad support + if(kc >= 96 && kc <= 105) { + kc = e.keyCode = kc - 48; + } + + kval = parseInt(String.fromCharCode(kc)); + + if (isNaN(kval)) { + + (kc !== 13) // enter + && (kc !== 8) // bs + && (kc !== 9) // tab + && (kc !== 189) // - + && e.preventDefault(); + + // arrows + if ($.inArray(kc,[37,38,39,40]) > -1) { + e.preventDefault(); + + var v = parseInt(s.$.val()) + kv[kc] * m; + + s.o.stopper + && (v = max(min(v, s.o.max), s.o.min)); + + s.change(v); + s._draw(); + + // long time keydown speed-up + to = window.setTimeout( + function () { m*=2; } + ,30 + ); + } + } + } + ) + .bind( + "keyup" + ,function (e) { + if (isNaN(kval)) { + if (to) { + window.clearTimeout(to); + to = null; + m = 1; + s.val(s.$.val()); + } + } else { + // kval postcond + (s.$.val() > s.o.max && s.$.val(s.o.max)) + || (s.$.val() < s.o.min && s.$.val(s.o.min)); + } + + } + ); + + this.$c.bind("mousewheel DOMMouseScroll", mw); + this.$.bind("mousewheel DOMMouseScroll", mw) + }; + + this.init = function () { + + if ( + this.v < this.o.min + || this.v > this.o.max + ) this.v = this.o.min; + + this.$.val(this.v); + this.w2 = this.w / 2; + this.cursorExt = this.o.cursor / 100; + this.xy = this.w2 * this.scale; + this.lineWidth = this.xy * this.o.thickness; + this.lineCap = this.o.lineCap; + this.radius = this.xy - this.lineWidth / 2; + + this.o.angleOffset + && (this.o.angleOffset = isNaN(this.o.angleOffset) ? 0 : this.o.angleOffset); + + this.o.angleArc + && (this.o.angleArc = isNaN(this.o.angleArc) ? this.PI2 : this.o.angleArc); + + // deg to rad + this.angleOffset = this.o.angleOffset * Math.PI / 180; + this.angleArc = this.o.angleArc * Math.PI / 180; + + // compute start and end angles + this.startAngle = 1.5 * Math.PI + this.angleOffset; + this.endAngle = 1.5 * Math.PI + this.angleOffset + this.angleArc; + + var s = max( + String(Math.abs(this.o.max)).length + , String(Math.abs(this.o.min)).length + , 2 + ) + 2; + + this.o.displayInput + && this.i.css({ + 'width' : ((this.w / 2 + 4) >> 0) + 'px' + ,'height' : ((this.w / 3) >> 0) + 'px' + ,'position' : 'absolute' + ,'vertical-align' : 'middle' + ,'margin-top' : ((this.w / 3) >> 0) + 'px' + ,'margin-left' : '-' + ((this.w * 3 / 4 + 2) >> 0) + 'px' + ,'border' : 0 + ,'background' : 'none' + ,'font' : this.o.fontWeight + ' ' + ((this.w / s) >> 0) + 'px ' + this.o.font + ,'text-align' : 'center' + ,'color' : this.o.inputColor || this.o.fgColor + ,'padding' : '0px' + ,'-webkit-appearance': 'none' + }) + || this.i.css({ + 'width' : '0px' + ,'visibility' : 'hidden' + }); + }; + + this.change = function (v) { + if (v == this.cv) return; + this.cv = v; + if ( + this.cH + && (this.cH(v) === false) + ) return; + }; + + this.angle = function (v) { + return (v - this.o.min) * this.angleArc / (this.o.max - this.o.min); + }; + + this.draw = function () { + + var c = this.g, // context + a = this.angle(this.cv) // Angle + , sat = this.startAngle // Start angle + , eat = sat + a // End angle + , sa, ea // Previous angles + , r = 1; + + c.lineWidth = this.lineWidth; + + c.lineCap = this.lineCap; + + this.o.cursor + && (sat = eat - this.cursorExt) + && (eat = eat + this.cursorExt); + + c.beginPath(); + c.strokeStyle = this.o.bgColor; + c.arc(this.xy, this.xy, this.radius, this.endAngle - 0.00001, this.startAngle + 0.00001, true); + c.stroke(); + + if (this.o.displayPrevious) { + ea = this.startAngle + this.angle(this.v); + sa = this.startAngle; + this.o.cursor + && (sa = ea - this.cursorExt) + && (ea = ea + this.cursorExt); + + c.beginPath(); + c.strokeStyle = this.pColor; + c.arc(this.xy, this.xy, this.radius, sa - 0.00001, ea + 0.00001, false); + c.stroke(); + r = (this.cv == this.v); + } + + c.beginPath(); + c.strokeStyle = r ? this.o.fgColor : this.fgColor ; + c.arc(this.xy, this.xy, this.radius, sat - 0.00001, eat + 0.00001, false); + c.stroke(); + }; + + this.cancel = function () { + this.val(this.v); + }; + }; + + $.fn.dial = $.fn.knob = function (o) { + return this.each( + function () { + var d = new k.Dial(); + d.o = o; + d.$ = $(this); + d.run(); + } + ).parent(); + }; + +})(jQuery); diff --git a/public/assets/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js b/public/assets/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js new file mode 100755 index 00000000..ea54476f --- /dev/null +++ b/public/assets/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js @@ -0,0 +1,8 @@ +/** + * jVectorMap version 1.2.2 + * + * Copyright 2011-2013, Kirill Lebedev + * Licensed under the MIT license. + * + */(function(e){var t={set:{colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,focus:1},get:{selectedRegions:1,selectedMarkers:1,mapObject:1,regionName:1}};e.fn.vectorMap=function(e){var n,r,i,n=this.children(".jvectormap-container").data("mapObject");if(e==="addMap")jvm.WorldMap.maps[arguments[1]]=arguments[2];else{if(!(e!=="set"&&e!=="get"||!t[e][arguments[1]]))return r=arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1),n[e+r].apply(n,Array.prototype.slice.call(arguments,2));e=e||{},e.container=this,n=new jvm.WorldMap(e)}return this}})(jQuery),function(e){function r(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=!0,o=0,u=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(i=n.wheelDelta/120),n.detail&&(i=-n.detail/3),u=i,n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS&&(u=0,o=-1*i),n.wheelDeltaY!==undefined&&(u=n.wheelDeltaY/120),n.wheelDeltaX!==undefined&&(o=-1*n.wheelDeltaX/120),r.unshift(t,i,o,u),(e.event.dispatch||e.event.handle).apply(this,r)}var t=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var n=t.length;n;)e.event.fixHooks[t[--n]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],r,!1);else this.onmousewheel=r},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],r,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery);var jvm={inherits:function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.parentClass=t},mixin:function(e,t){var n;for(n in t.prototype)t.prototype.hasOwnProperty(n)&&(e.prototype[n]=t.prototype[n])},min:function(e){var t=Number.MAX_VALUE,n;if(e instanceof Array)for(n=0;nt&&(t=e[n]);else for(n in e)e[n]>t&&(t=e[n]);return t},keys:function(e){var t=[],n;for(n in e)t.push(n);return t},values:function(e){var t=[],n,r;for(r=0;r')}}catch(e){jvm.VMLElement.prototype.createElement=function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"),jvm.VMLElement.VMLInitialized=!0},jvm.VMLElement.prototype.getElementCtr=function(e){return jvm["VML"+e]},jvm.VMLElement.prototype.addClass=function(e){jvm.$(this.node).addClass(e)},jvm.VMLElement.prototype.applyAttr=function(e,t){this.node[e]=t},jvm.VMLElement.prototype.getBBox=function(){var e=jvm.$(this.node);return{x:e.position().left/this.canvas.scale,y:e.position().top/this.canvas.scale,width:e.width()/this.canvas.scale,height:e.height()/this.canvas.scale}},jvm.VMLGroupElement=function(){jvm.VMLGroupElement.parentClass.call(this,"group"),this.node.style.left="0px",this.node.style.top="0px",this.node.coordorigin="0 0"},jvm.inherits(jvm.VMLGroupElement,jvm.VMLElement),jvm.VMLGroupElement.prototype.add=function(e){this.node.appendChild(e.node)},jvm.VMLCanvasElement=function(e,t,n){this.classPrefix="VML",jvm.VMLCanvasElement.parentClass.call(this,"group"),jvm.AbstractCanvasElement.apply(this,arguments),this.node.style.position="absolute"},jvm.inherits(jvm.VMLCanvasElement,jvm.VMLElement),jvm.mixin(jvm.VMLCanvasElement,jvm.AbstractCanvasElement),jvm.VMLCanvasElement.prototype.setSize=function(e,t){var n,r,i,s;this.width=e,this.height=t,this.node.style.width=e+"px",this.node.style.height=t+"px",this.node.coordsize=e+" "+t,this.node.coordorigin="0 0";if(this.rootElement){n=this.rootElement.node.getElementsByTagName("shape");for(i=0,s=n.length;i=0)e-=t[i],i++;return i==this.scale.length-1?e=this.vectorToNum(this.scale[i]):e=this.vectorToNum(this.vectorAdd(this.scale[i],this.vectorMult(this.vectorSubtract(this.scale[i+1],this.scale[i]),e/t[i]))),e},vectorToNum:function(e){var t=0,n;for(n=0;nt&&(t=e[i]),r0?1:e<0?-1:e},mill:function(e,t,n){return{x:this.radius*(t-n)*this.radDeg,y:-this.radius*Math.log(Math.tan((45+.4*e)*this.radDeg))/.8}},mill_inv:function(e,t,n){return{lat:(2.5*Math.atan(Math.exp(.8*t/this.radius))-5*Math.PI/8)*this.degRad,lng:(n*this.radDeg+e/this.radius)*this.degRad}},merc:function(e,t,n){return{x:this.radius*(t-n)*this.radDeg,y:-this.radius*Math.log(Math.tan(Math.PI/4+e*Math.PI/360))}},merc_inv:function(e,t,n){return{lat:(2*Math.atan(Math.exp(t/this.radius))-Math.PI/2)*this.degRad,lng:(n*this.radDeg+e/this.radius)*this.degRad}},aea:function(e,t,n){var r=0,i=n*this.radDeg,s=29.5*this.radDeg,o=45.5*this.radDeg,u=e*this.radDeg,a=t*this.radDeg,f=(Math.sin(s)+Math.sin(o))/2,l=Math.cos(s)*Math.cos(s)+2*f*Math.sin(s),c=f*(a-i),h=Math.sqrt(l-2*f*Math.sin(u))/f,p=Math.sqrt(l-2*f*Math.sin(r))/f;return{x:h*Math.sin(c)*this.radius,y:-(p-h*Math.cos(c))*this.radius}},aea_inv:function(e,t,n){var r=e/this.radius,i=t/this.radius,s=0,o=n*this.radDeg,u=29.5*this.radDeg,a=45.5*this.radDeg,f=(Math.sin(u)+Math.sin(a))/2,l=Math.cos(u)*Math.cos(u)+2*f*Math.sin(u),c=Math.sqrt(l-2*f*Math.sin(s))/f,h=Math.sqrt(r*r+(c-i)*(c-i)),p=Math.atan(r/(c-i));return{lat:Math.asin((l-h*h*f*f)/(2*f))*this.degRad,lng:(o+p/f)*this.degRad}},lcc:function(e,t,n){var r=0,i=n*this.radDeg,s=t*this.radDeg,o=33*this.radDeg,u=45*this.radDeg,a=e*this.radDeg,f=Math.log(Math.cos(o)*(1/Math.cos(u)))/Math.log(Math.tan(Math.PI/4+u/2)*(1/Math.tan(Math.PI/4+o/2))),l=Math.cos(o)*Math.pow(Math.tan(Math.PI/4+o/2),f)/f,c=l*Math.pow(1/Math.tan(Math.PI/4+a/2),f),h=l*Math.pow(1/Math.tan(Math.PI/4+r/2),f);return{x:c*Math.sin(f*(s-i))*this.radius,y:-(h-c*Math.cos(f*(s-i)))*this.radius}},lcc_inv:function(e,t,n){var r=e/this.radius,i=t/this.radius,s=0,o=n*this.radDeg,u=33*this.radDeg,a=45*this.radDeg,f=Math.log(Math.cos(u)*(1/Math.cos(a)))/Math.log(Math.tan(Math.PI/4+a/2)*(1/Math.tan(Math.PI/4+u/2))),l=Math.cos(u)*Math.pow(Math.tan(Math.PI/4+u/2),f)/f,c=l*Math.pow(1/Math.tan(Math.PI/4+s/2),f),h=this.sgn(f)*Math.sqrt(r*r+(c-i)*(c-i)),p=Math.atan(r/(c-i));return{lat:(2*Math.atan(Math.pow(l/h,1/f))-Math.PI/2)*this.degRad,lng:(o+p/f)*this.degRad}}},jvm.WorldMap=function(e){var t=this,n;this.params=jvm.$.extend(!0,{},jvm.WorldMap.defaultParams,e);if(!jvm.WorldMap.maps[this.params.map])throw new Error("Attempt to use map which was not loaded: "+this.params.map);this.mapData=jvm.WorldMap.maps[this.params.map],this.markers={},this.regions={},this.regionsColors={},this.regionsData={},this.container=jvm.$("
      ").css({width:"100%",height:"100%"}).addClass("jvectormap-container"),this.params.container.append(this.container),this.container.data("mapObject",this),this.container.css({position:"relative",overflow:"hidden"}),this.defaultWidth=this.mapData.width,this.defaultHeight=this.mapData.height,this.setBackgroundColor(this.params.backgroundColor),this.onResize=function(){t.setSize()},jvm.$(window).resize(this.onResize);for(n in jvm.WorldMap.apiEvents)this.params[n]&&this.container.bind(jvm.WorldMap.apiEvents[n]+".jvectormap",this.params[n]);this.canvas=new jvm.VectorCanvas(this.container[0],this.width,this.height),"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?this.params.bindTouchEvents&&this.bindContainerTouchEvents():this.bindContainerEvents(),this.bindElementEvents(),this.createLabel(),this.params.zoomButtons&&this.bindZoomButtons(),this.createRegions(),this.createMarkers(this.params.markers||{}),this.setSize(),this.params.focusOn&&(typeof this.params.focusOn=="object"?this.setFocus.call(this,this.params.focusOn.scale,this.params.focusOn.x,this.params.focusOn.y):this.setFocus.call(this,this.params.focusOn)),this.params.selectedRegions&&this.setSelectedRegions(this.params.selectedRegions),this.params.selectedMarkers&&this.setSelectedMarkers(this.params.selectedMarkers),this.params.series&&this.createSeries()},jvm.WorldMap.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,setBackgroundColor:function(e){this.container.css("background-color",e)},resize:function(){var e=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/e,this.transX*=this.baseScale/e,this.transY*=this.baseScale/e},setSize:function(){this.width=this.container.width(),this.height=this.container.height(),this.resize(),this.canvas.setSize(this.width,this.height),this.applyTransform()},reset:function(){var e,t;for(e in this.series)for(t=0;tt?this.transY=t:this.transYe?this.transX=e:this.transXf[1].pageX?s=f[1].pageX+(f[0].pageX-f[1].pageX)/2:s=f[0].pageX+(f[1].pageX-f[0].pageX)/2,f[0].pageY>f[1].pageY?o=f[1].pageY+(f[0].pageY-f[1].pageY)/2:o=f[0].pageY+(f[1].pageY-f[0].pageY)/2,s-=l.left,o-=l.top,e=n.scale,t=Math.sqrt(Math.pow(f[0].pageX-f[1].pageX,2)+Math.pow(f[0].pageY-f[1].pageY,2)))),u=f.length};jvm.$(this.container).bind("touchstart",a),jvm.$(this.container).bind("touchmove",a)},bindElementEvents:function(){var e=this,t;this.container.mousemove(function(){t=!0}),this.container.delegate("[class~='jvectormap-element']","mouseover mouseout",function(t){var n=this,r=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),i=r.indexOf("jvectormap-region")===-1?"marker":"region",s=i=="region"?jvm.$(this).attr("data-code"):jvm.$(this).attr("data-index"),o=i=="region"?e.regions[s].element:e.markers[s].element,u=i=="region"?e.mapData.paths[s].name:e.markers[s].config.name||"",a=jvm.$.Event(i+"LabelShow.jvectormap"),f=jvm.$.Event(i+"Over.jvectormap");t.type=="mouseover"?(e.container.trigger(f,[s]),f.isDefaultPrevented()||o.setHovered(!0),e.label.text(u),e.container.trigger(a,[e.label,s]),a.isDefaultPrevented()||(e.label.show(),e.labelWidth=e.label.width(),e.labelHeight=e.label.height())):(o.setHovered(!1),e.label.hide(),e.container.trigger(i+"Out.jvectormap",[s]))}),this.container.delegate("[class~='jvectormap-element']","mousedown",function(e){t=!1}),this.container.delegate("[class~='jvectormap-element']","mouseup",function(n){var r=this,i=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),s=i.indexOf("jvectormap-region")===-1?"marker":"region",o=s=="region"?jvm.$(this).attr("data-code"):jvm.$(this).attr("data-index"),u=jvm.$.Event(s+"Click.jvectormap"),a=s=="region"?e.regions[o].element:e.markers[o].element;if(!t){e.container.trigger(u,[o]);if(s==="region"&&e.params.regionsSelectable||s==="marker"&&e.params.markersSelectable)u.isDefaultPrevented()||(e.params[s+"sSelectableOne"]&&e.clearSelected(s+"s"),a.setSelected(!a.isSelected))}})},bindZoomButtons:function(){var e=this;jvm.$("
      ").addClass("jvectormap-zoomin").text("+").appendTo(this.container),jvm.$("
      ").addClass("jvectormap-zoomout").html("−").appendTo(this.container),this.container.find(".jvectormap-zoomin").click(function(){e.setScale(e.scale*e.params.zoomStep,e.width/2,e.height/2)}),this.container.find(".jvectormap-zoomout").click(function(){e.setScale(e.scale/e.params.zoomStep,e.width/2,e.height/2)})},createLabel:function(){var e=this;this.label=jvm.$("
      ").addClass("jvectormap-label").appendTo(jvm.$("body")),this.container.mousemove(function(t){var n=t.pageX-15-e.labelWidth,r=t.pageY-15-e.labelHeight;n<5&&(n=t.pageX+15),r<5&&(r=t.pageY+15),e.label.is(":visible")&&e.label.css({left:n,top:r})})},setScale:function(e,t,n,r){var i,s=jvm.$.Event("zoom.jvectormap");e>this.params.zoomMax*this.baseScale?e=this.params.zoomMax*this.baseScale:eu[0].x&&au[0].y&&fi[0].x&&ei[0].y&&tarticle,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}"; +c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| +"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f); +if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d').attr($.extend(args(this), { 'type': 'text' })); + } + $replacement + .removeAttr('name') + .data({ + 'placeholder-password': $input, + 'placeholder-id': id + }) + .bind('focus.placeholder', clearPlaceholder); + $input + .data({ + 'placeholder-textinput': $replacement, + 'placeholder-id': id + }) + .before($replacement); + } + $input = $input.removeAttr('id').hide().prev().attr('id', id).show(); + // Note: `$input[0] != input` now! + } + $input.addClass('placeholder'); + $input[0].value = $input.attr('placeholder'); + } else { + $input.removeClass('placeholder'); + } + } + + function safeActiveElement() { + // Avoid IE9 `document.activeElement` of death + // https://github.com/mathiasbynens/jquery-placeholder/pull/99 + try { + return document.activeElement; + } catch (err) {} + } + +}(this, document, jQuery)); + +$(function(){ + $("[placeholder]").placeholder(); +}); diff --git a/public/assets/js/plugins/misc/modernizr.min.js b/public/assets/js/plugins/misc/modernizr.min.js new file mode 100755 index 00000000..4a76012e --- /dev/null +++ b/public/assets/js/plugins/misc/modernizr.min.js @@ -0,0 +1,4 @@ +/* Modernizr 2.7.1 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-printshiv-mq-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load-cssclassprefix:modernizr + */ +;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.flexboxlegacy=function(){return J("boxDirection")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" modernizr"+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" modernizrjs modernizr"+v.join(" modernizr"):""),e}(this,this.document),function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e+~])("+m().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),f="$1"+u+"\\:$2";while(d--)b=c[d]=c[d].split("}"),b[b.length-1]=b[b.length-1].replace(e,f),c[d]=b.join("}");return c.join("{")}function z(a){var b=a.length;while(b--)a[b].removeNode()}function A(a){function g(){clearTimeout(d._removeSheetTimer),b&&b.removeNode(!0),b=null}var b,c,d=n(a),e=a.namespaces,f=a.parentWindow;return!v||a.printShived?a:(typeof e[u]=="undefined"&&e.add(u),f.attachEvent("onbeforeprint",function(){g();var d,e,f,h=a.styleSheets,i=[],j=h.length,k=Array(j);while(j--)k[j]=h[j];while(f=k.pop())if(!f.disabled&&t.test(f.media)){try{d=f.imports,e=d.length}catch(m){e=0}for(j=0;j",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b);var t=/^$|\b(?:all|print)\b/,u="html5shiv",v=!k&&function(){var c=b.documentElement;return typeof b.namespaces!="undefined"&&typeof b.parentWindow!="undefined"&&typeof c.applyElement!="undefined"&&typeof c.removeNode!="undefined"&&typeof a.attachEvent!="undefined"}();s.type+=" print",s.shivPrint=A,A(b)}(this,document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b intnum.length) { + ret += strabsnum.slice(intnum.length); + } + return ret; + } else { + return '-'; + } + }; + + Morris.pad2 = function(number) { + return (number < 10 ? '0' : '') + number; + }; + + Morris.Grid = (function(_super) { + __extends(Grid, _super); + + function Grid(options) { + this.resizeHandler = __bind(this.resizeHandler, this); + var _this = this; + if (typeof options.element === 'string') { + this.el = $(document.getElementById(options.element)); + } else { + this.el = $(options.element); + } + if ((this.el == null) || this.el.length === 0) { + throw new Error("Graph container element not found"); + } + if (this.el.css('position') === 'static') { + this.el.css('position', 'relative'); + } + this.options = $.extend({}, this.gridDefaults, this.defaults || {}, options); + if (typeof this.options.units === 'string') { + this.options.postUnits = options.units; + } + this.raphael = new Raphael(this.el[0]); + this.elementWidth = null; + this.elementHeight = null; + this.dirty = false; + this.selectFrom = null; + if (this.init) { + this.init(); + } + this.setData(this.options.data); + this.el.bind('mousemove', function(evt) { + var left, offset, right, width, x; + offset = _this.el.offset(); + x = evt.pageX - offset.left; + if (_this.selectFrom) { + left = _this.data[_this.hitTest(Math.min(x, _this.selectFrom))]._x; + right = _this.data[_this.hitTest(Math.max(x, _this.selectFrom))]._x; + width = right - left; + return _this.selectionRect.attr({ + x: left, + width: width + }); + } else { + return _this.fire('hovermove', x, evt.pageY - offset.top); + } + }); + this.el.bind('mouseleave', function(evt) { + if (_this.selectFrom) { + _this.selectionRect.hide(); + _this.selectFrom = null; + } + return _this.fire('hoverout'); + }); + this.el.bind('touchstart touchmove touchend', function(evt) { + var offset, touch; + touch = evt.originalEvent.touches[0] || evt.originalEvent.changedTouches[0]; + offset = _this.el.offset(); + _this.fire('hover', touch.pageX - offset.left, touch.pageY - offset.top); + return touch; + }); + this.el.bind('click', function(evt) { + var offset; + offset = _this.el.offset(); + return _this.fire('gridclick', evt.pageX - offset.left, evt.pageY - offset.top); + }); + if (this.options.rangeSelect) { + this.selectionRect = this.raphael.rect(0, 0, 0, this.el.innerHeight()).attr({ + fill: this.options.rangeSelectColor, + stroke: false + }).toBack().hide(); + this.el.bind('mousedown', function(evt) { + var offset; + offset = _this.el.offset(); + return _this.startRange(evt.pageX - offset.left); + }); + this.el.bind('mouseup', function(evt) { + var offset; + offset = _this.el.offset(); + _this.endRange(evt.pageX - offset.left); + return _this.fire('hovermove', evt.pageX - offset.left, evt.pageY - offset.top); + }); + } + if (this.options.resize) { + $(window).bind('resize', function(evt) { + if (_this.timeoutId != null) { + window.clearTimeout(_this.timeoutId); + } + return _this.timeoutId = window.setTimeout(_this.resizeHandler, 100); + }); + } + if (this.postInit) { + this.postInit(); + } + } + + Grid.prototype.gridDefaults = { + dateFormat: null, + axes: true, + grid: true, + gridLineColor: '#aaa', + gridStrokeWidth: 0.5, + gridTextColor: '#888', + gridTextSize: 12, + gridTextFamily: 'sans-serif', + gridTextWeight: 'normal', + hideHover: false, + yLabelFormat: null, + xLabelAngle: 0, + numLines: 5, + padding: 25, + parseTime: true, + postUnits: '', + preUnits: '', + ymax: 'auto', + ymin: 'auto 0', + goals: [], + goalStrokeWidth: 1.0, + goalLineColors: ['#666633', '#999966', '#cc6666', '#663333'], + events: [], + eventStrokeWidth: 1.0, + eventLineColors: ['#005a04', '#ccffbb', '#3a5f0b', '#005502'], + rangeSelect: null, + rangeSelectColor: '#eef', + resize: false + }; + + Grid.prototype.setData = function(data, redraw) { + var e, idx, index, maxGoal, minGoal, ret, row, step, total, y, ykey, ymax, ymin, yval, _ref; + if (redraw == null) { + redraw = true; + } + this.options.data = data; + if ((data == null) || data.length === 0) { + this.data = []; + this.raphael.clear(); + if (this.hover != null) { + this.hover.hide(); + } + return; + } + ymax = this.cumulative ? 0 : null; + ymin = this.cumulative ? 0 : null; + if (this.options.goals.length > 0) { + minGoal = Math.min.apply(Math, this.options.goals); + maxGoal = Math.max.apply(Math, this.options.goals); + ymin = ymin != null ? Math.min(ymin, minGoal) : minGoal; + ymax = ymax != null ? Math.max(ymax, maxGoal) : maxGoal; + } + this.data = (function() { + var _i, _len, _results; + _results = []; + for (index = _i = 0, _len = data.length; _i < _len; index = ++_i) { + row = data[index]; + ret = { + src: row + }; + ret.label = row[this.options.xkey]; + if (this.options.parseTime) { + ret.x = Morris.parseDate(ret.label); + if (this.options.dateFormat) { + ret.label = this.options.dateFormat(ret.x); + } else if (typeof ret.label === 'number') { + ret.label = new Date(ret.label).toString(); + } + } else { + ret.x = index; + if (this.options.xLabelFormat) { + ret.label = this.options.xLabelFormat(ret); + } + } + total = 0; + ret.y = (function() { + var _j, _len1, _ref, _results1; + _ref = this.options.ykeys; + _results1 = []; + for (idx = _j = 0, _len1 = _ref.length; _j < _len1; idx = ++_j) { + ykey = _ref[idx]; + yval = row[ykey]; + if (typeof yval === 'string') { + yval = parseFloat(yval); + } + if ((yval != null) && typeof yval !== 'number') { + yval = null; + } + if (yval != null) { + if (this.cumulative) { + total += yval; + } else { + if (ymax != null) { + ymax = Math.max(yval, ymax); + ymin = Math.min(yval, ymin); + } else { + ymax = ymin = yval; + } + } + } + if (this.cumulative && (total != null)) { + ymax = Math.max(total, ymax); + ymin = Math.min(total, ymin); + } + _results1.push(yval); + } + return _results1; + }).call(this); + _results.push(ret); + } + return _results; + }).call(this); + if (this.options.parseTime) { + this.data = this.data.sort(function(a, b) { + return (a.x > b.x) - (b.x > a.x); + }); + } + this.xmin = this.data[0].x; + this.xmax = this.data[this.data.length - 1].x; + this.events = []; + if (this.options.events.length > 0) { + if (this.options.parseTime) { + this.events = (function() { + var _i, _len, _ref, _results; + _ref = this.options.events; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + e = _ref[_i]; + _results.push(Morris.parseDate(e)); + } + return _results; + }).call(this); + } else { + this.events = this.options.events; + } + this.xmax = Math.max(this.xmax, Math.max.apply(Math, this.events)); + this.xmin = Math.min(this.xmin, Math.min.apply(Math, this.events)); + } + if (this.xmin === this.xmax) { + this.xmin -= 1; + this.xmax += 1; + } + this.ymin = this.yboundary('min', ymin); + this.ymax = this.yboundary('max', ymax); + if (this.ymin === this.ymax) { + if (ymin) { + this.ymin -= 1; + } + this.ymax += 1; + } + if (((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'y') || this.options.grid === true) { + if (this.options.ymax === this.gridDefaults.ymax && this.options.ymin === this.gridDefaults.ymin) { + this.grid = this.autoGridLines(this.ymin, this.ymax, this.options.numLines); + this.ymin = Math.min(this.ymin, this.grid[0]); + this.ymax = Math.max(this.ymax, this.grid[this.grid.length - 1]); + } else { + step = (this.ymax - this.ymin) / (this.options.numLines - 1); + this.grid = (function() { + var _i, _ref1, _ref2, _results; + _results = []; + for (y = _i = _ref1 = this.ymin, _ref2 = this.ymax; step > 0 ? _i <= _ref2 : _i >= _ref2; y = _i += step) { + _results.push(y); + } + return _results; + }).call(this); + } + } + this.dirty = true; + if (redraw) { + return this.redraw(); + } + }; + + Grid.prototype.yboundary = function(boundaryType, currentValue) { + var boundaryOption, suggestedValue; + boundaryOption = this.options["y" + boundaryType]; + if (typeof boundaryOption === 'string') { + if (boundaryOption.slice(0, 4) === 'auto') { + if (boundaryOption.length > 5) { + suggestedValue = parseInt(boundaryOption.slice(5), 10); + if (currentValue == null) { + return suggestedValue; + } + return Math[boundaryType](currentValue, suggestedValue); + } else { + if (currentValue != null) { + return currentValue; + } else { + return 0; + } + } + } else { + return parseInt(boundaryOption, 10); + } + } else { + return boundaryOption; + } + }; + + Grid.prototype.autoGridLines = function(ymin, ymax, nlines) { + var gmax, gmin, grid, smag, span, step, unit, y, ymag; + span = ymax - ymin; + ymag = Math.floor(Math.log(span) / Math.log(10)); + unit = Math.pow(10, ymag); + gmin = Math.floor(ymin / unit) * unit; + gmax = Math.ceil(ymax / unit) * unit; + step = (gmax - gmin) / (nlines - 1); + if (unit === 1 && step > 1 && Math.ceil(step) !== step) { + step = Math.ceil(step); + gmax = gmin + step * (nlines - 1); + } + if (gmin < 0 && gmax > 0) { + gmin = Math.floor(ymin / step) * step; + gmax = Math.ceil(ymax / step) * step; + } + if (step < 1) { + smag = Math.floor(Math.log(step) / Math.log(10)); + grid = (function() { + var _i, _results; + _results = []; + for (y = _i = gmin; step > 0 ? _i <= gmax : _i >= gmax; y = _i += step) { + _results.push(parseFloat(y.toFixed(1 - smag))); + } + return _results; + })(); + } else { + grid = (function() { + var _i, _results; + _results = []; + for (y = _i = gmin; step > 0 ? _i <= gmax : _i >= gmax; y = _i += step) { + _results.push(y); + } + return _results; + })(); + } + return grid; + }; + + Grid.prototype._calc = function() { + var bottomOffsets, gridLine, h, i, w, yLabelWidths, _ref, _ref1; + w = this.el.width(); + h = this.el.height(); + if (this.elementWidth !== w || this.elementHeight !== h || this.dirty) { + this.elementWidth = w; + this.elementHeight = h; + this.dirty = false; + this.left = this.options.padding; + this.right = this.elementWidth - this.options.padding; + this.top = this.options.padding; + this.bottom = this.elementHeight - this.options.padding; + if ((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'y') { + yLabelWidths = (function() { + var _i, _len, _ref1, _results; + _ref1 = this.grid; + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + gridLine = _ref1[_i]; + _results.push(this.measureText(this.yAxisFormat(gridLine)).width); + } + return _results; + }).call(this); + this.left += Math.max.apply(Math, yLabelWidths); + } + if ((_ref1 = this.options.axes) === true || _ref1 === 'both' || _ref1 === 'x') { + bottomOffsets = (function() { + var _i, _ref2, _results; + _results = []; + for (i = _i = 0, _ref2 = this.data.length; 0 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 0 <= _ref2 ? ++_i : --_i) { + _results.push(this.measureText(this.data[i].text, -this.options.xLabelAngle).height); + } + return _results; + }).call(this); + this.bottom -= Math.max.apply(Math, bottomOffsets); + } + this.width = Math.max(1, this.right - this.left); + this.height = Math.max(1, this.bottom - this.top); + this.dx = this.width / (this.xmax - this.xmin); + this.dy = this.height / (this.ymax - this.ymin); + if (this.calc) { + return this.calc(); + } + } + }; + + Grid.prototype.transY = function(y) { + return this.bottom - (y - this.ymin) * this.dy; + }; + + Grid.prototype.transX = function(x) { + if (this.data.length === 1) { + return (this.left + this.right) / 2; + } else { + return this.left + (x - this.xmin) * this.dx; + } + }; + + Grid.prototype.redraw = function() { + this.raphael.clear(); + this._calc(); + this.drawGrid(); + this.drawGoals(); + this.drawEvents(); + if (this.draw) { + return this.draw(); + } + }; + + Grid.prototype.measureText = function(text, angle) { + var ret, tt; + if (angle == null) { + angle = 0; + } + tt = this.raphael.text(100, 100, text).attr('font-size', this.options.gridTextSize).attr('font-family', this.options.gridTextFamily).attr('font-weight', this.options.gridTextWeight).rotate(angle); + ret = tt.getBBox(); + tt.remove(); + return ret; + }; + + Grid.prototype.yAxisFormat = function(label) { + return this.yLabelFormat(label); + }; + + Grid.prototype.yLabelFormat = function(label) { + if (typeof this.options.yLabelFormat === 'function') { + return this.options.yLabelFormat(label); + } else { + return "" + this.options.preUnits + (Morris.commas(label)) + this.options.postUnits; + } + }; + + Grid.prototype.drawGrid = function() { + var lineY, y, _i, _len, _ref, _ref1, _ref2, _results; + if (this.options.grid === false && ((_ref = this.options.axes) !== true && _ref !== 'both' && _ref !== 'y')) { + return; + } + _ref1 = this.grid; + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + lineY = _ref1[_i]; + y = this.transY(lineY); + if ((_ref2 = this.options.axes) === true || _ref2 === 'both' || _ref2 === 'y') { + this.drawYAxisLabel(this.left - this.options.padding / 2, y, this.yAxisFormat(lineY)); + } + if (this.options.grid) { + _results.push(this.drawGridLine("M" + this.left + "," + y + "H" + (this.left + this.width))); + } else { + _results.push(void 0); + } + } + return _results; + }; + + Grid.prototype.drawGoals = function() { + var color, goal, i, _i, _len, _ref, _results; + _ref = this.options.goals; + _results = []; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + goal = _ref[i]; + color = this.options.goalLineColors[i % this.options.goalLineColors.length]; + _results.push(this.drawGoal(goal, color)); + } + return _results; + }; + + Grid.prototype.drawEvents = function() { + var color, event, i, _i, _len, _ref, _results; + _ref = this.events; + _results = []; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + event = _ref[i]; + color = this.options.eventLineColors[i % this.options.eventLineColors.length]; + _results.push(this.drawEvent(event, color)); + } + return _results; + }; + + Grid.prototype.drawGoal = function(goal, color) { + return this.raphael.path("M" + this.left + "," + (this.transY(goal)) + "H" + this.right).attr('stroke', color).attr('stroke-width', this.options.goalStrokeWidth); + }; + + Grid.prototype.drawEvent = function(event, color) { + return this.raphael.path("M" + (this.transX(event)) + "," + this.bottom + "V" + this.top).attr('stroke', color).attr('stroke-width', this.options.eventStrokeWidth); + }; + + Grid.prototype.drawYAxisLabel = function(xPos, yPos, text) { + return this.raphael.text(xPos, yPos, text).attr('font-size', this.options.gridTextSize).attr('font-family', this.options.gridTextFamily).attr('font-weight', this.options.gridTextWeight).attr('fill', this.options.gridTextColor).attr('text-anchor', 'end'); + }; + + Grid.prototype.drawGridLine = function(path) { + return this.raphael.path(path).attr('stroke', this.options.gridLineColor).attr('stroke-width', this.options.gridStrokeWidth); + }; + + Grid.prototype.startRange = function(x) { + this.hover.hide(); + this.selectFrom = x; + return this.selectionRect.attr({ + x: x, + width: 0 + }).show(); + }; + + Grid.prototype.endRange = function(x) { + var end, start; + if (this.selectFrom) { + start = Math.min(this.selectFrom, x); + end = Math.max(this.selectFrom, x); + this.options.rangeSelect.call(this.el, { + start: this.data[this.hitTest(start)].x, + end: this.data[this.hitTest(end)].x + }); + return this.selectFrom = null; + } + }; + + Grid.prototype.resizeHandler = function() { + this.timeoutId = null; + this.raphael.setSize(this.el.width(), this.el.height()); + return this.redraw(); + }; + + return Grid; + + })(Morris.EventEmitter); + + Morris.parseDate = function(date) { + var isecs, m, msecs, n, o, offsetmins, p, q, r, ret, secs; + if (typeof date === 'number') { + return date; + } + m = date.match(/^(\d+) Q(\d)$/); + n = date.match(/^(\d+)-(\d+)$/); + o = date.match(/^(\d+)-(\d+)-(\d+)$/); + p = date.match(/^(\d+) W(\d+)$/); + q = date.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/); + r = date.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/); + if (m) { + return new Date(parseInt(m[1], 10), parseInt(m[2], 10) * 3 - 1, 1).getTime(); + } else if (n) { + return new Date(parseInt(n[1], 10), parseInt(n[2], 10) - 1, 1).getTime(); + } else if (o) { + return new Date(parseInt(o[1], 10), parseInt(o[2], 10) - 1, parseInt(o[3], 10)).getTime(); + } else if (p) { + ret = new Date(parseInt(p[1], 10), 0, 1); + if (ret.getDay() !== 4) { + ret.setMonth(0, 1 + ((4 - ret.getDay()) + 7) % 7); + } + return ret.getTime() + parseInt(p[2], 10) * 604800000; + } else if (q) { + if (!q[6]) { + return new Date(parseInt(q[1], 10), parseInt(q[2], 10) - 1, parseInt(q[3], 10), parseInt(q[4], 10), parseInt(q[5], 10)).getTime(); + } else { + offsetmins = 0; + if (q[6] !== 'Z') { + offsetmins = parseInt(q[8], 10) * 60 + parseInt(q[9], 10); + if (q[7] === '+') { + offsetmins = 0 - offsetmins; + } + } + return Date.UTC(parseInt(q[1], 10), parseInt(q[2], 10) - 1, parseInt(q[3], 10), parseInt(q[4], 10), parseInt(q[5], 10) + offsetmins); + } + } else if (r) { + secs = parseFloat(r[6]); + isecs = Math.floor(secs); + msecs = Math.round((secs - isecs) * 1000); + if (!r[8]) { + return new Date(parseInt(r[1], 10), parseInt(r[2], 10) - 1, parseInt(r[3], 10), parseInt(r[4], 10), parseInt(r[5], 10), isecs, msecs).getTime(); + } else { + offsetmins = 0; + if (r[8] !== 'Z') { + offsetmins = parseInt(r[10], 10) * 60 + parseInt(r[11], 10); + if (r[9] === '+') { + offsetmins = 0 - offsetmins; + } + } + return Date.UTC(parseInt(r[1], 10), parseInt(r[2], 10) - 1, parseInt(r[3], 10), parseInt(r[4], 10), parseInt(r[5], 10) + offsetmins, isecs, msecs); + } + } else { + return new Date(parseInt(date, 10), 0, 1).getTime(); + } + }; + + Morris.Hover = (function() { + Hover.defaults = { + "class": 'morris-hover morris-default-style' + }; + + function Hover(options) { + if (options == null) { + options = {}; + } + this.options = $.extend({}, Morris.Hover.defaults, options); + this.el = $("
      "); + this.el.hide(); + this.options.parent.append(this.el); + } + + Hover.prototype.update = function(html, x, y) { + this.html(html); + this.show(); + return this.moveTo(x, y); + }; + + Hover.prototype.html = function(content) { + return this.el.html(content); + }; + + Hover.prototype.moveTo = function(x, y) { + var hoverHeight, hoverWidth, left, parentHeight, parentWidth, top; + parentWidth = this.options.parent.innerWidth(); + parentHeight = this.options.parent.innerHeight(); + hoverWidth = this.el.outerWidth(); + hoverHeight = this.el.outerHeight(); + left = Math.min(Math.max(0, x - hoverWidth / 2), parentWidth - hoverWidth); + if (y != null) { + top = y - hoverHeight - 10; + if (top < 0) { + top = y + 10; + if (top + hoverHeight > parentHeight) { + top = parentHeight / 2 - hoverHeight / 2; + } + } + } else { + top = parentHeight / 2 - hoverHeight / 2; + } + return this.el.css({ + left: left + "px", + top: parseInt(top) + "px" + }); + }; + + Hover.prototype.show = function() { + return this.el.show(); + }; + + Hover.prototype.hide = function() { + return this.el.hide(); + }; + + return Hover; + + })(); + + Morris.Line = (function(_super) { + __extends(Line, _super); + + function Line(options) { + this.hilight = __bind(this.hilight, this); + this.onHoverOut = __bind(this.onHoverOut, this); + this.onHoverMove = __bind(this.onHoverMove, this); + this.onGridClick = __bind(this.onGridClick, this); + if (!(this instanceof Morris.Line)) { + return new Morris.Line(options); + } + Line.__super__.constructor.call(this, options); + } + + Line.prototype.init = function() { + if (this.options.hideHover !== 'always') { + this.hover = new Morris.Hover({ + parent: this.el + }); + this.on('hovermove', this.onHoverMove); + this.on('hoverout', this.onHoverOut); + return this.on('gridclick', this.onGridClick); + } + }; + + Line.prototype.defaults = { + lineWidth: 3, + pointSize: 4, + lineColors: ['#0b62a4', '#7A92A3', '#4da74d', '#afd8f8', '#edc240', '#cb4b4b', '#9440ed'], + pointStrokeWidths: [1], + pointStrokeColors: ['#ffffff'], + pointFillColors: [], + smooth: true, + xLabels: 'auto', + xLabelFormat: null, + xLabelMargin: 24, + continuousLine: true, + hideHover: false + }; + + Line.prototype.calc = function() { + this.calcPoints(); + return this.generatePaths(); + }; + + Line.prototype.calcPoints = function() { + var row, y, _i, _len, _ref, _results; + _ref = this.data; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + row = _ref[_i]; + row._x = this.transX(row.x); + row._y = (function() { + var _j, _len1, _ref1, _results1; + _ref1 = row.y; + _results1 = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + y = _ref1[_j]; + if (y != null) { + _results1.push(this.transY(y)); + } else { + _results1.push(y); + } + } + return _results1; + }).call(this); + _results.push(row._ymax = Math.min.apply(Math, [this.bottom].concat((function() { + var _j, _len1, _ref1, _results1; + _ref1 = row._y; + _results1 = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + y = _ref1[_j]; + if (y != null) { + _results1.push(y); + } + } + return _results1; + })()))); + } + return _results; + }; + + Line.prototype.hitTest = function(x) { + var index, r, _i, _len, _ref; + if (this.data.length === 0) { + return null; + } + _ref = this.data.slice(1); + for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { + r = _ref[index]; + if (x < (r._x + this.data[index]._x) / 2) { + break; + } + } + return index; + }; + + Line.prototype.onGridClick = function(x, y) { + var index; + index = this.hitTest(x); + return this.fire('click', index, this.data[index].src, x, y); + }; + + Line.prototype.onHoverMove = function(x, y) { + var index; + index = this.hitTest(x); + return this.displayHoverForRow(index); + }; + + Line.prototype.onHoverOut = function() { + if (this.options.hideHover !== false) { + return this.displayHoverForRow(null); + } + }; + + Line.prototype.displayHoverForRow = function(index) { + var _ref; + if (index != null) { + (_ref = this.hover).update.apply(_ref, this.hoverContentForRow(index)); + return this.hilight(index); + } else { + this.hover.hide(); + return this.hilight(); + } + }; + + Line.prototype.hoverContentForRow = function(index) { + var content, j, row, y, _i, _len, _ref; + row = this.data[index]; + content = "
      " + row.label + "
      "; + _ref = row.y; + for (j = _i = 0, _len = _ref.length; _i < _len; j = ++_i) { + y = _ref[j]; + content += "
      \n " + this.options.labels[j] + ":\n " + (this.yLabelFormat(y)) + "\n
      "; + } + if (typeof this.options.hoverCallback === 'function') { + content = this.options.hoverCallback(index, this.options, content, row.src); + } + return [content, row._x, row._ymax]; + }; + + Line.prototype.generatePaths = function() { + var c, coords, i, r, smooth; + return this.paths = (function() { + var _i, _ref, _ref1, _results; + _results = []; + for (i = _i = 0, _ref = this.options.ykeys.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { + smooth = typeof this.options.smooth === "boolean" ? this.options.smooth : (_ref1 = this.options.ykeys[i], __indexOf.call(this.options.smooth, _ref1) >= 0); + coords = (function() { + var _j, _len, _ref2, _results1; + _ref2 = this.data; + _results1 = []; + for (_j = 0, _len = _ref2.length; _j < _len; _j++) { + r = _ref2[_j]; + if (r._y[i] !== void 0) { + _results1.push({ + x: r._x, + y: r._y[i] + }); + } + } + return _results1; + }).call(this); + if (this.options.continuousLine) { + coords = (function() { + var _j, _len, _results1; + _results1 = []; + for (_j = 0, _len = coords.length; _j < _len; _j++) { + c = coords[_j]; + if (c.y !== null) { + _results1.push(c); + } + } + return _results1; + })(); + } + if (coords.length > 1) { + _results.push(Morris.Line.createPath(coords, smooth, this.bottom)); + } else { + _results.push(null); + } + } + return _results; + }).call(this); + }; + + Line.prototype.draw = function() { + var _ref; + if ((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'x') { + this.drawXAxis(); + } + this.drawSeries(); + if (this.options.hideHover === false) { + return this.displayHoverForRow(this.data.length - 1); + } + }; + + Line.prototype.drawXAxis = function() { + var drawLabel, l, labels, prevAngleMargin, prevLabelMargin, row, ypos, _i, _len, _results, + _this = this; + ypos = this.bottom + this.options.padding / 2; + prevLabelMargin = null; + prevAngleMargin = null; + drawLabel = function(labelText, xpos) { + var label, labelBox, margin, offset, textBox; + label = _this.drawXAxisLabel(_this.transX(xpos), ypos, labelText); + textBox = label.getBBox(); + label.transform("r" + (-_this.options.xLabelAngle)); + labelBox = label.getBBox(); + label.transform("t0," + (labelBox.height / 2) + "..."); + if (_this.options.xLabelAngle !== 0) { + offset = -0.5 * textBox.width * Math.cos(_this.options.xLabelAngle * Math.PI / 180.0); + label.transform("t" + offset + ",0..."); + } + labelBox = label.getBBox(); + if (((prevLabelMargin == null) || prevLabelMargin >= labelBox.x + labelBox.width || (prevAngleMargin != null) && prevAngleMargin >= labelBox.x) && labelBox.x >= 0 && (labelBox.x + labelBox.width) < _this.el.width()) { + if (_this.options.xLabelAngle !== 0) { + margin = 1.25 * _this.options.gridTextSize / Math.sin(_this.options.xLabelAngle * Math.PI / 180.0); + prevAngleMargin = labelBox.x - margin; + } + return prevLabelMargin = labelBox.x - _this.options.xLabelMargin; + } else { + return label.remove(); + } + }; + if (this.options.parseTime) { + if (this.data.length === 1 && this.options.xLabels === 'auto') { + labels = [[this.data[0].label, this.data[0].x]]; + } else { + labels = Morris.labelSeries(this.xmin, this.xmax, this.width, this.options.xLabels, this.options.xLabelFormat); + } + } else { + labels = (function() { + var _i, _len, _ref, _results; + _ref = this.data; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + row = _ref[_i]; + _results.push([row.label, row.x]); + } + return _results; + }).call(this); + } + labels.reverse(); + _results = []; + for (_i = 0, _len = labels.length; _i < _len; _i++) { + l = labels[_i]; + _results.push(drawLabel(l[0], l[1])); + } + return _results; + }; + + Line.prototype.drawSeries = function() { + var i, _i, _j, _ref, _ref1, _results; + this.seriesPoints = []; + for (i = _i = _ref = this.options.ykeys.length - 1; _ref <= 0 ? _i <= 0 : _i >= 0; i = _ref <= 0 ? ++_i : --_i) { + this._drawLineFor(i); + } + _results = []; + for (i = _j = _ref1 = this.options.ykeys.length - 1; _ref1 <= 0 ? _j <= 0 : _j >= 0; i = _ref1 <= 0 ? ++_j : --_j) { + _results.push(this._drawPointFor(i)); + } + return _results; + }; + + Line.prototype._drawPointFor = function(index) { + var circle, row, _i, _len, _ref, _results; + this.seriesPoints[index] = []; + _ref = this.data; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + row = _ref[_i]; + circle = null; + if (row._y[index] != null) { + circle = this.drawLinePoint(row._x, row._y[index], this.colorFor(row, index, 'point'), index); + } + _results.push(this.seriesPoints[index].push(circle)); + } + return _results; + }; + + Line.prototype._drawLineFor = function(index) { + var path; + path = this.paths[index]; + if (path !== null) { + return this.drawLinePath(path, this.colorFor(null, index, 'line'), index); + } + }; + + Line.createPath = function(coords, smooth, bottom) { + var coord, g, grads, i, ix, lg, path, prevCoord, x1, x2, y1, y2, _i, _len; + path = ""; + if (smooth) { + grads = Morris.Line.gradients(coords); + } + prevCoord = { + y: null + }; + for (i = _i = 0, _len = coords.length; _i < _len; i = ++_i) { + coord = coords[i]; + if (coord.y != null) { + if (prevCoord.y != null) { + if (smooth) { + g = grads[i]; + lg = grads[i - 1]; + ix = (coord.x - prevCoord.x) / 4; + x1 = prevCoord.x + ix; + y1 = Math.min(bottom, prevCoord.y + ix * lg); + x2 = coord.x - ix; + y2 = Math.min(bottom, coord.y - ix * g); + path += "C" + x1 + "," + y1 + "," + x2 + "," + y2 + "," + coord.x + "," + coord.y; + } else { + path += "L" + coord.x + "," + coord.y; + } + } else { + if (!smooth || (grads[i] != null)) { + path += "M" + coord.x + "," + coord.y; + } + } + } + prevCoord = coord; + } + return path; + }; + + Line.gradients = function(coords) { + var coord, grad, i, nextCoord, prevCoord, _i, _len, _results; + grad = function(a, b) { + return (a.y - b.y) / (a.x - b.x); + }; + _results = []; + for (i = _i = 0, _len = coords.length; _i < _len; i = ++_i) { + coord = coords[i]; + if (coord.y != null) { + nextCoord = coords[i + 1] || { + y: null + }; + prevCoord = coords[i - 1] || { + y: null + }; + if ((prevCoord.y != null) && (nextCoord.y != null)) { + _results.push(grad(prevCoord, nextCoord)); + } else if (prevCoord.y != null) { + _results.push(grad(prevCoord, coord)); + } else if (nextCoord.y != null) { + _results.push(grad(coord, nextCoord)); + } else { + _results.push(null); + } + } else { + _results.push(null); + } + } + return _results; + }; + + Line.prototype.hilight = function(index) { + var i, _i, _j, _ref, _ref1; + if (this.prevHilight !== null && this.prevHilight !== index) { + for (i = _i = 0, _ref = this.seriesPoints.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) { + if (this.seriesPoints[i][this.prevHilight]) { + this.seriesPoints[i][this.prevHilight].animate(this.pointShrinkSeries(i)); + } + } + } + if (index !== null && this.prevHilight !== index) { + for (i = _j = 0, _ref1 = this.seriesPoints.length - 1; 0 <= _ref1 ? _j <= _ref1 : _j >= _ref1; i = 0 <= _ref1 ? ++_j : --_j) { + if (this.seriesPoints[i][index]) { + this.seriesPoints[i][index].animate(this.pointGrowSeries(i)); + } + } + } + return this.prevHilight = index; + }; + + Line.prototype.colorFor = function(row, sidx, type) { + if (typeof this.options.lineColors === 'function') { + return this.options.lineColors.call(this, row, sidx, type); + } else if (type === 'point') { + return this.options.pointFillColors[sidx % this.options.pointFillColors.length] || this.options.lineColors[sidx % this.options.lineColors.length]; + } else { + return this.options.lineColors[sidx % this.options.lineColors.length]; + } + }; + + Line.prototype.drawXAxisLabel = function(xPos, yPos, text) { + return this.raphael.text(xPos, yPos, text).attr('font-size', this.options.gridTextSize).attr('font-family', this.options.gridTextFamily).attr('font-weight', this.options.gridTextWeight).attr('fill', this.options.gridTextColor); + }; + + Line.prototype.drawLinePath = function(path, lineColor, lineIndex) { + return this.raphael.path(path).attr('stroke', lineColor).attr('stroke-width', this.lineWidthForSeries(lineIndex)); + }; + + Line.prototype.drawLinePoint = function(xPos, yPos, pointColor, lineIndex) { + return this.raphael.circle(xPos, yPos, this.pointSizeForSeries(lineIndex)).attr('fill', pointColor).attr('stroke-width', this.pointStrokeWidthForSeries(lineIndex)).attr('stroke', this.pointStrokeColorForSeries(lineIndex)); + }; + + Line.prototype.pointStrokeWidthForSeries = function(index) { + return this.options.pointStrokeWidths[index % this.options.pointStrokeWidths.length]; + }; + + Line.prototype.pointStrokeColorForSeries = function(index) { + return this.options.pointStrokeColors[index % this.options.pointStrokeColors.length]; + }; + + Line.prototype.lineWidthForSeries = function(index) { + if (this.options.lineWidth instanceof Array) { + return this.options.lineWidth[index % this.options.lineWidth.length]; + } else { + return this.options.lineWidth; + } + }; + + Line.prototype.pointSizeForSeries = function(index) { + if (this.options.pointSize instanceof Array) { + return this.options.pointSize[index % this.options.pointSize.length]; + } else { + return this.options.pointSize; + } + }; + + Line.prototype.pointGrowSeries = function(index) { + return Raphael.animation({ + r: this.pointSizeForSeries(index) + 3 + }, 25, 'linear'); + }; + + Line.prototype.pointShrinkSeries = function(index) { + return Raphael.animation({ + r: this.pointSizeForSeries(index) + }, 25, 'linear'); + }; + + return Line; + + })(Morris.Grid); + + Morris.labelSeries = function(dmin, dmax, pxwidth, specName, xLabelFormat) { + var d, d0, ddensity, name, ret, s, spec, t, _i, _len, _ref; + ddensity = 200 * (dmax - dmin) / pxwidth; + d0 = new Date(dmin); + spec = Morris.LABEL_SPECS[specName]; + if (spec === void 0) { + _ref = Morris.AUTO_LABEL_ORDER; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + name = _ref[_i]; + s = Morris.LABEL_SPECS[name]; + if (ddensity >= s.span) { + spec = s; + break; + } + } + } + if (spec === void 0) { + spec = Morris.LABEL_SPECS["second"]; + } + if (xLabelFormat) { + spec = $.extend({}, spec, { + fmt: xLabelFormat + }); + } + d = spec.start(d0); + ret = []; + while ((t = d.getTime()) <= dmax) { + if (t >= dmin) { + ret.push([spec.fmt(d), t]); + } + spec.incr(d); + } + return ret; + }; + + minutesSpecHelper = function(interval) { + return { + span: interval * 60 * 1000, + start: function(d) { + return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours()); + }, + fmt: function(d) { + return "" + (Morris.pad2(d.getHours())) + ":" + (Morris.pad2(d.getMinutes())); + }, + incr: function(d) { + return d.setUTCMinutes(d.getUTCMinutes() + interval); + } + }; + }; + + secondsSpecHelper = function(interval) { + return { + span: interval * 1000, + start: function(d) { + return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes()); + }, + fmt: function(d) { + return "" + (Morris.pad2(d.getHours())) + ":" + (Morris.pad2(d.getMinutes())) + ":" + (Morris.pad2(d.getSeconds())); + }, + incr: function(d) { + return d.setUTCSeconds(d.getUTCSeconds() + interval); + } + }; + }; + + Morris.LABEL_SPECS = { + "decade": { + span: 172800000000, + start: function(d) { + return new Date(d.getFullYear() - d.getFullYear() % 10, 0, 1); + }, + fmt: function(d) { + return "" + (d.getFullYear()); + }, + incr: function(d) { + return d.setFullYear(d.getFullYear() + 10); + } + }, + "year": { + span: 17280000000, + start: function(d) { + return new Date(d.getFullYear(), 0, 1); + }, + fmt: function(d) { + return "" + (d.getFullYear()); + }, + incr: function(d) { + return d.setFullYear(d.getFullYear() + 1); + } + }, + "month": { + span: 2419200000, + start: function(d) { + return new Date(d.getFullYear(), d.getMonth(), 1); + }, + fmt: function(d) { + return "" + (d.getFullYear()) + "-" + (Morris.pad2(d.getMonth() + 1)); + }, + incr: function(d) { + return d.setMonth(d.getMonth() + 1); + } + }, + "week": { + span: 604800000, + start: function(d) { + return new Date(d.getFullYear(), d.getMonth(), d.getDate()); + }, + fmt: function(d) { + return "" + (d.getFullYear()) + "-" + (Morris.pad2(d.getMonth() + 1)) + "-" + (Morris.pad2(d.getDate())); + }, + incr: function(d) { + return d.setDate(d.getDate() + 7); + } + }, + "day": { + span: 86400000, + start: function(d) { + return new Date(d.getFullYear(), d.getMonth(), d.getDate()); + }, + fmt: function(d) { + return "" + (d.getFullYear()) + "-" + (Morris.pad2(d.getMonth() + 1)) + "-" + (Morris.pad2(d.getDate())); + }, + incr: function(d) { + return d.setDate(d.getDate() + 1); + } + }, + "hour": minutesSpecHelper(60), + "30min": minutesSpecHelper(30), + "15min": minutesSpecHelper(15), + "10min": minutesSpecHelper(10), + "5min": minutesSpecHelper(5), + "minute": minutesSpecHelper(1), + "30sec": secondsSpecHelper(30), + "15sec": secondsSpecHelper(15), + "10sec": secondsSpecHelper(10), + "5sec": secondsSpecHelper(5), + "second": secondsSpecHelper(1) + }; + + Morris.AUTO_LABEL_ORDER = ["decade", "year", "month", "week", "day", "hour", "30min", "15min", "10min", "5min", "minute", "30sec", "15sec", "10sec", "5sec", "second"]; + + Morris.Area = (function(_super) { + var areaDefaults; + + __extends(Area, _super); + + areaDefaults = { + fillOpacity: 'auto', + behaveLikeLine: false + }; + + function Area(options) { + var areaOptions; + if (!(this instanceof Morris.Area)) { + return new Morris.Area(options); + } + areaOptions = $.extend({}, areaDefaults, options); + this.cumulative = !areaOptions.behaveLikeLine; + if (areaOptions.fillOpacity === 'auto') { + areaOptions.fillOpacity = areaOptions.behaveLikeLine ? .8 : 1; + } + Area.__super__.constructor.call(this, areaOptions); + } + + Area.prototype.calcPoints = function() { + var row, total, y, _i, _len, _ref, _results; + _ref = this.data; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + row = _ref[_i]; + row._x = this.transX(row.x); + total = 0; + row._y = (function() { + var _j, _len1, _ref1, _results1; + _ref1 = row.y; + _results1 = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + y = _ref1[_j]; + if (this.options.behaveLikeLine) { + _results1.push(this.transY(y)); + } else { + total += y || 0; + _results1.push(this.transY(total)); + } + } + return _results1; + }).call(this); + _results.push(row._ymax = Math.max.apply(Math, row._y)); + } + return _results; + }; + + Area.prototype.drawSeries = function() { + var i, range, _i, _j, _k, _len, _ref, _ref1, _results, _results1, _results2; + this.seriesPoints = []; + if (this.options.behaveLikeLine) { + range = (function() { + _results = []; + for (var _i = 0, _ref = this.options.ykeys.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; 0 <= _ref ? _i++ : _i--){ _results.push(_i); } + return _results; + }).apply(this); + } else { + range = (function() { + _results1 = []; + for (var _j = _ref1 = this.options.ykeys.length - 1; _ref1 <= 0 ? _j <= 0 : _j >= 0; _ref1 <= 0 ? _j++ : _j--){ _results1.push(_j); } + return _results1; + }).apply(this); + } + _results2 = []; + for (_k = 0, _len = range.length; _k < _len; _k++) { + i = range[_k]; + this._drawFillFor(i); + this._drawLineFor(i); + _results2.push(this._drawPointFor(i)); + } + return _results2; + }; + + Area.prototype._drawFillFor = function(index) { + var path; + path = this.paths[index]; + if (path !== null) { + path = path + ("L" + (this.transX(this.xmax)) + "," + this.bottom + "L" + (this.transX(this.xmin)) + "," + this.bottom + "Z"); + return this.drawFilledPath(path, this.fillForSeries(index)); + } + }; + + Area.prototype.fillForSeries = function(i) { + var color; + color = Raphael.rgb2hsl(this.colorFor(this.data[i], i, 'line')); + return Raphael.hsl(color.h, this.options.behaveLikeLine ? color.s * 0.9 : color.s * 0.75, Math.min(0.98, this.options.behaveLikeLine ? color.l * 1.2 : color.l * 1.25)); + }; + + Area.prototype.drawFilledPath = function(path, fill) { + return this.raphael.path(path).attr('fill', fill).attr('fill-opacity', this.options.fillOpacity).attr('stroke', 'none'); + }; + + return Area; + + })(Morris.Line); + + Morris.Bar = (function(_super) { + __extends(Bar, _super); + + function Bar(options) { + this.onHoverOut = __bind(this.onHoverOut, this); + this.onHoverMove = __bind(this.onHoverMove, this); + this.onGridClick = __bind(this.onGridClick, this); + if (!(this instanceof Morris.Bar)) { + return new Morris.Bar(options); + } + Bar.__super__.constructor.call(this, $.extend({}, options, { + parseTime: false + })); + } + + Bar.prototype.init = function() { + this.cumulative = this.options.stacked; + if (this.options.hideHover !== 'always') { + this.hover = new Morris.Hover({ + parent: this.el + }); + this.on('hovermove', this.onHoverMove); + this.on('hoverout', this.onHoverOut); + return this.on('gridclick', this.onGridClick); + } + }; + + Bar.prototype.defaults = { + barSizeRatio: 0.75, + barGap: 3, + barColors: ['#0b62a4', '#7a92a3', '#4da74d', '#afd8f8', '#edc240', '#cb4b4b', '#9440ed'], + barOpacity: 1.0, + barRadius: [0, 0, 0, 0], + xLabelMargin: 50 + }; + + Bar.prototype.calc = function() { + var _ref; + this.calcBars(); + if (this.options.hideHover === false) { + return (_ref = this.hover).update.apply(_ref, this.hoverContentForRow(this.data.length - 1)); + } + }; + + Bar.prototype.calcBars = function() { + var idx, row, y, _i, _len, _ref, _results; + _ref = this.data; + _results = []; + for (idx = _i = 0, _len = _ref.length; _i < _len; idx = ++_i) { + row = _ref[idx]; + row._x = this.left + this.width * (idx + 0.5) / this.data.length; + _results.push(row._y = (function() { + var _j, _len1, _ref1, _results1; + _ref1 = row.y; + _results1 = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + y = _ref1[_j]; + if (y != null) { + _results1.push(this.transY(y)); + } else { + _results1.push(null); + } + } + return _results1; + }).call(this)); + } + return _results; + }; + + Bar.prototype.draw = function() { + var _ref; + if ((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'x') { + this.drawXAxis(); + } + return this.drawSeries(); + }; + + Bar.prototype.drawXAxis = function() { + var i, label, labelBox, margin, offset, prevAngleMargin, prevLabelMargin, row, textBox, ypos, _i, _ref, _results; + ypos = this.bottom + (this.options.xAxisLabelTopPadding || this.options.padding / 2); + prevLabelMargin = null; + prevAngleMargin = null; + _results = []; + for (i = _i = 0, _ref = this.data.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { + row = this.data[this.data.length - 1 - i]; + label = this.drawXAxisLabel(row._x, ypos, row.label); + textBox = label.getBBox(); + label.transform("r" + (-this.options.xLabelAngle)); + labelBox = label.getBBox(); + label.transform("t0," + (labelBox.height / 2) + "..."); + if (this.options.xLabelAngle !== 0) { + offset = -0.5 * textBox.width * Math.cos(this.options.xLabelAngle * Math.PI / 180.0); + label.transform("t" + offset + ",0..."); + } + if (((prevLabelMargin == null) || prevLabelMargin >= labelBox.x + labelBox.width || (prevAngleMargin != null) && prevAngleMargin >= labelBox.x) && labelBox.x >= 0 && (labelBox.x + labelBox.width) < this.el.width()) { + if (this.options.xLabelAngle !== 0) { + margin = 1.25 * this.options.gridTextSize / Math.sin(this.options.xLabelAngle * Math.PI / 180.0); + prevAngleMargin = labelBox.x - margin; + } + _results.push(prevLabelMargin = labelBox.x - this.options.xLabelMargin); + } else { + _results.push(label.remove()); + } + } + return _results; + }; + + Bar.prototype.drawSeries = function() { + var barWidth, bottom, groupWidth, idx, lastTop, left, leftPadding, numBars, row, sidx, size, top, ypos, zeroPos; + groupWidth = this.width / this.options.data.length; + numBars = this.options.stacked != null ? 1 : this.options.ykeys.length; + barWidth = (groupWidth * this.options.barSizeRatio - this.options.barGap * (numBars - 1)) / numBars; + leftPadding = groupWidth * (1 - this.options.barSizeRatio) / 2; + zeroPos = this.ymin <= 0 && this.ymax >= 0 ? this.transY(0) : null; + return this.bars = (function() { + var _i, _len, _ref, _results; + _ref = this.data; + _results = []; + for (idx = _i = 0, _len = _ref.length; _i < _len; idx = ++_i) { + row = _ref[idx]; + lastTop = 0; + _results.push((function() { + var _j, _len1, _ref1, _results1; + _ref1 = row._y; + _results1 = []; + for (sidx = _j = 0, _len1 = _ref1.length; _j < _len1; sidx = ++_j) { + ypos = _ref1[sidx]; + if (ypos !== null) { + if (zeroPos) { + top = Math.min(ypos, zeroPos); + bottom = Math.max(ypos, zeroPos); + } else { + top = ypos; + bottom = this.bottom; + } + left = this.left + idx * groupWidth + leftPadding; + if (!this.options.stacked) { + left += sidx * (barWidth + this.options.barGap); + } + size = bottom - top; + if (this.options.stacked) { + top -= lastTop; + } + this.drawBar(left, top, barWidth, size, this.colorFor(row, sidx, 'bar'), this.options.barOpacity, this.options.barRadius); + _results1.push(lastTop += size); + } else { + _results1.push(null); + } + } + return _results1; + }).call(this)); + } + return _results; + }).call(this); + }; + + Bar.prototype.colorFor = function(row, sidx, type) { + var r, s; + if (typeof this.options.barColors === 'function') { + r = { + x: row.x, + y: row.y[sidx], + label: row.label + }; + s = { + index: sidx, + key: this.options.ykeys[sidx], + label: this.options.labels[sidx] + }; + return this.options.barColors.call(this, r, s, type); + } else { + return this.options.barColors[sidx % this.options.barColors.length]; + } + }; + + Bar.prototype.hitTest = function(x) { + if (this.data.length === 0) { + return null; + } + x = Math.max(Math.min(x, this.right), this.left); + return Math.min(this.data.length - 1, Math.floor((x - this.left) / (this.width / this.data.length))); + }; + + Bar.prototype.onGridClick = function(x, y) { + var index; + index = this.hitTest(x); + return this.fire('click', index, this.data[index].src, x, y); + }; + + Bar.prototype.onHoverMove = function(x, y) { + var index, _ref; + index = this.hitTest(x); + return (_ref = this.hover).update.apply(_ref, this.hoverContentForRow(index)); + }; + + Bar.prototype.onHoverOut = function() { + if (this.options.hideHover !== false) { + return this.hover.hide(); + } + }; + + Bar.prototype.hoverContentForRow = function(index) { + var content, j, row, x, y, _i, _len, _ref; + row = this.data[index]; + content = "
      " + row.label + "
      "; + _ref = row.y; + for (j = _i = 0, _len = _ref.length; _i < _len; j = ++_i) { + y = _ref[j]; + content += "
      \n " + this.options.labels[j] + ":\n " + (this.yLabelFormat(y)) + "\n
      "; + } + if (typeof this.options.hoverCallback === 'function') { + content = this.options.hoverCallback(index, this.options, content, row.src); + } + x = this.left + (index + 0.5) * this.width / this.data.length; + return [content, x]; + }; + + Bar.prototype.drawXAxisLabel = function(xPos, yPos, text) { + var label; + return label = this.raphael.text(xPos, yPos, text).attr('font-size', this.options.gridTextSize).attr('font-family', this.options.gridTextFamily).attr('font-weight', this.options.gridTextWeight).attr('fill', this.options.gridTextColor); + }; + + Bar.prototype.drawBar = function(xPos, yPos, width, height, barColor, opacity, radiusArray) { + var maxRadius, path; + maxRadius = Math.max.apply(Math, radiusArray); + if (maxRadius === 0 || maxRadius > height) { + path = this.raphael.rect(xPos, yPos, width, height); + } else { + path = this.raphael.path(this.roundedRect(xPos, yPos, width, height, radiusArray)); + } + return path.attr('fill', barColor).attr('fill-opacity', opacity).attr('stroke', 'none'); + }; + + Bar.prototype.roundedRect = function(x, y, w, h, r) { + if (r == null) { + r = [0, 0, 0, 0]; + } + return ["M", x, r[0] + y, "Q", x, y, x + r[0], y, "L", x + w - r[1], y, "Q", x + w, y, x + w, y + r[1], "L", x + w, y + h - r[2], "Q", x + w, y + h, x + w - r[2], y + h, "L", x + r[3], y + h, "Q", x, y + h, x, y + h - r[3], "Z"]; + }; + + return Bar; + + })(Morris.Grid); + + Morris.Donut = (function(_super) { + __extends(Donut, _super); + + Donut.prototype.defaults = { + colors: ['#0B62A4', '#3980B5', '#679DC6', '#95BBD7', '#B0CCE1', '#095791', '#095085', '#083E67', '#052C48', '#042135'], + backgroundColor: '#FFFFFF', + labelColor: '#000000', + formatter: Morris.commas, + resize: false + }; + + function Donut(options) { + this.resizeHandler = __bind(this.resizeHandler, this); + this.select = __bind(this.select, this); + this.click = __bind(this.click, this); + var _this = this; + if (!(this instanceof Morris.Donut)) { + return new Morris.Donut(options); + } + this.options = $.extend({}, this.defaults, options); + if (typeof options.element === 'string') { + this.el = $(document.getElementById(options.element)); + } else { + this.el = $(options.element); + } + if (this.el === null || this.el.length === 0) { + throw new Error("Graph placeholder not found."); + } + if (options.data === void 0 || options.data.length === 0) { + return; + } + this.raphael = new Raphael(this.el[0]); + if (this.options.resize) { + $(window).bind('resize', function(evt) { + if (_this.timeoutId != null) { + window.clearTimeout(_this.timeoutId); + } + return _this.timeoutId = window.setTimeout(_this.resizeHandler, 100); + }); + } + this.setData(options.data); + } + + Donut.prototype.redraw = function() { + var C, cx, cy, i, idx, last, max_value, min, next, seg, total, value, w, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results; + this.raphael.clear(); + cx = this.el.width() / 2; + cy = this.el.height() / 2; + w = (Math.min(cx, cy) - 10) / 3; + total = 0; + _ref = this.values; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + value = _ref[_i]; + total += value; + } + min = 5 / (2 * w); + C = 1.9999 * Math.PI - min * this.data.length; + last = 0; + idx = 0; + this.segments = []; + _ref1 = this.values; + for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) { + value = _ref1[i]; + next = last + min + C * (value / total); + seg = new Morris.DonutSegment(cx, cy, w * 2, w, last, next, this.data[i].color || this.options.colors[idx % this.options.colors.length], this.options.backgroundColor, idx, this.raphael); + seg.render(); + this.segments.push(seg); + seg.on('hover', this.select); + seg.on('click', this.click); + last = next; + idx += 1; + } + this.text1 = this.drawEmptyDonutLabel(cx, cy - 10, this.options.labelColor, 15, 800); + this.text2 = this.drawEmptyDonutLabel(cx, cy + 10, this.options.labelColor, 14); + max_value = Math.max.apply(Math, this.values); + idx = 0; + _ref2 = this.values; + _results = []; + for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { + value = _ref2[_k]; + if (value === max_value) { + this.select(idx); + break; + } + _results.push(idx += 1); + } + return _results; + }; + + Donut.prototype.setData = function(data) { + var row; + this.data = data; + this.values = (function() { + var _i, _len, _ref, _results; + _ref = this.data; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + row = _ref[_i]; + _results.push(parseFloat(row.value)); + } + return _results; + }).call(this); + return this.redraw(); + }; + + Donut.prototype.click = function(idx) { + return this.fire('click', idx, this.data[idx]); + }; + + Donut.prototype.select = function(idx) { + var row, s, segment, _i, _len, _ref; + _ref = this.segments; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + s = _ref[_i]; + s.deselect(); + } + segment = this.segments[idx]; + segment.select(); + row = this.data[idx]; + return this.setLabels(row.label, this.options.formatter(row.value, row)); + }; + + Donut.prototype.setLabels = function(label1, label2) { + var inner, maxHeightBottom, maxHeightTop, maxWidth, text1bbox, text1scale, text2bbox, text2scale; + inner = (Math.min(this.el.width() / 2, this.el.height() / 2) - 10) * 2 / 3; + maxWidth = 1.8 * inner; + maxHeightTop = inner / 2; + maxHeightBottom = inner / 3; + this.text1.attr({ + text: label1, + transform: '' + }); + text1bbox = this.text1.getBBox(); + text1scale = Math.min(maxWidth / text1bbox.width, maxHeightTop / text1bbox.height); + this.text1.attr({ + transform: "S" + text1scale + "," + text1scale + "," + (text1bbox.x + text1bbox.width / 2) + "," + (text1bbox.y + text1bbox.height) + }); + this.text2.attr({ + text: label2, + transform: '' + }); + text2bbox = this.text2.getBBox(); + text2scale = Math.min(maxWidth / text2bbox.width, maxHeightBottom / text2bbox.height); + return this.text2.attr({ + transform: "S" + text2scale + "," + text2scale + "," + (text2bbox.x + text2bbox.width / 2) + "," + text2bbox.y + }); + }; + + Donut.prototype.drawEmptyDonutLabel = function(xPos, yPos, color, fontSize, fontWeight) { + var text; + text = this.raphael.text(xPos, yPos, '').attr('font-size', fontSize).attr('fill', color); + if (fontWeight != null) { + text.attr('font-weight', fontWeight); + } + return text; + }; + + Donut.prototype.resizeHandler = function() { + this.timeoutId = null; + this.raphael.setSize(this.el.width(), this.el.height()); + return this.redraw(); + }; + + return Donut; + + })(Morris.EventEmitter); + + Morris.DonutSegment = (function(_super) { + __extends(DonutSegment, _super); + + function DonutSegment(cx, cy, inner, outer, p0, p1, color, backgroundColor, index, raphael) { + this.cx = cx; + this.cy = cy; + this.inner = inner; + this.outer = outer; + this.color = color; + this.backgroundColor = backgroundColor; + this.index = index; + this.raphael = raphael; + this.deselect = __bind(this.deselect, this); + this.select = __bind(this.select, this); + this.sin_p0 = Math.sin(p0); + this.cos_p0 = Math.cos(p0); + this.sin_p1 = Math.sin(p1); + this.cos_p1 = Math.cos(p1); + this.is_long = (p1 - p0) > Math.PI ? 1 : 0; + this.path = this.calcSegment(this.inner + 3, this.inner + this.outer - 5); + this.selectedPath = this.calcSegment(this.inner + 3, this.inner + this.outer); + this.hilight = this.calcArc(this.inner); + } + + DonutSegment.prototype.calcArcPoints = function(r) { + return [this.cx + r * this.sin_p0, this.cy + r * this.cos_p0, this.cx + r * this.sin_p1, this.cy + r * this.cos_p1]; + }; + + DonutSegment.prototype.calcSegment = function(r1, r2) { + var ix0, ix1, iy0, iy1, ox0, ox1, oy0, oy1, _ref, _ref1; + _ref = this.calcArcPoints(r1), ix0 = _ref[0], iy0 = _ref[1], ix1 = _ref[2], iy1 = _ref[3]; + _ref1 = this.calcArcPoints(r2), ox0 = _ref1[0], oy0 = _ref1[1], ox1 = _ref1[2], oy1 = _ref1[3]; + return ("M" + ix0 + "," + iy0) + ("A" + r1 + "," + r1 + ",0," + this.is_long + ",0," + ix1 + "," + iy1) + ("L" + ox1 + "," + oy1) + ("A" + r2 + "," + r2 + ",0," + this.is_long + ",1," + ox0 + "," + oy0) + "Z"; + }; + + DonutSegment.prototype.calcArc = function(r) { + var ix0, ix1, iy0, iy1, _ref; + _ref = this.calcArcPoints(r), ix0 = _ref[0], iy0 = _ref[1], ix1 = _ref[2], iy1 = _ref[3]; + return ("M" + ix0 + "," + iy0) + ("A" + r + "," + r + ",0," + this.is_long + ",0," + ix1 + "," + iy1); + }; + + DonutSegment.prototype.render = function() { + var _this = this; + this.arc = this.drawDonutArc(this.hilight, this.color); + return this.seg = this.drawDonutSegment(this.path, this.color, this.backgroundColor, function() { + return _this.fire('hover', _this.index); + }, function() { + return _this.fire('click', _this.index); + }); + }; + + DonutSegment.prototype.drawDonutArc = function(path, color) { + return this.raphael.path(path).attr({ + stroke: color, + 'stroke-width': 2, + opacity: 0 + }); + }; + + DonutSegment.prototype.drawDonutSegment = function(path, fillColor, strokeColor, hoverFunction, clickFunction) { + return this.raphael.path(path).attr({ + fill: fillColor, + stroke: strokeColor, + 'stroke-width': 3 + }).hover(hoverFunction).click(clickFunction); + }; + + DonutSegment.prototype.select = function() { + if (!this.selected) { + this.seg.animate({ + path: this.selectedPath + }, 150, '<>'); + this.arc.animate({ + opacity: 1 + }, 150, '<>'); + return this.selected = true; + } + }; + + DonutSegment.prototype.deselect = function() { + if (this.selected) { + this.seg.animate({ + path: this.path + }, 150, '<>'); + this.arc.animate({ + opacity: 0 + }, 150, '<>'); + return this.selected = false; + } + }; + + return DonutSegment; + + })(Morris.EventEmitter); + +}).call(this); diff --git a/public/assets/js/plugins/morris/morris.min.js b/public/assets/js/plugins/morris/morris.min.js new file mode 100755 index 00000000..b7842aaf --- /dev/null +++ b/public/assets/js/plugins/morris/morris.min.js @@ -0,0 +1,2 @@ +(function(){var a,b,c,d,e=[].slice,f=function(a,b){return function(){return a.apply(b,arguments)}},g={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},i=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=window.Morris={},a=jQuery,b.EventEmitter=function(){function a(){}return a.prototype.on=function(a,b){return null==this.handlers&&(this.handlers={}),null==this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this},a.prototype.fire=function(){var a,b,c,d,f,g,h;if(c=arguments[0],a=2<=arguments.length?e.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[c]){for(g=this.handlers[c],h=[],d=0,f=g.length;f>d;d++)b=g[d],h.push(b.apply(null,a));return h}},a}(),b.commas=function(a){var b,c,d,e;return null!=a?(d=0>a?"-":"",b=Math.abs(a),c=Math.floor(b).toFixed(0),d+=c.replace(/(?=(?:\d{3})+$)(?!^)/g,","),e=b.toString(),e.length>c.length&&(d+=e.slice(c.length)),d):"-"},b.pad2=function(a){return(10>a?"0":"")+a},b.Grid=function(c){function d(b){this.resizeHandler=f(this.resizeHandler,this);var c=this;if(this.el="string"==typeof b.element?a(document.getElementById(b.element)):a(b.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=a.extend({},this.gridDefaults,this.defaults||{},b),"string"==typeof this.options.units&&(this.options.postUnits=b.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(a){var b,d,e,f,g;return d=c.el.offset(),g=a.pageX-d.left,c.selectFrom?(b=c.data[c.hitTest(Math.min(g,c.selectFrom))]._x,e=c.data[c.hitTest(Math.max(g,c.selectFrom))]._x,f=e-b,c.selectionRect.attr({x:b,width:f})):c.fire("hovermove",g,a.pageY-d.top)}),this.el.bind("mouseleave",function(){return c.selectFrom&&(c.selectionRect.hide(),c.selectFrom=null),c.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(a){var b,d;return d=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0],b=c.el.offset(),c.fire("hover",d.pageX-b.left,d.pageY-b.top),d}),this.el.bind("click",function(a){var b;return b=c.el.offset(),c.fire("gridclick",a.pageX-b.left,a.pageY-b.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),this.el.bind("mousedown",function(a){var b;return b=c.el.offset(),c.startRange(a.pageX-b.left)}),this.el.bind("mouseup",function(a){var b;return b=c.el.offset(),c.endRange(a.pageX-b.left),c.fire("hovermove",a.pageX-b.left,a.pageY-b.top)})),this.options.resize&&a(window).bind("resize",function(){return null!=c.timeoutId&&window.clearTimeout(c.timeoutId),c.timeoutId=window.setTimeout(c.resizeHandler,100)}),this.postInit&&this.postInit()}return h(d,c),d.prototype.gridDefaults={dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",hideHover:!1,yLabelFormat:null,xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],rangeSelect:null,rangeSelectColor:"#eef",resize:!1},d.prototype.setData=function(a,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;return null==c&&(c=!0),this.options.data=a,null==a||0===a.length?(this.data=[],this.raphael.clear(),null!=this.hover&&this.hover.hide(),void 0):(o=this.cumulative?0:null,p=this.cumulative?0:null,this.options.goals.length>0&&(h=Math.min.apply(Math,this.options.goals),g=Math.max.apply(Math,this.options.goals),p=null!=p?Math.min(p,h):h,o=null!=o?Math.max(o,g):g),this.data=function(){var c,d,g;for(g=[],f=c=0,d=a.length;d>c;f=++c)j=a[f],i={src:j},i.label=j[this.options.xkey],this.options.parseTime?(i.x=b.parseDate(i.label),this.options.dateFormat?i.label=this.options.dateFormat(i.x):"number"==typeof i.label&&(i.label=new Date(i.label).toString())):(i.x=f,this.options.xLabelFormat&&(i.label=this.options.xLabelFormat(i))),l=0,i.y=function(){var a,b,c,d;for(c=this.options.ykeys,d=[],e=a=0,b=c.length;b>a;e=++a)n=c[e],q=j[n],"string"==typeof q&&(q=parseFloat(q)),null!=q&&"number"!=typeof q&&(q=null),null!=q&&(this.cumulative?l+=q:null!=o?(o=Math.max(q,o),p=Math.min(q,p)):o=p=q),this.cumulative&&null!=l&&(o=Math.max(l,o),p=Math.min(l,p)),d.push(q);return d}.call(this),g.push(i);return g}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(a,b){return(a.x>b.x)-(b.x>a.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.events=this.options.parseTime?function(){var a,c,e,f;for(e=this.options.events,f=[],a=0,c=e.length;c>a;a++)d=e[a],f.push(b.parseDate(d));return f}.call(this):this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",p),this.ymax=this.yboundary("max",o),this.ymin===this.ymax&&(p&&(this.ymin-=1),this.ymax+=1),((r=this.options.axes)===!0||"both"===r||"y"===r||this.options.grid===!0)&&(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(k=(this.ymax-this.ymin)/(this.options.numLines-1),this.grid=function(){var a,b,c,d;for(d=[],m=a=b=this.ymin,c=this.ymax;k>0?c>=a:a>=c;m=a+=k)d.push(m);return d}.call(this))),this.dirty=!0,c?this.redraw():void 0)},d.prototype.yboundary=function(a,b){var c,d;return c=this.options["y"+a],"string"==typeof c?"auto"===c.slice(0,4)?c.length>5?(d=parseInt(c.slice(5),10),null==b?d:Math[a](b,d)):null!=b?b:0:parseInt(c,10):c},d.prototype.autoGridLines=function(a,b,c){var d,e,f,g,h,i,j,k,l;return h=b-a,l=Math.floor(Math.log(h)/Math.log(10)),j=Math.pow(10,l),e=Math.floor(a/j)*j,d=Math.ceil(b/j)*j,i=(d-e)/(c-1),1===j&&i>1&&Math.ceil(i)!==i&&(i=Math.ceil(i),d=e+i*(c-1)),0>e&&d>0&&(e=Math.floor(a/i)*i,d=Math.ceil(b/i)*i),1>i?(g=Math.floor(Math.log(i)/Math.log(10)),f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(parseFloat(k.toFixed(1-g)));return b}()):f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(k);return b}(),f},d.prototype._calc=function(){var a,b,c,d,e,f,g,h;return e=this.el.width(),c=this.el.height(),(this.elementWidth!==e||this.elementHeight!==c||this.dirty)&&(this.elementWidth=e,this.elementHeight=c,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,((g=this.options.axes)===!0||"both"===g||"y"===g)&&(f=function(){var a,c,d,e;for(d=this.grid,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(this.measureText(this.yAxisFormat(b)).width);return e}.call(this),this.left+=Math.max.apply(Math,f)),((h=this.options.axes)===!0||"both"===h||"x"===h)&&(a=function(){var a,b,c;for(c=[],d=a=0,b=this.data.length;b>=0?b>a:a>b;d=b>=0?++a:--a)c.push(this.measureText(this.data[d].text,-this.options.xLabelAngle).height);return c}.call(this),this.bottom-=Math.max.apply(Math,a)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc)?this.calc():void 0},d.prototype.transY=function(a){return this.bottom-(a-this.ymin)*this.dy},d.prototype.transX=function(a){return 1===this.data.length?(this.left+this.right)/2:this.left+(a-this.xmin)*this.dx},d.prototype.redraw=function(){return this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw?this.draw():void 0},d.prototype.measureText=function(a,b){var c,d;return null==b&&(b=0),d=this.raphael.text(100,100,a).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(b),c=d.getBBox(),d.remove(),c},d.prototype.yAxisFormat=function(a){return this.yLabelFormat(a)},d.prototype.yLabelFormat=function(a){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(a):""+this.options.preUnits+b.commas(a)+this.options.postUnits},d.prototype.drawGrid=function(){var a,b,c,d,e,f,g,h;if(this.options.grid!==!1||(e=this.options.axes)===!0||"both"===e||"y"===e){for(f=this.grid,h=[],c=0,d=f.length;d>c;c++)a=f[c],b=this.transY(a),((g=this.options.axes)===!0||"both"===g||"y"===g)&&this.drawYAxisLabel(this.left-this.options.padding/2,b,this.yAxisFormat(a)),this.options.grid?h.push(this.drawGridLine("M"+this.left+","+b+"H"+(this.left+this.width))):h.push(void 0);return h}},d.prototype.drawGoals=function(){var a,b,c,d,e,f,g;for(f=this.options.goals,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.goalLineColors[c%this.options.goalLineColors.length],g.push(this.drawGoal(b,a));return g},d.prototype.drawEvents=function(){var a,b,c,d,e,f,g;for(f=this.events,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.eventLineColors[c%this.options.eventLineColors.length],g.push(this.drawEvent(b,a));return g},d.prototype.drawGoal=function(a,b){return this.raphael.path("M"+this.left+","+this.transY(a)+"H"+this.right).attr("stroke",b).attr("stroke-width",this.options.goalStrokeWidth)},d.prototype.drawEvent=function(a,b){return this.raphael.path("M"+this.transX(a)+","+this.bottom+"V"+this.top).attr("stroke",b).attr("stroke-width",this.options.eventStrokeWidth)},d.prototype.drawYAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},d.prototype.drawGridLine=function(a){return this.raphael.path(a).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},d.prototype.startRange=function(a){return this.hover.hide(),this.selectFrom=a,this.selectionRect.attr({x:a,width:0}).show()},d.prototype.endRange=function(a){var b,c;return this.selectFrom?(c=Math.min(this.selectFrom,a),b=Math.max(this.selectFrom,a),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(c)].x,end:this.data[this.hitTest(b)].x}),this.selectFrom=null):void 0},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.parseDate=function(a){var b,c,d,e,f,g,h,i,j,k,l;return"number"==typeof a?a:(c=a.match(/^(\d+) Q(\d)$/),e=a.match(/^(\d+)-(\d+)$/),f=a.match(/^(\d+)-(\d+)-(\d+)$/),h=a.match(/^(\d+) W(\d+)$/),i=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),j=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),c?new Date(parseInt(c[1],10),3*parseInt(c[2],10)-1,1).getTime():e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,1).getTime():f?new Date(parseInt(f[1],10),parseInt(f[2],10)-1,parseInt(f[3],10)).getTime():h?(k=new Date(parseInt(h[1],10),0,1),4!==k.getDay()&&k.setMonth(0,1+(4-k.getDay()+7)%7),k.getTime()+6048e5*parseInt(h[2],10)):i?i[6]?(g=0,"Z"!==i[6]&&(g=60*parseInt(i[8],10)+parseInt(i[9],10),"+"===i[7]&&(g=0-g)),Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)+g)):new Date(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)).getTime():j?(l=parseFloat(j[6]),b=Math.floor(l),d=Math.round(1e3*(l-b)),j[8]?(g=0,"Z"!==j[8]&&(g=60*parseInt(j[10],10)+parseInt(j[11],10),"+"===j[9]&&(g=0-g)),Date.UTC(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10)+g,b,d)):new Date(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10),b,d).getTime()):new Date(parseInt(a,10),0,1).getTime())},b.Hover=function(){function c(c){null==c&&(c={}),this.options=a.extend({},b.Hover.defaults,c),this.el=a("
      "),this.el.hide(),this.options.parent.append(this.el)}return c.defaults={"class":"morris-hover morris-default-style"},c.prototype.update=function(a,b,c){return this.html(a),this.show(),this.moveTo(b,c)},c.prototype.html=function(a){return this.el.html(a)},c.prototype.moveTo=function(a,b){var c,d,e,f,g,h;return g=this.options.parent.innerWidth(),f=this.options.parent.innerHeight(),d=this.el.outerWidth(),c=this.el.outerHeight(),e=Math.min(Math.max(0,a-d/2),g-d),null!=b?(h=b-c-10,0>h&&(h=b+10,h+c>f&&(h=f/2-c/2))):h=f/2-c/2,this.el.css({left:e+"px",top:parseInt(h)+"px"})},c.prototype.show=function(){return this.el.show()},c.prototype.hide=function(){return this.el.hide()},c}(),b.Line=function(a){function c(a){return this.hilight=f(this.hilight,this),this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Line?(c.__super__.constructor.call(this,a),void 0):new b.Line(a)}return h(c,a),c.prototype.init=function(){return"always"!==this.options.hideHover?(this.hover=new b.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},c.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:24,continuousLine:!0,hideHover:!1},c.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},c.prototype.calcPoints=function(){var a,b,c,d,e,f;for(e=this.data,f=[],c=0,d=e.length;d>c;c++)a=e[c],a._x=this.transX(a.x),a._y=function(){var c,d,e,f;for(e=a.y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b?f.push(this.transY(b)):f.push(b);return f}.call(this),f.push(a._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var c,d,e,f;for(e=a._y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b&&f.push(b);return f}())));return f},c.prototype.hitTest=function(a){var b,c,d,e,f;if(0===this.data.length)return null;for(f=this.data.slice(1),b=d=0,e=f.length;e>d&&(c=f[b],!(a<(c._x+this.data[b]._x)/2));b=++d);return b},c.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},c.prototype.onHoverMove=function(a){var b;return b=this.hitTest(a),this.displayHoverForRow(b)},c.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.displayHoverForRow(null):void 0},c.prototype.displayHoverForRow=function(a){var b;return null!=a?((b=this.hover).update.apply(b,this.hoverContentForRow(a)),this.hilight(a)):(this.hover.hide(),this.hilight())},c.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h;for(d=this.data[a],b="
      "+d.label+"
      ",h=d.y,c=f=0,g=h.length;g>f;c=++f)e=h[c],b+="
      \n "+this.options.labels[c]+":\n "+this.yLabelFormat(e)+"\n
      ";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),[b,d._x,d._ymax]},c.prototype.generatePaths=function(){var a,c,d,e,f;return this.paths=function(){var g,h,j,k;for(k=[],d=g=0,h=this.options.ykeys.length;h>=0?h>g:g>h;d=h>=0?++g:--g)f="boolean"==typeof this.options.smooth?this.options.smooth:(j=this.options.ykeys[d],i.call(this.options.smooth,j)>=0),c=function(){var a,b,c,f;for(c=this.data,f=[],a=0,b=c.length;b>a;a++)e=c[a],void 0!==e._y[d]&&f.push({x:e._x,y:e._y[d]});return f}.call(this),this.options.continuousLine&&(c=function(){var b,d,e;for(e=[],b=0,d=c.length;d>b;b++)a=c[b],null!==a.y&&e.push(a);return e}()),c.length>1?k.push(b.Line.createPath(c,f,this.bottom)):k.push(null);return k}.call(this)},c.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries(),this.options.hideHover===!1?this.displayHoverForRow(this.data.length-1):void 0},c.prototype.drawXAxis=function(){var a,c,d,e,f,g,h,i,j,k,l=this;for(h=this.bottom+this.options.padding/2,f=null,e=null,a=function(a,b){var c,d,g,i,j;return c=l.drawXAxisLabel(l.transX(b),h,a),j=c.getBBox(),c.transform("r"+-l.options.xLabelAngle),d=c.getBBox(),c.transform("t0,"+d.height/2+"..."),0!==l.options.xLabelAngle&&(i=-.5*j.width*Math.cos(l.options.xLabelAngle*Math.PI/180),c.transform("t"+i+",0...")),d=c.getBBox(),(null==f||f>=d.x+d.width||null!=e&&e>=d.x)&&d.x>=0&&d.x+d.widtha;a++)g=c[a],d.push([g.label,g.x]);return d}.call(this),d.reverse(),k=[],i=0,j=d.length;j>i;i++)c=d[i],k.push(a(c[0],c[1]));return k},c.prototype.drawSeries=function(){var a,b,c,d,e,f;for(this.seriesPoints=[],a=b=d=this.options.ykeys.length-1;0>=d?0>=b:b>=0;a=0>=d?++b:--b)this._drawLineFor(a);for(f=[],a=c=e=this.options.ykeys.length-1;0>=e?0>=c:c>=0;a=0>=e?++c:--c)f.push(this._drawPointFor(a));return f},c.prototype._drawPointFor=function(a){var b,c,d,e,f,g;for(this.seriesPoints[a]=[],f=this.data,g=[],d=0,e=f.length;e>d;d++)c=f[d],b=null,null!=c._y[a]&&(b=this.drawLinePoint(c._x,c._y[a],this.colorFor(c,a,"point"),a)),g.push(this.seriesPoints[a].push(b));return g},c.prototype._drawLineFor=function(a){var b;return b=this.paths[a],null!==b?this.drawLinePath(b,this.colorFor(null,a,"line"),a):void 0},c.createPath=function(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(k="",c&&(g=b.Line.gradients(a)),l={y:null},h=q=0,r=a.length;r>q;h=++q)e=a[h],null!=e.y&&(null!=l.y?c?(f=g[h],j=g[h-1],i=(e.x-l.x)/4,m=l.x+i,o=Math.min(d,l.y+i*j),n=e.x-i,p=Math.min(d,e.y-i*f),k+="C"+m+","+o+","+n+","+p+","+e.x+","+e.y):k+="L"+e.x+","+e.y:c&&null==g[h]||(k+="M"+e.x+","+e.y)),l=e;return k},c.gradients=function(a){var b,c,d,e,f,g,h,i;for(c=function(a,b){return(a.y-b.y)/(a.x-b.x)},i=[],d=g=0,h=a.length;h>g;d=++g)b=a[d],null!=b.y?(e=a[d+1]||{y:null},f=a[d-1]||{y:null},null!=f.y&&null!=e.y?i.push(c(f,e)):null!=f.y?i.push(c(f,b)):null!=e.y?i.push(c(b,e)):i.push(null)):i.push(null);return i},c.prototype.hilight=function(a){var b,c,d,e,f;if(null!==this.prevHilight&&this.prevHilight!==a)for(b=c=0,e=this.seriesPoints.length-1;e>=0?e>=c:c>=e;b=e>=0?++c:--c)this.seriesPoints[b][this.prevHilight]&&this.seriesPoints[b][this.prevHilight].animate(this.pointShrinkSeries(b));if(null!==a&&this.prevHilight!==a)for(b=d=0,f=this.seriesPoints.length-1;f>=0?f>=d:d>=f;b=f>=0?++d:--d)this.seriesPoints[b][a]&&this.seriesPoints[b][a].animate(this.pointGrowSeries(b));return this.prevHilight=a},c.prototype.colorFor=function(a,b,c){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,a,b,c):"point"===c?this.options.pointFillColors[b%this.options.pointFillColors.length]||this.options.lineColors[b%this.options.lineColors.length]:this.options.lineColors[b%this.options.lineColors.length]},c.prototype.drawXAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},c.prototype.drawLinePath=function(a,b,c){return this.raphael.path(a).attr("stroke",b).attr("stroke-width",this.lineWidthForSeries(c))},c.prototype.drawLinePoint=function(a,b,c,d){return this.raphael.circle(a,b,this.pointSizeForSeries(d)).attr("fill",c).attr("stroke-width",this.pointStrokeWidthForSeries(d)).attr("stroke",this.pointStrokeColorForSeries(d))},c.prototype.pointStrokeWidthForSeries=function(a){return this.options.pointStrokeWidths[a%this.options.pointStrokeWidths.length]},c.prototype.pointStrokeColorForSeries=function(a){return this.options.pointStrokeColors[a%this.options.pointStrokeColors.length]},c.prototype.lineWidthForSeries=function(a){return this.options.lineWidth instanceof Array?this.options.lineWidth[a%this.options.lineWidth.length]:this.options.lineWidth},c.prototype.pointSizeForSeries=function(a){return this.options.pointSize instanceof Array?this.options.pointSize[a%this.options.pointSize.length]:this.options.pointSize},c.prototype.pointGrowSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)+3},25,"linear")},c.prototype.pointShrinkSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)},25,"linear")},c}(b.Grid),b.labelSeries=function(c,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r;if(j=200*(d-c)/e,i=new Date(c),n=b.LABEL_SPECS[f],void 0===n)for(r=b.AUTO_LABEL_ORDER,p=0,q=r.length;q>p;p++)if(k=r[p],m=b.LABEL_SPECS[k],j>=m.span){n=m;break}for(void 0===n&&(n=b.LABEL_SPECS.second),g&&(n=a.extend({},n,{fmt:g})),h=n.start(i),l=[];(o=h.getTime())<=d;)o>=c&&l.push([n.fmt(h),o]),n.incr(h);return l},c=function(a){return{span:60*a*1e3,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())},fmt:function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())},incr:function(b){return b.setUTCMinutes(b.getUTCMinutes()+a)}}},d=function(a){return{span:1e3*a,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes())},fmt:function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())+":"+b.pad2(a.getSeconds())},incr:function(b){return b.setUTCSeconds(b.getUTCSeconds()+a)}}},b.LABEL_SPECS={decade:{span:1728e8,start:function(a){return new Date(a.getFullYear()-a.getFullYear()%10,0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+10)}},year:{span:1728e7,start:function(a){return new Date(a.getFullYear(),0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+1)}},month:{span:24192e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),1)},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)},incr:function(a){return a.setMonth(a.getMonth()+1)}},week:{span:6048e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},incr:function(a){return a.setDate(a.getDate()+7)}},day:{span:864e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},incr:function(a){return a.setDate(a.getDate()+1)}},hour:c(60),"30min":c(30),"15min":c(15),"10min":c(10),"5min":c(5),minute:c(1),"30sec":d(30),"15sec":d(15),"10sec":d(10),"5sec":d(5),second:d(1)},b.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],b.Area=function(c){function d(c){var f;return this instanceof b.Area?(f=a.extend({},e,c),this.cumulative=!f.behaveLikeLine,"auto"===f.fillOpacity&&(f.fillOpacity=f.behaveLikeLine?.8:1),d.__super__.constructor.call(this,f),void 0):new b.Area(c)}var e;return h(d,c),e={fillOpacity:"auto",behaveLikeLine:!1},d.prototype.calcPoints=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],d=0,e=f.length;e>d;d++)a=f[d],a._x=this.transX(a.x),b=0,a._y=function(){var d,e,f,g;for(f=a.y,g=[],d=0,e=f.length;e>d;d++)c=f[d],this.options.behaveLikeLine?g.push(this.transY(c)):(b+=c||0,g.push(this.transY(b)));return g}.call(this),g.push(a._ymax=Math.max.apply(Math,a._y));return g},d.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h;for(this.seriesPoints=[],b=this.options.behaveLikeLine?function(){f=[];for(var a=0,b=this.options.ykeys.length-1;b>=0?b>=a:a>=b;b>=0?a++:a--)f.push(a);return f}.apply(this):function(){g=[];for(var a=e=this.options.ykeys.length-1;0>=e?0>=a:a>=0;0>=e?a++:a--)g.push(a);return g}.apply(this),h=[],c=0,d=b.length;d>c;c++)a=b[c],this._drawFillFor(a),this._drawLineFor(a),h.push(this._drawPointFor(a));return h},d.prototype._drawFillFor=function(a){var b;return b=this.paths[a],null!==b?(b+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(b,this.fillForSeries(a))):void 0},d.prototype.fillForSeries=function(a){var b;return b=Raphael.rgb2hsl(this.colorFor(this.data[a],a,"line")),Raphael.hsl(b.h,this.options.behaveLikeLine?.9*b.s:.75*b.s,Math.min(.98,this.options.behaveLikeLine?1.2*b.l:1.25*b.l))},d.prototype.drawFilledPath=function(a,b){return this.raphael.path(a).attr("fill",b).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},d}(b.Line),b.Bar=function(c){function d(c){return this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Bar?(d.__super__.constructor.call(this,a.extend({},c,{parseTime:!1})),void 0):new b.Bar(c)}return h(d,c),d.prototype.init=function(){return this.cumulative=this.options.stacked,"always"!==this.options.hideHover?(this.hover=new b.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},d.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],barOpacity:1,barRadius:[0,0,0,0],xLabelMargin:50},d.prototype.calc=function(){var a;return this.calcBars(),this.options.hideHover===!1?(a=this.hover).update.apply(a,this.hoverContentForRow(this.data.length-1)):void 0},d.prototype.calcBars=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],a=d=0,e=f.length;e>d;a=++d)b=f[a],b._x=this.left+this.width*(a+.5)/this.data.length,g.push(b._y=function(){var a,d,e,f;for(e=b.y,f=[],a=0,d=e.length;d>a;a++)c=e[a],null!=c?f.push(this.transY(c)):f.push(null);return f}.call(this));return g},d.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries()},d.prototype.drawXAxis=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(j=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),g=null,f=null,m=[],a=k=0,l=this.data.length;l>=0?l>k:k>l;a=l>=0?++k:--k)h=this.data[this.data.length-1-a],b=this.drawXAxisLabel(h._x,j,h.label),i=b.getBBox(),b.transform("r"+-this.options.xLabelAngle),c=b.getBBox(),b.transform("t0,"+c.height/2+"..."),0!==this.options.xLabelAngle&&(e=-.5*i.width*Math.cos(this.options.xLabelAngle*Math.PI/180),b.transform("t"+e+",0...")),(null==g||g>=c.x+c.width||null!=f&&f>=c.x)&&c.x>=0&&c.x+c.width=0?this.transY(0):null,this.bars=function(){var h,o,p,q;for(p=this.data,q=[],d=h=0,o=p.length;o>h;d=++h)i=p[d],e=0,q.push(function(){var h,o,p,q;for(p=i._y,q=[],j=h=0,o=p.length;o>h;j=++h)m=p[j],null!==m?(n?(l=Math.min(m,n),b=Math.max(m,n)):(l=m,b=this.bottom),f=this.left+d*c+g,this.options.stacked||(f+=j*(a+this.options.barGap)),k=b-l,this.options.stacked&&(l-=e),this.drawBar(f,l,a,k,this.colorFor(i,j,"bar"),this.options.barOpacity,this.options.barRadius),q.push(e+=k)):q.push(null);return q}.call(this));return q}.call(this)},d.prototype.colorFor=function(a,b,c){var d,e;return"function"==typeof this.options.barColors?(d={x:a.x,y:a.y[b],label:a.label},e={index:b,key:this.options.ykeys[b],label:this.options.labels[b]},this.options.barColors.call(this,d,e,c)):this.options.barColors[b%this.options.barColors.length]},d.prototype.hitTest=function(a){return 0===this.data.length?null:(a=Math.max(Math.min(a,this.right),this.left),Math.min(this.data.length-1,Math.floor((a-this.left)/(this.width/this.data.length))))},d.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},d.prototype.onHoverMove=function(a){var b,c;return b=this.hitTest(a),(c=this.hover).update.apply(c,this.hoverContentForRow(b))},d.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.hover.hide():void 0},d.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h,i;for(d=this.data[a],b="
      "+d.label+"
      ",i=d.y,c=g=0,h=i.length;h>g;c=++g)f=i[c],b+="
      \n "+this.options.labels[c]+":\n "+this.yLabelFormat(f)+"\n
      ";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),e=this.left+(a+.5)*this.width/this.data.length,[b,e]},d.prototype.drawXAxisLabel=function(a,b,c){var d;return d=this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},d.prototype.drawBar=function(a,b,c,d,e,f,g){var h,i;return h=Math.max.apply(Math,g),i=0===h||h>d?this.raphael.rect(a,b,c,d):this.raphael.path(this.roundedRect(a,b,c,d,g)),i.attr("fill",e).attr("fill-opacity",f).attr("stroke","none")},d.prototype.roundedRect=function(a,b,c,d,e){return null==e&&(e=[0,0,0,0]),["M",a,e[0]+b,"Q",a,b,a+e[0],b,"L",a+c-e[1],b,"Q",a+c,b,a+c,b+e[1],"L",a+c,b+d-e[2],"Q",a+c,b+d,a+c-e[2],b+d,"L",a+e[3],b+d,"Q",a,b+d,a,b+d-e[3],"Z"]},d}(b.Grid),b.Donut=function(c){function d(c){this.resizeHandler=f(this.resizeHandler,this),this.select=f(this.select,this),this.click=f(this.click,this);var d=this;if(!(this instanceof b.Donut))return new b.Donut(c);if(this.options=a.extend({},this.defaults,c),this.el="string"==typeof c.element?a(document.getElementById(c.element)):a(c.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==c.data&&0!==c.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&a(window).bind("resize",function(){return null!=d.timeoutId&&window.clearTimeout(d.timeoutId),d.timeoutId=window.setTimeout(d.resizeHandler,100)}),this.setData(c.data))}return h(d,c),d.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:b.commas,resize:!1},d.prototype.redraw=function(){var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;for(this.raphael.clear(),c=this.el.width()/2,d=this.el.height()/2,n=(Math.min(c,d)-10)/3,l=0,u=this.values,o=0,r=u.length;r>o;o++)m=u[o],l+=m;for(i=5/(2*n),a=1.9999*Math.PI-i*this.data.length,g=0,f=0,this.segments=[],v=this.values,e=p=0,s=v.length;s>p;e=++p)m=v[e],j=g+i+a*(m/l),k=new b.DonutSegment(c,d,2*n,n,g,j,this.data[e].color||this.options.colors[f%this.options.colors.length],this.options.backgroundColor,f,this.raphael),k.render(),this.segments.push(k),k.on("hover",this.select),k.on("click",this.click),g=j,f+=1;for(this.text1=this.drawEmptyDonutLabel(c,d-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(c,d+10,this.options.labelColor,14),h=Math.max.apply(Math,this.values),f=0,w=this.values,x=[],q=0,t=w.length;t>q;q++){if(m=w[q],m===h){this.select(f);break}x.push(f+=1)}return x},d.prototype.setData=function(a){var b; +return this.data=a,this.values=function(){var a,c,d,e;for(d=this.data,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(parseFloat(b.value));return e}.call(this),this.redraw()},d.prototype.click=function(a){return this.fire("click",a,this.data[a])},d.prototype.select=function(a){var b,c,d,e,f,g;for(g=this.segments,e=0,f=g.length;f>e;e++)c=g[e],c.deselect();return d=this.segments[a],d.select(),b=this.data[a],this.setLabels(b.label,this.options.formatter(b.value,b))},d.prototype.setLabels=function(a,b){var c,d,e,f,g,h,i,j;return c=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,f=1.8*c,e=c/2,d=c/3,this.text1.attr({text:a,transform:""}),g=this.text1.getBBox(),h=Math.min(f/g.width,e/g.height),this.text1.attr({transform:"S"+h+","+h+","+(g.x+g.width/2)+","+(g.y+g.height)}),this.text2.attr({text:b,transform:""}),i=this.text2.getBBox(),j=Math.min(f/i.width,d/i.height),this.text2.attr({transform:"S"+j+","+j+","+(i.x+i.width/2)+","+i.y})},d.prototype.drawEmptyDonutLabel=function(a,b,c,d,e){var f;return f=this.raphael.text(a,b,"").attr("font-size",d).attr("fill",c),null!=e&&f.attr("font-weight",e),f},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.DonutSegment=function(a){function b(a,b,c,d,e,g,h,i,j,k){this.cx=a,this.cy=b,this.inner=c,this.outer=d,this.color=h,this.backgroundColor=i,this.index=j,this.raphael=k,this.deselect=f(this.deselect,this),this.select=f(this.select,this),this.sin_p0=Math.sin(e),this.cos_p0=Math.cos(e),this.sin_p1=Math.sin(g),this.cos_p1=Math.cos(g),this.is_long=g-e>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return h(b,a),b.prototype.calcArcPoints=function(a){return[this.cx+a*this.sin_p0,this.cy+a*this.cos_p0,this.cx+a*this.sin_p1,this.cy+a*this.cos_p1]},b.prototype.calcSegment=function(a,b){var c,d,e,f,g,h,i,j,k,l;return k=this.calcArcPoints(a),c=k[0],e=k[1],d=k[2],f=k[3],l=this.calcArcPoints(b),g=l[0],i=l[1],h=l[2],j=l[3],"M"+c+","+e+("A"+a+","+a+",0,"+this.is_long+",0,"+d+","+f)+("L"+h+","+j)+("A"+b+","+b+",0,"+this.is_long+",1,"+g+","+i)+"Z"},b.prototype.calcArc=function(a){var b,c,d,e,f;return f=this.calcArcPoints(a),b=f[0],d=f[1],c=f[2],e=f[3],"M"+b+","+d+("A"+a+","+a+",0,"+this.is_long+",0,"+c+","+e)},b.prototype.render=function(){var a=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return a.fire("hover",a.index)},function(){return a.fire("click",a.index)})},b.prototype.drawDonutArc=function(a,b){return this.raphael.path(a).attr({stroke:b,"stroke-width":2,opacity:0})},b.prototype.drawDonutSegment=function(a,b,c,d,e){return this.raphael.path(a).attr({fill:b,stroke:c,"stroke-width":3}).hover(d).click(e)},b.prototype.select=function(){return this.selected?void 0:(this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0)},b.prototype.deselect=function(){return this.selected?(this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1):void 0},b}(b.EventEmitter)}).call(this); \ No newline at end of file diff --git a/public/assets/js/plugins/slimScroll/jquery.slimscroll.js b/public/assets/js/plugins/slimScroll/jquery.slimscroll.js new file mode 100755 index 00000000..2ea5b080 --- /dev/null +++ b/public/assets/js/plugins/slimScroll/jquery.slimscroll.js @@ -0,0 +1,464 @@ +/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * Version: 1.3.0 + * + */ +(function($) { + + jQuery.fn.extend({ + slimScroll: function(options) { + + var defaults = { + + // width in pixels of the visible scroll area + width : 'auto', + + // height in pixels of the visible scroll area + height : '250px', + + // width in pixels of the scrollbar and rail + size : '7px', + + // scrollbar color, accepts any hex/color value + color: '#000', + + // scrollbar position - left/right + position : 'right', + + // distance in pixels between the side edge and the scrollbar + distance : '1px', + + // default scroll position on load - top / bottom / $('selector') + start : 'top', + + // sets scrollbar opacity + opacity : .4, + + // enables always-on mode for the scrollbar + alwaysVisible : false, + + // check if we should hide the scrollbar when user is hovering over + disableFadeOut : false, + + // sets visibility of the rail + railVisible : false, + + // sets rail color + railColor : '#333', + + // sets rail opacity + railOpacity : .2, + + // whether we should use jQuery UI Draggable to enable bar dragging + railDraggable : true, + + // defautlt CSS class of the slimscroll rail + railClass : 'slimScrollRail', + + // defautlt CSS class of the slimscroll bar + barClass : 'slimScrollBar', + + // defautlt CSS class of the slimscroll wrapper + wrapperClass : 'slimScrollDiv', + + // check if mousewheel should scroll the window if we reach top/bottom + allowPageScroll : false, + + // scroll amount applied to each mouse wheel step + wheelStep : 20, + + // scroll amount applied when user is using gestures + touchScrollStep : 200, + + // sets border radius + borderRadius: '7px', + + // sets border radius of the rail + railBorderRadius : '7px' + }; + + var o = $.extend(defaults, options); + + // do it for every element that matches selector + this.each(function(){ + + var isOverPanel, isOverBar, isDragg, queueHide, touchDif, + barHeight, percentScroll, lastScroll, + divS = '
      ', + minBarHeight = 30, + releaseScroll = false; + + // used in event handlers and for better minification + var me = $(this); + + // ensure we are not binding it again + if (me.parent().hasClass(o.wrapperClass)) + { + // start from last bar position + var offset = me.scrollTop(); + + // find bar and rail + bar = me.parent().find('.' + o.barClass); + rail = me.parent().find('.' + o.railClass); + + getBarHeight(); + + // check if we should scroll existing instance + if ($.isPlainObject(options)) + { + // Pass height: auto to an existing slimscroll object to force a resize after contents have changed + if ( 'height' in options && options.height == 'auto' ) { + me.parent().css('height', 'auto'); + me.css('height', 'auto'); + var height = me.parent().parent().height(); + me.parent().css('height', height); + me.css('height', height); + } + + if ('scrollTo' in options) + { + // jump to a static point + offset = parseInt(o.scrollTo); + } + else if ('scrollBy' in options) + { + // jump by value pixels + offset += parseInt(o.scrollBy); + } + else if ('destroy' in options) + { + // remove slimscroll elements + bar.remove(); + rail.remove(); + me.unwrap(); + return; + } + + // scroll content by the given offset + scrollContent(offset, false, true); + } + + return; + } + + // optionally set height to the parent's height + o.height = (o.height == 'auto') ? me.parent().height() : o.height; + + // wrap content + var wrapper = $(divS) + .addClass(o.wrapperClass) + .css({ + position: 'relative', + overflow: 'hidden', + width: o.width, + height: o.height + }); + + // update style for the div + me.css({ + overflow: 'hidden', + width: o.width, + height: o.height + }); + + // create scrollbar rail + var rail = $(divS) + .addClass(o.railClass) + .css({ + width: o.size, + height: '100%', + position: 'absolute', + top: 0, + display: (o.alwaysVisible && o.railVisible) ? 'block' : 'none', + 'border-radius': o.railBorderRadius, + background: o.railColor, + opacity: o.railOpacity, + zIndex: 90 + }); + + // create scrollbar + var bar = $(divS) + .addClass(o.barClass) + .css({ + background: o.color, + width: o.size, + position: 'absolute', + top: 0, + opacity: o.opacity, + display: o.alwaysVisible ? 'block' : 'none', + 'border-radius' : o.borderRadius, + BorderRadius: o.borderRadius, + MozBorderRadius: o.borderRadius, + WebkitBorderRadius: o.borderRadius, + zIndex: 99 + }); + + // set position + var posCss = (o.position == 'right') ? { right: o.distance } : { left: o.distance }; + rail.css(posCss); + bar.css(posCss); + + // wrap it + me.wrap(wrapper); + + // append to parent div + me.parent().append(bar); + me.parent().append(rail); + + // make it draggable and no longer dependent on the jqueryUI + if (o.railDraggable){ + bar.bind("mousedown", function(e) { + var $doc = $(document); + isDragg = true; + t = parseFloat(bar.css('top')); + pageY = e.pageY; + + $doc.bind("mousemove.slimscroll", function(e){ + currTop = t + e.pageY - pageY; + bar.css('top', currTop); + scrollContent(0, bar.position().top, false);// scroll content + }); + + $doc.bind("mouseup.slimscroll", function(e) { + isDragg = false;hideBar(); + $doc.unbind('.slimscroll'); + }); + return false; + }).bind("selectstart.slimscroll", function(e){ + e.stopPropagation(); + e.preventDefault(); + return false; + }); + } + + // on rail over + rail.hover(function(){ + showBar(); + }, function(){ + hideBar(); + }); + + // on bar over + bar.hover(function(){ + isOverBar = true; + }, function(){ + isOverBar = false; + }); + + // show on parent mouseover + me.hover(function(){ + isOverPanel = true; + showBar(); + hideBar(); + }, function(){ + isOverPanel = false; + hideBar(); + }); + + // support for mobile + me.bind('touchstart', function(e,b){ + if (e.originalEvent.touches.length) + { + // record where touch started + touchDif = e.originalEvent.touches[0].pageY; + } + }); + + me.bind('touchmove', function(e){ + // prevent scrolling the page if necessary + if(!releaseScroll) + { + e.originalEvent.preventDefault(); + } + if (e.originalEvent.touches.length) + { + // see how far user swiped + var diff = (touchDif - e.originalEvent.touches[0].pageY) / o.touchScrollStep; + // scroll content + scrollContent(diff, true); + touchDif = e.originalEvent.touches[0].pageY; + } + }); + + // set up initial height + getBarHeight(); + + // check start position + if (o.start === 'bottom') + { + // scroll content to bottom + bar.css({ top: me.outerHeight() - bar.outerHeight() }); + scrollContent(0, true); + } + else if (o.start !== 'top') + { + // assume jQuery selector + scrollContent($(o.start).position().top, null, true); + + // make sure bar stays hidden + if (!o.alwaysVisible) { bar.hide(); } + } + + // attach scroll events + attachWheel(); + + function _onWheel(e) + { + // use mouse wheel only when mouse is over + if (!isOverPanel) { return; } + + var e = e || window.event; + + var delta = 0; + if (e.wheelDelta) { delta = -e.wheelDelta/120; } + if (e.detail) { delta = e.detail / 3; } + + var target = e.target || e.srcTarget || e.srcElement; + if ($(target).closest('.' + o.wrapperClass).is(me.parent())) { + // scroll content + scrollContent(delta, true); + } + + // stop window scroll + if (e.preventDefault && !releaseScroll) { e.preventDefault(); } + if (!releaseScroll) { e.returnValue = false; } + } + + function scrollContent(y, isWheel, isJump) + { + releaseScroll = false; + var delta = y; + var maxTop = me.outerHeight() - bar.outerHeight(); + + if (isWheel) + { + // move bar with mouse wheel + delta = parseInt(bar.css('top')) + y * parseInt(o.wheelStep) / 100 * bar.outerHeight(); + + // move bar, make sure it doesn't go out + delta = Math.min(Math.max(delta, 0), maxTop); + + // if scrolling down, make sure a fractional change to the + // scroll position isn't rounded away when the scrollbar's CSS is set + // this flooring of delta would happened automatically when + // bar.css is set below, but we floor here for clarity + delta = (y > 0) ? Math.ceil(delta) : Math.floor(delta); + + // scroll the scrollbar + bar.css({ top: delta + 'px' }); + } + + // calculate actual scroll amount + percentScroll = parseInt(bar.css('top')) / (me.outerHeight() - bar.outerHeight()); + delta = percentScroll * (me[0].scrollHeight - me.outerHeight()); + + if (isJump) + { + delta = y; + var offsetTop = delta / me[0].scrollHeight * me.outerHeight(); + offsetTop = Math.min(Math.max(offsetTop, 0), maxTop); + bar.css({ top: offsetTop + 'px' }); + } + + // scroll content + me.scrollTop(delta); + + // fire scrolling event + me.trigger('slimscrolling', ~~delta); + + // ensure bar is visible + showBar(); + + // trigger hide when scroll is stopped + hideBar(); + } + + function attachWheel() + { + if (window.addEventListener) + { + this.addEventListener('DOMMouseScroll', _onWheel, false ); + this.addEventListener('mousewheel', _onWheel, false ); + this.addEventListener('MozMousePixelScroll', _onWheel, false ); + } + else + { + document.attachEvent("onmousewheel", _onWheel) + } + } + + function getBarHeight() + { + // calculate scrollbar height and make sure it is not too small + barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight); + bar.css({ height: barHeight + 'px' }); + + // hide scrollbar if content is not long enough + var display = barHeight == me.outerHeight() ? 'none' : 'block'; + bar.css({ display: display }); + } + + function showBar() + { + // recalculate bar height + getBarHeight(); + clearTimeout(queueHide); + + // when bar reached top or bottom + if (percentScroll == ~~percentScroll) + { + //release wheel + releaseScroll = o.allowPageScroll; + + // publish approporiate event + if (lastScroll != percentScroll) + { + var msg = (~~percentScroll == 0) ? 'top' : 'bottom'; + me.trigger('slimscroll', msg); + } + } + else + { + releaseScroll = false; + } + lastScroll = percentScroll; + + // show only when required + if(barHeight >= me.outerHeight()) { + //allow window scroll + releaseScroll = true; + return; + } + bar.stop(true,true).fadeIn('fast'); + if (o.railVisible) { rail.stop(true,true).fadeIn('fast'); } + } + + function hideBar() + { + // only hide when options allow it + if (!o.alwaysVisible) + { + queueHide = setTimeout(function(){ + if (!(o.disableFadeOut && isOverPanel) && !isOverBar && !isDragg) + { + bar.fadeOut('slow'); + rail.fadeOut('slow'); + } + }, 1000); + } + } + + }); + + // maintain chainability + return this; + } + }); + + jQuery.fn.extend({ + slimscroll: jQuery.fn.slimScroll + }); + +})(jQuery); diff --git a/public/assets/js/plugins/slimScroll/jquery.slimscroll.min.js b/public/assets/js/plugins/slimScroll/jquery.slimscroll.min.js new file mode 100755 index 00000000..26220d6b --- /dev/null +++ b/public/assets/js/plugins/slimScroll/jquery.slimscroll.min.js @@ -0,0 +1,16 @@ +/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * Version: 1.3.0 + * + */ +(function(f){jQuery.fn.extend({slimScroll:function(h){var a=f.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:0.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},h);this.each(function(){function r(d){if(s){d=d|| +window.event;var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);f(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&m(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function m(d,f,h){k=!1;var e=d,g=b.outerHeight()-c.outerHeight();f&&(e=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),e=Math.min(Math.max(e,0),g),e=0=b.outerHeight()?k=!0:(c.stop(!0,!0).fadeIn("fast"),a.railVisible&&g.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(A=setTimeout(function(){a.disableFadeOut&&s||(x||y)||(c.fadeOut("slow"),g.fadeOut("slow"))},1E3))}var s,x,y,A,z,u,l,B,D=30,k=!1,b=f(this);if(b.parent().hasClass(a.wrapperClass)){var n=b.scrollTop(), +c=b.parent().find("."+a.barClass),g=b.parent().find("."+a.railClass);w();if(f.isPlainObject(h)){if("height"in h&&"auto"==h.height){b.parent().css("height","auto");b.css("height","auto");var q=b.parent().parent().height();b.parent().css("height",q);b.css("height",q)}if("scrollTo"in h)n=parseInt(a.scrollTo);else if("scrollBy"in h)n+=parseInt(a.scrollBy);else if("destroy"in h){c.remove();g.remove();b.unwrap();return}m(n,!1,!0)}}else{a.height="auto"==a.height?b.parent().height():a.height;n=f("
      ").addClass(a.wrapperClass).css({position:"relative", +overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var g=f("
      ").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=f("
      ").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible? +"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),q="right"==a.position?{right:a.distance}:{left:a.distance};g.css(q);c.css(q);b.wrap(n);b.parent().append(c);b.parent().append(g);a.railDraggable&&c.bind("mousedown",function(a){var b=f(document);y=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);m(0,c.position().top,!1)}); +b.bind("mouseup.slimscroll",function(a){y=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1});g.hover(function(){v()},function(){p()});c.hover(function(){x=!0},function(){x=!1});b.hover(function(){s=!0;v();p()},function(){s=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(z=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&& +(m((z-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),z=b.originalEvent.touches[0].pageY)});w();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),m(0,!0)):"top"!==a.start&&(m(f(a.start).position().top,null,!0),a.alwaysVisible||c.hide());C()}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery); \ No newline at end of file diff --git a/public/assets/js/plugins/slimScroll/slimScroll.jquery.json b/public/assets/js/plugins/slimScroll/slimScroll.jquery.json new file mode 100755 index 00000000..41174e64 --- /dev/null +++ b/public/assets/js/plugins/slimScroll/slimScroll.jquery.json @@ -0,0 +1,30 @@ +{ + "name" : "slimScroll", + "version" : "1.2.0", + "title" : "jQuery slimScroll scrollbar", + "description" : "slimScroll is a small jQuery plugin that transforms any div into a scrollable area. slimScroll doesn't occupy any visual space as it only appears on a user initiated mouse-over.", + "keywords" : ["scrollbar", "scroll", "slimscroll", "scrollable", "scrolling", "scroller", "ui"], + "demo" : "http://rocha.la/jQuery-slimScroll/", + "homepage" : "http://rocha.la/jQuery-slimScroll/", + "download" : "http://rocha.la/jQuery-slimScroll/", + + "author" : { + "name" : "Piotr Rochala", + "url" : "http://rocha.la/" + }, + + "dependencies" : { + "jquery" : ">= 1.7" + }, + + "licenses" : [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + }, + { + "type": "GPL", + "url": "http://www.opensource.org/licenses/gpl-license.php" + } + ] +} \ No newline at end of file diff --git a/public/assets/js/plugins/sparkline/jquery.sparkline.js b/public/assets/js/plugins/sparkline/jquery.sparkline.js new file mode 100755 index 00000000..721e03b7 --- /dev/null +++ b/public/assets/js/plugins/sparkline/jquery.sparkline.js @@ -0,0 +1,3054 @@ +/** +* +* jquery.sparkline.js +* +* v2.1.2 +* (c) Splunk, Inc +* Contact: Gareth Watts (gareth@splunk.com) +* http://omnipotent.net/jquery.sparkline/ +* +* Generates inline sparkline charts from data supplied either to the method +* or inline in HTML +* +* Compatible with Internet Explorer 6.0+ and modern browsers equipped with the canvas tag +* (Firefox 2.0+, Safari, Opera, etc) +* +* License: New BSD License +* +* Copyright (c) 2012, Splunk Inc. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, +* are permitted provided that the following conditions are met: +* +* * Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright notice, +* this list of conditions and the following disclaimer in the documentation +* and/or other materials provided with the distribution. +* * Neither the name of Splunk Inc nor the names of its contributors may +* be used to endorse or promote products derived from this software without +* specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +* SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* +* Usage: +* $(selector).sparkline(values, options) +* +* If values is undefined or set to 'html' then the data values are read from the specified tag: +*

      Sparkline: 1,4,6,6,8,5,3,5

      +* $('.sparkline').sparkline(); +* There must be no spaces in the enclosed data set +* +* Otherwise values must be an array of numbers or null values +*

      Sparkline: This text replaced if the browser is compatible

      +* $('#sparkline1').sparkline([1,4,6,6,8,5,3,5]) +* $('#sparkline2').sparkline([1,4,6,null,null,5,3,5]) +* +* Values can also be specified in an HTML comment, or as a values attribute: +*

      Sparkline:

      +*

      Sparkline:

      +* $('.sparkline').sparkline(); +* +* For line charts, x values can also be specified: +*

      Sparkline: 1:1,2.7:4,3.4:6,5:6,6:8,8.7:5,9:3,10:5

      +* $('#sparkline1').sparkline([ [1,1], [2.7,4], [3.4,6], [5,6], [6,8], [8.7,5], [9,3], [10,5] ]) +* +* By default, options should be passed in as teh second argument to the sparkline function: +* $('.sparkline').sparkline([1,2,3,4], {type: 'bar'}) +* +* Options can also be set by passing them on the tag itself. This feature is disabled by default though +* as there's a slight performance overhead: +* $('.sparkline').sparkline([1,2,3,4], {enableTagOptions: true}) +*

      Sparkline: loading

      +* Prefix all options supplied as tag attribute with "spark" (configurable by setting tagOptionPrefix) +* +* Supported options: +* lineColor - Color of the line used for the chart +* fillColor - Color used to fill in the chart - Set to '' or false for a transparent chart +* width - Width of the chart - Defaults to 3 times the number of values in pixels +* height - Height of the chart - Defaults to the height of the containing element +* chartRangeMin - Specify the minimum value to use for the Y range of the chart - Defaults to the minimum value supplied +* chartRangeMax - Specify the maximum value to use for the Y range of the chart - Defaults to the maximum value supplied +* chartRangeClip - Clip out of range values to the max/min specified by chartRangeMin and chartRangeMax +* chartRangeMinX - Specify the minimum value to use for the X range of the chart - Defaults to the minimum value supplied +* chartRangeMaxX - Specify the maximum value to use for the X range of the chart - Defaults to the maximum value supplied +* composite - If true then don't erase any existing chart attached to the tag, but draw +* another chart over the top - Note that width and height are ignored if an +* existing chart is detected. +* tagValuesAttribute - Name of tag attribute to check for data values - Defaults to 'values' +* enableTagOptions - Whether to check tags for sparkline options +* tagOptionPrefix - Prefix used for options supplied as tag attributes - Defaults to 'spark' +* disableHiddenCheck - If set to true, then the plugin will assume that charts will never be drawn into a +* hidden dom element, avoding a browser reflow +* disableInteraction - If set to true then all mouseover/click interaction behaviour will be disabled, +* making the plugin perform much like it did in 1.x +* disableTooltips - If set to true then tooltips will be disabled - Defaults to false (tooltips enabled) +* disableHighlight - If set to true then highlighting of selected chart elements on mouseover will be disabled +* defaults to false (highlights enabled) +* highlightLighten - Factor to lighten/darken highlighted chart values by - Defaults to 1.4 for a 40% increase +* tooltipContainer - Specify which DOM element the tooltip should be rendered into - defaults to document.body +* tooltipClassname - Optional CSS classname to apply to tooltips - If not specified then a default style will be applied +* tooltipOffsetX - How many pixels away from the mouse pointer to render the tooltip on the X axis +* tooltipOffsetY - How many pixels away from the mouse pointer to render the tooltip on the r axis +* tooltipFormatter - Optional callback that allows you to override the HTML displayed in the tooltip +* callback is given arguments of (sparkline, options, fields) +* tooltipChartTitle - If specified then the tooltip uses the string specified by this setting as a title +* tooltipFormat - A format string or SPFormat object (or an array thereof for multiple entries) +* to control the format of the tooltip +* tooltipPrefix - A string to prepend to each field displayed in a tooltip +* tooltipSuffix - A string to append to each field displayed in a tooltip +* tooltipSkipNull - If true then null values will not have a tooltip displayed (defaults to true) +* tooltipValueLookups - An object or range map to map field values to tooltip strings +* (eg. to map -1 to "Lost", 0 to "Draw", and 1 to "Win") +* numberFormatter - Optional callback for formatting numbers in tooltips +* numberDigitGroupSep - Character to use for group separator in numbers "1,234" - Defaults to "," +* numberDecimalMark - Character to use for the decimal point when formatting numbers - Defaults to "." +* numberDigitGroupCount - Number of digits between group separator - Defaults to 3 +* +* There are 7 types of sparkline, selected by supplying a "type" option of 'line' (default), +* 'bar', 'tristate', 'bullet', 'discrete', 'pie' or 'box' +* line - Line chart. Options: +* spotColor - Set to '' to not end each line in a circular spot +* minSpotColor - If set, color of spot at minimum value +* maxSpotColor - If set, color of spot at maximum value +* spotRadius - Radius in pixels +* lineWidth - Width of line in pixels +* normalRangeMin +* normalRangeMax - If set draws a filled horizontal bar between these two values marking the "normal" +* or expected range of values +* normalRangeColor - Color to use for the above bar +* drawNormalOnTop - Draw the normal range above the chart fill color if true +* defaultPixelsPerValue - Defaults to 3 pixels of width for each value in the chart +* highlightSpotColor - The color to use for drawing a highlight spot on mouseover - Set to null to disable +* highlightLineColor - The color to use for drawing a highlight line on mouseover - Set to null to disable +* valueSpots - Specify which points to draw spots on, and in which color. Accepts a range map +* +* bar - Bar chart. Options: +* barColor - Color of bars for postive values +* negBarColor - Color of bars for negative values +* zeroColor - Color of bars with zero values +* nullColor - Color of bars with null values - Defaults to omitting the bar entirely +* barWidth - Width of bars in pixels +* colorMap - Optional mappnig of values to colors to override the *BarColor values above +* can be an Array of values to control the color of individual bars or a range map +* to specify colors for individual ranges of values +* barSpacing - Gap between bars in pixels +* zeroAxis - Centers the y-axis around zero if true +* +* tristate - Charts values of win (>0), lose (<0) or draw (=0) +* posBarColor - Color of win values +* negBarColor - Color of lose values +* zeroBarColor - Color of draw values +* barWidth - Width of bars in pixels +* barSpacing - Gap between bars in pixels +* colorMap - Optional mappnig of values to colors to override the *BarColor values above +* can be an Array of values to control the color of individual bars or a range map +* to specify colors for individual ranges of values +* +* discrete - Options: +* lineHeight - Height of each line in pixels - Defaults to 30% of the graph height +* thesholdValue - Values less than this value will be drawn using thresholdColor instead of lineColor +* thresholdColor +* +* bullet - Values for bullet graphs msut be in the order: target, performance, range1, range2, range3, ... +* options: +* targetColor - The color of the vertical target marker +* targetWidth - The width of the target marker in pixels +* performanceColor - The color of the performance measure horizontal bar +* rangeColors - Colors to use for each qualitative range background color +* +* pie - Pie chart. Options: +* sliceColors - An array of colors to use for pie slices +* offset - Angle in degrees to offset the first slice - Try -90 or +90 +* borderWidth - Width of border to draw around the pie chart, in pixels - Defaults to 0 (no border) +* borderColor - Color to use for the pie chart border - Defaults to #000 +* +* box - Box plot. Options: +* raw - Set to true to supply pre-computed plot points as values +* values should be: low_outlier, low_whisker, q1, median, q3, high_whisker, high_outlier +* When set to false you can supply any number of values and the box plot will +* be computed for you. Default is false. +* showOutliers - Set to true (default) to display outliers as circles +* outlierIQR - Interquartile range used to determine outliers. Default 1.5 +* boxLineColor - Outline color of the box +* boxFillColor - Fill color for the box +* whiskerColor - Line color used for whiskers +* outlierLineColor - Outline color of outlier circles +* outlierFillColor - Fill color of the outlier circles +* spotRadius - Radius of outlier circles +* medianColor - Line color of the median line +* target - Draw a target cross hair at the supplied value (default undefined) +* +* +* +* Examples: +* $('#sparkline1').sparkline(myvalues, { lineColor: '#f00', fillColor: false }); +* $('.barsparks').sparkline('html', { type:'bar', height:'40px', barWidth:5 }); +* $('#tristate').sparkline([1,1,-1,1,0,0,-1], { type:'tristate' }): +* $('#discrete').sparkline([1,3,4,5,5,3,4,5], { type:'discrete' }); +* $('#bullet').sparkline([10,12,12,9,7], { type:'bullet' }); +* $('#pie').sparkline([1,1,2], { type:'pie' }); +*/ + +/*jslint regexp: true, browser: true, jquery: true, white: true, nomen: false, plusplus: false, maxerr: 500, indent: 4 */ + +(function(document, Math, undefined) { // performance/minified-size optimization +(function(factory) { + if(typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (jQuery && !jQuery.fn.sparkline) { + factory(jQuery); + } +} +(function($) { + 'use strict'; + + var UNSET_OPTION = {}, + getDefaults, createClass, SPFormat, clipval, quartile, normalizeValue, normalizeValues, + remove, isNumber, all, sum, addCSS, ensureArray, formatNumber, RangeMap, + MouseHandler, Tooltip, barHighlightMixin, + line, bar, tristate, discrete, bullet, pie, box, defaultStyles, initStyles, + VShape, VCanvas_base, VCanvas_canvas, VCanvas_vml, pending, shapeCount = 0; + + /** + * Default configuration settings + */ + getDefaults = function () { + return { + // Settings common to most/all chart types + common: { + type: 'line', + lineColor: '#00f', + fillColor: '#cdf', + defaultPixelsPerValue: 3, + width: 'auto', + height: 'auto', + composite: false, + tagValuesAttribute: 'values', + tagOptionsPrefix: 'spark', + enableTagOptions: false, + enableHighlight: true, + highlightLighten: 1.4, + tooltipSkipNull: true, + tooltipPrefix: '', + tooltipSuffix: '', + disableHiddenCheck: false, + numberFormatter: false, + numberDigitGroupCount: 3, + numberDigitGroupSep: ',', + numberDecimalMark: '.', + disableTooltips: false, + disableInteraction: false + }, + // Defaults for line charts + line: { + spotColor: '#f80', + highlightSpotColor: '#5f5', + highlightLineColor: '#f22', + spotRadius: 1.5, + minSpotColor: '#f80', + maxSpotColor: '#f80', + lineWidth: 1, + normalRangeMin: undefined, + normalRangeMax: undefined, + normalRangeColor: '#ccc', + drawNormalOnTop: false, + chartRangeMin: undefined, + chartRangeMax: undefined, + chartRangeMinX: undefined, + chartRangeMaxX: undefined, + tooltipFormat: new SPFormat(' {{prefix}}{{y}}{{suffix}}') + }, + // Defaults for bar charts + bar: { + barColor: '#3366cc', + negBarColor: '#f44', + stackedBarColor: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00', + '#dd4477', '#0099c6', '#990099'], + zeroColor: undefined, + nullColor: undefined, + zeroAxis: true, + barWidth: 4, + barSpacing: 1, + chartRangeMax: undefined, + chartRangeMin: undefined, + chartRangeClip: false, + colorMap: undefined, + tooltipFormat: new SPFormat(' {{prefix}}{{value}}{{suffix}}') + }, + // Defaults for tristate charts + tristate: { + barWidth: 4, + barSpacing: 1, + posBarColor: '#6f6', + negBarColor: '#f44', + zeroBarColor: '#999', + colorMap: {}, + tooltipFormat: new SPFormat(' {{value:map}}'), + tooltipValueLookups: { map: { '-1': 'Loss', '0': 'Draw', '1': 'Win' } } + }, + // Defaults for discrete charts + discrete: { + lineHeight: 'auto', + thresholdColor: undefined, + thresholdValue: 0, + chartRangeMax: undefined, + chartRangeMin: undefined, + chartRangeClip: false, + tooltipFormat: new SPFormat('{{prefix}}{{value}}{{suffix}}') + }, + // Defaults for bullet charts + bullet: { + targetColor: '#f33', + targetWidth: 3, // width of the target bar in pixels + performanceColor: '#33f', + rangeColors: ['#d3dafe', '#a8b6ff', '#7f94ff'], + base: undefined, // set this to a number to change the base start number + tooltipFormat: new SPFormat('{{fieldkey:fields}} - {{value}}'), + tooltipValueLookups: { fields: {r: 'Range', p: 'Performance', t: 'Target'} } + }, + // Defaults for pie charts + pie: { + offset: 0, + sliceColors: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00', + '#dd4477', '#0099c6', '#990099'], + borderWidth: 0, + borderColor: '#000', + tooltipFormat: new SPFormat(' {{value}} ({{percent.1}}%)') + }, + // Defaults for box plots + box: { + raw: false, + boxLineColor: '#000', + boxFillColor: '#cdf', + whiskerColor: '#000', + outlierLineColor: '#333', + outlierFillColor: '#fff', + medianColor: '#f00', + showOutliers: true, + outlierIQR: 1.5, + spotRadius: 1.5, + target: undefined, + targetColor: '#4a2', + chartRangeMax: undefined, + chartRangeMin: undefined, + tooltipFormat: new SPFormat('{{field:fields}}: {{value}}'), + tooltipFormatFieldlistKey: 'field', + tooltipValueLookups: { fields: { lq: 'Lower Quartile', med: 'Median', + uq: 'Upper Quartile', lo: 'Left Outlier', ro: 'Right Outlier', + lw: 'Left Whisker', rw: 'Right Whisker'} } + } + }; + }; + + // You can have tooltips use a css class other than jqstooltip by specifying tooltipClassname + defaultStyles = '.jqstooltip { ' + + 'position: absolute;' + + 'left: 0px;' + + 'top: 0px;' + + 'visibility: hidden;' + + 'background: rgb(0, 0, 0) transparent;' + + 'background-color: rgba(0,0,0,0.6);' + + 'filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);' + + '-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";' + + 'color: white;' + + 'font: 10px arial, san serif;' + + 'text-align: left;' + + 'white-space: nowrap;' + + 'padding: 5px;' + + 'border: 1px solid white;' + + 'z-index: 10000;' + + '}' + + '.jqsfield { ' + + 'color: white;' + + 'font: 10px arial, san serif;' + + 'text-align: left;' + + '}'; + + /** + * Utilities + */ + + createClass = function (/* [baseclass, [mixin, ...]], definition */) { + var Class, args; + Class = function () { + this.init.apply(this, arguments); + }; + if (arguments.length > 1) { + if (arguments[0]) { + Class.prototype = $.extend(new arguments[0](), arguments[arguments.length - 1]); + Class._super = arguments[0].prototype; + } else { + Class.prototype = arguments[arguments.length - 1]; + } + if (arguments.length > 2) { + args = Array.prototype.slice.call(arguments, 1, -1); + args.unshift(Class.prototype); + $.extend.apply($, args); + } + } else { + Class.prototype = arguments[0]; + } + Class.prototype.cls = Class; + return Class; + }; + + /** + * Wraps a format string for tooltips + * {{x}} + * {{x.2} + * {{x:months}} + */ + $.SPFormatClass = SPFormat = createClass({ + fre: /\{\{([\w.]+?)(:(.+?))?\}\}/g, + precre: /(\w+)\.(\d+)/, + + init: function (format, fclass) { + this.format = format; + this.fclass = fclass; + }, + + render: function (fieldset, lookups, options) { + var self = this, + fields = fieldset, + match, token, lookupkey, fieldvalue, prec; + return this.format.replace(this.fre, function () { + var lookup; + token = arguments[1]; + lookupkey = arguments[3]; + match = self.precre.exec(token); + if (match) { + prec = match[2]; + token = match[1]; + } else { + prec = false; + } + fieldvalue = fields[token]; + if (fieldvalue === undefined) { + return ''; + } + if (lookupkey && lookups && lookups[lookupkey]) { + lookup = lookups[lookupkey]; + if (lookup.get) { // RangeMap + return lookups[lookupkey].get(fieldvalue) || fieldvalue; + } else { + return lookups[lookupkey][fieldvalue] || fieldvalue; + } + } + if (isNumber(fieldvalue)) { + if (options.get('numberFormatter')) { + fieldvalue = options.get('numberFormatter')(fieldvalue); + } else { + fieldvalue = formatNumber(fieldvalue, prec, + options.get('numberDigitGroupCount'), + options.get('numberDigitGroupSep'), + options.get('numberDecimalMark')); + } + } + return fieldvalue; + }); + } + }); + + // convience method to avoid needing the new operator + $.spformat = function(format, fclass) { + return new SPFormat(format, fclass); + }; + + clipval = function (val, min, max) { + if (val < min) { + return min; + } + if (val > max) { + return max; + } + return val; + }; + + quartile = function (values, q) { + var vl; + if (q === 2) { + vl = Math.floor(values.length / 2); + return values.length % 2 ? values[vl] : (values[vl-1] + values[vl]) / 2; + } else { + if (values.length % 2 ) { // odd + vl = (values.length * q + q) / 4; + return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1]; + } else { //even + vl = (values.length * q + 2) / 4; + return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1]; + + } + } + }; + + normalizeValue = function (val) { + var nf; + switch (val) { + case 'undefined': + val = undefined; + break; + case 'null': + val = null; + break; + case 'true': + val = true; + break; + case 'false': + val = false; + break; + default: + nf = parseFloat(val); + if (val == nf) { + val = nf; + } + } + return val; + }; + + normalizeValues = function (vals) { + var i, result = []; + for (i = vals.length; i--;) { + result[i] = normalizeValue(vals[i]); + } + return result; + }; + + remove = function (vals, filter) { + var i, vl, result = []; + for (i = 0, vl = vals.length; i < vl; i++) { + if (vals[i] !== filter) { + result.push(vals[i]); + } + } + return result; + }; + + isNumber = function (num) { + return !isNaN(parseFloat(num)) && isFinite(num); + }; + + formatNumber = function (num, prec, groupsize, groupsep, decsep) { + var p, i; + num = (prec === false ? parseFloat(num).toString() : num.toFixed(prec)).split(''); + p = (p = $.inArray('.', num)) < 0 ? num.length : p; + if (p < num.length) { + num[p] = decsep; + } + for (i = p - groupsize; i > 0; i -= groupsize) { + num.splice(i, 0, groupsep); + } + return num.join(''); + }; + + // determine if all values of an array match a value + // returns true if the array is empty + all = function (val, arr, ignoreNull) { + var i; + for (i = arr.length; i--; ) { + if (ignoreNull && arr[i] === null) continue; + if (arr[i] !== val) { + return false; + } + } + return true; + }; + + // sums the numeric values in an array, ignoring other values + sum = function (vals) { + var total = 0, i; + for (i = vals.length; i--;) { + total += typeof vals[i] === 'number' ? vals[i] : 0; + } + return total; + }; + + ensureArray = function (val) { + return $.isArray(val) ? val : [val]; + }; + + // http://paulirish.com/2008/bookmarklet-inject-new-css-rules/ + addCSS = function(css) { + var tag; + //if ('\v' == 'v') /* ie only */ { + if (document.createStyleSheet) { + document.createStyleSheet().cssText = css; + } else { + tag = document.createElement('style'); + tag.type = 'text/css'; + document.getElementsByTagName('head')[0].appendChild(tag); + tag[(typeof document.body.style.WebkitAppearance == 'string') /* webkit only */ ? 'innerText' : 'innerHTML'] = css; + } + }; + + // Provide a cross-browser interface to a few simple drawing primitives + $.fn.simpledraw = function (width, height, useExisting, interact) { + var target, mhandler; + if (useExisting && (target = this.data('_jqs_vcanvas'))) { + return target; + } + + if ($.fn.sparkline.canvas === false) { + // We've already determined that neither Canvas nor VML are available + return false; + + } else if ($.fn.sparkline.canvas === undefined) { + // No function defined yet -- need to see if we support Canvas or VML + var el = document.createElement('canvas'); + if (!!(el.getContext && el.getContext('2d'))) { + // Canvas is available + $.fn.sparkline.canvas = function(width, height, target, interact) { + return new VCanvas_canvas(width, height, target, interact); + }; + } else if (document.namespaces && !document.namespaces.v) { + // VML is available + document.namespaces.add('v', 'urn:schemas-microsoft-com:vml', '#default#VML'); + $.fn.sparkline.canvas = function(width, height, target, interact) { + return new VCanvas_vml(width, height, target); + }; + } else { + // Neither Canvas nor VML are available + $.fn.sparkline.canvas = false; + return false; + } + } + + if (width === undefined) { + width = $(this).innerWidth(); + } + if (height === undefined) { + height = $(this).innerHeight(); + } + + target = $.fn.sparkline.canvas(width, height, this, interact); + + mhandler = $(this).data('_jqs_mhandler'); + if (mhandler) { + mhandler.registerCanvas(target); + } + return target; + }; + + $.fn.cleardraw = function () { + var target = this.data('_jqs_vcanvas'); + if (target) { + target.reset(); + } + }; + + $.RangeMapClass = RangeMap = createClass({ + init: function (map) { + var key, range, rangelist = []; + for (key in map) { + if (map.hasOwnProperty(key) && typeof key === 'string' && key.indexOf(':') > -1) { + range = key.split(':'); + range[0] = range[0].length === 0 ? -Infinity : parseFloat(range[0]); + range[1] = range[1].length === 0 ? Infinity : parseFloat(range[1]); + range[2] = map[key]; + rangelist.push(range); + } + } + this.map = map; + this.rangelist = rangelist || false; + }, + + get: function (value) { + var rangelist = this.rangelist, + i, range, result; + if ((result = this.map[value]) !== undefined) { + return result; + } + if (rangelist) { + for (i = rangelist.length; i--;) { + range = rangelist[i]; + if (range[0] <= value && range[1] >= value) { + return range[2]; + } + } + } + return undefined; + } + }); + + // Convenience function + $.range_map = function(map) { + return new RangeMap(map); + }; + + MouseHandler = createClass({ + init: function (el, options) { + var $el = $(el); + this.$el = $el; + this.options = options; + this.currentPageX = 0; + this.currentPageY = 0; + this.el = el; + this.splist = []; + this.tooltip = null; + this.over = false; + this.displayTooltips = !options.get('disableTooltips'); + this.highlightEnabled = !options.get('disableHighlight'); + }, + + registerSparkline: function (sp) { + this.splist.push(sp); + if (this.over) { + this.updateDisplay(); + } + }, + + registerCanvas: function (canvas) { + var $canvas = $(canvas.canvas); + this.canvas = canvas; + this.$canvas = $canvas; + $canvas.mouseenter($.proxy(this.mouseenter, this)); + $canvas.mouseleave($.proxy(this.mouseleave, this)); + $canvas.click($.proxy(this.mouseclick, this)); + }, + + reset: function (removeTooltip) { + this.splist = []; + if (this.tooltip && removeTooltip) { + this.tooltip.remove(); + this.tooltip = undefined; + } + }, + + mouseclick: function (e) { + var clickEvent = $.Event('sparklineClick'); + clickEvent.originalEvent = e; + clickEvent.sparklines = this.splist; + this.$el.trigger(clickEvent); + }, + + mouseenter: function (e) { + $(document.body).unbind('mousemove.jqs'); + $(document.body).bind('mousemove.jqs', $.proxy(this.mousemove, this)); + this.over = true; + this.currentPageX = e.pageX; + this.currentPageY = e.pageY; + this.currentEl = e.target; + if (!this.tooltip && this.displayTooltips) { + this.tooltip = new Tooltip(this.options); + this.tooltip.updatePosition(e.pageX, e.pageY); + } + this.updateDisplay(); + }, + + mouseleave: function () { + $(document.body).unbind('mousemove.jqs'); + var splist = this.splist, + spcount = splist.length, + needsRefresh = false, + sp, i; + this.over = false; + this.currentEl = null; + + if (this.tooltip) { + this.tooltip.remove(); + this.tooltip = null; + } + + for (i = 0; i < spcount; i++) { + sp = splist[i]; + if (sp.clearRegionHighlight()) { + needsRefresh = true; + } + } + + if (needsRefresh) { + this.canvas.render(); + } + }, + + mousemove: function (e) { + this.currentPageX = e.pageX; + this.currentPageY = e.pageY; + this.currentEl = e.target; + if (this.tooltip) { + this.tooltip.updatePosition(e.pageX, e.pageY); + } + this.updateDisplay(); + }, + + updateDisplay: function () { + var splist = this.splist, + spcount = splist.length, + needsRefresh = false, + offset = this.$canvas.offset(), + localX = this.currentPageX - offset.left, + localY = this.currentPageY - offset.top, + tooltiphtml, sp, i, result, changeEvent; + if (!this.over) { + return; + } + for (i = 0; i < spcount; i++) { + sp = splist[i]; + result = sp.setRegionHighlight(this.currentEl, localX, localY); + if (result) { + needsRefresh = true; + } + } + if (needsRefresh) { + changeEvent = $.Event('sparklineRegionChange'); + changeEvent.sparklines = this.splist; + this.$el.trigger(changeEvent); + if (this.tooltip) { + tooltiphtml = ''; + for (i = 0; i < spcount; i++) { + sp = splist[i]; + tooltiphtml += sp.getCurrentRegionTooltip(); + } + this.tooltip.setContent(tooltiphtml); + } + if (!this.disableHighlight) { + this.canvas.render(); + } + } + if (result === null) { + this.mouseleave(); + } + } + }); + + + Tooltip = createClass({ + sizeStyle: 'position: static !important;' + + 'display: block !important;' + + 'visibility: hidden !important;' + + 'float: left !important;', + + init: function (options) { + var tooltipClassname = options.get('tooltipClassname', 'jqstooltip'), + sizetipStyle = this.sizeStyle, + offset; + this.container = options.get('tooltipContainer') || document.body; + this.tooltipOffsetX = options.get('tooltipOffsetX', 10); + this.tooltipOffsetY = options.get('tooltipOffsetY', 12); + // remove any previous lingering tooltip + $('#jqssizetip').remove(); + $('#jqstooltip').remove(); + this.sizetip = $('
      ', { + id: 'jqssizetip', + style: sizetipStyle, + 'class': tooltipClassname + }); + this.tooltip = $('
      ', { + id: 'jqstooltip', + 'class': tooltipClassname + }).appendTo(this.container); + // account for the container's location + offset = this.tooltip.offset(); + this.offsetLeft = offset.left; + this.offsetTop = offset.top; + this.hidden = true; + $(window).unbind('resize.jqs scroll.jqs'); + $(window).bind('resize.jqs scroll.jqs', $.proxy(this.updateWindowDims, this)); + this.updateWindowDims(); + }, + + updateWindowDims: function () { + this.scrollTop = $(window).scrollTop(); + this.scrollLeft = $(window).scrollLeft(); + this.scrollRight = this.scrollLeft + $(window).width(); + this.updatePosition(); + }, + + getSize: function (content) { + this.sizetip.html(content).appendTo(this.container); + this.width = this.sizetip.width() + 1; + this.height = this.sizetip.height(); + this.sizetip.remove(); + }, + + setContent: function (content) { + if (!content) { + this.tooltip.css('visibility', 'hidden'); + this.hidden = true; + return; + } + this.getSize(content); + this.tooltip.html(content) + .css({ + 'width': this.width, + 'height': this.height, + 'visibility': 'visible' + }); + if (this.hidden) { + this.hidden = false; + this.updatePosition(); + } + }, + + updatePosition: function (x, y) { + if (x === undefined) { + if (this.mousex === undefined) { + return; + } + x = this.mousex - this.offsetLeft; + y = this.mousey - this.offsetTop; + + } else { + this.mousex = x = x - this.offsetLeft; + this.mousey = y = y - this.offsetTop; + } + if (!this.height || !this.width || this.hidden) { + return; + } + + y -= this.height + this.tooltipOffsetY; + x += this.tooltipOffsetX; + + if (y < this.scrollTop) { + y = this.scrollTop; + } + if (x < this.scrollLeft) { + x = this.scrollLeft; + } else if (x + this.width > this.scrollRight) { + x = this.scrollRight - this.width; + } + + this.tooltip.css({ + 'left': x, + 'top': y + }); + }, + + remove: function () { + this.tooltip.remove(); + this.sizetip.remove(); + this.sizetip = this.tooltip = undefined; + $(window).unbind('resize.jqs scroll.jqs'); + } + }); + + initStyles = function() { + addCSS(defaultStyles); + }; + + $(initStyles); + + pending = []; + $.fn.sparkline = function (userValues, userOptions) { + return this.each(function () { + var options = new $.fn.sparkline.options(this, userOptions), + $this = $(this), + render, i; + render = function () { + var values, width, height, tmp, mhandler, sp, vals; + if (userValues === 'html' || userValues === undefined) { + vals = this.getAttribute(options.get('tagValuesAttribute')); + if (vals === undefined || vals === null) { + vals = $this.html(); + } + values = vals.replace(/(^\s*\s*$)|\s+/g, '').split(','); + } else { + values = userValues; + } + + width = options.get('width') === 'auto' ? values.length * options.get('defaultPixelsPerValue') : options.get('width'); + if (options.get('height') === 'auto') { + if (!options.get('composite') || !$.data(this, '_jqs_vcanvas')) { + // must be a better way to get the line height + tmp = document.createElement('span'); + tmp.innerHTML = 'a'; + $this.html(tmp); + height = $(tmp).innerHeight() || $(tmp).height(); + $(tmp).remove(); + tmp = null; + } + } else { + height = options.get('height'); + } + + if (!options.get('disableInteraction')) { + mhandler = $.data(this, '_jqs_mhandler'); + if (!mhandler) { + mhandler = new MouseHandler(this, options); + $.data(this, '_jqs_mhandler', mhandler); + } else if (!options.get('composite')) { + mhandler.reset(); + } + } else { + mhandler = false; + } + + if (options.get('composite') && !$.data(this, '_jqs_vcanvas')) { + if (!$.data(this, '_jqs_errnotify')) { + alert('Attempted to attach a composite sparkline to an element with no existing sparkline'); + $.data(this, '_jqs_errnotify', true); + } + return; + } + + sp = new $.fn.sparkline[options.get('type')](this, values, options, width, height); + + sp.render(); + + if (mhandler) { + mhandler.registerSparkline(sp); + } + }; + if (($(this).html() && !options.get('disableHiddenCheck') && $(this).is(':hidden')) || !$(this).parents('body').length) { + if (!options.get('composite') && $.data(this, '_jqs_pending')) { + // remove any existing references to the element + for (i = pending.length; i; i--) { + if (pending[i - 1][0] == this) { + pending.splice(i - 1, 1); + } + } + } + pending.push([this, render]); + $.data(this, '_jqs_pending', true); + } else { + render.call(this); + } + }); + }; + + $.fn.sparkline.defaults = getDefaults(); + + + $.sparkline_display_visible = function () { + var el, i, pl; + var done = []; + for (i = 0, pl = pending.length; i < pl; i++) { + el = pending[i][0]; + if ($(el).is(':visible') && !$(el).parents().is(':hidden')) { + pending[i][1].call(el); + $.data(pending[i][0], '_jqs_pending', false); + done.push(i); + } else if (!$(el).closest('html').length && !$.data(el, '_jqs_pending')) { + // element has been inserted and removed from the DOM + // If it was not yet inserted into the dom then the .data request + // will return true. + // removing from the dom causes the data to be removed. + $.data(pending[i][0], '_jqs_pending', false); + done.push(i); + } + } + for (i = done.length; i; i--) { + pending.splice(done[i - 1], 1); + } + }; + + + /** + * User option handler + */ + $.fn.sparkline.options = createClass({ + init: function (tag, userOptions) { + var extendedOptions, defaults, base, tagOptionType; + this.userOptions = userOptions = userOptions || {}; + this.tag = tag; + this.tagValCache = {}; + defaults = $.fn.sparkline.defaults; + base = defaults.common; + this.tagOptionsPrefix = userOptions.enableTagOptions && (userOptions.tagOptionsPrefix || base.tagOptionsPrefix); + + tagOptionType = this.getTagSetting('type'); + if (tagOptionType === UNSET_OPTION) { + extendedOptions = defaults[userOptions.type || base.type]; + } else { + extendedOptions = defaults[tagOptionType]; + } + this.mergedOptions = $.extend({}, base, extendedOptions, userOptions); + }, + + + getTagSetting: function (key) { + var prefix = this.tagOptionsPrefix, + val, i, pairs, keyval; + if (prefix === false || prefix === undefined) { + return UNSET_OPTION; + } + if (this.tagValCache.hasOwnProperty(key)) { + val = this.tagValCache.key; + } else { + val = this.tag.getAttribute(prefix + key); + if (val === undefined || val === null) { + val = UNSET_OPTION; + } else if (val.substr(0, 1) === '[') { + val = val.substr(1, val.length - 2).split(','); + for (i = val.length; i--;) { + val[i] = normalizeValue(val[i].replace(/(^\s*)|(\s*$)/g, '')); + } + } else if (val.substr(0, 1) === '{') { + pairs = val.substr(1, val.length - 2).split(','); + val = {}; + for (i = pairs.length; i--;) { + keyval = pairs[i].split(':', 2); + val[keyval[0].replace(/(^\s*)|(\s*$)/g, '')] = normalizeValue(keyval[1].replace(/(^\s*)|(\s*$)/g, '')); + } + } else { + val = normalizeValue(val); + } + this.tagValCache.key = val; + } + return val; + }, + + get: function (key, defaultval) { + var tagOption = this.getTagSetting(key), + result; + if (tagOption !== UNSET_OPTION) { + return tagOption; + } + return (result = this.mergedOptions[key]) === undefined ? defaultval : result; + } + }); + + + $.fn.sparkline._base = createClass({ + disabled: false, + + init: function (el, values, options, width, height) { + this.el = el; + this.$el = $(el); + this.values = values; + this.options = options; + this.width = width; + this.height = height; + this.currentRegion = undefined; + }, + + /** + * Setup the canvas + */ + initTarget: function () { + var interactive = !this.options.get('disableInteraction'); + if (!(this.target = this.$el.simpledraw(this.width, this.height, this.options.get('composite'), interactive))) { + this.disabled = true; + } else { + this.canvasWidth = this.target.pixelWidth; + this.canvasHeight = this.target.pixelHeight; + } + }, + + /** + * Actually render the chart to the canvas + */ + render: function () { + if (this.disabled) { + this.el.innerHTML = ''; + return false; + } + return true; + }, + + /** + * Return a region id for a given x/y co-ordinate + */ + getRegion: function (x, y) { + }, + + /** + * Highlight an item based on the moused-over x,y co-ordinate + */ + setRegionHighlight: function (el, x, y) { + var currentRegion = this.currentRegion, + highlightEnabled = !this.options.get('disableHighlight'), + newRegion; + if (x > this.canvasWidth || y > this.canvasHeight || x < 0 || y < 0) { + return null; + } + newRegion = this.getRegion(el, x, y); + if (currentRegion !== newRegion) { + if (currentRegion !== undefined && highlightEnabled) { + this.removeHighlight(); + } + this.currentRegion = newRegion; + if (newRegion !== undefined && highlightEnabled) { + this.renderHighlight(); + } + return true; + } + return false; + }, + + /** + * Reset any currently highlighted item + */ + clearRegionHighlight: function () { + if (this.currentRegion !== undefined) { + this.removeHighlight(); + this.currentRegion = undefined; + return true; + } + return false; + }, + + renderHighlight: function () { + this.changeHighlight(true); + }, + + removeHighlight: function () { + this.changeHighlight(false); + }, + + changeHighlight: function (highlight) {}, + + /** + * Fetch the HTML to display as a tooltip + */ + getCurrentRegionTooltip: function () { + var options = this.options, + header = '', + entries = [], + fields, formats, formatlen, fclass, text, i, + showFields, showFieldsKey, newFields, fv, + formatter, format, fieldlen, j; + if (this.currentRegion === undefined) { + return ''; + } + fields = this.getCurrentRegionFields(); + formatter = options.get('tooltipFormatter'); + if (formatter) { + return formatter(this, options, fields); + } + if (options.get('tooltipChartTitle')) { + header += '
      ' + options.get('tooltipChartTitle') + '
      \n'; + } + formats = this.options.get('tooltipFormat'); + if (!formats) { + return ''; + } + if (!$.isArray(formats)) { + formats = [formats]; + } + if (!$.isArray(fields)) { + fields = [fields]; + } + showFields = this.options.get('tooltipFormatFieldlist'); + showFieldsKey = this.options.get('tooltipFormatFieldlistKey'); + if (showFields && showFieldsKey) { + // user-selected ordering of fields + newFields = []; + for (i = fields.length; i--;) { + fv = fields[i][showFieldsKey]; + if ((j = $.inArray(fv, showFields)) != -1) { + newFields[j] = fields[i]; + } + } + fields = newFields; + } + formatlen = formats.length; + fieldlen = fields.length; + for (i = 0; i < formatlen; i++) { + format = formats[i]; + if (typeof format === 'string') { + format = new SPFormat(format); + } + fclass = format.fclass || 'jqsfield'; + for (j = 0; j < fieldlen; j++) { + if (!fields[j].isNull || !options.get('tooltipSkipNull')) { + $.extend(fields[j], { + prefix: options.get('tooltipPrefix'), + suffix: options.get('tooltipSuffix') + }); + text = format.render(fields[j], options.get('tooltipValueLookups'), options); + entries.push('
      ' + text + '
      '); + } + } + } + if (entries.length) { + return header + entries.join('\n'); + } + return ''; + }, + + getCurrentRegionFields: function () {}, + + calcHighlightColor: function (color, options) { + var highlightColor = options.get('highlightColor'), + lighten = options.get('highlightLighten'), + parse, mult, rgbnew, i; + if (highlightColor) { + return highlightColor; + } + if (lighten) { + // extract RGB values + parse = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(color) || /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color); + if (parse) { + rgbnew = []; + mult = color.length === 4 ? 16 : 1; + for (i = 0; i < 3; i++) { + rgbnew[i] = clipval(Math.round(parseInt(parse[i + 1], 16) * mult * lighten), 0, 255); + } + return 'rgb(' + rgbnew.join(',') + ')'; + } + + } + return color; + } + + }); + + barHighlightMixin = { + changeHighlight: function (highlight) { + var currentRegion = this.currentRegion, + target = this.target, + shapeids = this.regionShapes[currentRegion], + newShapes; + // will be null if the region value was null + if (shapeids) { + newShapes = this.renderRegion(currentRegion, highlight); + if ($.isArray(newShapes) || $.isArray(shapeids)) { + target.replaceWithShapes(shapeids, newShapes); + this.regionShapes[currentRegion] = $.map(newShapes, function (newShape) { + return newShape.id; + }); + } else { + target.replaceWithShape(shapeids, newShapes); + this.regionShapes[currentRegion] = newShapes.id; + } + } + }, + + render: function () { + var values = this.values, + target = this.target, + regionShapes = this.regionShapes, + shapes, ids, i, j; + + if (!this.cls._super.render.call(this)) { + return; + } + for (i = values.length; i--;) { + shapes = this.renderRegion(i); + if (shapes) { + if ($.isArray(shapes)) { + ids = []; + for (j = shapes.length; j--;) { + shapes[j].append(); + ids.push(shapes[j].id); + } + regionShapes[i] = ids; + } else { + shapes.append(); + regionShapes[i] = shapes.id; // store just the shapeid + } + } else { + // null value + regionShapes[i] = null; + } + } + target.render(); + } + }; + + /** + * Line charts + */ + $.fn.sparkline.line = line = createClass($.fn.sparkline._base, { + type: 'line', + + init: function (el, values, options, width, height) { + line._super.init.call(this, el, values, options, width, height); + this.vertices = []; + this.regionMap = []; + this.xvalues = []; + this.yvalues = []; + this.yminmax = []; + this.hightlightSpotId = null; + this.lastShapeId = null; + this.initTarget(); + }, + + getRegion: function (el, x, y) { + var i, + regionMap = this.regionMap; // maps regions to value positions + for (i = regionMap.length; i--;) { + if (regionMap[i] !== null && x >= regionMap[i][0] && x <= regionMap[i][1]) { + return regionMap[i][2]; + } + } + return undefined; + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + isNull: this.yvalues[currentRegion] === null, + x: this.xvalues[currentRegion], + y: this.yvalues[currentRegion], + color: this.options.get('lineColor'), + fillColor: this.options.get('fillColor'), + offset: currentRegion + }; + }, + + renderHighlight: function () { + var currentRegion = this.currentRegion, + target = this.target, + vertex = this.vertices[currentRegion], + options = this.options, + spotRadius = options.get('spotRadius'), + highlightSpotColor = options.get('highlightSpotColor'), + highlightLineColor = options.get('highlightLineColor'), + highlightSpot, highlightLine; + + if (!vertex) { + return; + } + if (spotRadius && highlightSpotColor) { + highlightSpot = target.drawCircle(vertex[0], vertex[1], + spotRadius, undefined, highlightSpotColor); + this.highlightSpotId = highlightSpot.id; + target.insertAfterShape(this.lastShapeId, highlightSpot); + } + if (highlightLineColor) { + highlightLine = target.drawLine(vertex[0], this.canvasTop, vertex[0], + this.canvasTop + this.canvasHeight, highlightLineColor); + this.highlightLineId = highlightLine.id; + target.insertAfterShape(this.lastShapeId, highlightLine); + } + }, + + removeHighlight: function () { + var target = this.target; + if (this.highlightSpotId) { + target.removeShapeId(this.highlightSpotId); + this.highlightSpotId = null; + } + if (this.highlightLineId) { + target.removeShapeId(this.highlightLineId); + this.highlightLineId = null; + } + }, + + scanValues: function () { + var values = this.values, + valcount = values.length, + xvalues = this.xvalues, + yvalues = this.yvalues, + yminmax = this.yminmax, + i, val, isStr, isArray, sp; + for (i = 0; i < valcount; i++) { + val = values[i]; + isStr = typeof(values[i]) === 'string'; + isArray = typeof(values[i]) === 'object' && values[i] instanceof Array; + sp = isStr && values[i].split(':'); + if (isStr && sp.length === 2) { // x:y + xvalues.push(Number(sp[0])); + yvalues.push(Number(sp[1])); + yminmax.push(Number(sp[1])); + } else if (isArray) { + xvalues.push(val[0]); + yvalues.push(val[1]); + yminmax.push(val[1]); + } else { + xvalues.push(i); + if (values[i] === null || values[i] === 'null') { + yvalues.push(null); + } else { + yvalues.push(Number(val)); + yminmax.push(Number(val)); + } + } + } + if (this.options.get('xvalues')) { + xvalues = this.options.get('xvalues'); + } + + this.maxy = this.maxyorg = Math.max.apply(Math, yminmax); + this.miny = this.minyorg = Math.min.apply(Math, yminmax); + + this.maxx = Math.max.apply(Math, xvalues); + this.minx = Math.min.apply(Math, xvalues); + + this.xvalues = xvalues; + this.yvalues = yvalues; + this.yminmax = yminmax; + + }, + + processRangeOptions: function () { + var options = this.options, + normalRangeMin = options.get('normalRangeMin'), + normalRangeMax = options.get('normalRangeMax'); + + if (normalRangeMin !== undefined) { + if (normalRangeMin < this.miny) { + this.miny = normalRangeMin; + } + if (normalRangeMax > this.maxy) { + this.maxy = normalRangeMax; + } + } + if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.miny)) { + this.miny = options.get('chartRangeMin'); + } + if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.maxy)) { + this.maxy = options.get('chartRangeMax'); + } + if (options.get('chartRangeMinX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMinX') < this.minx)) { + this.minx = options.get('chartRangeMinX'); + } + if (options.get('chartRangeMaxX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMaxX') > this.maxx)) { + this.maxx = options.get('chartRangeMaxX'); + } + + }, + + drawNormalRange: function (canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey) { + var normalRangeMin = this.options.get('normalRangeMin'), + normalRangeMax = this.options.get('normalRangeMax'), + ytop = canvasTop + Math.round(canvasHeight - (canvasHeight * ((normalRangeMax - this.miny) / rangey))), + height = Math.round((canvasHeight * (normalRangeMax - normalRangeMin)) / rangey); + this.target.drawRect(canvasLeft, ytop, canvasWidth, height, undefined, this.options.get('normalRangeColor')).append(); + }, + + render: function () { + var options = this.options, + target = this.target, + canvasWidth = this.canvasWidth, + canvasHeight = this.canvasHeight, + vertices = this.vertices, + spotRadius = options.get('spotRadius'), + regionMap = this.regionMap, + rangex, rangey, yvallast, + canvasTop, canvasLeft, + vertex, path, paths, x, y, xnext, xpos, xposnext, + last, next, yvalcount, lineShapes, fillShapes, plen, + valueSpots, hlSpotsEnabled, color, xvalues, yvalues, i; + + if (!line._super.render.call(this)) { + return; + } + + this.scanValues(); + this.processRangeOptions(); + + xvalues = this.xvalues; + yvalues = this.yvalues; + + if (!this.yminmax.length || this.yvalues.length < 2) { + // empty or all null valuess + return; + } + + canvasTop = canvasLeft = 0; + + rangex = this.maxx - this.minx === 0 ? 1 : this.maxx - this.minx; + rangey = this.maxy - this.miny === 0 ? 1 : this.maxy - this.miny; + yvallast = this.yvalues.length - 1; + + if (spotRadius && (canvasWidth < (spotRadius * 4) || canvasHeight < (spotRadius * 4))) { + spotRadius = 0; + } + if (spotRadius) { + // adjust the canvas size as required so that spots will fit + hlSpotsEnabled = options.get('highlightSpotColor') && !options.get('disableInteraction'); + if (hlSpotsEnabled || options.get('minSpotColor') || (options.get('spotColor') && yvalues[yvallast] === this.miny)) { + canvasHeight -= Math.ceil(spotRadius); + } + if (hlSpotsEnabled || options.get('maxSpotColor') || (options.get('spotColor') && yvalues[yvallast] === this.maxy)) { + canvasHeight -= Math.ceil(spotRadius); + canvasTop += Math.ceil(spotRadius); + } + if (hlSpotsEnabled || + ((options.get('minSpotColor') || options.get('maxSpotColor')) && (yvalues[0] === this.miny || yvalues[0] === this.maxy))) { + canvasLeft += Math.ceil(spotRadius); + canvasWidth -= Math.ceil(spotRadius); + } + if (hlSpotsEnabled || options.get('spotColor') || + (options.get('minSpotColor') || options.get('maxSpotColor') && + (yvalues[yvallast] === this.miny || yvalues[yvallast] === this.maxy))) { + canvasWidth -= Math.ceil(spotRadius); + } + } + + + canvasHeight--; + + if (options.get('normalRangeMin') !== undefined && !options.get('drawNormalOnTop')) { + this.drawNormalRange(canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey); + } + + path = []; + paths = [path]; + last = next = null; + yvalcount = yvalues.length; + for (i = 0; i < yvalcount; i++) { + x = xvalues[i]; + xnext = xvalues[i + 1]; + y = yvalues[i]; + xpos = canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)); + xposnext = i < yvalcount - 1 ? canvasLeft + Math.round((xnext - this.minx) * (canvasWidth / rangex)) : canvasWidth; + next = xpos + ((xposnext - xpos) / 2); + regionMap[i] = [last || 0, next, i]; + last = next; + if (y === null) { + if (i) { + if (yvalues[i - 1] !== null) { + path = []; + paths.push(path); + } + vertices.push(null); + } + } else { + if (y < this.miny) { + y = this.miny; + } + if (y > this.maxy) { + y = this.maxy; + } + if (!path.length) { + // previous value was null + path.push([xpos, canvasTop + canvasHeight]); + } + vertex = [xpos, canvasTop + Math.round(canvasHeight - (canvasHeight * ((y - this.miny) / rangey)))]; + path.push(vertex); + vertices.push(vertex); + } + } + + lineShapes = []; + fillShapes = []; + plen = paths.length; + for (i = 0; i < plen; i++) { + path = paths[i]; + if (path.length) { + if (options.get('fillColor')) { + path.push([path[path.length - 1][0], (canvasTop + canvasHeight)]); + fillShapes.push(path.slice(0)); + path.pop(); + } + // if there's only a single point in this path, then we want to display it + // as a vertical line which means we keep path[0] as is + if (path.length > 2) { + // else we want the first value + path[0] = [path[0][0], path[1][1]]; + } + lineShapes.push(path); + } + } + + // draw the fill first, then optionally the normal range, then the line on top of that + plen = fillShapes.length; + for (i = 0; i < plen; i++) { + target.drawShape(fillShapes[i], + options.get('fillColor'), options.get('fillColor')).append(); + } + + if (options.get('normalRangeMin') !== undefined && options.get('drawNormalOnTop')) { + this.drawNormalRange(canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey); + } + + plen = lineShapes.length; + for (i = 0; i < plen; i++) { + target.drawShape(lineShapes[i], options.get('lineColor'), undefined, + options.get('lineWidth')).append(); + } + + if (spotRadius && options.get('valueSpots')) { + valueSpots = options.get('valueSpots'); + if (valueSpots.get === undefined) { + valueSpots = new RangeMap(valueSpots); + } + for (i = 0; i < yvalcount; i++) { + color = valueSpots.get(yvalues[i]); + if (color) { + target.drawCircle(canvasLeft + Math.round((xvalues[i] - this.minx) * (canvasWidth / rangex)), + canvasTop + Math.round(canvasHeight - (canvasHeight * ((yvalues[i] - this.miny) / rangey))), + spotRadius, undefined, + color).append(); + } + } + + } + if (spotRadius && options.get('spotColor') && yvalues[yvallast] !== null) { + target.drawCircle(canvasLeft + Math.round((xvalues[xvalues.length - 1] - this.minx) * (canvasWidth / rangex)), + canvasTop + Math.round(canvasHeight - (canvasHeight * ((yvalues[yvallast] - this.miny) / rangey))), + spotRadius, undefined, + options.get('spotColor')).append(); + } + if (this.maxy !== this.minyorg) { + if (spotRadius && options.get('minSpotColor')) { + x = xvalues[$.inArray(this.minyorg, yvalues)]; + target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)), + canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.minyorg - this.miny) / rangey))), + spotRadius, undefined, + options.get('minSpotColor')).append(); + } + if (spotRadius && options.get('maxSpotColor')) { + x = xvalues[$.inArray(this.maxyorg, yvalues)]; + target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)), + canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.maxyorg - this.miny) / rangey))), + spotRadius, undefined, + options.get('maxSpotColor')).append(); + } + } + + this.lastShapeId = target.getLastShapeId(); + this.canvasTop = canvasTop; + target.render(); + } + }); + + /** + * Bar charts + */ + $.fn.sparkline.bar = bar = createClass($.fn.sparkline._base, barHighlightMixin, { + type: 'bar', + + init: function (el, values, options, width, height) { + var barWidth = parseInt(options.get('barWidth'), 10), + barSpacing = parseInt(options.get('barSpacing'), 10), + chartRangeMin = options.get('chartRangeMin'), + chartRangeMax = options.get('chartRangeMax'), + chartRangeClip = options.get('chartRangeClip'), + stackMin = Infinity, + stackMax = -Infinity, + isStackString, groupMin, groupMax, stackRanges, + numValues, i, vlen, range, zeroAxis, xaxisOffset, min, max, clipMin, clipMax, + stacked, vlist, j, slen, svals, val, yoffset, yMaxCalc, canvasHeightEf; + bar._super.init.call(this, el, values, options, width, height); + + // scan values to determine whether to stack bars + for (i = 0, vlen = values.length; i < vlen; i++) { + val = values[i]; + isStackString = typeof(val) === 'string' && val.indexOf(':') > -1; + if (isStackString || $.isArray(val)) { + stacked = true; + if (isStackString) { + val = values[i] = normalizeValues(val.split(':')); + } + val = remove(val, null); // min/max will treat null as zero + groupMin = Math.min.apply(Math, val); + groupMax = Math.max.apply(Math, val); + if (groupMin < stackMin) { + stackMin = groupMin; + } + if (groupMax > stackMax) { + stackMax = groupMax; + } + } + } + + this.stacked = stacked; + this.regionShapes = {}; + this.barWidth = barWidth; + this.barSpacing = barSpacing; + this.totalBarWidth = barWidth + barSpacing; + this.width = width = (values.length * barWidth) + ((values.length - 1) * barSpacing); + + this.initTarget(); + + if (chartRangeClip) { + clipMin = chartRangeMin === undefined ? -Infinity : chartRangeMin; + clipMax = chartRangeMax === undefined ? Infinity : chartRangeMax; + } + + numValues = []; + stackRanges = stacked ? [] : numValues; + var stackTotals = []; + var stackRangesNeg = []; + for (i = 0, vlen = values.length; i < vlen; i++) { + if (stacked) { + vlist = values[i]; + values[i] = svals = []; + stackTotals[i] = 0; + stackRanges[i] = stackRangesNeg[i] = 0; + for (j = 0, slen = vlist.length; j < slen; j++) { + val = svals[j] = chartRangeClip ? clipval(vlist[j], clipMin, clipMax) : vlist[j]; + if (val !== null) { + if (val > 0) { + stackTotals[i] += val; + } + if (stackMin < 0 && stackMax > 0) { + if (val < 0) { + stackRangesNeg[i] += Math.abs(val); + } else { + stackRanges[i] += val; + } + } else { + stackRanges[i] += Math.abs(val - (val < 0 ? stackMax : stackMin)); + } + numValues.push(val); + } + } + } else { + val = chartRangeClip ? clipval(values[i], clipMin, clipMax) : values[i]; + val = values[i] = normalizeValue(val); + if (val !== null) { + numValues.push(val); + } + } + } + this.max = max = Math.max.apply(Math, numValues); + this.min = min = Math.min.apply(Math, numValues); + this.stackMax = stackMax = stacked ? Math.max.apply(Math, stackTotals) : max; + this.stackMin = stackMin = stacked ? Math.min.apply(Math, numValues) : min; + + if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < min)) { + min = options.get('chartRangeMin'); + } + if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > max)) { + max = options.get('chartRangeMax'); + } + + this.zeroAxis = zeroAxis = options.get('zeroAxis', true); + if (min <= 0 && max >= 0 && zeroAxis) { + xaxisOffset = 0; + } else if (zeroAxis == false) { + xaxisOffset = min; + } else if (min > 0) { + xaxisOffset = min; + } else { + xaxisOffset = max; + } + this.xaxisOffset = xaxisOffset; + + range = stacked ? (Math.max.apply(Math, stackRanges) + Math.max.apply(Math, stackRangesNeg)) : max - min; + + // as we plot zero/min values a single pixel line, we add a pixel to all other + // values - Reduce the effective canvas size to suit + this.canvasHeightEf = (zeroAxis && min < 0) ? this.canvasHeight - 2 : this.canvasHeight - 1; + + if (min < xaxisOffset) { + yMaxCalc = (stacked && max >= 0) ? stackMax : max; + yoffset = (yMaxCalc - xaxisOffset) / range * this.canvasHeight; + if (yoffset !== Math.ceil(yoffset)) { + this.canvasHeightEf -= 2; + yoffset = Math.ceil(yoffset); + } + } else { + yoffset = this.canvasHeight; + } + this.yoffset = yoffset; + + if ($.isArray(options.get('colorMap'))) { + this.colorMapByIndex = options.get('colorMap'); + this.colorMapByValue = null; + } else { + this.colorMapByIndex = null; + this.colorMapByValue = options.get('colorMap'); + if (this.colorMapByValue && this.colorMapByValue.get === undefined) { + this.colorMapByValue = new RangeMap(this.colorMapByValue); + } + } + + this.range = range; + }, + + getRegion: function (el, x, y) { + var result = Math.floor(x / this.totalBarWidth); + return (result < 0 || result >= this.values.length) ? undefined : result; + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion, + values = ensureArray(this.values[currentRegion]), + result = [], + value, i; + for (i = values.length; i--;) { + value = values[i]; + result.push({ + isNull: value === null, + value: value, + color: this.calcColor(i, value, currentRegion), + offset: currentRegion + }); + } + return result; + }, + + calcColor: function (stacknum, value, valuenum) { + var colorMapByIndex = this.colorMapByIndex, + colorMapByValue = this.colorMapByValue, + options = this.options, + color, newColor; + if (this.stacked) { + color = options.get('stackedBarColor'); + } else { + color = (value < 0) ? options.get('negBarColor') : options.get('barColor'); + } + if (value === 0 && options.get('zeroColor') !== undefined) { + color = options.get('zeroColor'); + } + if (colorMapByValue && (newColor = colorMapByValue.get(value))) { + color = newColor; + } else if (colorMapByIndex && colorMapByIndex.length > valuenum) { + color = colorMapByIndex[valuenum]; + } + return $.isArray(color) ? color[stacknum % color.length] : color; + }, + + /** + * Render bar(s) for a region + */ + renderRegion: function (valuenum, highlight) { + var vals = this.values[valuenum], + options = this.options, + xaxisOffset = this.xaxisOffset, + result = [], + range = this.range, + stacked = this.stacked, + target = this.target, + x = valuenum * this.totalBarWidth, + canvasHeightEf = this.canvasHeightEf, + yoffset = this.yoffset, + y, height, color, isNull, yoffsetNeg, i, valcount, val, minPlotted, allMin; + + vals = $.isArray(vals) ? vals : [vals]; + valcount = vals.length; + val = vals[0]; + isNull = all(null, vals); + allMin = all(xaxisOffset, vals, true); + + if (isNull) { + if (options.get('nullColor')) { + color = highlight ? options.get('nullColor') : this.calcHighlightColor(options.get('nullColor'), options); + y = (yoffset > 0) ? yoffset - 1 : yoffset; + return target.drawRect(x, y, this.barWidth - 1, 0, color, color); + } else { + return undefined; + } + } + yoffsetNeg = yoffset; + for (i = 0; i < valcount; i++) { + val = vals[i]; + + if (stacked && val === xaxisOffset) { + if (!allMin || minPlotted) { + continue; + } + minPlotted = true; + } + + if (range > 0) { + height = Math.floor(canvasHeightEf * ((Math.abs(val - xaxisOffset) / range))) + 1; + } else { + height = 1; + } + if (val < xaxisOffset || (val === xaxisOffset && yoffset === 0)) { + y = yoffsetNeg; + yoffsetNeg += height; + } else { + y = yoffset - height; + yoffset -= height; + } + color = this.calcColor(i, val, valuenum); + if (highlight) { + color = this.calcHighlightColor(color, options); + } + result.push(target.drawRect(x, y, this.barWidth - 1, height - 1, color, color)); + } + if (result.length === 1) { + return result[0]; + } + return result; + } + }); + + /** + * Tristate charts + */ + $.fn.sparkline.tristate = tristate = createClass($.fn.sparkline._base, barHighlightMixin, { + type: 'tristate', + + init: function (el, values, options, width, height) { + var barWidth = parseInt(options.get('barWidth'), 10), + barSpacing = parseInt(options.get('barSpacing'), 10); + tristate._super.init.call(this, el, values, options, width, height); + + this.regionShapes = {}; + this.barWidth = barWidth; + this.barSpacing = barSpacing; + this.totalBarWidth = barWidth + barSpacing; + this.values = $.map(values, Number); + this.width = width = (values.length * barWidth) + ((values.length - 1) * barSpacing); + + if ($.isArray(options.get('colorMap'))) { + this.colorMapByIndex = options.get('colorMap'); + this.colorMapByValue = null; + } else { + this.colorMapByIndex = null; + this.colorMapByValue = options.get('colorMap'); + if (this.colorMapByValue && this.colorMapByValue.get === undefined) { + this.colorMapByValue = new RangeMap(this.colorMapByValue); + } + } + this.initTarget(); + }, + + getRegion: function (el, x, y) { + return Math.floor(x / this.totalBarWidth); + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + isNull: this.values[currentRegion] === undefined, + value: this.values[currentRegion], + color: this.calcColor(this.values[currentRegion], currentRegion), + offset: currentRegion + }; + }, + + calcColor: function (value, valuenum) { + var values = this.values, + options = this.options, + colorMapByIndex = this.colorMapByIndex, + colorMapByValue = this.colorMapByValue, + color, newColor; + + if (colorMapByValue && (newColor = colorMapByValue.get(value))) { + color = newColor; + } else if (colorMapByIndex && colorMapByIndex.length > valuenum) { + color = colorMapByIndex[valuenum]; + } else if (values[valuenum] < 0) { + color = options.get('negBarColor'); + } else if (values[valuenum] > 0) { + color = options.get('posBarColor'); + } else { + color = options.get('zeroBarColor'); + } + return color; + }, + + renderRegion: function (valuenum, highlight) { + var values = this.values, + options = this.options, + target = this.target, + canvasHeight, height, halfHeight, + x, y, color; + + canvasHeight = target.pixelHeight; + halfHeight = Math.round(canvasHeight / 2); + + x = valuenum * this.totalBarWidth; + if (values[valuenum] < 0) { + y = halfHeight; + height = halfHeight - 1; + } else if (values[valuenum] > 0) { + y = 0; + height = halfHeight - 1; + } else { + y = halfHeight - 1; + height = 2; + } + color = this.calcColor(values[valuenum], valuenum); + if (color === null) { + return; + } + if (highlight) { + color = this.calcHighlightColor(color, options); + } + return target.drawRect(x, y, this.barWidth - 1, height - 1, color, color); + } + }); + + /** + * Discrete charts + */ + $.fn.sparkline.discrete = discrete = createClass($.fn.sparkline._base, barHighlightMixin, { + type: 'discrete', + + init: function (el, values, options, width, height) { + discrete._super.init.call(this, el, values, options, width, height); + + this.regionShapes = {}; + this.values = values = $.map(values, Number); + this.min = Math.min.apply(Math, values); + this.max = Math.max.apply(Math, values); + this.range = this.max - this.min; + this.width = width = options.get('width') === 'auto' ? values.length * 2 : this.width; + this.interval = Math.floor(width / values.length); + this.itemWidth = width / values.length; + if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.min)) { + this.min = options.get('chartRangeMin'); + } + if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.max)) { + this.max = options.get('chartRangeMax'); + } + this.initTarget(); + if (this.target) { + this.lineHeight = options.get('lineHeight') === 'auto' ? Math.round(this.canvasHeight * 0.3) : options.get('lineHeight'); + } + }, + + getRegion: function (el, x, y) { + return Math.floor(x / this.itemWidth); + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + isNull: this.values[currentRegion] === undefined, + value: this.values[currentRegion], + offset: currentRegion + }; + }, + + renderRegion: function (valuenum, highlight) { + var values = this.values, + options = this.options, + min = this.min, + max = this.max, + range = this.range, + interval = this.interval, + target = this.target, + canvasHeight = this.canvasHeight, + lineHeight = this.lineHeight, + pheight = canvasHeight - lineHeight, + ytop, val, color, x; + + val = clipval(values[valuenum], min, max); + x = valuenum * interval; + ytop = Math.round(pheight - pheight * ((val - min) / range)); + color = (options.get('thresholdColor') && val < options.get('thresholdValue')) ? options.get('thresholdColor') : options.get('lineColor'); + if (highlight) { + color = this.calcHighlightColor(color, options); + } + return target.drawLine(x, ytop, x, ytop + lineHeight, color); + } + }); + + /** + * Bullet charts + */ + $.fn.sparkline.bullet = bullet = createClass($.fn.sparkline._base, { + type: 'bullet', + + init: function (el, values, options, width, height) { + var min, max, vals; + bullet._super.init.call(this, el, values, options, width, height); + + // values: target, performance, range1, range2, range3 + this.values = values = normalizeValues(values); + // target or performance could be null + vals = values.slice(); + vals[0] = vals[0] === null ? vals[2] : vals[0]; + vals[1] = values[1] === null ? vals[2] : vals[1]; + min = Math.min.apply(Math, values); + max = Math.max.apply(Math, values); + if (options.get('base') === undefined) { + min = min < 0 ? min : 0; + } else { + min = options.get('base'); + } + this.min = min; + this.max = max; + this.range = max - min; + this.shapes = {}; + this.valueShapes = {}; + this.regiondata = {}; + this.width = width = options.get('width') === 'auto' ? '4.0em' : width; + this.target = this.$el.simpledraw(width, height, options.get('composite')); + if (!values.length) { + this.disabled = true; + } + this.initTarget(); + }, + + getRegion: function (el, x, y) { + var shapeid = this.target.getShapeAt(el, x, y); + return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined; + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + fieldkey: currentRegion.substr(0, 1), + value: this.values[currentRegion.substr(1)], + region: currentRegion + }; + }, + + changeHighlight: function (highlight) { + var currentRegion = this.currentRegion, + shapeid = this.valueShapes[currentRegion], + shape; + delete this.shapes[shapeid]; + switch (currentRegion.substr(0, 1)) { + case 'r': + shape = this.renderRange(currentRegion.substr(1), highlight); + break; + case 'p': + shape = this.renderPerformance(highlight); + break; + case 't': + shape = this.renderTarget(highlight); + break; + } + this.valueShapes[currentRegion] = shape.id; + this.shapes[shape.id] = currentRegion; + this.target.replaceWithShape(shapeid, shape); + }, + + renderRange: function (rn, highlight) { + var rangeval = this.values[rn], + rangewidth = Math.round(this.canvasWidth * ((rangeval - this.min) / this.range)), + color = this.options.get('rangeColors')[rn - 2]; + if (highlight) { + color = this.calcHighlightColor(color, this.options); + } + return this.target.drawRect(0, 0, rangewidth - 1, this.canvasHeight - 1, color, color); + }, + + renderPerformance: function (highlight) { + var perfval = this.values[1], + perfwidth = Math.round(this.canvasWidth * ((perfval - this.min) / this.range)), + color = this.options.get('performanceColor'); + if (highlight) { + color = this.calcHighlightColor(color, this.options); + } + return this.target.drawRect(0, Math.round(this.canvasHeight * 0.3), perfwidth - 1, + Math.round(this.canvasHeight * 0.4) - 1, color, color); + }, + + renderTarget: function (highlight) { + var targetval = this.values[0], + x = Math.round(this.canvasWidth * ((targetval - this.min) / this.range) - (this.options.get('targetWidth') / 2)), + targettop = Math.round(this.canvasHeight * 0.10), + targetheight = this.canvasHeight - (targettop * 2), + color = this.options.get('targetColor'); + if (highlight) { + color = this.calcHighlightColor(color, this.options); + } + return this.target.drawRect(x, targettop, this.options.get('targetWidth') - 1, targetheight - 1, color, color); + }, + + render: function () { + var vlen = this.values.length, + target = this.target, + i, shape; + if (!bullet._super.render.call(this)) { + return; + } + for (i = 2; i < vlen; i++) { + shape = this.renderRange(i).append(); + this.shapes[shape.id] = 'r' + i; + this.valueShapes['r' + i] = shape.id; + } + if (this.values[1] !== null) { + shape = this.renderPerformance().append(); + this.shapes[shape.id] = 'p1'; + this.valueShapes.p1 = shape.id; + } + if (this.values[0] !== null) { + shape = this.renderTarget().append(); + this.shapes[shape.id] = 't0'; + this.valueShapes.t0 = shape.id; + } + target.render(); + } + }); + + /** + * Pie charts + */ + $.fn.sparkline.pie = pie = createClass($.fn.sparkline._base, { + type: 'pie', + + init: function (el, values, options, width, height) { + var total = 0, i; + + pie._super.init.call(this, el, values, options, width, height); + + this.shapes = {}; // map shape ids to value offsets + this.valueShapes = {}; // maps value offsets to shape ids + this.values = values = $.map(values, Number); + + if (options.get('width') === 'auto') { + this.width = this.height; + } + + if (values.length > 0) { + for (i = values.length; i--;) { + total += values[i]; + } + } + this.total = total; + this.initTarget(); + this.radius = Math.floor(Math.min(this.canvasWidth, this.canvasHeight) / 2); + }, + + getRegion: function (el, x, y) { + var shapeid = this.target.getShapeAt(el, x, y); + return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined; + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + isNull: this.values[currentRegion] === undefined, + value: this.values[currentRegion], + percent: this.values[currentRegion] / this.total * 100, + color: this.options.get('sliceColors')[currentRegion % this.options.get('sliceColors').length], + offset: currentRegion + }; + }, + + changeHighlight: function (highlight) { + var currentRegion = this.currentRegion, + newslice = this.renderSlice(currentRegion, highlight), + shapeid = this.valueShapes[currentRegion]; + delete this.shapes[shapeid]; + this.target.replaceWithShape(shapeid, newslice); + this.valueShapes[currentRegion] = newslice.id; + this.shapes[newslice.id] = currentRegion; + }, + + renderSlice: function (valuenum, highlight) { + var target = this.target, + options = this.options, + radius = this.radius, + borderWidth = options.get('borderWidth'), + offset = options.get('offset'), + circle = 2 * Math.PI, + values = this.values, + total = this.total, + next = offset ? (2*Math.PI)*(offset/360) : 0, + start, end, i, vlen, color; + + vlen = values.length; + for (i = 0; i < vlen; i++) { + start = next; + end = next; + if (total > 0) { // avoid divide by zero + end = next + (circle * (values[i] / total)); + } + if (valuenum === i) { + color = options.get('sliceColors')[i % options.get('sliceColors').length]; + if (highlight) { + color = this.calcHighlightColor(color, options); + } + + return target.drawPieSlice(radius, radius, radius - borderWidth, start, end, undefined, color); + } + next = end; + } + }, + + render: function () { + var target = this.target, + values = this.values, + options = this.options, + radius = this.radius, + borderWidth = options.get('borderWidth'), + shape, i; + + if (!pie._super.render.call(this)) { + return; + } + if (borderWidth) { + target.drawCircle(radius, radius, Math.floor(radius - (borderWidth / 2)), + options.get('borderColor'), undefined, borderWidth).append(); + } + for (i = values.length; i--;) { + if (values[i]) { // don't render zero values + shape = this.renderSlice(i).append(); + this.valueShapes[i] = shape.id; // store just the shapeid + this.shapes[shape.id] = i; + } + } + target.render(); + } + }); + + /** + * Box plots + */ + $.fn.sparkline.box = box = createClass($.fn.sparkline._base, { + type: 'box', + + init: function (el, values, options, width, height) { + box._super.init.call(this, el, values, options, width, height); + this.values = $.map(values, Number); + this.width = options.get('width') === 'auto' ? '4.0em' : width; + this.initTarget(); + if (!this.values.length) { + this.disabled = 1; + } + }, + + /** + * Simulate a single region + */ + getRegion: function () { + return 1; + }, + + getCurrentRegionFields: function () { + var result = [ + { field: 'lq', value: this.quartiles[0] }, + { field: 'med', value: this.quartiles[1] }, + { field: 'uq', value: this.quartiles[2] } + ]; + if (this.loutlier !== undefined) { + result.push({ field: 'lo', value: this.loutlier}); + } + if (this.routlier !== undefined) { + result.push({ field: 'ro', value: this.routlier}); + } + if (this.lwhisker !== undefined) { + result.push({ field: 'lw', value: this.lwhisker}); + } + if (this.rwhisker !== undefined) { + result.push({ field: 'rw', value: this.rwhisker}); + } + return result; + }, + + render: function () { + var target = this.target, + values = this.values, + vlen = values.length, + options = this.options, + canvasWidth = this.canvasWidth, + canvasHeight = this.canvasHeight, + minValue = options.get('chartRangeMin') === undefined ? Math.min.apply(Math, values) : options.get('chartRangeMin'), + maxValue = options.get('chartRangeMax') === undefined ? Math.max.apply(Math, values) : options.get('chartRangeMax'), + canvasLeft = 0, + lwhisker, loutlier, iqr, q1, q2, q3, rwhisker, routlier, i, + size, unitSize; + + if (!box._super.render.call(this)) { + return; + } + + if (options.get('raw')) { + if (options.get('showOutliers') && values.length > 5) { + loutlier = values[0]; + lwhisker = values[1]; + q1 = values[2]; + q2 = values[3]; + q3 = values[4]; + rwhisker = values[5]; + routlier = values[6]; + } else { + lwhisker = values[0]; + q1 = values[1]; + q2 = values[2]; + q3 = values[3]; + rwhisker = values[4]; + } + } else { + values.sort(function (a, b) { return a - b; }); + q1 = quartile(values, 1); + q2 = quartile(values, 2); + q3 = quartile(values, 3); + iqr = q3 - q1; + if (options.get('showOutliers')) { + lwhisker = rwhisker = undefined; + for (i = 0; i < vlen; i++) { + if (lwhisker === undefined && values[i] > q1 - (iqr * options.get('outlierIQR'))) { + lwhisker = values[i]; + } + if (values[i] < q3 + (iqr * options.get('outlierIQR'))) { + rwhisker = values[i]; + } + } + loutlier = values[0]; + routlier = values[vlen - 1]; + } else { + lwhisker = values[0]; + rwhisker = values[vlen - 1]; + } + } + this.quartiles = [q1, q2, q3]; + this.lwhisker = lwhisker; + this.rwhisker = rwhisker; + this.loutlier = loutlier; + this.routlier = routlier; + + unitSize = canvasWidth / (maxValue - minValue + 1); + if (options.get('showOutliers')) { + canvasLeft = Math.ceil(options.get('spotRadius')); + canvasWidth -= 2 * Math.ceil(options.get('spotRadius')); + unitSize = canvasWidth / (maxValue - minValue + 1); + if (loutlier < lwhisker) { + target.drawCircle((loutlier - minValue) * unitSize + canvasLeft, + canvasHeight / 2, + options.get('spotRadius'), + options.get('outlierLineColor'), + options.get('outlierFillColor')).append(); + } + if (routlier > rwhisker) { + target.drawCircle((routlier - minValue) * unitSize + canvasLeft, + canvasHeight / 2, + options.get('spotRadius'), + options.get('outlierLineColor'), + options.get('outlierFillColor')).append(); + } + } + + // box + target.drawRect( + Math.round((q1 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight * 0.1), + Math.round((q3 - q1) * unitSize), + Math.round(canvasHeight * 0.8), + options.get('boxLineColor'), + options.get('boxFillColor')).append(); + // left whisker + target.drawLine( + Math.round((lwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 2), + Math.round((q1 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 2), + options.get('lineColor')).append(); + target.drawLine( + Math.round((lwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 4), + Math.round((lwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight - canvasHeight / 4), + options.get('whiskerColor')).append(); + // right whisker + target.drawLine(Math.round((rwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 2), + Math.round((q3 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 2), + options.get('lineColor')).append(); + target.drawLine( + Math.round((rwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 4), + Math.round((rwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight - canvasHeight / 4), + options.get('whiskerColor')).append(); + // median line + target.drawLine( + Math.round((q2 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight * 0.1), + Math.round((q2 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight * 0.9), + options.get('medianColor')).append(); + if (options.get('target')) { + size = Math.ceil(options.get('spotRadius')); + target.drawLine( + Math.round((options.get('target') - minValue) * unitSize + canvasLeft), + Math.round((canvasHeight / 2) - size), + Math.round((options.get('target') - minValue) * unitSize + canvasLeft), + Math.round((canvasHeight / 2) + size), + options.get('targetColor')).append(); + target.drawLine( + Math.round((options.get('target') - minValue) * unitSize + canvasLeft - size), + Math.round(canvasHeight / 2), + Math.round((options.get('target') - minValue) * unitSize + canvasLeft + size), + Math.round(canvasHeight / 2), + options.get('targetColor')).append(); + } + target.render(); + } + }); + + // Setup a very simple "virtual canvas" to make drawing the few shapes we need easier + // This is accessible as $(foo).simpledraw() + + VShape = createClass({ + init: function (target, id, type, args) { + this.target = target; + this.id = id; + this.type = type; + this.args = args; + }, + append: function () { + this.target.appendShape(this); + return this; + } + }); + + VCanvas_base = createClass({ + _pxregex: /(\d+)(px)?\s*$/i, + + init: function (width, height, target) { + if (!width) { + return; + } + this.width = width; + this.height = height; + this.target = target; + this.lastShapeId = null; + if (target[0]) { + target = target[0]; + } + $.data(target, '_jqs_vcanvas', this); + }, + + drawLine: function (x1, y1, x2, y2, lineColor, lineWidth) { + return this.drawShape([[x1, y1], [x2, y2]], lineColor, lineWidth); + }, + + drawShape: function (path, lineColor, fillColor, lineWidth) { + return this._genShape('Shape', [path, lineColor, fillColor, lineWidth]); + }, + + drawCircle: function (x, y, radius, lineColor, fillColor, lineWidth) { + return this._genShape('Circle', [x, y, radius, lineColor, fillColor, lineWidth]); + }, + + drawPieSlice: function (x, y, radius, startAngle, endAngle, lineColor, fillColor) { + return this._genShape('PieSlice', [x, y, radius, startAngle, endAngle, lineColor, fillColor]); + }, + + drawRect: function (x, y, width, height, lineColor, fillColor) { + return this._genShape('Rect', [x, y, width, height, lineColor, fillColor]); + }, + + getElement: function () { + return this.canvas; + }, + + /** + * Return the most recently inserted shape id + */ + getLastShapeId: function () { + return this.lastShapeId; + }, + + /** + * Clear and reset the canvas + */ + reset: function () { + alert('reset not implemented'); + }, + + _insert: function (el, target) { + $(target).html(el); + }, + + /** + * Calculate the pixel dimensions of the canvas + */ + _calculatePixelDims: function (width, height, canvas) { + // XXX This should probably be a configurable option + var match; + match = this._pxregex.exec(height); + if (match) { + this.pixelHeight = match[1]; + } else { + this.pixelHeight = $(canvas).height(); + } + match = this._pxregex.exec(width); + if (match) { + this.pixelWidth = match[1]; + } else { + this.pixelWidth = $(canvas).width(); + } + }, + + /** + * Generate a shape object and id for later rendering + */ + _genShape: function (shapetype, shapeargs) { + var id = shapeCount++; + shapeargs.unshift(id); + return new VShape(this, id, shapetype, shapeargs); + }, + + /** + * Add a shape to the end of the render queue + */ + appendShape: function (shape) { + alert('appendShape not implemented'); + }, + + /** + * Replace one shape with another + */ + replaceWithShape: function (shapeid, shape) { + alert('replaceWithShape not implemented'); + }, + + /** + * Insert one shape after another in the render queue + */ + insertAfterShape: function (shapeid, shape) { + alert('insertAfterShape not implemented'); + }, + + /** + * Remove a shape from the queue + */ + removeShapeId: function (shapeid) { + alert('removeShapeId not implemented'); + }, + + /** + * Find a shape at the specified x/y co-ordinates + */ + getShapeAt: function (el, x, y) { + alert('getShapeAt not implemented'); + }, + + /** + * Render all queued shapes onto the canvas + */ + render: function () { + alert('render not implemented'); + } + }); + + VCanvas_canvas = createClass(VCanvas_base, { + init: function (width, height, target, interact) { + VCanvas_canvas._super.init.call(this, width, height, target); + this.canvas = document.createElement('canvas'); + if (target[0]) { + target = target[0]; + } + $.data(target, '_jqs_vcanvas', this); + $(this.canvas).css({ display: 'inline-block', width: width, height: height, verticalAlign: 'top' }); + this._insert(this.canvas, target); + this._calculatePixelDims(width, height, this.canvas); + this.canvas.width = this.pixelWidth; + this.canvas.height = this.pixelHeight; + this.interact = interact; + this.shapes = {}; + this.shapeseq = []; + this.currentTargetShapeId = undefined; + $(this.canvas).css({width: this.pixelWidth, height: this.pixelHeight}); + }, + + _getContext: function (lineColor, fillColor, lineWidth) { + var context = this.canvas.getContext('2d'); + if (lineColor !== undefined) { + context.strokeStyle = lineColor; + } + context.lineWidth = lineWidth === undefined ? 1 : lineWidth; + if (fillColor !== undefined) { + context.fillStyle = fillColor; + } + return context; + }, + + reset: function () { + var context = this._getContext(); + context.clearRect(0, 0, this.pixelWidth, this.pixelHeight); + this.shapes = {}; + this.shapeseq = []; + this.currentTargetShapeId = undefined; + }, + + _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) { + var context = this._getContext(lineColor, fillColor, lineWidth), + i, plen; + context.beginPath(); + context.moveTo(path[0][0] + 0.5, path[0][1] + 0.5); + for (i = 1, plen = path.length; i < plen; i++) { + context.lineTo(path[i][0] + 0.5, path[i][1] + 0.5); // the 0.5 offset gives us crisp pixel-width lines + } + if (lineColor !== undefined) { + context.stroke(); + } + if (fillColor !== undefined) { + context.fill(); + } + if (this.targetX !== undefined && this.targetY !== undefined && + context.isPointInPath(this.targetX, this.targetY)) { + this.currentTargetShapeId = shapeid; + } + }, + + _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) { + var context = this._getContext(lineColor, fillColor, lineWidth); + context.beginPath(); + context.arc(x, y, radius, 0, 2 * Math.PI, false); + if (this.targetX !== undefined && this.targetY !== undefined && + context.isPointInPath(this.targetX, this.targetY)) { + this.currentTargetShapeId = shapeid; + } + if (lineColor !== undefined) { + context.stroke(); + } + if (fillColor !== undefined) { + context.fill(); + } + }, + + _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) { + var context = this._getContext(lineColor, fillColor); + context.beginPath(); + context.moveTo(x, y); + context.arc(x, y, radius, startAngle, endAngle, false); + context.lineTo(x, y); + context.closePath(); + if (lineColor !== undefined) { + context.stroke(); + } + if (fillColor) { + context.fill(); + } + if (this.targetX !== undefined && this.targetY !== undefined && + context.isPointInPath(this.targetX, this.targetY)) { + this.currentTargetShapeId = shapeid; + } + }, + + _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) { + return this._drawShape(shapeid, [[x, y], [x + width, y], [x + width, y + height], [x, y + height], [x, y]], lineColor, fillColor); + }, + + appendShape: function (shape) { + this.shapes[shape.id] = shape; + this.shapeseq.push(shape.id); + this.lastShapeId = shape.id; + return shape.id; + }, + + replaceWithShape: function (shapeid, shape) { + var shapeseq = this.shapeseq, + i; + this.shapes[shape.id] = shape; + for (i = shapeseq.length; i--;) { + if (shapeseq[i] == shapeid) { + shapeseq[i] = shape.id; + } + } + delete this.shapes[shapeid]; + }, + + replaceWithShapes: function (shapeids, shapes) { + var shapeseq = this.shapeseq, + shapemap = {}, + sid, i, first; + + for (i = shapeids.length; i--;) { + shapemap[shapeids[i]] = true; + } + for (i = shapeseq.length; i--;) { + sid = shapeseq[i]; + if (shapemap[sid]) { + shapeseq.splice(i, 1); + delete this.shapes[sid]; + first = i; + } + } + for (i = shapes.length; i--;) { + shapeseq.splice(first, 0, shapes[i].id); + this.shapes[shapes[i].id] = shapes[i]; + } + + }, + + insertAfterShape: function (shapeid, shape) { + var shapeseq = this.shapeseq, + i; + for (i = shapeseq.length; i--;) { + if (shapeseq[i] === shapeid) { + shapeseq.splice(i + 1, 0, shape.id); + this.shapes[shape.id] = shape; + return; + } + } + }, + + removeShapeId: function (shapeid) { + var shapeseq = this.shapeseq, + i; + for (i = shapeseq.length; i--;) { + if (shapeseq[i] === shapeid) { + shapeseq.splice(i, 1); + break; + } + } + delete this.shapes[shapeid]; + }, + + getShapeAt: function (el, x, y) { + this.targetX = x; + this.targetY = y; + this.render(); + return this.currentTargetShapeId; + }, + + render: function () { + var shapeseq = this.shapeseq, + shapes = this.shapes, + shapeCount = shapeseq.length, + context = this._getContext(), + shapeid, shape, i; + context.clearRect(0, 0, this.pixelWidth, this.pixelHeight); + for (i = 0; i < shapeCount; i++) { + shapeid = shapeseq[i]; + shape = shapes[shapeid]; + this['_draw' + shape.type].apply(this, shape.args); + } + if (!this.interact) { + // not interactive so no need to keep the shapes array + this.shapes = {}; + this.shapeseq = []; + } + } + + }); + + VCanvas_vml = createClass(VCanvas_base, { + init: function (width, height, target) { + var groupel; + VCanvas_vml._super.init.call(this, width, height, target); + if (target[0]) { + target = target[0]; + } + $.data(target, '_jqs_vcanvas', this); + this.canvas = document.createElement('span'); + $(this.canvas).css({ display: 'inline-block', position: 'relative', overflow: 'hidden', width: width, height: height, margin: '0px', padding: '0px', verticalAlign: 'top'}); + this._insert(this.canvas, target); + this._calculatePixelDims(width, height, this.canvas); + this.canvas.width = this.pixelWidth; + this.canvas.height = this.pixelHeight; + groupel = ''; + this.canvas.insertAdjacentHTML('beforeEnd', groupel); + this.group = $(this.canvas).children()[0]; + this.rendered = false; + this.prerender = ''; + }, + + _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) { + var vpath = [], + initial, stroke, fill, closed, vel, plen, i; + for (i = 0, plen = path.length; i < plen; i++) { + vpath[i] = '' + (path[i][0]) + ',' + (path[i][1]); + } + initial = vpath.splice(0, 1); + lineWidth = lineWidth === undefined ? 1 : lineWidth; + stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="' + lineWidth + 'px" strokeColor="' + lineColor + '" '; + fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" '; + closed = vpath[0] === vpath[vpath.length - 1] ? 'x ' : ''; + vel = '' + + ' '; + return vel; + }, + + _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) { + var stroke, fill, vel; + x -= radius; + y -= radius; + stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="' + lineWidth + 'px" strokeColor="' + lineColor + '" '; + fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" '; + vel = ''; + return vel; + + }, + + _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) { + var vpath, startx, starty, endx, endy, stroke, fill, vel; + if (startAngle === endAngle) { + return ''; // VML seems to have problem when start angle equals end angle. + } + if ((endAngle - startAngle) === (2 * Math.PI)) { + startAngle = 0.0; // VML seems to have a problem when drawing a full circle that doesn't start 0 + endAngle = (2 * Math.PI); + } + + startx = x + Math.round(Math.cos(startAngle) * radius); + starty = y + Math.round(Math.sin(startAngle) * radius); + endx = x + Math.round(Math.cos(endAngle) * radius); + endy = y + Math.round(Math.sin(endAngle) * radius); + + if (startx === endx && starty === endy) { + if ((endAngle - startAngle) < Math.PI) { + // Prevent very small slices from being mistaken as a whole pie + return ''; + } + // essentially going to be the entire circle, so ignore startAngle + startx = endx = x + radius; + starty = endy = y; + } + + if (startx === endx && starty === endy && (endAngle - startAngle) < Math.PI) { + return ''; + } + + vpath = [x - radius, y - radius, x + radius, y + radius, startx, starty, endx, endy]; + stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="1px" strokeColor="' + lineColor + '" '; + fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" '; + vel = '' + + ' '; + return vel; + }, + + _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) { + return this._drawShape(shapeid, [[x, y], [x, y + height], [x + width, y + height], [x + width, y], [x, y]], lineColor, fillColor); + }, + + reset: function () { + this.group.innerHTML = ''; + }, + + appendShape: function (shape) { + var vel = this['_draw' + shape.type].apply(this, shape.args); + if (this.rendered) { + this.group.insertAdjacentHTML('beforeEnd', vel); + } else { + this.prerender += vel; + } + this.lastShapeId = shape.id; + return shape.id; + }, + + replaceWithShape: function (shapeid, shape) { + var existing = $('#jqsshape' + shapeid), + vel = this['_draw' + shape.type].apply(this, shape.args); + existing[0].outerHTML = vel; + }, + + replaceWithShapes: function (shapeids, shapes) { + // replace the first shapeid with all the new shapes then toast the remaining old shapes + var existing = $('#jqsshape' + shapeids[0]), + replace = '', + slen = shapes.length, + i; + for (i = 0; i < slen; i++) { + replace += this['_draw' + shapes[i].type].apply(this, shapes[i].args); + } + existing[0].outerHTML = replace; + for (i = 1; i < shapeids.length; i++) { + $('#jqsshape' + shapeids[i]).remove(); + } + }, + + insertAfterShape: function (shapeid, shape) { + var existing = $('#jqsshape' + shapeid), + vel = this['_draw' + shape.type].apply(this, shape.args); + existing[0].insertAdjacentHTML('afterEnd', vel); + }, + + removeShapeId: function (shapeid) { + var existing = $('#jqsshape' + shapeid); + this.group.removeChild(existing[0]); + }, + + getShapeAt: function (el, x, y) { + var shapeid = el.id.substr(8); + return shapeid; + }, + + render: function () { + if (!this.rendered) { + // batch the intial render into a single repaint + this.group.innerHTML = this.prerender; + this.rendered = true; + } + } + }); + +}))}(document, Math)); diff --git a/public/assets/js/plugins/sparkline/jquery.sparkline.min.js b/public/assets/js/plugins/sparkline/jquery.sparkline.min.js new file mode 100755 index 00000000..fa616bf9 --- /dev/null +++ b/public/assets/js/plugins/sparkline/jquery.sparkline.min.js @@ -0,0 +1,5 @@ +/* jquery.sparkline 2.1.2 - http://omnipotent.net/jquery.sparkline/ +** Licensed under the New BSD License - see above site for details */ + +(function(a,b,c){(function(a){typeof define=="function"&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.sparkline&&a(jQuery)})(function(d){"use strict";var e={},f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L=0;f=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:c,normalRangeMax:c,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:c,chartRangeMax:c,chartRangeMinX:c,chartRangeMaxX:c,tooltipFormat:new h(' {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:c,nullColor:c,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:c,chartRangeMin:c,chartRangeClip:!1,colorMap:c,tooltipFormat:new h(' {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new h(' {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:c,thresholdValue:0,chartRangeMax:c,chartRangeMin:c,chartRangeClip:!1,tooltipFormat:new h("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:c,tooltipFormat:new h("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new h(' {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:c,targetColor:"#4a2",chartRangeMax:c,chartRangeMin:c,tooltipFormat:new h("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},E='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',g=function(){var a,b;return a=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(a.prototype=d.extend(new arguments[0],arguments[arguments.length-1]),a._super=arguments[0].prototype):a.prototype=arguments[arguments.length-1],arguments.length>2&&(b=Array.prototype.slice.call(arguments,1,-1),b.unshift(a.prototype),d.extend.apply(d,b))):a.prototype=arguments[0],a.prototype.cls=a,a},d.SPFormatClass=h=g({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(a,b){this.format=a,this.fclass=b},render:function(a,b,d){var e=this,f=a,g,h,i,j,k;return this.format.replace(this.fre,function(){var a;return h=arguments[1],i=arguments[3],g=e.precre.exec(h),g?(k=g[2],h=g[1]):k=!1,j=f[h],j===c?"":i&&b&&b[i]?(a=b[i],a.get?b[i].get(j)||j:b[i][j]||j):(n(j)&&(d.get("numberFormatter")?j=d.get("numberFormatter")(j):j=s(j,k,d.get("numberDigitGroupCount"),d.get("numberDigitGroupSep"),d.get("numberDecimalMark"))),j)})}}),d.spformat=function(a,b){return new h(a,b)},i=function(a,b,c){return ac?c:a},j=function(a,c){var d;return c===2?(d=b.floor(a.length/2),a.length%2?a[d]:(a[d-1]+a[d])/2):a.length%2?(d=(a.length*c+c)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1]):(d=(a.length*c+2)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1])},k=function(a){var b;switch(a){case"undefined":a=c;break;case"null":a=null;break;case"true":a=!0;break;case"false":a=!1;break;default:b=parseFloat(a),a==b&&(a=b)}return a},l=function(a){var b,c=[];for(b=a.length;b--;)c[b]=k(a[b]);return c},m=function(a,b){var c,d,e=[];for(c=0,d=a.length;c0;h-=c)a.splice(h,0,e);return a.join("")},o=function(a,b,c){var d;for(d=b.length;d--;){if(c&&b[d]===null)continue;if(b[d]!==a)return!1}return!0},p=function(a){var b=0,c;for(c=a.length;c--;)b+=typeof a[c]=="number"?a[c]:0;return b},r=function(a){return d.isArray(a)?a:[a]},q=function(b){var c;a.createStyleSheet?a.createStyleSheet().cssText=b:(c=a.createElement("style"),c.type="text/css",a.getElementsByTagName("head")[0].appendChild(c),c[typeof a.body.style.WebkitAppearance=="string"?"innerText":"innerHTML"]=b)},d.fn.simpledraw=function(b,e,f,g){var h,i;if(f&&(h=this.data("_jqs_vcanvas")))return h;if(d.fn.sparkline.canvas===!1)return!1;if(d.fn.sparkline.canvas===c){var j=a.createElement("canvas");if(!j.getContext||!j.getContext("2d")){if(!a.namespaces||!!a.namespaces.v)return d.fn.sparkline.canvas=!1,!1;a.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),d.fn.sparkline.canvas=function(a,b,c,d){return new J(a,b,c)}}else d.fn.sparkline.canvas=function(a,b,c,d){return new I(a,b,c,d)}}return b===c&&(b=d(this).innerWidth()),e===c&&(e=d(this).innerHeight()),h=d.fn.sparkline.canvas(b,e,this,g),i=d(this).data("_jqs_mhandler"),i&&i.registerCanvas(h),h},d.fn.cleardraw=function(){var a=this.data("_jqs_vcanvas");a&&a.reset()},d.RangeMapClass=t=g({init:function(a){var b,c,d=[];for(b in a)a.hasOwnProperty(b)&&typeof b=="string"&&b.indexOf(":")>-1&&(c=b.split(":"),c[0]=c[0].length===0?-Infinity:parseFloat(c[0]),c[1]=c[1].length===0?Infinity:parseFloat(c[1]),c[2]=a[b],d.push(c));this.map=a,this.rangelist=d||!1},get:function(a){var b=this.rangelist,d,e,f;if((f=this.map[a])!==c)return f;if(b)for(d=b.length;d--;){e=b[d];if(e[0]<=a&&e[1]>=a)return e[2]}return c}}),d.range_map=function(a){return new t(a)},u=g({init:function(a,b){var c=d(a);this.$el=c,this.options=b,this.currentPageX=0,this.currentPageY=0,this.el=a,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!b.get("disableTooltips"),this.highlightEnabled=!b.get("disableHighlight")},registerSparkline:function(a){this.splist.push(a),this.over&&this.updateDisplay()},registerCanvas:function(a){var b=d(a.canvas);this.canvas=a,this.$canvas=b,b.mouseenter(d.proxy(this.mouseenter,this)),b.mouseleave(d.proxy(this.mouseleave,this)),b.click(d.proxy(this.mouseclick,this))},reset:function(a){this.splist=[],this.tooltip&&a&&(this.tooltip.remove(),this.tooltip=c)},mouseclick:function(a){var b=d.Event("sparklineClick");b.originalEvent=a,b.sparklines=this.splist,this.$el.trigger(b)},mouseenter:function(b){d(a.body).unbind("mousemove.jqs"),d(a.body).bind("mousemove.jqs",d.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=b.pageX,this.currentPageY=b.pageY,this.currentEl=b.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new v(this.options),this.tooltip.updatePosition(b.pageX,b.pageY)),this.updateDisplay()},mouseleave:function(){d(a.body).unbind("mousemove.jqs");var b=this.splist,c=b.length,e=!1,f,g;this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null);for(g=0;g