Merge pull request #1 from TheSerapher/next

Merge next
This commit is contained in:
obigal 2013-10-10 16:38:14 -07:00
commit ff5cd9737c
253 changed files with 22460 additions and 528 deletions

View File

@ -54,7 +54,7 @@ consider following this contribution guide!
* [General GitHub documentation][2]
* [GitHub pull request documentation][3]
[1]: https://github.com/TheSerapher/php-mmcfe-ng/issues "Issue"
[1]: https://github.com/TheSerapher/php-mpos/issues "Issue"
[2]: http://help.github.com/ "GitHub documentation"
[3]: http://help.github.com/send-pull-requests/ "GitHub pull request documentation"
[4]: https://github.com/signup/free "GitHub account"

View File

@ -1,7 +1,7 @@
Pools running mmcfe-ng
======================
Pools running MPOS
==================
If you are not sure if you want to use `mmcfe-ng` on your own pool,
If you are not sure if you want to use `MPOS` on your own pool,
maybe this list will push you over the edge of decision making. Some
small and large pools are already running on it and have succesfully
tested it on various coins.
@ -12,7 +12,7 @@ as of this writing and may have changed since then.
### vias79
Vias is using mmcfe-ng with a small group of people to mine various coins.
Vias is using MPOS with a small group of people to mine various coins.
They have succesfully mined blocks on each of those pools listed.
All pools are running on Stratum only.
@ -32,9 +32,9 @@ All pools are running on Stratum only.
### WKNiGHT
WKNiGHT was an early adopter of `mmcfe-ng`. He has been around since a first stable release
WKNiGHT was an early adopter of `MPOS`. He has been around since a first stable release
which only featured proportional payouts. He successfully moved to PPS since then and is
running more or less without any issues (related to `mmcfe-ng` that is ;-)). He is also running
running more or less without any issues (related to `MPOS` that is ;-)). He is also running
the most powerful pool!
| Pool URL | Coin | Avg. Hashrate | Avg. Active Workers | Notes |
@ -120,3 +120,15 @@ Small Time Miners are running various stratum only pools for different coins.
| Pool URL | Coin | Avg. Hashrate | Avg. Active Workers | Notes |
| -------- | ---- | ------------: | ------------------: | ----- |
| https://www.mine-litecoin.com | Litecoin | 10Mhs | 75 workers | Custom Template, Prop |
### CaptainAK
| Pool URL | Coin | Avg. Hashrate | Avg. Active Workers | Notes |
| -------- | ---- | ------------: | ------------------: | ----- |
| http://btb.pnwminer.com | Bitbar | 5-10 Mhs | 5 workers | PPLNS |
| http://dgc.pnwminer.com | DigitalCoin | 0 Mhs | 0 workers | PPLNS |
| http://btg.pnwminer.com | BitGem | .5-2 Mhs | 1 workers | PPLNS |
| http://ezc.pnwminer.com | EZCoin | 5-10Mhs | 2 workers | PPLNS |
| http://nbl.pnwminer.com | Nibble | 0 Mhs | 0 workers | PPLNS |
| http://mst.pnwminer.com | MasterCoin | 1-5 Mhs | 2 workers | PPLNS |

View File

@ -1,21 +1,12 @@
Description
===========
mmcFE-ng is a web frontend for Pooled LTC Mining. A few pools using this interface are running at:
MPOS is a web based Mining Portal for various crypto currencies. A few pools using this interface are running at:
* http://ltc.pool.grewe.ca
* http://fst.pool.grewe.ca
* http://nvc.pool.grewe.ca
The web frontend layout is based on mmcFE, the original work by Greedi:
https://github.com/Greedi/mmcFE
After working a few days trying to learn to run my own pool and the
systems behind it I figured I'd look a bit deeper in the code to
understand how it works. While doing so I also migrated the existing
code over to my own framework so maintenance would be easier in the
future.
**NOTE**: This project is still under development and commits are happening on a daily basis.
I do not recommend using this for a live setup as of yet. Wait for the later Release Candidate
if you wish to run your pool with it. Testing pools are much appreciated though!
@ -27,14 +18,16 @@ I was hoping to keep this out of the README but apparently people remove or chan
at the bottom of the page. For those of you finding my project and are willing to appreciate the work
with some hard earned coins feel free to donate:
* BTC address: `1HuYK6WPU8o3yWCrAaADDZPRpL5QiXitfv`
* LTC address: `Lge95QR2frp9y1wJufjUPCycVsg5gLJPW8`
* FTC address: `6jDgGaUzMVyac5uqBhJCMiFMKCtH1LagTA`
* NVC address: `4Guct6z7NVPVALHRAVn517TTmvqQve4WYr`
* FST address: `g17CfFHqNqR5JnUjtG8RNBYh2WrhEirV67`
# Website Footer
Website Footer
==============
When you decide to use `mmcfe-ng` please be so kind and leave the footer intact. You are not the author of the software and should honor those that have worked on it. I don't mind changing the LTC donation address at the bottom, but keep in mind who really wrote this software and would deserve those ;-).
When you decide to use `MPOS` please be so kind and leave the footer intact. You are not the author of the software and should honor those that have worked on it. I don't mind changing the LTC donation address at the bottom, but keep in mind who really wrote this software and would deserve those ;-).
Donors
======
@ -47,8 +40,8 @@ These people have supported this project with a donation:
* [ZC](https://github.com/zccopwrx)
* Nutnut
Pools running mmcfe-ng
======================
Pools running MPOS
==================
You can find a list of active pools [here](POOLS.md).
@ -60,7 +53,7 @@ It should also work on any related distribution (RHEL, Debian).
For support on how to get `litecoind` or `pushpoold` to work, please ask
in the appropriate forums.
Be aware that `mmcfe-ng` is **only** for pooled mining. Solo Mining is not
Be aware that `MPOS` is **only** for pooled mining. Solo Mining is not
supported. They will never match an upstream share, solo miners do not create
any shares, only blocks. Expect weird behavior if trying to mix them. See #299
for full information.
@ -90,11 +83,10 @@ The following feature have been implemented so far:
* PPS
* PPLNS
* Statistics are cached in Memcache by Cronjob for quick data access
* **NEW** Now supporting incremental round share updates!
* **SOON** New Theme
* **SOON** Live Dashboard
* **SOON** AJAX Support
* **SOON** Overhauled API
* **NEW** New Theme
* **NEW** Live Dashboard
* **NEW** AJAX Support
* **NEW** Overhauled API
* Web User accounts
* Re-Captcha protected registration form
* Worker accounts
@ -104,7 +96,7 @@ The following feature have been implemented so far:
* Minimal Block statistics
* Pool donations
* Pool fees
* Block Bonus Payouts **NEW**
* Block Bonus Payouts
* Manual payout
* Auto payout
* Transaction list
@ -114,13 +106,13 @@ The following feature have been implemented so far:
* Wallet information
* User Transactions
* News Posts
* Pool Settings **NEW**
* Pool Settings
* Notification system
* IDLE Workers
* New blocks found in pool
* Auto Payout
* Manual Payout
* User-to-user Invitation System **NEW**
* User-to-user Invitation System
* Support for various Scrypt based coins via config
* MNC
* LTC
@ -129,9 +121,28 @@ The following feature have been implemented so far:
Installation
============
Please take a look at the [Quick Start Guide](https://github.com/TheSerapher/php-mmcfe-ng/wiki/Quick-Start-Guide). This will give you
an idea how to setup `mmcfe-ng`.
Please take a look at the [Quick Start Guide](https://github.com/TheSerapher/php-mpos/wiki/Quick-Start-Guide). This will give you
an idea how to setup `MPOS`.
Customization
=============
This project was meant to allow users to easily cusomize the system and templates. Hence no upstream framework was used to keep it as simple as possible.
If you are just using the system, there will be no need to adjust anything. Things will work out of the box! But if you plan on creating
your own theme, things are pretty easy:
* Create a new theme folder in `public/templates/`
* Create a new site_assets folder in `public/site_assets`
* Create your own complete custom template or copy from an existing one
* Change your theme in the `Admin Panel` and point it to the newly created folder
The good thing with this approach: You can keep the backend code updated! Since your new theme will never conflict with existing themes, a simple git pull will
keep your installation updated. You decide which new feature you'd like to integrate on your own theme. Bugfixes to the code will work out of the box!
Other customizations are also possible but will require merging changes together. Usually users would not need to change the backend code unless they wish to work
on non-existing features in `MPOS`. For the vast majority, adjusting themes should be enough to highlight your pool from others.
In all that, I humbly ask to keep the `MPOS` author reference and Github URL intact.
Contributing
============
@ -144,7 +155,7 @@ You can contribute to this project in different ways:
Contact
=======
You can find me on Freenode.net, #mmcfe-ng.
You can find me on Freenode.net, #MPOS.
License and Author
==================
@ -164,5 +175,5 @@ See the License for the specific language governing permissions and
limitations under the License.
[1]: https://github.com/TheSerapher/php-mmcfe-ng/issues "Issue"
[1]: https://github.com/TheSerapher/php-mpos/issues "Issue"
[2]: http://www.smarty.net/docs/en/ "Smarty"

View File

@ -46,7 +46,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
// We support some dynamic share targets but fall back to our fixed value
// Re-calculate after each run due to re-targets in this loop
if ($config['pplns']['shares']['type'] == 'blockavg' && $block->getBlockCount() > 0) {
$pplns_target = round($block->getAvgBlockShares($config['pplns']['blockavg']['blockcount']));
$pplns_target = round($block->getAvgBlockShares($aBlock['height'], $config['pplns']['blockavg']['blockcount']));
} else {
$pplns_target = $config['pplns']['shares']['default'];
}

View File

@ -22,10 +22,13 @@ limitations under the License.
// We need to find our include files so set this properly
define("BASEPATH", "../public/");
/*****************************************************
* No need to change beyond this point *
*****************************************************/
// Used in autoloading of API class, adding it to stop PHP warnings
$dStartTime = microtime(true);
// Our cron name
$cron_name = basename($_SERVER['PHP_SELF'], '.php');

View File

@ -19,7 +19,7 @@ if ($detect->isMobile() && $setting->getValue('website_mobile_theme')) {
$setting->getValue('website_mobile_theme') ? $theme = $setting->getValue('website_mobile_theme') : $theme = 'mobile';
} else {
// Use configured theme, fallback to default theme
$setting->getValue('website_theme') ? $theme = $setting->getValue('website_theme') : $theme = 'mmcFE';
$setting->getValue('website_theme') ? $theme = $setting->getValue('website_theme') : $theme = 'mpos';
}
define('THEME', $theme);
@ -27,7 +27,6 @@ define('THEME', $theme);
require_once(INCLUDE_DIR . '/smarty.inc.php');
// Load everything else in proper order
require_once(CLASS_DIR . '/api.class.php');
require_once(CLASS_DIR . '/mail.class.php');
require_once(CLASS_DIR . '/tokentype.class.php');
require_once(CLASS_DIR . '/token.class.php');
@ -49,6 +48,7 @@ require_once(CLASS_DIR . '/roundstats.class.php');
require_once(CLASS_DIR . '/transaction.class.php');
require_once(CLASS_DIR . '/notification.class.php');
require_once(CLASS_DIR . '/news.class.php');
require_once(CLASS_DIR . '/api.class.php');
require_once(INCLUDE_DIR . '/lib/Michelf/Markdown.php');
require_once(INCLUDE_DIR . '/lib/scrypt.php');

View File

@ -7,6 +7,11 @@ if (!defined('SECURITY')) die('Hacking attempt');
* Helper class for our API
**/
class Api extends Base {
private $api_version = '1.0.0';
function setStartTime($dStartTime) {
$this->dStartTime = $dStartTime;
}
function isActive($error=true) {
if (!$this->setting->getValue('disable_api')) {
return true;
@ -17,8 +22,45 @@ class Api extends Base {
}
}
}
/**
* Create API json object from input array
* @param data Array data to create JSON for
* @param force bool Enforce a JSON object
* @return string JSON object
**/
function get_json($data, $force=false) {
return json_encode(
array( $_REQUEST['action'] => array(
'version' => $this->api_version,
'runtime' => (microtime(true) - $this->dStartTime) * 1000,
'data' => $data
)), $force ? JSON_FORCE_OBJECT : 0
);
}
/**
* Check user access level to the API call
**/
function checkAccess($user_id, $get_id=NULL) {
if ( ! $this->user->isAdmin($user_id) && (!empty($get_id) && $get_id != $user_id)) {
// User is NOT admin and tries to access an ID that is not their own
header("HTTP/1.1 401 Unauthorized");
die("Access denied");
} else if ($this->user->isAdmin($user_id) && !empty($get_id)) {
// User is an admin and tries to fetch another users data
$id = $get_id;
// Is it a username or a user ID
ctype_digit($_REQUEST['id']) ? $id = $get_id : $id = $this->user->getUserId($get_id);
} else {
$id = $user_id;
}
return $id;
}
}
$api = new Api();
$api->setConfig($config);
$api->setUser($user);
$api->setSetting($setting);
$api->setStartTime($dStartTime);

View File

@ -109,9 +109,9 @@ class Block {
* @param limit int Maximum blocks to check
* @return data float Float value of average shares
**/
public function getAvgBlockShares($limit=1) {
$stmt = $this->mysqli->prepare("SELECT AVG(x.shares) AS average FROM (SELECT shares FROM $this->table ORDER BY height DESC LIMIT ?) AS x");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $limit) && $stmt->execute() && $result = $stmt->get_result())
public function getAvgBlockShares($height, $limit=1) {
$stmt = $this->mysqli->prepare("SELECT AVG(x.shares) AS average FROM (SELECT shares FROM $this->table WHERE height <= ? ORDER BY height DESC LIMIT ?) AS x");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $height, $limit) && $stmt->execute() && $result = $stmt->get_result())
return (float)$result->fetch_object()->average;
return false;
}

View File

@ -15,6 +15,49 @@ class Mail extends Base {
return true;
}
/**
* Mail form contact site admin
* @param senderName string senderName
* @param senderEmail string senderEmail
* @param senderSubject string senderSubject
* @param senderMessage string senderMessage
* @param email string config Email address
* @param subject string header subject
* @return bool
**/
public function contactform($senderName, $senderEmail, $senderSubject, $senderMessage) {
$this->debug->append("STA " . __METHOD__, 4);
if (preg_match('/[^a-z_\.\!\?\-0-9\\s ]/i', $senderName)) {
$this->setErrorMessage('Username may only contain alphanumeric characters');
return false;
}
if (empty($senderEmail) || !filter_var($senderEmail, FILTER_VALIDATE_EMAIL)) {
$this->setErrorMessage( 'Invalid e-mail address' );
return false;
}
if (preg_match('/[^a-z_\.\!\?\-0-9\\s ]/i', $senderSubject)) {
$this->setErrorMessage('Subject may only contain alphanumeric characters');
return false;
}
if (strlen(strip_tags($senderMessage)) < strlen($senderMessage)) {
$this->setErrorMessage('Your message may only contain alphanumeric characters');
return false;
}
$aData['senderName'] = $senderName;
$aData['senderEmail'] = $senderEmail;
$aData['senderSubject'] = $senderSubject;
$aData['senderMessage'] = $senderMessage;
$aData['email'] = $this->setting->getValue('website_email');
$aData['subject'] = 'Contact From';
if ($this->sendMail('contactform/body', $aData)) {
return true;
} else {
$this->setErrorMessage( 'Unable to send email' );
return false;
}
return false;
}
public function sendMail($template, $aData) {
$this->smarty->assign('WEBSITENAME', $this->setting->getValue('website_name'));
$this->smarty->assign('SUBJECT', $aData['subject']);

View File

@ -102,12 +102,12 @@ class RoundStats {
* @param height int Block Height
* @return data array Block round transactions
**/
public function getAllRoundTransactions($iHeight=0) {
public function getAllRoundTransactions($iHeight=0, $admin) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("
SELECT
t.id AS id,
a.username AS username,
IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS username,
t.type AS type,
t.amount AS amount
FROM $this->tableTrans AS t
@ -115,7 +115,7 @@ class RoundStats {
LEFT JOIN $this->tableUsers AS a ON t.account_id = a.id
WHERE b.height = ?
ORDER BY id ASC");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $admin, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
$this->debug->append('Unable to fetch transactions');
return false;

View File

@ -99,25 +99,25 @@ class Statistics {
* @param none
* @return data object Return our hashrateas an object
**/
public function getCurrentHashrate() {
public function getCurrentHashrate($interval=600) {
$this->debug->append("STA " . __METHOD__, 4);
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
(
(
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / 600 / 1000), 0) AS hashrate
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / ? / 1000), 0) AS hashrate
FROM " . $this->share->getTableName() . "
WHERE time > DATE_SUB(now(), INTERVAL 600 SECOND)
WHERE time > DATE_SUB(now(), INTERVAL ? SECOND)
) + (
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / 600 / 1000), 0) AS hashrate
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / ? / 1000), 0) AS hashrate
FROM " . $this->share->getArchiveTableName() . "
WHERE time > DATE_SUB(now(), INTERVAL 600 SECOND)
WHERE time > DATE_SUB(now(), INTERVAL ? SECOND)
)
) AS hashrate
FROM DUAL");
// Catchall
if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result() ) return $this->memcache->setCache(__FUNCTION__, $result->fetch_object()->hashrate);
if ($this->checkStmt($stmt) && $stmt->bind_param('iiii', $interval, $interval, $interval, $interval) && $stmt->execute() && $result = $stmt->get_result() ) return $this->memcache->setCache(__FUNCTION__, $result->fetch_object()->hashrate);
$this->debug->append("Failed to get hashrate: " . $this->mysqli->error);
return false;
}
@ -222,6 +222,8 @@ class Statistics {
} else {
$data['data'][$row['id']]['valid'] += $row['valid'];
$data['data'][$row['id']]['invalid'] += $row['invalid'];
$data['data'][$row['id']]['donate_percent'] = $row['donate_percent'];
$data['data'][$row['id']]['is_anonymous'] = $row['is_anonymous'];
}
}
$data['share_id'] = $this->share->getMaxShareId();
@ -240,7 +242,7 @@ class Statistics {
public function getUserShares($account_id) {
$this->debug->append("STA " . __METHOD__, 4);
// Dual-caching, try statistics cron first, then fallback to local, then fallbock to SQL
if ($data = $this->memcache->get(STATISTICS_ALL_USER_SHARES)) return $data['data'][$account_id];
if ($data = $this->memcache->get(STATISTICS_ALL_USER_SHARES)) return @$data['data'][$account_id];
if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
@ -293,28 +295,28 @@ class Statistics {
* @param account_id integer User ID
* @return data integer Current Hashrate in khash/s
**/
public function getUserHashrate($account_id) {
public function getUserHashrate($account_id, $interval=600) {
$this->debug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
(
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / 600 / 1000), 0) AS hashrate
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / ? / 1000), 0) AS hashrate
FROM " . $this->share->getTableName() . " AS s,
" . $this->user->getTableName() . " AS u
WHERE u.username = SUBSTRING_INDEX( s.username, '.', 1 )
AND s.time > DATE_SUB(now(), INTERVAL 600 SECOND)
AND s.time > DATE_SUB(now(), INTERVAL ? SECOND)
AND u.id = ?
) + (
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / 600 / 1000), 0) AS hashrate
SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536 / ? / 1000), 0) AS hashrate
FROM " . $this->share->getArchiveTableName() . " AS s,
" . $this->user->getTableName() . " AS u
WHERE u.username = SUBSTRING_INDEX( s.username, '.', 1 )
AND s.time > DATE_SUB(now(), INTERVAL 600 SECOND)
AND s.time > DATE_SUB(now(), INTERVAL ? SECOND)
AND u.id = ?
) AS hashrate
FROM DUAL");
if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $account_id, $account_id) && $stmt->execute() && $result = $stmt->get_result() )
if ($this->checkStmt($stmt) && $stmt->bind_param("iiiiii", $interval, $interval, $account_id, $interval, $interval, $account_id) && $stmt->execute() && $result = $stmt->get_result() )
return $this->memcache->setCache(__FUNCTION__ . $account_id, $result->fetch_object()->hashrate);
// Catchall
$this->debug->append("Failed to fetch hashrate: " . $this->mysqli->error);
@ -328,7 +330,7 @@ class Statistics {
**/
public function getUserSharerate($account_id, $interval=600) {
$this->debug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
(
@ -400,6 +402,8 @@ class Statistics {
foreach ($data['data'] as $key => $aUser) {
$data_new[$key]['shares'] = $aUser['valid'];
$data_new[$key]['account'] = $aUser['username'];
$data_new[$key]['donate_percent'] = $aUser['donate_percent'];
$data_new[$key]['is_anonymous'] = $aUser['is_anonymous'];
}
return $data_new;
}

View File

@ -251,19 +251,19 @@ class Transaction extends Base {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("
SELECT
ROUND((
IFNULL(ROUND((
SUM( IF( ( t.type IN ('Credit','Bonus') AND b.confirmations >= ? ) OR t.type = 'Credit_PPS', t.amount, 0 ) ) -
SUM( IF( t.type IN ('Debit_MP', 'Debit_AP'), t.amount, 0 ) ) -
SUM( IF( ( t.type IN ('Donation','Fee') AND b.confirmations >= ? ) OR ( t.type IN ('Donation_PPS', 'Fee_PPS', 'TXFee') ), t.amount, 0 ) )
), 8) AS confirmed,
ROUND((
), 8), 0) AS confirmed,
IFNULL(ROUND((
SUM( IF( t.type IN ('Credit','Bonus') AND b.confirmations < ? AND b.confirmations >= 0, t.amount, 0 ) ) -
SUM( IF( t.type IN ('Donation','Fee') AND b.confirmations < ? AND b.confirmations >= 0, t.amount, 0 ) )
), 8) AS unconfirmed,
ROUND((
), 8), 0) AS unconfirmed,
IFNULL(ROUND((
SUM( IF( t.type IN ('Credit','Bonus') AND b.confirmations = -1, t.amount, 0) ) -
SUM( IF( t.type IN ('Donation','Fee') AND b.confirmations = -1, t.amount, 0) )
), 8) AS orphaned
), 8), 0) AS orphaned
FROM $this->table AS t
LEFT JOIN " . $this->block->getTableName() . " AS b
ON t.block_id = b.id

View File

@ -43,6 +43,9 @@ class User {
public function getUserName($id) {
return $this->getSingle($id, 'username', 'id');
}
public function getUserNameByEmail($email) {
return $this->getSingle($email, 'username', 'email', 's');
}
public function getUserId($username) {
return $this->getSingle($username, 'id', 'username', 's');
}
@ -126,6 +129,13 @@ class User {
$this->setErrorMessage("Invalid username or password.");
return false;
}
if (filter_var($username, FILTER_VALIDATE_EMAIL)) {
$this->debug->append("Username is an e-mail", 2);
if (!$username = $this->getUserNameByEmail($username)) {
$this->setErrorMessage("Invalid username or password.");
return false;
}
}
if ($this->isLocked($this->getUserId($username))) {
$this->setErrorMessage("Account is locked. Please contact site support.");
return false;
@ -411,7 +421,7 @@ class User {
* @param none
* @return true
**/
public function logoutUser($redirect="index.php") {
public function logoutUser($from="") {
$this->debug->append("STA " . __METHOD__, 4);
// Unset all of the session variables
$_SESSION = array();
@ -424,8 +434,11 @@ class User {
session_destroy();
// Enforce generation of a new Session ID and delete the old
session_regenerate_id(true);
// Enforce a page reload
header("Location: $redirect");
// Enforce a page reload and point towards login with referrer included, if supplied
$location = @$_SERVER['HTTPS'] ? 'https' . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] : 'http' . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
if (!empty($from)) $location .= '?page=login&to=' . urlencode($from);
// if (!headers_sent()) header('Location: ' . $location);
exit('<meta http-equiv="refresh" content="0; url=' . $location . '"/>');
}
/**
@ -651,14 +664,14 @@ class User {
* @param none
* @return bool
**/
public function isAuthenticated() {
public function isAuthenticated($logout=true) {
$this->debug->append("STA " . __METHOD__, 4);
if (@$_SESSION['AUTHENTICATED'] == true &&
!$this->isLocked($_SESSION['USERDATA']['id']) &&
$this->getUserIp($_SESSION['USERDATA']['id']) == $_SERVER['REMOTE_ADDR']
) return true;
// Catchall
$this->logoutUser();
if ($logout == true) $this->logoutUser($_SERVER['REQUEST_URI']);
return false;
}
}

View File

@ -56,7 +56,7 @@ $aSettings['website'][] = array(
$aSettings['website'][] = array(
'display' => 'Website theme', 'type' => 'select',
'options' => $aThemes,
'default' => 'mmcFE',
'default' => 'mpos',
'name' => 'website_theme', 'value' => $setting->getValue('website_theme'),
'tooltip' => 'The default theme used on your pool.'
);
@ -102,6 +102,20 @@ $aSettings['wallet'][] = array(
'name' => 'wallet_cold_coins', 'value' => $setting->getValue('wallet_cold_coins'),
'tooltip' => 'Amount of coins held in a pools cold wallet.'
);
$aSettings['statistics'][] = array(
'display' => 'Ajax Refresh Interval', 'type' => 'select',
'options' => array('5' => '5', '10' => '10', '15' => '15', '30' => '30', '60' => '60' ),
'default' => 10,
'name' => 'statistics_ajax_refresh_interval', 'value' => $setting->getValue('statistics_ajax_refresh_interval'),
'tooltip' => 'How often to refresh data via ajax in seconds.'
);
$aSettings['statistics'][] = array(
'display' => 'Ajax Data Interval', 'type' => 'select',
'options' => array('60' => '1', '300' => '5', '600' => '10'),
'default' => 300,
'name' => 'statistics_ajax_data_interval', 'value' => $setting->getValue('statistics_ajax_data_interval'),
'tooltip' => 'Time in minutes, interval for hashrate and sharerate calculations. Higher intervals allow for better accuracy at a higer server load.'
);
$aSettings['statistics'][] = array(
'display' => 'Block Statistics Count', 'type' => 'text',
'size' => 25,
@ -151,6 +165,13 @@ $aSettings['acl'][] = array(
'name' => 'acl_round_statistics', 'value' => $setting->getValue('acl_round_statistics'),
'tooltip' => 'Make the round statistics page private (users only) or public.'
);
$aSettings['acl'][] = array(
'display' => 'Round Transactions', 'type' => 'select',
'options' => array( 0 => 'Admins', 1 => 'Public'),
'default' => 0,
'name' => 'acl_round_transactions', 'value' => $setting->getValue('acl_round_transactions'),
'tooltip' => 'Display all transactions regardless of admin status.'
);
$aSettings['system'][] = array(
'display' => 'Disable e-mail confirmations', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
@ -200,6 +221,13 @@ $aSettings['system'][] = array(
'name' => 'disable_api', 'value' => $setting->getValue('disable_api'),
'tooltip' => 'Enable or Disable the pool wide API functions. See API reference on Github for details.'
);
$aSettings['system'][] = array(
'display' => 'Disable Contactform', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'disable_contactform', 'value' => $setting->getValue('disable_contactform'),
'tooltip' => 'Enable or Disable Contactform. Users will not be able to use the contact form.'
);
$aSettings['recaptcha'][] = array(
'display' => 'Enable re-Captcha', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),

View File

@ -23,7 +23,7 @@ define('SALT', 'PLEASEMAKEMESOMETHINGRANDOM');
/**
* Database configuration
*
* A MySQL database backend is required for mmcfe-ng.
* A MySQL database backend is required for MPOS.
* Also ensure the database structure is imported!
* The SQL file should be included in this project under the `sql` directory
*
@ -32,18 +32,18 @@ define('SALT', 'PLEASEMAKEMESOMETHINGRANDOM');
* port = 3306
* user = 'someuser'
* pass = 'somepass'
* name = 'mmcfe_ng'
* name = 'mpos'
**/
$config['db']['host'] = 'localhost';
$config['db']['user'] = 'someuser';
$config['db']['pass'] = 'somepass';
$config['db']['port'] = 3306;
$config['db']['name'] = 'mmcfe_ng';
$config['db']['name'] = 'mpos';
/**
* Local wallet RPC configuration
*
* mmcfe-ng uses the RPC backend to fetch transactions, blocks
* MPOS uses the RPC backend to fetch transactions, blocks
* and various other things. They need to match your coind RPC
* configuration.
*
@ -62,9 +62,9 @@ $config['wallet']['password'] = 'testnet';
* API configuration to fetch prices for set currency
*
* Explanation:
* mmcfe-ng will try to fetch the current exchange rates
* MPOS will try to fetch the current exchange rates
* from this API URL/target. Currently btc-e and coinchoose
* are supported in mmcfe-ng. If you want to remove the trade
* are supported in MPOS. If you want to remove the trade
* header just set currency to an empty string.
*
* Default (btc-e.com):
@ -236,7 +236,7 @@ $config['pplns']['shares']['type'] = 'blockavg';
$config['pplns']['blockavg']['blockcount'] = 10;
// Pool target difficulty as set in pushpoold configuration file
// Please also read this for stratum: https://github.com/TheSerapher/php-mmcfe-ng/wiki/FAQ
// Please also read this for stratum: https://github.com/TheSerapher/php-mpos/wiki/FAQ
$config['difficulty'] = 20;
@ -315,7 +315,7 @@ $config['pps_target'] = 16; // do not change unless you know what it does
* enabled : Disable (false) memcache for debugging or enable (true) it
* host : Host IP or hostname
* port : memcache port
* keyprefix : Must be changed for multiple mmcfe-ng instances on one host
* keyprefix : Must be changed for multiple MPOS instances on one host
* expiration : Default expiration time in seconds of all cached keys.
* Increase if caches expire too fast.
* splay : Default randomizer for expiration times.
@ -325,14 +325,14 @@ $config['pps_target'] = 16; // do not change unless you know what it does
* enabled = `true`
* host = `localhost`
* port = 11211
* keyprefix = `mmcfe_ng_`
* keyprefix = `mpos_`
* expiration = 90
* splay = 15
**/
$config['memcache']['enabled'] = true;
$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;
$config['memcache']['keyprefix'] = 'mmcfe_ng_';
$config['memcache']['keyprefix'] = 'mpos_';
$config['memcache']['expiration'] = 90;
$config['memcache']['splay'] = 15;
@ -342,7 +342,7 @@ $config['memcache']['splay'] = 15;
*
* You can configure the cookie behaviour to secure your cookies more than the PHP defaults
*
* For multiple installations of mmcfe-ng on the same domain you must change the cookie path.
* For multiple installations of MPOS on the same domain you must change the cookie path.
*
* Explanation:
* duration:
@ -393,7 +393,7 @@ $config['cookie']['secure'] = false;
* all data so rendering the page should not take too long anyway.
*
* You can test this out and enable (1) this setting but it's not guaranteed to
* work with mmcfe-ng.
* work with MPOS.
*
* Ensure that the folder `templates/cache` is writable by the webserver!
*

View File

@ -5,7 +5,7 @@ if (!defined('SECURITY')) die('Hacking attempt');
if ($user->isAuthenticated()) {
if ($setting->getValue('disable_notifications') == 1) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Notification system disabled by admin.', 'TYPE' => 'info');
$smarty->assign('CONTENT', '../../global/empty.tpl');
$smarty->assign('CONTENT', 'empty');
} else {
if (@$_REQUEST['do'] == 'save') {
if ($notification->updateSettings($_SESSION['USERDATA']['id'], $_REQUEST['data'])) {

View File

@ -9,5 +9,5 @@ if ($user->isAuthenticated()) {
header("Location: " . $_SERVER['HTTP_REFERER']);
}
// Somehow we still need to load this empty template
$smarty->assign("CONTENT", "../../global/empty.tpl");
$smarty->assign("CONTENT", "empty");
?>

View File

@ -7,19 +7,16 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
if ($bitcoin->can_connect() === true){
if (!$iBlock = $memcache->get('iBlock')) {
$iBlock = $bitcoin->query('getblockcount');
$memcache->set('iBlock', $iBlock);
}
$iBlock = $bitcoin->getblockcount();
} else {
$iBlock = 0;
}
// Output JSON format
echo json_encode(array('getblockcount' => $iBlock));
echo $api->get_json($iBlock);
// Supress master template
$supress_master = 1;

View File

@ -7,15 +7,13 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Set a sane limit, overwrite with URL parameter
$iLimit = 10;
if (@$_REQUEST['limit'])
$iLimit = $_REQUEST['limit'];
// Check how many blocks to fetch
$setting->getValue('statistics_block_count') ? $iLimit = $setting->getValue('statistics_block_count') : $iLimit = 20;
// Output JSON format
echo json_encode(array('getblocksfound' => $statistics->getBlocksFound($iLimit)));
echo $api->get_json($statistics->getBlocksFound($iLimit));
// Supress master template
$supress_master = 1;

View File

@ -7,10 +7,10 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Output JSON format
echo json_encode(array('getcurrentworkers' => $worker->getCountAllActiveWorkers()));
echo $api->get_json($worker->getCountAllActiveWorkers());
// Supress master template
$supress_master = 1;

View File

@ -0,0 +1,57 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Check if the API is activated
$api->isActive();
// Check user token and access level permissions
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Fetch RPC information
if ($bitcoin->can_connect() === true) {
$dNetworkHashrate = $bitcoin->getnetworkhashps();
$dDifficulty = $bitcoin->getdifficulty();
$iBlock = $bitcoin->getblockcount();
} else {
$dNetworkHashrate = 0;
$dDifficulty = 1;
$iBlock = 0;
}
// Some settings
if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
if ( ! $dPoolHashrateModifier = $setting->getValue('statistics_pool_hashrate_modifier') ) $dPoolHashrateModifier = 1;
if ( ! $dPersonalHashrateModifier = $setting->getValue('statistics_personal_hashrate_modifier') ) $dPersonalHashrateModifier = 1;
if ( ! $dNetworkHashrateModifier = $setting->getValue('statistics_network_hashrate_modifier') ) $dNetworkHashrateModifier = 1;
// Fetch raw data
$statistics->setGetCache(false);
$dPoolHashrate = $statistics->getCurrentHashrate($interval);
if ($dPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $dPoolHashrate;
$dPersonalHashrate = $statistics->getUserHashrate($user_id, $interval);
$dPersonalSharerate = $statistics->getUserSharerate($user_id, $interval);
$statistics->setGetCache(true);
// Use caches for this one
$aUserRoundShares = $statistics->getUserShares($user_id);
$aRoundShares = $statistics->getRoundShares();
// Apply pool modifiers
$dPersonalHashrateAdjusted = $dPersonalHashrate * $dPersonalHashrateModifier;
$dPoolHashrateAdjusted = $dPoolHashrate * $dPoolHashrateModifier;
$dNetworkHashrateAdjusted = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier;
// Output JSON format
$data = array(
'raw' => array( 'personal' => array( 'hashrate' => $dPersonalHashrate ), 'pool' => array( 'hashrate' => $dPoolHashrate ), 'network' => array( 'hashrate' => $dNetworkHashrate / 1000 ) ),
'personal' => array ( 'hashrate' => $dPersonalHashrateAdjusted, 'sharerate' => $dPersonalSharerate, 'shares' => $aUserRoundShares, 'balance' => $transaction->getBalance($user_id)),
'pool' => array( 'hashrate' => $dPoolHashrateAdjusted, 'shares' => $aRoundShares ),
'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock ),
);
echo $api->get_json($data);
// Supress master template
$supress_master = 1;
?>

View File

@ -7,17 +7,13 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Fetch data from wallet
if ($bitcoin->can_connect() === true){
$dDifficulty = $bitcoin->getdifficulty();
} else {
$iDifficulty = 1;
}
$bitcoin->can_connect() === true ? $dDifficulty = $bitcoin->getdifficulty() : $iDifficulty = 1;
// Output JSON format
echo json_encode(array('getdifficulty' => $dDifficulty));
echo $api->get_json($dDifficulty);
// Supress master template
$supress_master = 1;

View File

@ -7,13 +7,14 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Estimated time to find the next block
$iCurrentPoolHashrate = $statistics->getCurrentHashrate() * 1000;
$bitcoin->can_connect() === true ? $dEstimatedTime = $bitcoin->getestimatedtime($iCurrentPoolHashrate) : $dEstimatedTime = 0;
// Output JSON format
echo json_encode(array('getestimatedtime' => $bitcoin->getestimatedtime($iCurrentPoolHashrate)));
echo $api->get_json($dEstimatedTime);
// Supress master template
$supress_master = 1;

View File

@ -7,25 +7,15 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$user_id = $user->checkApiKey($_REQUEST['api_key']);
if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQUEST['id']))) {
// User is admin and tries to access an ID that is not their own
header("HTTP/1.1 401 Unauthorized");
die("Access denied");
} else if ($user->isAdmin($user_id)) {
// Is it a username or a user ID
ctype_digit($_REQUEST['id']) ? $id = $_REQUEST['id'] : $id = $user->getUserId($_REQUEST['id']);
} else {
// Not admin, only allow own user ID
$id = $user_id;
}
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Output JSON format
echo json_encode(array('gethourlyhashrates' => array(
$data = array(
'mine' => $statistics->getHourlyHashrateByAccount($id),
'pool' => $statistics->getHourlyHashrateByPool()
)), JSON_FORCE_OBJECT);
);
echo $api->json($data);
// Supress master template
$supress_master = 1;

View File

@ -7,10 +7,17 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Fetch settings
if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
// Output JSON format
echo json_encode(array('getpoolhashrate' => $statistics->getCurrentHashrate()));
$statistics->setGetCache(false);
$dPoolHashrate = $statistics->getCurrentHashrate($interval);
$statistics->setGetCache(true);
echo $api->get_json($dPoolHashrate);
// Supress master template
$supress_master = 1;

View File

@ -7,7 +7,10 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Fetch settings
if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
// Output JSON format
echo json_encode(array('getpoolsharerate' => $statistics->getCurrentShareRate()));

View File

@ -7,7 +7,7 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$user_id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Fetch last block information
$aLastBlock = $block->getLast();
@ -20,14 +20,19 @@ $aShares['valid'] > 0 ? $dEfficiency = round((100 - (100 / $aShares['valid'] * $
if ($bitcoin->can_connect() === true){
$dDifficulty = $bitcoin->getdifficulty();
$iBlock = $bitcoin->getblockcount();
$dNetworkHashrate = $bitcoin->getnetworkhashps();
} else {
$dDifficulty = 1;
$iBlock = 0;
$dNetworkHashrate = 0;
}
// Estimated time to find the next block
$iCurrentPoolHashrate = $statistics->getCurrentHashrate();
// Avoid confusion, ensure our nethash isn't higher than poolhash
if ($iCurrentPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $iCurrentPoolHashrate;
// Time in seconds, not hours, using modifier in smarty to translate
$iCurrentPoolHashrate > 0 ? $iEstTime = $dDifficulty * pow(2,32) / ($iCurrentPoolHashrate * 1000) : $iEstTime = 0;
$iEstShares = (pow(2, 32 - $config['difficulty']) * $dDifficulty);
@ -41,20 +46,21 @@ if (!empty($aLastBlock)) {
}
// Output JSON format
echo json_encode(
array(
'getpoolstatus' => array(
'hashrate' => $iCurrentPoolHashrate,
'efficiency' => $dEfficiency,
'workers' => $worker->getCountAllActiveWorkers(),
'currentnetworkblock' => $iBlock,
'nextnetworkblock' => $iBlock + 1,
'lastblock' => $aLastBlock['height'],
'networkdiff' => $dDifficulty,
'esttime' => $iEstTime,
'estshares' => $iEstShares,
'timesincelast' => $dTimeSinceLast,
)));
$data = array(
'hashrate' => $iCurrentPoolHashrate,
'efficiency' => $dEfficiency,
'workers' => $worker->getCountAllActiveWorkers(),
'currentnetworkblock' => $iBlock,
'nextnetworkblock' => $iBlock + 1,
'lastblock' => $aLastBlock['height'],
'networkdiff' => $dDifficulty,
'esttime' => $iEstTime,
'estshares' => $iEstShares,
'timesincelast' => $dTimeSinceLast,
'nethashrate' => $dNetworkHashrate
);
echo $api->get_json($data);
// Supress master template
$supress_master = 1;

View File

@ -7,21 +7,17 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$id = $user->checkApiKey($_REQUEST['api_key']);
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Fetch our last block found
$aBlocksFoundData = $statistics->getBlocksFound(1);
// Time since last block
$now = new DateTime( "now" );
if (!empty($aBlocksFoundData)) {
$dTimeSinceLast = ($now->getTimestamp() - $aBlocksFoundData[0]['time']);
} else {
$dTimeSinceLast = 0;
}
! empty($aBlocksFoundData) ? $dTimeSinceLast = ($now->getTimestamp() - $aBlocksFoundData[0]['time']) : $dTimeSinceLast = 0;
// Output JSON format
echo json_encode(array('gettimesincelastblock' => $dTimeSinceLast));
echo $api->get_json($dTimeSinceLast);
// Supress master template
$supress_master = 1;

View File

@ -7,23 +7,10 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$user_id = $user->checkApiKey($_REQUEST['api_key']);
echo $user_id;
// We have to check if that user is admin too
if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQUEST['id']))) {
header("HTTP/1.1 401 Unauthorized");
die("Access denied");
} else if ($user->isAdmin($user_id) && !empty($_REQUEST['id'])) {
$id = $_REQUEST['id'];
ctype_digit($_REQUEST['id']) ? $id = $_REQUEST['id'] : $id = $user->getUserId($_REQUEST['id']);
} else {
$id = $user_id;
}
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Output JSON format
echo json_encode(array('getuserbalance' => $transaction->getBalance($id)));
echo $api->get_json($transaction->getBalance($user_id));
// Supress master template
$supress_master = 1;

View File

@ -0,0 +1,25 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Check if the API is activated
$api->isActive();
// Check user token
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Fetch some settings
if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
// Gather un-cached data
$statistics->setGetCache(false);
$hashrate = $statistics->getUserHashrate($user_id, $interval);
$statistics->setGetCache(true);
// Output JSON
echo $api->get_json($hashrate);
// Supress master template
$supress_master = 1;
?>

View File

@ -0,0 +1,25 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Check if the API is activated
$api->isActive();
// Check user token
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Fetch settings
if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
// Gather un-cached data
$statistics->setGetCache(false);
$sharerate = $statistics->getUserSharerate($user_id, $interval);
$statistics->setGetCache(true);
// Output JSON format
echo $api->get_json($sharerate);
// Supress master template
$supress_master = 1;
?>

View File

@ -7,36 +7,16 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$user_id = $user->checkApiKey($_REQUEST['api_key']);
/**
* This check will ensure the user can do the following:
* Admin: Check any user via request id
* Regular: Check your own status
* Other: Deny access via checkApiKey
**/
if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQUEST['id']))) {
// User is admin and tries to access an ID that is not their own
header("HTTP/1.1 401 Unauthorized");
die("Access denied");
} else if ($user->isAdmin($user_id)) {
// Admin, so allow any ID passed in request
$id = $_REQUEST['id'];
// Is it a username or a user ID
ctype_digit($_REQUEST['id']) ? $username = $user->getUserName($_REQUEST['id']) : $username = $_REQUEST['id'];
ctype_digit($_REQUEST['id']) ? $id = $_REQUEST['id'] : $id = $user->getUserId($_REQUEST['id']);
} else {
// Not admin, only allow own user ID
$id = $user_id;
$username = $user->getUserName($id);
}
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Output JSON format
echo json_encode(array('getuserstatus' => array(
'username' => $username,
'shares' => $statistics->getUserShares($id),
'hashrate' => $statistics->getUserHashrate($id)
)));
$data = array(
'username' => $user->getUsername($user_id),
'shares' => $statistics->getUserShares($user_id),
'hashrate' => $statistics->getUserHashrate($user_id),
'sharerate' => $statistics->getUserSharerate($user_id)
);
echo $api->get_json($data);
// Supress master template
$supress_master = 1;

View File

@ -7,21 +7,10 @@ if (!defined('SECURITY')) die('Hacking attempt');
$api->isActive();
// Check user token
$user_id = $user->checkApiKey($_REQUEST['api_key']);
// We have to check if that user is admin too
if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQUEST['id']))) {
header("HTTP/1.1 401 Unauthorized");
die("Access denied");
} else if ($user->isAdmin($user_id)) {
$id = $_REQUEST['id'];
ctype_digit($_REQUEST['id']) ? $id = $_REQUEST['id'] : $id = $user->getUserId($_REQUEST['id']);
} else {
$id = $user_id;
}
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Output JSON format
echo json_encode(array('getuserworkers' => $worker->getWorkers($id)));
echo $api->get_json($worker->getWorkers($user_id));
// Supress master template
$supress_master = 1;

View File

@ -13,6 +13,7 @@ $aShares = $statistics->getRoundShares();
// RPC Calls
$bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->getnetworkhashps() : $dNetworkHashrate = 0;
// Backwards compatible with the existing services
echo json_encode(
array(
'pool_name' => $setting->getValue('website_name'),

View File

@ -0,0 +1,18 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
if ($setting->getValue('disable_contactform')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Contactform is currently disabled. Please try again later.', 'TYPE' => 'errormsg');
$smarty->assign("CONTENT", "disabled.tpl");
} else {
if ($setting->getValue('recaptcha_enabled')) {
require_once(INCLUDE_DIR . '/lib/recaptchalib.php');
$smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key')));
}
// Tempalte specifics
$smarty->assign("CONTENT", "default.tpl");
}
?>

View File

@ -0,0 +1,51 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
if ($setting->getValue('recaptcha_enabled')) {
// Load re-captcha specific data
require_once(INCLUDE_DIR . '/lib/recaptchalib.php');
$rsp = recaptcha_check_answer (
$setting->getValue('recaptcha_private_key'),
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]
);
}
if ($setting->getValue('disable_contactform')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Contactform is currently disabled. Please try again later.', 'TYPE' => 'errormsg');
} else {
// Check if recaptcha is enabled, process form data if valid
if($setting->getValue('recaptcha_enabled') && $_POST["recaptcha_response_field"] && $_POST["recaptcha_response_field"]!=''){
if ($rsp->is_valid) {
$smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key')));
if ($mail->contactform($_POST['senderName'], $_POST['senderEmail'], $_POST['senderSubject'], $_POST['senderMessage'])) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Thanks for sending your message! We will get back to you shortly');
} else {
$_SESSION['POPUP'][] = array('CONTENT' => 'There was a problem sending your message. Please try again.' . $user->getError(), 'TYPE' => 'errormsg');
}
} else {
$smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key'), $rsp->error));
$_SESSION['POPUP'][] = array('CONTENT' => 'Invalid Captcha, please try again. (' . $rsp->error . ')', 'TYPE' => 'errormsg');
}
// Empty captcha
} else if ($setting->getValue('recaptcha_enabled')) {
$smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key'), $rsp->error));
$_SESSION['POPUP'][] = array('CONTENT' => 'Empty Captcha, please try again.', 'TYPE' => 'errormsg');
// Captcha disabled
} else {
if ($mail->contactform($_POST['senderName'], $_POST['senderEmail'], $_POST['senderSubject'], $_POST['senderMessage'])) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Thanks for sending your message! We will get back to you shortly');
} else {
$_SESSION['POPUP'][] = array('CONTENT' => 'There was a problem sending your message. Please try again. ' . $user->getError(), 'TYPE' => 'errormsg');
}
}
}
// Tempalte specifics
$smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -0,0 +1,50 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
if ($user->isAuthenticated()) {
if (! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
// Defaults to get rid of PHP Notice warnings
$dDifficulty = 1;
$aRoundShares = 1;
// Only run these if the user is logged in
$aRoundShares = $statistics->getRoundShares();
if ($bitcoin->can_connect() === true) {
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
}
// Always fetch this since we need for ministats header
$aRoundShares = $statistics->getRoundShares();
if ($bitcoin->can_connect() === true) {
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
try { $dNetworkHashrate = $bitcoin->query('getnetworkhashps') / 1000; } catch (Exception $e) {
// Maybe we are SHA
try { $dNetworkHashrate = $bitcoin->query('gethashespersec') / 1000; } catch (Exception $e) {
$dNetworkHashrate = 0;
}
$dNetworkHashrate = 0;
}
} else {
$dNetworkHashrate = 0;
}
// Fetch some data
if (!$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers()) $iCurrentActiveWorkers = 0;
$iCurrentPoolHashrate = $statistics->getCurrentHashrate();
$iCurrentPoolShareRate = $statistics->getCurrentShareRate();
// Avoid confusion, ensure our nethash isn't higher than poolhash
if ($iCurrentPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $iCurrentPoolHashrate;
// Make it available in Smarty
$smarty->assign('INTERVAL', $interval / 60);
$smarty->assign('CONTENT', 'default.tpl');
}
?>

View File

@ -5,8 +5,11 @@ if (!defined('SECURITY')) die('Hacking attempt');
if ($setting->getValue('maintenance') && !$user->isAdmin($user->getUserId($_POST['username']))) {
$_SESSION['POPUP'][] = array('CONTENT' => 'You are not allowed to login during maintenace.', 'TYPE' => 'info');
} else if ($user->checkLogin($_POST['username'],$_POST['password']) ) {
header('Location: index.php?page=home');
} else if ($user->checkLogin(@$_POST['username'], @$_POST['password']) ) {
empty($_POST['to']) ? $to = $_SERVER['PHP_SELF'] : $to = $_POST['to'];
$location = @$_SERVER['HTTPS'] === true ? 'https' : 'http' . '://' . $_SERVER['SERVER_NAME'] . $to;
if (!headers_sent()) header('Location: ' . $location);
exit('<meta http-equiv="refresh" content="0; url=' . $location . '"/>');
} else if (@$_POST['username'] && @$_POST['password']) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to login: '. $user->getError(), 'TYPE' => 'errormsg');
}

View File

@ -7,5 +7,5 @@ if (!defined('SECURITY'))
// This probably (?) never fails
$user->logoutUser();
$smarty->assign("CONTENT", "default.tpl");
header('Location: index.php?page=home');
// header('Location: index.php?page=home');
?>

View File

@ -65,9 +65,9 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
// Public / private page detection
if ($setting->getValue('acl_pool_statistics')) {
$smarty->assign("CONTENT", "authenticated.tpl");
$smarty->assign("CONTENT", "default.tpl");
} else if ($user->isAuthenticated() && ! $setting->getValue('acl_pool_statistics')) {
$smarty->assign("CONTENT", "authenticated.tpl");
$smarty->assign("CONTENT", "default.tpl");
} else {
$smarty->assign("CONTENT", "../default.tpl");
}

View File

@ -19,13 +19,13 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$iKey = $_REQUEST['height'];
}
}
$aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin($_SESSION['USERDATA']['id']));
$aRoundShareStats = $roundstats->getRoundStatsForAccounts($iKey, $user->isAdmin($_SESSION['USERDATA']['id']));
$aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin(@$_SESSION['USERDATA']['id']));
$aRoundShareStats = $roundstats->getRoundStatsForAccounts($iKey, $user->isAdmin(@$_SESSION['USERDATA']['id']));
if ($user->isAdmin($_SESSION['USERDATA']['id'])) {
$aUserRoundTransactions = $roundstats->getAllRoundTransactions($iKey);
if ($user->isAdmin(@$_SESSION['USERDATA']['id']) || $setting->getValue('acl_round_transactions')) {
$aUserRoundTransactions = $roundstats->getAllRoundTransactions($iKey, @$_SESSION['USERDATA']['id']);
} else {
$aUserRoundTransactions = $roundstats->getUserRoundTransactions($iKey, $_SESSION['USERDATA']['id']);
$aUserRoundTransactions = $roundstats->getUserRoundTransactions($iKey, @$_SESSION['USERDATA']['id']);
}
// Propagate content our template
@ -38,7 +38,9 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
if ($setting->getValue('acl_round_statistics')) {
$smarty->assign("CONTENT", "default.tpl");
} else if ($user->isAuthenticated()) {
} else if ($user->isAuthenticated(false)) {
$smarty->assign("CONTENT", "default.tpl");
} else {
$smarty->assign("CONTENT", "empty");
}
?>

View File

@ -44,6 +44,9 @@ $iCurrentPoolShareRate = $statistics->getCurrentShareRate();
// Active workers
if (!$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers()) $iCurrentActiveWorkers = 0;
// Some settings to propagate to template
if (! $statistics_ajax_refresh_interval = $setting->getValue('statistics_ajax_refresh_interval')) $statistics_ajax_refresh_interval = 10;
// Small helper array
$aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' );
@ -65,6 +68,7 @@ $aGlobal = array(
'accounts' => $config['accounts'],
'disable_invitations' => $setting->getValue('disable_invitations'),
'disable_notifications' => $setting->getValue('disable_notifications'),
'statistics_ajax_refresh_interval' => $statistics_ajax_refresh_interval,
'price' => array( 'currency' => $config['price']['currency'] ),
'targetdiff' => $config['difficulty'],
'currency' => $config['currency'],
@ -136,10 +140,11 @@ if (@$_SESSION['USERDATA']['id']) {
$aGlobal['userdata']['est_payout'] = 0;
}
case 'pplns':
if ($iAvgBlockShares = round($block->getAvgBlockShares($config['pplns']['blockavg']['blockcount']))) {
$aGlobal['pplns']['target'] = $iAvgBlockShares;
} else {
$aGlobal['pplns']['target'] = $config['pplns']['shares']['default'];
$aGlobal['pplns']['target'] = $config['pplns']['shares']['default'];
if ($aLastBlock = $block->getLast()) {
if ($iAvgBlockShares = round($block->getAvgBlockShares($aLastBlock['height'], $config['pplns']['blockavg']['blockcount']))) {
$aGlobal['pplns']['target'] = $iAvgBlockShares;
}
}
break;
case 'pps':
@ -158,6 +163,9 @@ if ($setting->getValue('maintenance'))
if ($motd = $setting->getValue('system_motd'))
$_SESSION['POPUP'][] = array('CONTENT' => $motd, 'TYPE' => 'info');
// So we can display additional info
$smarty->assign('DEBUG', DEBUG);
// Make it available in Smarty
$smarty->assign('PATH', 'site_assets/' . THEME);
$smarty->assign('GLOBAL', $aGlobal);

View File

@ -18,6 +18,9 @@ limitations under the License.
*/
// Used for performance calculations
$dStartTime = microtime(true);
// This should be okay
define("BASEPATH", "./");
@ -76,15 +79,15 @@ $smarty->assign("PAGE", $page);
$smarty->assign("ACTION", $action);
// Now with all loaded and processed, setup some globals we need for smarty templates
require_once(INCLUDE_DIR . '/smarty_globals.inc.php');
if ($page != 'api') require_once(INCLUDE_DIR . '/smarty_globals.inc.php');
// Load debug information into template
$debug->append("Loading debug information into template", 4);
$smarty->assign('DebuggerInfo', $debug->getDebugInfo());
$smarty->assign('RUNTIME', (microtime(true) - $dStartTime) * 1000);
// Display our page
if (!@$supress_master)
$smarty->display("master.tpl", $smarty_cache_key);
if (!@$supress_master) $smarty->display("master.tpl", $smarty_cache_key);
// Unset any temporary values here
unset($_SESSION['POPUP']);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,85 @@
/*
Animation example, for spinners
*/
.animate-spin {
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
display: inline-block;
}
@-moz-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@-webkit-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@-o-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@-ms-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}

View File

@ -0,0 +1,211 @@
/* Custom stuff */
span.confirmed {
display: inline-block;
width: 60px;
font-size: 10px;
background: #e6efc2;
color:#264409;
padding: 2px 4px;
border:1px solid #c6d880;
border-radius: 4px;
}
span.orphan {
display: inline-block;
width: 60px;
font-size: 10px;
background: #ff9473;
color:#264409;
padding: 2px 4px;
border:1px solid #ff6342;
border-radius: 4px;
}
span.unconfirmed {
display: inline-block;
width: 60px;
font-size: 10px;
background: #ffce9c;
color:#264409;
padding: 2px 4px;
border:1px solid #ffb573;
border-radius: 4px;
}
div.login_small {
float: right;
background: #E0E0E3;
background: linear-gradient(to bottom, rgb(255, 255, 255) 0%, rgb(241, 241, 241) 50%, rgb(225, 225, 225) 51%, rgb(246, 246, 246) 100%) repeat scroll 0% 0%;
border-radius: 5px 5px 5px 5px;
position: absolute;
padding: 5px;
top: 10px;
right: 10px;
}
fieldset2 {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #F6F6F6;
padding: 1% 0%;
margin: 10px 0;
}
fieldset2 label {
display: block;
float: left;
height: 25px;
line-height: 25px;
text-shadow: 0 1px 0 #fff;
font-weight: bold;
padding-left: 10px;
text-transform: uppercase;
}
fieldset2 input[type=text], fieldset2 input[type=password] {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #BBBBBB;
height: 20px;
color: #666666;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
padding-left: 10px;
background-position: 10px 6px;
margin: 0;
display: block;
float: left;
margin: 0 10px;
}
fieldset2 input[type=text]:focus, fieldset2 input[type=password]:focus, fieldset2 input[type=checkbox] {
outline: none;
border: 1px solid #77BACE;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
}
/* Custom checkboxes */
input[type=checkbox] {
position: absolute;
opacity: 0;
}
input[type=checkbox] + label
{
background: url('../images/icn_alert_error.png');
height: 16px;
width: 16px;
display:inline-block;
padding: 0 0 0 0px;
}
input[type=checkbox]:checked + label
{
background: url('../images/icn_alert_success.png');
height: 16px;
width: 16px;
display:inline-block;
padding: 0 0 0 0px;
}
/* Debugger console toggle switch */
span.toggle {
display:block;
width: 75px;
height: 100%;
margin: 0 auto;
}
:root input[type="checkbox"] {
position: absolute;
opacity: 0;
}
:root input[type="checkbox"].ios-switch + div {
display: inline-block;
vertical-align: middle;
width: 3em; height: 1em;
border: 1px solid rgba(0,0,0,.3);
border-radius: 999px;
margin: 0 .5em;
background: white;
background-image: linear-gradient(rgba(0,0,0,.1), transparent),
linear-gradient(90deg, hsl(210, 90%, 60%) 50%, transparent 50%);
background-size: 200% 100%;
background-position: 100% 0;
background-origin: border-box;
background-clip: border-box;
overflow: hidden;
transition-duration: .4s;
transition-property: padding, width, background-position, text-indent;
box-shadow: 0 .1em .1em rgba(0,0,0,.2) inset,
0 .45em 0 .1em rgba(0,0,0,.05) inset;
font-size: 150%;
}
:root input[type="checkbox"].ios-switch:checked + div {
padding-left: 2em; width: 1em;
background-position: 0 0;
}
:root input[type="checkbox"].ios-switch + div:before {
content: 'On';
float: left;
width: 1.65em; height: 1.65em;
margin: -.1em;
border: 1px solid rgba(0,0,0,.35);
border-radius: inherit;
background: white;
background-image: linear-gradient(rgba(0,0,0,.2), transparent);
box-shadow: 0 .1em .1em .1em hsla(0,0%,100%,.8) inset,
0 0 .5em rgba(0,0,0,.3);
color: white;
text-shadow: 0 -1px 1px rgba(0,0,0,.3);
text-indent: -2.5em;
}
:root input[type="checkbox"].ios-switch:active + div:before {
background-color: #eee;
}
:root input[type="checkbox"].ios-switch:focus + div {
box-shadow: 0 .1em .1em rgba(0,0,0,.2) inset,
0 .45em 0 .1em rgba(0,0,0,.05) inset,
0 0 .4em 1px rgba(255,0,0,.5);
}
:root input[type="checkbox"].ios-switch + div:before,
:root input[type="checkbox"].ios-switch + div:after {
font: bold 60%/1.9 sans-serif;
text-transform: uppercase;
}
:root input[type="checkbox"].ios-switch + div:after {
content: 'Off';
float: left;
text-indent: .5em;
color: rgba(0,0,0,.45);
text-shadow: none;
}
footer.footer {
clear: both;
text-align: center;
height: 60px;
margin-top: -60px;
position: relative;
padding: 4px 0px 0px 0px;
background:url("../images/header_bg.png") repeat-x scroll 0% 0% rgb(34, 34, 34);
font-size:11px;
width:100%;
}
footer.footer p {
color:grey;
margin: 0px 0 0 0;
}
.DebuggerConsole {
z-index:500;position:absolute;display:none
}

View File

@ -0,0 +1,36 @@
.icon-money:before { content: '\e819'; } /* '' */
.icon-exchange:before { content: '\e81a'; } /* '' */
.icon-wrench:before { content: '\e80f'; } /* '' */
.icon-user:before { content: '\e804'; } /* '' */
.icon-doc:before { content: '\e81b'; } /* '' */
.icon-trash:before { content: '\e812'; } /* '' */
.icon-torso:before { content: '\e805'; } /* '' */
.icon-th-large:before { content: '\e808'; } /* '' */
.icon-star-empty:before { content: '\e821'; } /* '' */
.icon-desktop:before { content: '\e806'; } /* '' */
.icon-cancel:before { content: '\e80a'; } /* '' */
.icon-record:before { content: '\e822'; } /* '' */
.icon-plus:before { content: '\e80c'; } /* '' */
.icon-photo:before { content: '\e815'; } /* '' */
.icon-pencil:before { content: '\e802'; } /* '' */
.icon-ok:before { content: '\e80b'; } /* '' */
.icon-off:before { content: '\e811'; } /* '' */
.icon-indent-left:before { content: '\e80d'; } /* '' */
.icon-forward:before { content: '\e81d'; } /* '' */
.icon-fast-forward:before { content: '\e820'; } /* '' */
.icon-fast-backward:before { content: '\e81f'; } /* '' */
.icon-gauge:before { content: '\e803'; } /* '' */
.icon-backward:before { content: '\e81e'; } /* '' */
.icon-right-open:before { content: '\e800'; } /* '' */
.icon-left-open:before { content: '\e801'; } /* '' */
.icon-bell:before { content: '\e817'; } /* '' */
.icon-barcode:before { content: '\e80e'; } /* '' */
.icon-align-left:before { content: '\e807'; } /* '' */
.icon-home:before { content: '\e813'; } /* '' */
.icon-mail:before { content: '\e814'; } /* '' */
.icon-chart:before { content: '\e809'; } /* '' */
.icon-cog:before { content: '\e810'; } /* '' */
.icon-megaphone:before { content: '\e816'; } /* '' */
.icon-login:before { content: '\e81c'; } /* '' */
.icon-dollar:before { content: '\e818'; } /* '' */

View File

@ -0,0 +1,218 @@
{
"name": "",
"css_prefix_text": "icon-",
"css_use_suffix": false,
"hinting": true,
"glyphs": [
{
"uid": "026007bd17bfc67f3fe013199676f620",
"css": "dollar",
"code": 59416,
"src": "fontawesome"
},
{
"uid": "a204f0fa972408eaae5a363c444991b2",
"css": "login",
"code": 59420,
"src": "entypo"
},
{
"uid": "e07df3e5b9ae72836b7804f38f0644a9",
"css": "exchange",
"code": 59418,
"src": "iconic"
},
{
"uid": "212ab54aac31030950fec3e2448ebee9",
"css": "money",
"code": 59417,
"src": "modernpics"
},
{
"uid": "b6ef4443ecc502136135437837d9724b",
"css": "mail",
"code": 59412,
"src": "elusive"
},
{
"uid": "8346e81b88fa3c57b42978f8b137a93a",
"css": "star-empty",
"code": 59425,
"src": "elusive"
},
{
"uid": "2c576f7c6c3233c31abad0899fc9f4af",
"css": "user",
"code": 59396,
"src": "elusive"
},
{
"uid": "6ad86a953a5a76086c5568366863bbca",
"css": "torso",
"code": 59397,
"src": "elusive"
},
{
"uid": "745f28cc6b06e5d131f6d650377b6cf5",
"css": "photo",
"code": 59413,
"src": "elusive"
},
{
"uid": "76f961b11f65300838a5a78856aca30f",
"css": "th-large",
"code": 59400,
"src": "elusive"
},
{
"uid": "ce7452abce8b55ded1c393997a51e6b3",
"css": "ok",
"code": 59403,
"src": "elusive"
},
{
"uid": "499b745a2e2485bdd059c3a53d048e5f",
"css": "cancel",
"code": 59402,
"src": "elusive"
},
{
"uid": "55e2ff85b1c459c383f46da6e96014b0",
"css": "plus",
"code": 59404,
"src": "elusive"
},
{
"uid": "829c06a0a3b73b02a6224f4bbb73d99c",
"css": "home",
"code": 59411,
"src": "elusive"
},
{
"uid": "62b0580ee8edc3a3edfbf68a47c852d5",
"css": "pencil",
"code": 59394,
"src": "elusive"
},
{
"uid": "f84e243b91683403debed23b950f7efb",
"css": "bell",
"code": 59415,
"src": "elusive"
},
{
"uid": "3ab2abf6f936d3e53ee8c184cedaed82",
"css": "trash",
"code": 59410,
"src": "elusive"
},
{
"uid": "6083c8aa5e3345476a24a28ac1afaa61",
"css": "cog",
"code": 59408,
"src": "elusive"
},
{
"uid": "cde79a37774e5817bc68fff2464aee28",
"css": "wrench",
"code": 59407,
"src": "elusive"
},
{
"uid": "c0a07aca383ff2a164a4d691fa46e35c",
"css": "left-open",
"code": 59393,
"src": "elusive"
},
{
"uid": "dc4a03854ef986d64565143bea4241aa",
"css": "right-open",
"code": 59392,
"src": "elusive"
},
{
"uid": "14cab076c708524c1031b29ffd1c188f",
"css": "record",
"code": 59426,
"src": "elusive"
},
{
"uid": "a76bd0de8b24c94f7fe0e1f93c34e65f",
"css": "backward",
"code": 59422,
"src": "elusive"
},
{
"uid": "c69425891f0b3ba4883e692a55e83bfd",
"css": "fast-backward",
"code": 59423,
"src": "elusive"
},
{
"uid": "c03284ddefae90dfd5ae9f0ee03325a2",
"css": "fast-forward",
"code": 59424,
"src": "elusive"
},
{
"uid": "86bf86dba2ca65051aa87794221fee1c",
"css": "forward",
"code": 59421,
"src": "elusive"
},
{
"uid": "abe051e31ad705400cf6226b24b6e828",
"css": "desktop",
"code": 59398,
"src": "elusive"
},
{
"uid": "3a3b33acd5fe66d84ff303baf9d8efa8",
"css": "align-left",
"code": 59399,
"src": "elusive"
},
{
"uid": "2a6cc3252195b53ed77ad3bdd73391b3",
"css": "indent-left",
"code": 59405,
"src": "elusive"
},
{
"uid": "c835a3a0692cca9dffde9a8a561da938",
"css": "off",
"code": 59409,
"src": "elusive"
},
{
"uid": "b622423405bcc984de6553e2f23c9fb6",
"css": "barcode",
"code": 59406,
"src": "elusive"
},
{
"uid": "08fcae555c22437a112411038ac28e16",
"css": "chart",
"code": 59401,
"src": "elusive"
},
{
"uid": "d9ca3bd7577f1110305a2ca1841826cb",
"css": "megaphone",
"code": 59414,
"src": "elusive"
},
{
"uid": "c053ebe321823b081483d332b06eee54",
"css": "gauge",
"code": 59395,
"src": "elusive"
},
{
"uid": "f978da58836f23373882916f05fb70b4",
"css": "doc",
"code": 59419,
"src": "linecons"
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,36 @@
.icon-money { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe819;&nbsp;'); }
.icon-exchange { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81a;&nbsp;'); }
.icon-wrench { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80f;&nbsp;'); }
.icon-user { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe804;&nbsp;'); }
.icon-doc { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81b;&nbsp;'); }
.icon-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe812;&nbsp;'); }
.icon-torso { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
.icon-th-large { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe808;&nbsp;'); }
.icon-star-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe821;&nbsp;'); }
.icon-desktop { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
.icon-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
.icon-record { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe822;&nbsp;'); }
.icon-plus { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80c;&nbsp;'); }
.icon-photo { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe815;&nbsp;'); }
.icon-pencil { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
.icon-ok { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80b;&nbsp;'); }
.icon-off { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe811;&nbsp;'); }
.icon-indent-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80d;&nbsp;'); }
.icon-forward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81d;&nbsp;'); }
.icon-fast-forward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe820;&nbsp;'); }
.icon-fast-backward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81f;&nbsp;'); }
.icon-gauge { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
.icon-backward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81e;&nbsp;'); }
.icon-right-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
.icon-left-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
.icon-bell { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe817;&nbsp;'); }
.icon-barcode { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80e;&nbsp;'); }
.icon-align-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
.icon-home { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe813;&nbsp;'); }
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe814;&nbsp;'); }
.icon-chart { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
.icon-cog { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe810;&nbsp;'); }
.icon-megaphone { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe816;&nbsp;'); }
.icon-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81c;&nbsp;'); }
.icon-dollar { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe818;&nbsp;'); }

View File

@ -0,0 +1,47 @@
[class^="icon-"], [class*=" icon-"] {
font-family: 'fontello';
font-style: normal;
font-weight: normal;
/* fix buttons height */
line-height: 1em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
}
.icon-money { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe819;&nbsp;'); }
.icon-exchange { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81a;&nbsp;'); }
.icon-wrench { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80f;&nbsp;'); }
.icon-user { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe804;&nbsp;'); }
.icon-doc { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81b;&nbsp;'); }
.icon-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe812;&nbsp;'); }
.icon-torso { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
.icon-th-large { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe808;&nbsp;'); }
.icon-star-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe821;&nbsp;'); }
.icon-desktop { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
.icon-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
.icon-record { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe822;&nbsp;'); }
.icon-plus { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80c;&nbsp;'); }
.icon-photo { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe815;&nbsp;'); }
.icon-pencil { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
.icon-ok { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80b;&nbsp;'); }
.icon-off { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe811;&nbsp;'); }
.icon-indent-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80d;&nbsp;'); }
.icon-forward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81d;&nbsp;'); }
.icon-fast-forward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe820;&nbsp;'); }
.icon-fast-backward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81f;&nbsp;'); }
.icon-gauge { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
.icon-backward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81e;&nbsp;'); }
.icon-right-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
.icon-left-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
.icon-bell { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe817;&nbsp;'); }
.icon-barcode { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80e;&nbsp;'); }
.icon-align-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
.icon-home { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe813;&nbsp;'); }
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe814;&nbsp;'); }
.icon-chart { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
.icon-cog { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe810;&nbsp;'); }
.icon-megaphone { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe816;&nbsp;'); }
.icon-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81c;&nbsp;'); }
.icon-dollar { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe818;&nbsp;'); }

View File

@ -0,0 +1,87 @@
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?11596946');
src: url('../font/fontello.eot?11596946#iefix') format('embedded-opentype'),
url('../font/fontello.woff?11596946') format('woff'),
url('../font/fontello.ttf?11596946') format('truetype'),
url('../font/fontello.svg?11596946#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?11596946#fontello') format('svg');
}
}
*/
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.icon-money:before { content: '\e819'; } /* '' */
.icon-exchange:before { content: '\e81a'; } /* '' */
.icon-wrench:before { content: '\e80f'; } /* '' */
.icon-user:before { content: '\e804'; } /* '' */
.icon-doc:before { content: '\e81b'; } /* '' */
.icon-trash:before { content: '\e812'; } /* '' */
.icon-torso:before { content: '\e805'; } /* '' */
.icon-th-large:before { content: '\e808'; } /* '' */
.icon-star-empty:before { content: '\e821'; } /* '' */
.icon-desktop:before { content: '\e806'; } /* '' */
.icon-cancel:before { content: '\e80a'; } /* '' */
.icon-record:before { content: '\e822'; } /* '' */
.icon-plus:before { content: '\e80c'; } /* '' */
.icon-photo:before { content: '\e815'; } /* '' */
.icon-pencil:before { content: '\e802'; } /* '' */
.icon-ok:before { content: '\e80b'; } /* '' */
.icon-off:before { content: '\e811'; } /* '' */
.icon-indent-left:before { content: '\e80d'; } /* '' */
.icon-forward:before { content: '\e81d'; } /* '' */
.icon-fast-forward:before { content: '\e820'; } /* '' */
.icon-fast-backward:before { content: '\e81f'; } /* '' */
.icon-gauge:before { content: '\e803'; } /* '' */
.icon-backward:before { content: '\e81e'; } /* '' */
.icon-right-open:before { content: '\e800'; } /* '' */
.icon-left-open:before { content: '\e801'; } /* '' */
.icon-bell:before { content: '\e817'; } /* '' */
.icon-barcode:before { content: '\e80e'; } /* '' */
.icon-align-left:before { content: '\e807'; } /* '' */
.icon-home:before { content: '\e813'; } /* '' */
.icon-mail:before { content: '\e814'; } /* '' */
.icon-chart:before { content: '\e809'; } /* '' */
.icon-cog:before { content: '\e810'; } /* '' */
.icon-megaphone:before { content: '\e816'; } /* '' */
.icon-login:before { content: '\e81c'; } /* '' */
.icon-dollar:before { content: '\e818'; } /* '' */

View File

@ -0,0 +1,43 @@
.quick_search {
text-align: center;
padding: 14px 0 0px 0;
}
.quick_search input[type=text] {
text-align: left;
height: 22px;
width: 88%;
color: #ccc;
padding-left: 2%;
padding-top: 5px;
background: #fff url(../images/icn_search.png) no-repeat;
background-position: 10px 6px;
}
.toggleLink {
display: inline;
float: none;
margin-left: 2%
}
html ul.tabs li.active, html ul.tabs li.active a:hover {
background: #ccc;
}
input[type=submit].btn_post_message {
background: url(../images/post_message.png) no-repeat;
}
fieldset input[type=text] {
margin-left: -10px;
}
fieldset select {
margin-left: -10px
}
fieldset textarea {
margin-left: -10px;
}

View File

@ -0,0 +1 @@
.jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em}.jqplot-axis{font-size:.75em}.jqplot-xaxis{margin-top:10px}.jqplot-x2axis{margin-bottom:10px}.jqplot-yaxis{margin-right:10px}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis,.jqplot-yMidAxis{margin-left:10px;margin-right:10px}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick,.jqplot-yMidAxis-tick{position:absolute;white-space:pre}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom}.jqplot-yaxis-tick{right:0;top:15px;text-align:right}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px 1px 5px;z-index:2;font-size:1.5em}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left}.jqplot-yMidAxis-tick{text-align:center;white-space:nowrap}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute}.jqplot-yMidAxis-label{font-size:11pt;position:absolute}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;margin-left:10px;position:absolute}.jqplot-meterGauge-tick{font-size:.75em;color:#999}.jqplot-meterGauge-label{font-size:1em;color:#999}table.jqplot-table-legend{margin-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em}td.jqplot-table-legend{vertical-align:middle}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{cursor:pointer}.jqplot-table-legend .jqplot-series-hidden{text-decoration:line-through}div.jqplot-table-legend-swatch-outline{border:1px solid #ccc;padding:1px}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-highlighter-tooltip,.jqplot-canvasOverlay-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-point-label{font-size:.75em;z-index:2}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em}.jqplot-error{text-align:center}.jqplot-error-message{position:relative;top:46%;display:inline-block}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%)}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,0.7)}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3)}

View File

@ -0,0 +1,839 @@
/* Essentials */
html, div, map, dt, isindex, form, header, aside, section, section, article, footer {
display: block;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
background: #F8F8F8;
font-size: 12px;
}
.clear {
clear: both;
}
.spacer {
height: 20px;
}
a:link, a:visited {
color: #77BACE;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* Header */
header#header {
height: 55px;
width: 100%;
background: #222222 url(../images/header_bg.png) repeat-x;
}
header#header h1.site_title, header#header h2.section_title {
float: left;
margin: 0;
font-size: 22px;
display: block;
width: 23%;
height: 55px;
font-weight: normal;
text-align: left;
text-indent: 1.8%;
line-height: 55px;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
header#header h1.site_title a {
color: #fff;
text-decoration: none;
}
header#header h2.section_title {
text-align: left;
text-indent: 4.5%;
text-transform: uppercase;
width: 68%;
background: url(../images/header_shadow.png) no-repeat left top;
}
.btn_view_site {
float: left;
width: 9%;
}
.btn_view_site a {
display: block;
margin-top: 12px;
width: 91px;
height: 27px;
background: url(../images/btn_view_site.png) no-repeat;
text-align: center;
line-height: 29px;
color: #fff;
text-decoration: none;
text-shadow: 0 -1px 0 #000;}
.btn_view_site a:hover {
background-position: 0 -27px;
}
/* Secondary Header Bar */
section#secondary_bar {
height: 38px;
width: 100%;
background: #F1F1F4 url(../images/secondary_bar.png) repeat-x;
}
section#secondary_bar .user {
float: left;
width: 12%;
height: 38px;
}
.user p {
margin: 0;
padding: 0;
color: #666666;
font-weight: bold;
display: block;
float: left;
width: 85%;
height: 35px;
line-height: 35px;
text-indent: 25px;
text-shadow: 0 1px 0 #fff;
margin-left: 6%;
}
.user a {
text-decoration: none;
color: #666666}
.user a:hover {
color: #77BACE;
}
.user a.logout_user {
float: left;
display: block;
width: 16px;
height: 35px;
text-indent: -5000px;
}
/* Breadcrumbs */
section#secondary_bar .breadcrumbs_container {
float: left;
width: 77%;
background: url(../images/secondary_bar_shadow.png) no-repeat left top;
height: 38px;
}
article.breadcrumbs {
float: left;
padding: 0 10px;
border: 1px solid #ccc;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 1px 0 #fff;
-moz-box-shadow: 0 1px 0 #fff;
box-shadow: 0 1px 0 #fff;
height: 23px;
margin: 4px 3%;
}
.breadcrumbs a {
display: inline-block;
float: left;
height: 24px;
line-height: 23px;
}
.breadcrumbs a.current, .breadcrumbs a.current:hover {
color: #9E9E9E;
font-weight: bold;
text-shadow: 0 1px 0 #fff;
text-decoration: none;
}
.breadcrumbs a:link, .breadcrumbs a:visited {
color: #44474F;
text-decoration: none;
text-shadow: 0 1px 0 #fff;
font-weight: bold;}
.breadcrumbs a:hover {
color: #222222;
}
.breadcrumb_divider {
display: inline-block;
width: 12px;
height: 24px;
background: url(../images/breadcrumb_divider.png) no-repeat;
float: left;
margin: 0 5px;
}
/* Sidebar */
aside#sidebar {
width: 12%;
background: #E0E0E3 url(../images/sidebar.png) repeat;
float: left;
min-height: 85%;
margin-top: -4px;
}
#sidebar hr {
border: none;
outline: none;
background: url(../images/sidebar_divider.png) repeat-x;
display: block;
width: 100%;
height: 2px;}
/* Search */
.quick_search {
text-align: center;
padding: 14px 0 10px 0;
}
.quick_search input[type=text] {
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
border: 1px solid #bbb;
height: 26px;
width: 90%;
color: #ccc;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
text-indent: 30px;
background: #fff url(../images/icn_search.png) no-repeat;
background-position: 10px 6px;
}
.quick_search input[type=text]:focus {
outline: none;
color: #666666;
border: 1px solid #77BACE;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
}
/* Sidebar Menu */
#sidebar h3 {
color: #1F1F20;
text-transform: uppercase;
text-shadow: 0 1px 0 #fff;
font-size: 13px;
margin: 10px 0 10px 6%;
display: block;
float: left;
width: 90%;
}
.toggleLink {
color: #999999;
font-size: 10px;
text-decoration: none;
display: block;
float: right;
margin-right: 2%
}
#sidebar .toggleLink:hover {
color: #77BACE;
text-decoration: none;
}
#sidebar ul {
clear: both;
margin: 0; padding: 0;
}
#sidebar li {
list-style: none;
margin: 0 0 0 12%; padding: 0;
}
#sidebar li a {
color: #666666;
padding-left: 12px;
text-decoration: none;
display: inline-block;
height: 17px;
line-height: 17px;
text-shadow: 0 1px 0 #fff;
margin: 2px 0;
}
#sidebar li a:hover {
color: #444444;
}
#sidebar p {
color: #666666;
padding-left: 6%;
text-shadow: 0 1px 0 #fff;
margin: 10px 0 0 0;}
#sidebar a {
color: #666666;
text-decoration: none;
}
#sidebar a:hover {
text-decoration: underline;
}
#sidebar footer {
margin-top: 20%;
}
/* Main Content */
section#main {
background: url("../images/sidebar_shadow.png") repeat-y scroll left top transparent;
float: left;
margin-top: -2px;
min-height: 85%;
width: 88%;
}
#main h3 {
color: #1F1F20;
text-transform: uppercase;
text-shadow: 0 1px 0 #fff;
font-size: 13px;
margin: 8px 20px;
}
/* Modules */
.module {
border: 1px solid #9BA0AF;
width: 100%;
margin: 20px 3% 0 3%;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #ffffff;
}
#main .module header h3 {
display: block;
width: 60%;
float: left;
}
.module header {
height: 38px;
width: 100%;
background: #F1F1F4 url(../images/secondary_bar.png) repeat-x;
-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
border-top-left-radius: 5px; border-top-right-radius: 5px;
}
.module footer {
height: 32px;
width: 100%;
border-top: 1px solid #9CA1B0;
background: #F1F1F4 url(../images/module_footer_bg.png) repeat-x;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px;
-moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomright: 5px;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px;
}
.module_content {
margin: 10px 20px;
color: #666;}
/* Module Widths */
.width_full {
width: 95%;
margin: 20px 0px 10px 30px;
float: left;
}
.width_half {
width: 46%;
margin: 20px 0px 10px 30px;
float: left;
}
.width_quarter {
width: 26%;
margin: 20px 0px 10px 30px;
float: left;
}
.width_3_quarter {
width: 66%;
margin: 20px 0px 10px 30px;
float: left;
}
/* Stats Module */
.stats_graph {
width: 64%;
float: left;
}
.stats_overview {
background: #F6F6F6;
border: 1px solid #ccc;
float: right;
width: 26%;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.overview_today, .overview_previous {
width: 50%;
float: left;}
.stats_overview p {
margin: 0; padding: 0;
text-align: center;
text-transform: uppercase;
text-shadow: 0 1px 0 #fff;
}
.stats_overview p.overview_day {
font-size: 12px;
font-weight: bold;
margin: 6px 0;
}
.stats_overview p.overview_count {
font-size: 26px;
font-weight: bold;
color: #333333;}
.stats_overview p.overview_type {
font-size: 10px;
color: #999999;
margin-bottom: 8px}
/* Content Manager */
.tablesorter, .tablesorterpager {
width: 100%;
margin: -5px 0 0 0;
}
.tablesorter td, .tablesorterpager td{
margin: 0;
padding: 0;
border-bottom: 1px dotted #ccc;
}
.tablesorter thead tr, .tablesorterpager thead tr {
height: 34px;
background: url(../images/table_sorter_header.png) repeat-x;
text-align: left;
text-indent: 10px;
cursor: pointer;
}
.tablesorter td , .tablesorterpager td {
padding: 15px 10px;
}
.tablesorter input[type=image], .tablesorterpager input[type=image] {
margin-right: 10px;}
ul.tabs {
margin: 3px 10px 0 0;
padding: 0;
float: right;
list-style: none;
height: 24px; /*--Set height of tabs--*/
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 1px 0 #fff;
-moz-box-shadow: 0 1px 0 #fff;
box-shadow: 0 1px 0 #fff;
border: 1px solid #ccc;
font-weight: bold;
text-shadow: 0 1px 0 #fff;
}
ul.tabs li {
float: left;
margin: 0;
padding: 0;
line-height: 24px;
}
ul.tabs li a {
text-decoration: none;
color: #999;
display: block;
padding: 0 10px;
height: 24px;
}
ul.tabs li a:hover {
color: #44474F;
}
html ul.tabs li.active a {
color: #44474F;
}
html ul.tabs li.active, html ul.tabs li.active a:hover {
background: #F1F2F4;
-webkit-box-shadow: inset 0 2px 3px #818181;
-moz-box-shadow: inset 0 2px 3px #818181;
box-shadow: inset 0 2px 3px #818181;
}
html ul.tabs li:first-child, html ul.tabs li:first-child a {
-webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px;
-moz-border-radius-topleft: 5px; -moz-border-radius-bottomleft: 5px;
border-top-left-radius: 5px; border-bottom-left-radius: 5px;
}
html ul.tabs li:last-child, html ul.tabs li:last-child a {
-webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 5px;
-moz-border-radius-topright: 5px; -moz-border-radius-bottomright: 5px;
border-top-right-radius: 5px; border-bottom-right-radius: 5px;
}
#main .module header h3.tabs_involved {
display: block;
width: 60%;
float: left;
}
/* Messages */
.message {
border-bottom: 1px dotted #cccccc;
}
input[type=submit] {
background: #D0D1D4 url(../images/btn_submit.png) repeat-x;
border: 1px solid #A8A9A8;
-webkit-box-shadow: 0 1px 0 #fff;
-moz-box-shadow: 0 1px 0 #fff;
box-shadow: 0 1px 0 #fff;
font-weight: bold;
height: 22px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
padding: 0 10px;
color: #666;
text-shadow: 0 1px 0 #fff;
cursor: pointer;
}
input[type=submit]:hover {
color: #333333;
}
input[type=submit].alt_btn {
background: #D0D1D4 url(../images/btn_submit_2.png) repeat-x;
border: 1px solid#30B0C8;
-webkit-box-shadow: 0 1px 0 #fff;
-moz-box-shadow: 0 1px 0 #fff;
box-shadow: 0 1px 0 #fff;
font-weight: bold;
height: 22px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
padding: 0 10px;
color: #003E49;
text-shadow: 0 1px 0 #6CDCF9;
cursor: pointer;
}
input[type=submit].alt_btn:hover {
color: #001217;
}
input[type=submit].btn_post_message {
background: #D0D1D4 url(../images/post_message.png) no-repeat;
display: block;
width: 37px;
border: none;
height: 24px;
cursor: pointer;
text-indent: -5000px;
}
input[type=submit].btn_post_message:hover {
background-position: 0 -24px;
}
.post_message {
text-align: left;
padding: 5px 0;
}
.post_message input[type=text] {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #bbb;
height: 20px;
width: 70%;
color: #ccc;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
text-indent: 10px;
background-position: 10px 6px;
float: left;
margin: 0 3.5%;
}
.post_message input[type=text]:focus {
outline: none;
border: 1px solid #77BACE;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
color: #666666;
}
.post_message input[type=image] {
float: left;
}
.message_list {
height: 250px;
overflow-x:hidden;
overflow-y: scroll;
}
/* New/Edit Article Module */
fieldset {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #F6F6F6;
border: 1px solid #ccc;
padding: 1% 0%;
margin: 10px 0;
}
fieldset label {
display: block;
float: left;
width: 200px;
height: 25px;
line-height: 25px;
text-shadow: 0 1px 0 #fff;
font-weight: bold;
padding-left: 10px;
margin: -5px 0 5px 0;
text-transform: uppercase;
}
fieldset input[type=text], fieldset input[type=password] {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #BBBBBB;
height: 20px;
color: #666666;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
padding-left: 10px;
background-position: 10px 6px;
margin: 0;
display: block;
float: left;
width: 92%;
margin: 0 10px;
}
fieldset input[type=text]:focus, fieldset input[type=password]:focus, fieldset input[type=checkbox] {
outline: none;
border: 1px solid #77BACE;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
}
fieldset select {
width: 96%;
margin: 0 10px;
border: 1px solid #bbb;
height: 20px;
color: #666666;
}
fieldset textarea {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #BBBBBB;
color: #666666;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;
padding-left: 10px;
background-position: 10px 6px;
margin: 0 0.5%;
display: block;
float: left;
width: 92%;
margin: 0 10px;
}
fieldset textarea:focus {
outline: none;
border: 1px solid #77BACE;
-webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
-moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6;
}
.submit_link {
float: right;
margin-right: 3%;
padding: 5px 0;
}
.submit_link select {
width: 150px;
border: 1px solid #bbb;
height: 20px;
color: #666666;
}
#main .module_content h1 {
color: #333333;
text-transform: none;
text-shadow: 0 1px 0 #fff;
font-size: 22px;
margin: 8px 0px;
}
#main .module_content h2 {
color: #444444;
text-transform: none;
text-shadow: 0 1px 0 #fff;
font-size: 18px;
margin: 8px 0px;
}
#main .module_content h3 {
color: #666666;
text-transform: uppercase;
text-shadow: 0 1px 0 #fff;
font-size: 13px;
margin: 8px 0px;
}
#main .module_content h4 {
color: #666666;
text-transform: none;
text-shadow: 0 1px 0 #fff;
font-size: 13px;
margin: 8px 0px;
}
#main .module_content li {
line-height: 150%;
}
/* Alerts */
#main h4.info {
display: block;
width: 95%;
margin: 20px 3% 0 3%;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #B5E5EF url(../images/icn_alert_info.png) no-repeat;
background-position: 10px 10px;
border: 1px solid #77BACE;
color: #082B33;
padding: 10px 0;
text-indent: 40px;
font-size: 14px;}
#main h4.warning {
display: block;
width: 95%;
margin: 20px 3% 0 3%;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #F5F3BA url(../images/icn_alert_warning.png) no-repeat;
background-position: 10px 10px;
border: 1px solid #C7A20D;
color: #796616;
padding: 10px 0;
text-indent: 40px;
font-size: 14px;}
#main h4.errormsg {
display: block;
width: 95%;
margin: 20px 3% 0 3%;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #F3D9D9 url(../images/icn_alert_error.png) no-repeat;
background-position: 10px 10px;
border: 1px solid #D20009;
color: #7B040F;
padding: 10px 0;
text-indent: 40px;
font-size: 14px;}
#main h4.success {
display: block;
width: 95%;
margin: 20px 3% 0 3%;
margin-top: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #E2F6C5 url(../images/icn_alert_success.png) no-repeat;
background-position: 10px 10px;
border: 1px solid #79C20D;
color: #32510F;
padding: 10px 0;
text-indent: 40px;
font-size: 14px;}

View File

@ -0,0 +1,47 @@
/*plugin styles*/
.visualize { border: 1px solid #bbb; position: relative; background: #fbfbfb; margin: 20px auto 40px auto; z-index: 1; }
.visualize canvas { position: absolute; }
.visualize ul, .visualize ul li { margin: 0; padding: 0; background: none; }
.visualize-bar { border-top: 0; }
/*table title, key elements*/
.visualize .visualize-info { padding: 0 0 2px 8px; background: #fafafa; border: 1px solid #aaa; position: absolute; top: -15px; right: 10px; font-size: 11px; }
.visualize .visualize-title { display: block; color: #333; margin-bottom: 3px; }
.visualize ul.visualize-key { list-style: none; }
.visualize ul.visualize-key li { list-style: none; float: left; margin-right: 10px; padding-left: 10px; position: relative;}
.visualize ul.visualize-key .visualize-key-color { width: 6px; height: 6px; left: 0; position: absolute; top: 50%; margin-top: -3px; font-size: 6px; }
.visualize ul.visualize-key .visualize-key-label { color: #333; }
/*pie labels*/
.visualize-pie .visualize-labels { list-style: none; }
.visualize-pie .visualize-label-pos, .visualize-pie .visualize-label { position: absolute; margin: 0; padding:0; }
.visualize-pie .visualize-label { display: block; color: #fff; font-weight: bold; font-size: 1em; }
.visualize-pie-outside .visualize-label { color: #000; font-weight: normal; }
/*line,bar, area labels*/
.visualize-labels-x,.visualize-labels-y { position: absolute; left: 0; top: 0; list-style: none; }
.visualize-labels-x li, .visualize-labels-y li { position: absolute; bottom: 0; }
.visualize-labels-x li span.label, .visualize-labels-y li span.label { position: absolute; color: #555; }
.visualize-labels-x li span.line, .visualize-labels-y li span.line { position: absolute; border: 0 solid #ccc; }
.visualize-labels-x li { height: 100%; font-size: 10px; }
.visualize-labels-x li span.label { top: 100%; margin-top: 15px; left:-10; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); }
.visualize-labels-x li span.line { border-left-width: 1px; height: 100%; display: block; }
.visualize-labels-x li span.line { border: 0;} /*hide vertical lines on area, line, bar*/
.visualize-labels-y li { width: 100%; font-size: 11px; line-height: normal; }
.visualize-labels-y li span.label { right: 100%; margin-right: 5px; display: block; width: 100px; text-align: right; }
.visualize-labels-y li span.line { border-top-width: 1px; width: 100%; }
.visualize-bar .visualize-labels-x li span.label { width: 100%; text-align: center; }
/*tooltips*/
.visualize .chart_tooltip {
padding: 6px 7px;
background: #000;
background: url(../images/mbg.png) 0 0 repeat;
margin: 3px 4px 0;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
color: #ddd;
font-size: 10px;
line-height: normal;
}

Binary file not shown.

View File

@ -0,0 +1,46 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2012 by original authors @ fontello.com</metadata>
<defs>
<font id="fontello" horiz-adv-x="1000" >
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="money" unicode="&#xe819;" d="M238 378c14 16 35 21 65 24l0-85c-50 5-75 9-75 39 0 8 3 15 10 23z m108-241l0 91c59-5 78-9 78-35 0-30-24-49-78-56z m70 244c30-16 36-24 36-38l8-4 45 90-6 5c-6-5-10-8-14-8s-8 0-13 4c-61 24-90 35-126 35l0 18c0 9 5 15 20 19l0 9-79 0 0-9c14-4 16-11 16-19l0-15c-96-4-153-50-153-123 0-74 40-100 153-110l0-96c-78 8-116 38-116 64l-8 4-41-94 6-4c6 4 9 5 13 5 1 0 6 0 9-3 48-24 94-38 138-40l0-19c0-10-3-16-16-20l0-9 79 0 0 9c-15 4-20 9-20 20l0 19c96 5 159 54 159 126 0 70-53 106-149 115l-10 0 0 88c23-1 46-8 70-20z m41 181c116-50 198-165 198-300 0-181-146-328-326-328-181 0-328 146-328 328 0 135 81 250 198 300l-81 179c0 18 11 25 28 25l366 0c16 0 28-6 28-25z" horiz-adv-x="654" />
<glyph glyph-name="exchange" unicode="&#xe81a;" d="M911 127l-670 0 0-111-223 168 223 167 0-112 670 0 0-112z m-893 335l0 112 670 0 0 111 223-166-223-168 0 111-670 0z" horiz-adv-x="928" />
<glyph glyph-name="wrench" unicode="&#xe80f;" d="M0 21l463 463q-25 68-10 145t72 134 133 72 146-10l-162-162 45-117 115-45 164 164q25-70 9-147t-72-133-133-72-147 9l-463-463z m113-2q0-20 14-33t33-14 33 14 14 33-14 33-33 14-33-14-14-33z" horiz-adv-x="982" />
<glyph glyph-name="user" unicode="&#xe804;" d="M0-150l0 156q0 23 58 58t159 71q100 35 137 72t37 102q0 29-26 72t-32 59q-12 35-29 135-10 53-14 94-2 21 6 50t28 60 66 52 110 21 110-21 66-52 28-60 6-50q-4-41-14-94-18-100-29-135-6-16-32-59t-26-72q0-64 37-102t137-72q217-80 217-129l0-156-1000 0z" horiz-adv-x="1000" />
<glyph glyph-name="doc" unicode="&#xe81b;" d="M0-25l0 625q0 39 27 66t66 27l31 0 0 62q0 39 27 66t66 27l687 0q39 0 66-27t27-66l0-781q0-53-36-89t-89-36l-750 0q-53 0-89 36t-36 89z m62 0q0-25 19-44t44-19l750 0q25 0 44 19t19 44l0 781q0 14-9 22t-22 9l-687 0q-14 0-22-9t-9-22l0-750q0-14-9-22t-22-9-22 9-9 22l0 625-31 0q-14 0-22-9t-9-22l0-625z m187 16q0 16 16 16l250 0q16 0 16-16t-16-16l-250 0q-16 0-16 16z m0 94q0 16 16 16l250 0q16 0 16-16t-16-16l-250 0q-16 0-16 16z m0 94q0 16 16 16l250 0q16 0 16-16 0-6-5-11t-11-5l-250 0q-16 0-16 16z m0 94q0 16 16 16l594 0q16 0 16-16t-16-16l-594 0q-16 0-16 16z m0 94q0 16 16 16l594 0q16 0 16-16t-16-16l-594 0q-16 0-16 16z m0 109l0 219q0 14 9 22t22 9l219 0q14 0 22-9t9-22l0-219q0-14-9-22t-22-9l-219 0q-14 0-22 9t-9 22z m62 31l156 0 0 156-156 0 0-156z m281-516q0 16 16 16l250 0q16 0 16-16t-16-16l-250 0q-16 0-16 16z m0 94q0 16 16 16l250 0q16 0 16-16t-16-16l-250 0q-16 0-16 16z m0 94q0 16 16 16l250 0q16 0 16-16 0-6-5-11t-11-5l-250 0q-16 0-16 16z m0 281q0 16 16 16l250 0q16 0 16-16t-16-16l-250 0q-16 0-16 16z m0 94q0 16 16 16l250 0q16 0 16-16t-16-16l-250 0q-16 0-16 16z m0 94q0 16 16 16l250 0q16 0 16-16t-16-16l-250 0q-16 0-16 16z" horiz-adv-x="1000" />
<glyph glyph-name="trash" unicode="&#xe812;" d="M0 633l0 141 289 0 0 76 246 0 0-76 289 0 0-141-824 0z m43-783l0 676 738 0 0-676-738 0z" horiz-adv-x="824" />
<glyph glyph-name="torso" unicode="&#xe805;" d="M0-150l0 357 338 145q-61 37-92 101t-31 134q0 104 64 184t162 80q102-4 164-83t62-181q-2-74-33-137t-86-98l334-145 0-357-883 0z" horiz-adv-x="883" />
<glyph glyph-name="th-large" unicode="&#xe808;" d="M0-150l0 437 437 0 0-437-437 0z m0 562l0 437 437 0 0-437-437 0z m562-562l0 437 437 0 0-437-437 0z m0 562l0 437 437 0 0-437-437 0z" horiz-adv-x="1000" />
<glyph glyph-name="star-empty" unicode="&#xe821;" d="M0 471l94 0 285-2 96 270 29 90 29-92 88-271 285-6 94-2-76-55-232-166 82-273 27-92-76 57-230 168-232-162-78-53 29 90 90 270-227 174z m189-64l168-129 20-14-8-21-66-203 176 123 18 12 18-14 172-125-61 203-6 21 18 14 174 125-215 4-21 2-8 21-64 201-70-199-8-21-234 0z" horiz-adv-x="1000" />
<glyph glyph-name="desktop" unicode="&#xe806;" d="M0 104l0 660 1000 0 0-660-363 0 0-96 88 0 0-72-449 0 0 72 88 0 0 96-363 0z m123 125l754 0 0 410-754 0 0-410z" horiz-adv-x="1000" />
<glyph glyph-name="cancel" unicode="&#xe80a;" d="M0 71l279 279-279 279 221 221 279-279 279 279 221-221-279-279 279-279-221-221-279 279-279-279z" horiz-adv-x="1000" />
<glyph glyph-name="record" unicode="&#xe822;" d="M0 350q0 207 146 353t353 146 353-146 146-353-146-353-353-146-353 146-146 353z m250 0q0-104 73-177t177-73 177 73 73 177-73 177-177 73-177-73-73-177z" horiz-adv-x="1000" />
<glyph glyph-name="plus" unicode="&#xe80c;" d="M0 209l0 281 359 0 0 359 281 0 0-359 359 0 0-281-359 0 0-359-281 0 0 359-359 0z" horiz-adv-x="1000" />
<glyph glyph-name="photo" unicode="&#xe815;" d="M0-125l0 949 1000 0 0-949-1000 0z m123 309l754 0 0 521-754 0 0-521z" horiz-adv-x="1000" />
<glyph glyph-name="pencil" unicode="&#xe802;" d="M0-143l68 344 273-273z m137 393l422 422 260-260-422-422z m531 494q2 39 31 68t68 31 66-25l131-131q25-25 24-65t-30-69-69-30-65 24l-131 131q-27 27-25 66z" horiz-adv-x="989" />
<glyph glyph-name="ok" unicode="&#xe80b;" d="M0 260l162 162 166-164 508 510 164-164-510-510-162-162-162 164z" horiz-adv-x="1000" />
<glyph glyph-name="off" unicode="&#xe811;" d="M0 350q0 207 146 353l102-102q-105-104-105-252t104-253 253-104 253 104 104 253-105 252l102 102q146-146 146-353t-146-353-353-146-353 146-146 353z m428-78l0 578 145 0 0-578-145 0z" horiz-adv-x="1000" />
<glyph glyph-name="indent-left" unicode="&#xe80d;" d="M0-66l0 146 1000 0 0-146-1000 0z m0 229l0 375 281-187z m0 457l0 146 1000 0 0-146-1000 0z m422-457l0 146 578 0 0-146-578 0z m0 229l0 146 578 0 0-146-578 0z" horiz-adv-x="1000" />
<glyph glyph-name="forward" unicode="&#xe81d;" d="M0 6l0 687 312-312 0 312 344-344-344-344 0 312z" horiz-adv-x="656" />
<glyph glyph-name="fast-forward" unicode="&#xe820;" d="M0 6l0 687 312-312 0 312 312-312 0 344 125 0 0-750-125 0 0 344-312-312 0 312z" horiz-adv-x="750" />
<glyph glyph-name="fast-backward" unicode="&#xe81f;" d="M0-25l0 750 125 0 0-344 312 312 0-312 312 312 0-687-312 312 0-312-312 312 0-344-125 0z" horiz-adv-x="750" />
<glyph glyph-name="gauge" unicode="&#xe803;" d="M0 188q0 207 146 353t353 146 353-146 146-353q0-92-31-176l-137 0q43 82 43 176 0 154-109 265t-266 110-266-110-109-265q0-94 43-176l-137 0q-31 84-31 176z m250 180q0 25 19 44t44 19 44-19 19-44-19-44-44-19-44 19-19 44z m187 61q0 25 19 44t44 19 44-19 19-44-19-44-44-19-44 19-19 44z m14-416l0 49 49 246 49-246 0-49-98 0z m174 355q0 25 19 44t44 19 44-19 19-44-19-44-44-19-44 19-19 44z" horiz-adv-x="1000" />
<glyph glyph-name="backward" unicode="&#xe81e;" d="M0 350l344 344 0-312 312 312 0-687-312 312 0-312z" horiz-adv-x="656" />
<glyph glyph-name="right-open" unicode="&#xe800;" d="M0-2l352 352-352 352 148 148 352-352 148-148-148-148-352-352z" horiz-adv-x="648" />
<glyph glyph-name="left-open" unicode="&#xe801;" d="M0 350l148 148 352 352 148-148-352-352 352-352-148-148-352 352z" horiz-adv-x="648" />
<glyph glyph-name="bell" unicode="&#xe817;" d="M0 10l0 45 197 170 0 266q0 107 67 190t171 104l0 62 131 0 0-62q102-21 170-104t68-190l0-266 195-170 0-45-1000 0z m428-87q0 30 21 52t52 21 52-21 21-52-21-51-52-21-52 21-21 51z" horiz-adv-x="1000" />
<glyph glyph-name="barcode" unicode="&#xe80e;" d="M0-82l0 863 84 0 0-863-84 0z m123 0l0 863 20 0 0-863-20 0z m70 0l0 863 62 0 0-863-62 0z m92 0l0 863 27 0 0-863-27 0z m104 0l0 863 41 0 0-863-41 0z m57 0l0 863 18 0 0-863-18 0z m61 0l0 863 20 0 0-863-20 0z m45 0l0 863 82 0 0-863-82 0z m111 0l0 863 43 0 0-863-43 0z m102 0l0 863 10 0 0-863-10 0z m25 0l0 863 27 0 0-863-27 0z m68 0l0 863 20 0 0-863-20 0z m61 0l0 863 82 0 0-863-82 0z" horiz-adv-x="1000" />
<glyph glyph-name="align-left" unicode="&#xe807;" d="M0-89l0 156 1000 0 0-156-1000 0z m0 240l0 156 609 0 0-156-609 0z m0 242l0 156 789 0 0-156-789 0z m0 240l0 156 516 0 0-156-516 0z" horiz-adv-x="1000" />
<glyph glyph-name="home" unicode="&#xe813;" d="M0-150l0 648 453 352 453-352 0-648-312 0 0 391-281 0 0-391-312 0z" horiz-adv-x="906" />
<glyph glyph-name="mail" unicode="&#xe814;" d="M0-29l324 342 176-100 176 100 324-342-1000 0z m0 113l0 414 254-146z m0 504l0 141 1000 0 0-141-500-285z m746-236l254 146 0-414z" horiz-adv-x="1000" />
<glyph glyph-name="chart" unicode="&#xe809;" d="M0-29l0 758 1000 0 0-758-1000 0z m123 123l754 0 0 512-754 0 0-512z m27 162l125 104 35 29 31-33 43-47 105 166 47 72 39-78 61-125 127 223 86-49-176-305-45-80-41 84-62 131-92-143-33-53-43 45-55 57-90-74z" horiz-adv-x="1000" />
<glyph glyph-name="cog" unicode="&#xe810;" d="M0 272l0 156 150 16q14 45 37 88l-96 117 109 109 117-96q41 23 88 37l16 150 156 0 16-150q45-14 88-37l117 96 109-109-96-117q23-43 37-88l150-16 0-156-150-16q-14-47-37-88l96-117-109-109-117 96q-43-23-88-37l-16-150-156 0-16 150q-47 14-88 37l-117-96-109 109 96 117q-23 41-37 88z m355 78q0-61 42-103t103-42 103 42 42 103-42 103-103 42-103-42-42-103z" horiz-adv-x="1000" />
<glyph glyph-name="megaphone" unicode="&#xe816;" d="M0 344l0 123q2 35 26 60t58 24l270 0q139 8 272 64t229 152q35-2 59-26t23-58l0-199q27-8 45-30t18-50q-2-29-19-51t-44-27l0-201q-2-35-26-59t-56-23q-207 184-449 211-66-33-54-127t77-143q-27-47-96-52t-105 30q-16 45-24 75t-17 71-7 78 11 72l-107 0q-35 2-60 26t-24 58z m437-10q240-45 420-184l0 508q-203-150-420-182l0-143z" horiz-adv-x="1000" />
<glyph glyph-name="login" unicode="&#xe81c;" d="M800 800q42 0 71-29t29-71l0-700q0-40-29-70t-71-30l-450 0q-40 0-69 30t-29 70l0 100 98 0 0-100 450 0 0 700-450 0 0-150-98 0 0 150q0 42 29 71t69 29l450 0z m-350-670l0 120-450 0 0 150 450 0 0 120 200-194z" horiz-adv-x="900" />
<glyph glyph-name="dollar" unicode="&#xe818;" d="M546 189q0-85-56-147t-144-76l0-98q0-8-5-13t-13-5l-75 0q-7 0-13 5t-5 13l0 98q-37 5-71 17t-57 25-41 27-26 21-10 10q-9 12-1 23l57 75q4 6 13 7 8 1 13-5l1-1q63-55 136-70 21-4 41-4 45 0 80 24t34 68q0 16-8 30t-19 23-33 21-37 18-45 18q-22 9-34 14t-34 15-35 17-32 20-30 24-24 27-20 32-12 37-5 44q0 77 55 135t142 75l0 100q0 7 5 13t13 5l75 0q8 0 13-5t5-13l0-98q32-3 62-13t49-19 35-21 22-16 8-8q9-10 3-21l-45-81q-4-8-13-9-8-2-15 4-2 2-8 7t-22 15-33 18-42 15-48 6q-53 0-86-24t-33-62q0-15 5-27t16-23 22-18 31-17 34-15 39-15q30-11 45-18t42-20 42-24 35-28 30-35 18-43 7-52z" horiz-adv-x="571.429" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

View File

@ -0,0 +1,55 @@
$(document).ready(function() {
$(".tablesorter").tablesorter();
$(".tablesorterpager").tablesorter().tablesorterPager({positionFixed: false, container: $("#pager"), cssNext: ".icon-forward", cssPrev: ".icon-backward", cssFirst: ".icon-fast-backward", cssLast: ".icon-fast-forward"});
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content
$(activeTab).find('.visualize').trigger('visualizeRefresh');
return false;
});
$('table.visualize').each(function () {
if ($(this).attr('rel')) {
var statsType = $(this).attr('rel');
} else {
var statsType = 'area';
}
// hack to statically set width as something is broken with div width calculation - anni
var chart_width = $(document).width() - 500;
if (statsType == 'line' || statsType == 'pie') {
$(this).hide().visualize({
type: statsType,
// 'bar', 'area', 'pie', 'line'
width: chart_width,
height: '240px',
colors: ['#6fb9e8', '#ec8526', '#9dc453', '#ddd74c'],
lineDots: 'double',
interaction: true,
multiHover: 5,
tooltip: true,
tooltiphtml: function (data) {
var html = '';
for (var i = 0; i < data.point.length; i++) {
html += '<p class="chart_tooltip"><strong>' + data.point[i].value + '</strong> ' + data.point[i].yLabels[0] + '</p>';
}
return html;
}
});
} else {
$(this).hide().visualize({
// 'bar', 'area', 'pie', 'line'
width: chart_width,
type: statsType,
height: '240px',
colors: ['#6fb9e8', '#ec8526', '#9dc453', '#ddd74c']
});
}
});
});

View File

@ -0,0 +1,36 @@
// 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.
document.createElement("canvas").getContext||(function(){var s=Math,j=s.round,F=s.sin,G=s.cos,V=s.abs,W=s.sqrt,k=10,v=k/2;function X(){return this.context_||(this.context_=new H(this))}var L=Array.prototype.slice;function Y(b,a){var c=L.call(arguments,2);return function(){return b.apply(a,c.concat(L.call(arguments)))}}var M={init:function(b){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var a=b||document;a.createElement("canvas");a.attachEvent("onreadystatechange",Y(this.init_,this,a))}},init_:function(b){b.namespaces.g_vml_||
b.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");b.namespaces.g_o_||b.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!b.styleSheets.ex_canvas_){var a=b.createStyleSheet();a.owningElement.id="ex_canvas_";a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var c=b.getElementsByTagName("canvas"),d=0;for(;d<c.length;d++)this.initElement(c[d])},
initElement:function(b){if(!b.getContext){b.getContext=X;b.innerHTML="";b.attachEvent("onpropertychange",Z);b.attachEvent("onresize",$);var a=b.attributes;if(a.width&&a.width.specified)b.style.width=a.width.nodeValue+"px";else b.width=b.clientWidth;if(a.height&&a.height.specified)b.style.height=a.height.nodeValue+"px";else b.height=b.clientHeight}return b}};function Z(b){var a=b.srcElement;switch(b.propertyName){case "width":a.style.width=a.attributes.width.nodeValue+"px";a.getContext().clearRect();
break;case "height":a.style.height=a.attributes.height.nodeValue+"px";a.getContext().clearRect();break}}function $(b){var a=b.srcElement;if(a.firstChild){a.firstChild.style.width=a.clientWidth+"px";a.firstChild.style.height=a.clientHeight+"px"}}M.init();var N=[],B=0;for(;B<16;B++){var C=0;for(;C<16;C++)N[B*16+C]=B.toString(16)+C.toString(16)}function I(){return[[1,0,0],[0,1,0],[0,0,1]]}function y(b,a){var c=I(),d=0;for(;d<3;d++){var f=0;for(;f<3;f++){var h=0,g=0;for(;g<3;g++)h+=b[d][g]*a[g][f];c[d][f]=
h}}return c}function O(b,a){a.fillStyle=b.fillStyle;a.lineCap=b.lineCap;a.lineJoin=b.lineJoin;a.lineWidth=b.lineWidth;a.miterLimit=b.miterLimit;a.shadowBlur=b.shadowBlur;a.shadowColor=b.shadowColor;a.shadowOffsetX=b.shadowOffsetX;a.shadowOffsetY=b.shadowOffsetY;a.strokeStyle=b.strokeStyle;a.globalAlpha=b.globalAlpha;a.arcScaleX_=b.arcScaleX_;a.arcScaleY_=b.arcScaleY_;a.lineScale_=b.lineScale_}function P(b){var a,c=1;b=String(b);if(b.substring(0,3)=="rgb"){var d=b.indexOf("(",3),f=b.indexOf(")",d+
1),h=b.substring(d+1,f).split(",");a="#";var g=0;for(;g<3;g++)a+=N[Number(h[g])];if(h.length==4&&b.substr(3,1)=="a")c=h[3]}else a=b;return{color:a,alpha:c}}function aa(b){switch(b){case "butt":return"flat";case "round":return"round";case "square":default:return"square"}}function H(b){this.m_=I();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=k*1;this.globalAlpha=1;this.canvas=b;
var a=b.ownerDocument.createElement("div");a.style.width=b.clientWidth+"px";a.style.height=b.clientHeight+"px";a.style.overflow="hidden";a.style.position="absolute";b.appendChild(a);this.element_=a;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}var i=H.prototype;i.clearRect=function(){this.element_.innerHTML=""};i.beginPath=function(){this.currentPath_=[]};i.moveTo=function(b,a){var c=this.getCoords_(b,a);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};
i.lineTo=function(b,a){var c=this.getCoords_(b,a);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};i.bezierCurveTo=function(b,a,c,d,f,h){var g=this.getCoords_(f,h),l=this.getCoords_(b,a),e=this.getCoords_(c,d);Q(this,l,e,g)};function Q(b,a,c,d){b.currentPath_.push({type:"bezierCurveTo",cp1x:a.x,cp1y:a.y,cp2x:c.x,cp2y:c.y,x:d.x,y:d.y});b.currentX_=d.x;b.currentY_=d.y}i.quadraticCurveTo=function(b,a,c,d){var f=this.getCoords_(b,a),h=this.getCoords_(c,d),g={x:this.currentX_+
0.6666666666666666*(f.x-this.currentX_),y:this.currentY_+0.6666666666666666*(f.y-this.currentY_)};Q(this,g,{x:g.x+(h.x-this.currentX_)/3,y:g.y+(h.y-this.currentY_)/3},h)};i.arc=function(b,a,c,d,f,h){c*=k;var g=h?"at":"wa",l=b+G(d)*c-v,e=a+F(d)*c-v,m=b+G(f)*c-v,r=a+F(f)*c-v;if(l==m&&!h)l+=0.125;var n=this.getCoords_(b,a),o=this.getCoords_(l,e),q=this.getCoords_(m,r);this.currentPath_.push({type:g,x:n.x,y:n.y,radius:c,xStart:o.x,yStart:o.y,xEnd:q.x,yEnd:q.y})};i.rect=function(b,a,c,d){this.moveTo(b,
a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath()};i.strokeRect=function(b,a,c,d){var f=this.currentPath_;this.beginPath();this.moveTo(b,a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath();this.stroke();this.currentPath_=f};i.fillRect=function(b,a,c,d){var f=this.currentPath_;this.beginPath();this.moveTo(b,a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath();this.fill();this.currentPath_=f};i.createLinearGradient=function(b,
a,c,d){var f=new D("gradient");f.x0_=b;f.y0_=a;f.x1_=c;f.y1_=d;return f};i.createRadialGradient=function(b,a,c,d,f,h){var g=new D("gradientradial");g.x0_=b;g.y0_=a;g.r0_=c;g.x1_=d;g.y1_=f;g.r1_=h;return g};i.drawImage=function(b){var a,c,d,f,h,g,l,e,m=b.runtimeStyle.width,r=b.runtimeStyle.height;b.runtimeStyle.width="auto";b.runtimeStyle.height="auto";var n=b.width,o=b.height;b.runtimeStyle.width=m;b.runtimeStyle.height=r;if(arguments.length==3){a=arguments[1];c=arguments[2];h=g=0;l=d=n;e=f=o}else if(arguments.length==
5){a=arguments[1];c=arguments[2];d=arguments[3];f=arguments[4];h=g=0;l=n;e=o}else if(arguments.length==9){h=arguments[1];g=arguments[2];l=arguments[3];e=arguments[4];a=arguments[5];c=arguments[6];d=arguments[7];f=arguments[8]}else throw Error("Invalid number of arguments");var q=this.getCoords_(a,c),t=[];t.push(" <g_vml_:group",' coordsize="',k*10,",",k*10,'"',' coordorigin="0,0"',' style="width:',10,"px;height:",10,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var E=[];E.push("M11=",
this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",j(q.x/k),",","Dy=",j(q.y/k),"");var p=q,z=this.getCoords_(a+d,c),w=this.getCoords_(a,c+f),x=this.getCoords_(a+d,c+f);p.x=s.max(p.x,z.x,w.x,x.x);p.y=s.max(p.y,z.y,w.y,x.y);t.push("padding:0 ",j(p.x/k),"px ",j(p.y/k),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",E.join(""),", sizingmethod='clip');")}else t.push("top:",j(q.y/k),"px;left:",j(q.x/k),"px;");t.push(' ">','<g_vml_:image src="',b.src,
'"',' style="width:',k*d,"px;"," height:",k*f,'px;"',' cropleft="',h/n,'"',' croptop="',g/o,'"',' cropright="',(n-h-l)/n,'"',' cropbottom="',(o-g-e)/o,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};i.stroke=function(b){var a=[],c=P(b?this.fillStyle:this.strokeStyle),d=c.color,f=c.alpha*this.globalAlpha;a.push("<g_vml_:shape",' filled="',!!b,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0 0" coordsize="',k*10," ",k*10,'"',' stroked="',
!b,'"',' path="');var h={x:null,y:null},g={x:null,y:null},l=0;for(;l<this.currentPath_.length;l++){var e=this.currentPath_[l];switch(e.type){case "moveTo":a.push(" m ",j(e.x),",",j(e.y));break;case "lineTo":a.push(" l ",j(e.x),",",j(e.y));break;case "close":a.push(" x ");e=null;break;case "bezierCurveTo":a.push(" c ",j(e.cp1x),",",j(e.cp1y),",",j(e.cp2x),",",j(e.cp2y),",",j(e.x),",",j(e.y));break;case "at":case "wa":a.push(" ",e.type," ",j(e.x-this.arcScaleX_*e.radius),",",j(e.y-this.arcScaleY_*e.radius),
" ",j(e.x+this.arcScaleX_*e.radius),",",j(e.y+this.arcScaleY_*e.radius)," ",j(e.xStart),",",j(e.yStart)," ",j(e.xEnd),",",j(e.yEnd));break}if(e){if(h.x==null||e.x<h.x)h.x=e.x;if(g.x==null||e.x>g.x)g.x=e.x;if(h.y==null||e.y<h.y)h.y=e.y;if(g.y==null||e.y>g.y)g.y=e.y}}a.push(' ">');if(b)if(typeof this.fillStyle=="object"){var m=this.fillStyle,r=0,n={x:0,y:0},o=0,q=1;if(m.type_=="gradient"){var t=m.x1_/this.arcScaleX_,E=m.y1_/this.arcScaleY_,p=this.getCoords_(m.x0_/this.arcScaleX_,m.y0_/this.arcScaleY_),
z=this.getCoords_(t,E);r=Math.atan2(z.x-p.x,z.y-p.y)*180/Math.PI;if(r<0)r+=360;if(r<1.0E-6)r=0}else{var p=this.getCoords_(m.x0_,m.y0_),w=g.x-h.x,x=g.y-h.y;n={x:(p.x-h.x)/w,y:(p.y-h.y)/x};w/=this.arcScaleX_*k;x/=this.arcScaleY_*k;var R=s.max(w,x);o=2*m.r0_/R;q=2*m.r1_/R-o}var u=m.colors_;u.sort(function(ba,ca){return ba.offset-ca.offset});var J=u.length,da=u[0].color,ea=u[J-1].color,fa=u[0].alpha*this.globalAlpha,ga=u[J-1].alpha*this.globalAlpha,S=[],l=0;for(;l<J;l++){var T=u[l];S.push(T.offset*q+
o+" "+T.color)}a.push('<g_vml_:fill type="',m.type_,'"',' method="none" focus="100%"',' color="',da,'"',' color2="',ea,'"',' colors="',S.join(","),'"',' opacity="',ga,'"',' g_o_:opacity2="',fa,'"',' angle="',r,'"',' focusposition="',n.x,",",n.y,'" />')}else a.push('<g_vml_:fill color="',d,'" opacity="',f,'" />');else{var K=this.lineScale_*this.lineWidth;if(K<1)f*=K;a.push("<g_vml_:stroke",' opacity="',f,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',aa(this.lineCap),
'"',' weight="',K,'px"',' color="',d,'" />')}a.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",a.join(""))};i.fill=function(){this.stroke(true)};i.closePath=function(){this.currentPath_.push({type:"close"})};i.getCoords_=function(b,a){var c=this.m_;return{x:k*(b*c[0][0]+a*c[1][0]+c[2][0])-v,y:k*(b*c[0][1]+a*c[1][1]+c[2][1])-v}};i.save=function(){var b={};O(this,b);this.aStack_.push(b);this.mStack_.push(this.m_);this.m_=y(I(),this.m_)};i.restore=function(){O(this.aStack_.pop(),
this);this.m_=this.mStack_.pop()};function ha(b){var a=0;for(;a<3;a++){var c=0;for(;c<2;c++)if(!isFinite(b[a][c])||isNaN(b[a][c]))return false}return true}function A(b,a,c){if(!!ha(a)){b.m_=a;if(c)b.lineScale_=W(V(a[0][0]*a[1][1]-a[0][1]*a[1][0]))}}i.translate=function(b,a){A(this,y([[1,0,0],[0,1,0],[b,a,1]],this.m_),false)};i.rotate=function(b){var a=G(b),c=F(b);A(this,y([[a,c,0],[-c,a,0],[0,0,1]],this.m_),false)};i.scale=function(b,a){this.arcScaleX_*=b;this.arcScaleY_*=a;A(this,y([[b,0,0],[0,a,
0],[0,0,1]],this.m_),true)};i.transform=function(b,a,c,d,f,h){A(this,y([[b,a,0],[c,d,0],[f,h,1]],this.m_),true)};i.setTransform=function(b,a,c,d,f,h){A(this,[[b,a,0],[c,d,0],[f,h,1]],true)};i.clip=function(){};i.arcTo=function(){};i.createPattern=function(){return new U};function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}D.prototype.addColorStop=function(b,a){a=P(a);this.colors_.push({offset:b,color:a.color,alpha:a.alpha})};function U(){}G_vmlCanvasManager=
M;CanvasRenderingContext2D=H;CanvasGradient=D;CanvasPattern=U})();

View File

@ -0,0 +1,39 @@
// Andy Langton's show/hide/mini-accordion @ http://andylangton.co.uk/jquery-show-hide
// this tells jquery to run the function below once the DOM is ready
$(document).ready(function() {
// choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='Show';
var hideText='Hide';
// initialise the visibility check
var is_visible = false;
// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.toggle').prev().append(' <a href="#" class="toggleLink">'+hideText+'</a>');
// hide all of the elements with a class of 'toggle'
$('.toggle').show();
// capture clicks on the toggle links
$('a.toggleLink').click(function() {
// switch visibility
is_visible = !is_visible;
// change the link text depending on whether the element is shown or hidden
if ($(this).text()==showText) {
$(this).text(hideText);
$(this).parent().next('.toggle').slideDown('slow');
}
else {
$(this).text(showText);
$(this).parent().next('.toggle').slideUp('slow');
}
// return false so any link destination is not followed
return false;
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,20 @@
// make sure the $ is pointing to JQuery and not some other library
(function($){
// add a new method to JQuery
$.fn.equalHeight = function() {
// find the tallest height in the collection
// that was passed in (.column)
tallest = 0;
this.each(function(){
thisHeight = $(this).height();
if( thisHeight > tallest)
tallest = thisHeight;
});
// set each items height to use the tallest value found
this.each(function(){
$(this).height(tallest);
});
}
})(jQuery);

View File

@ -0,0 +1 @@
.jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em}.jqplot-axis{font-size:.75em}.jqplot-xaxis{margin-top:10px}.jqplot-x2axis{margin-bottom:10px}.jqplot-yaxis{margin-right:10px}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis,.jqplot-yMidAxis{margin-left:10px;margin-right:10px}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick,.jqplot-yMidAxis-tick{position:absolute;white-space:pre}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom}.jqplot-yaxis-tick{right:0;top:15px;text-align:right}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px 1px 5px;z-index:2;font-size:1.5em}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left}.jqplot-yMidAxis-tick{text-align:center;white-space:nowrap}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute}.jqplot-yMidAxis-label{font-size:11pt;position:absolute}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;margin-left:10px;position:absolute}.jqplot-meterGauge-tick{font-size:.75em;color:#999}.jqplot-meterGauge-label{font-size:1em;color:#999}table.jqplot-table-legend{margin-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em}td.jqplot-table-legend{vertical-align:middle}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{cursor:pointer}.jqplot-table-legend .jqplot-series-hidden{text-decoration:line-through}div.jqplot-table-legend-swatch-outline{border:1px solid #ccc;padding:1px}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-highlighter-tooltip,.jqplot-canvasOverlay-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-point-label{font-size:.75em;z-index:2}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em}.jqplot-error{text-align:center}.jqplot-error-message{position:relative;top:46%;display:inline-block}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%)}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,0.7)}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3)}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,184 @@
(function($) {
$.extend({
tablesorterPager: new function() {
function updatePageDisplay(c) {
var s = $(c.cssPageDisplay,c.container).val((c.page+1) + c.seperator + c.totalPages);
}
function setPageSize(table,size) {
var c = table.config;
c.size = size;
c.totalPages = Math.ceil(c.totalRows / c.size);
c.pagerPositionSet = false;
moveToPage(table);
fixPosition(table);
}
function fixPosition(table) {
var c = table.config;
if(!c.pagerPositionSet && c.positionFixed) {
var c = table.config, o = $(table);
if(o.offset) {
c.container.css({
top: o.offset().top + o.height() + 'px',
position: 'absolute'
});
}
c.pagerPositionSet = true;
}
}
function moveToFirstPage(table) {
var c = table.config;
c.page = 0;
moveToPage(table);
}
function moveToLastPage(table) {
var c = table.config;
c.page = (c.totalPages-1);
moveToPage(table);
}
function moveToNextPage(table) {
var c = table.config;
c.page++;
if(c.page >= (c.totalPages-1)) {
c.page = (c.totalPages-1);
}
moveToPage(table);
}
function moveToPrevPage(table) {
var c = table.config;
c.page--;
if(c.page <= 0) {
c.page = 0;
}
moveToPage(table);
}
function moveToPage(table) {
var c = table.config;
if(c.page < 0 || c.page > (c.totalPages-1)) {
c.page = 0;
}
renderTable(table,c.rowsCopy);
}
function renderTable(table,rows) {
var c = table.config;
var l = rows.length;
var s = (c.page * c.size);
var e = (s + c.size);
if(e > rows.length ) {
e = rows.length;
}
var tableBody = $(table.tBodies[0]);
// clear the table body
$.tablesorter.clearTableBody(table);
for(var i = s; i < e; i++) {
//tableBody.append(rows[i]);
var o = rows[i];
var l = o.length;
for(var j=0; j < l; j++) {
tableBody[0].appendChild(o[j]);
}
}
fixPosition(table,tableBody);
$(table).trigger("applyWidgets");
if( c.page >= c.totalPages ) {
moveToLastPage(table);
}
updatePageDisplay(c);
}
this.appender = function(table,rows) {
var c = table.config;
c.rowsCopy = rows;
c.totalRows = rows.length;
c.totalPages = Math.ceil(c.totalRows / c.size);
renderTable(table,rows);
};
this.defaults = {
size: 10,
offset: 0,
page: 0,
totalRows: 0,
totalPages: 0,
container: null,
cssNext: '.next',
cssPrev: '.prev',
cssFirst: '.first',
cssLast: '.last',
cssPageDisplay: '.pagedisplay',
cssPageSize: '.pagesize',
seperator: "/",
positionFixed: true,
appender: this.appender
};
this.construct = function(settings) {
return this.each(function() {
config = $.extend(this.config, $.tablesorterPager.defaults, settings);
var table = this, pager = config.container;
$(this).trigger("appendCache");
config.size = parseInt($(".pagesize",pager).val());
$(config.cssFirst,pager).click(function() {
moveToFirstPage(table);
return false;
});
$(config.cssNext,pager).click(function() {
moveToNextPage(table);
return false;
});
$(config.cssPrev,pager).click(function() {
moveToPrevPage(table);
return false;
});
$(config.cssLast,pager).click(function() {
moveToLastPage(table);
return false;
});
$(config.cssPageSize,pager).change(function() {
setPageSize(table,parseInt($(this).val()));
return false;
});
});
};
}
});
// extend plugin scope
$.fn.extend({
tablesorterPager: $.tablesorterPager.construct
});
})(jQuery);

View File

@ -0,0 +1,106 @@
/**
* --------------------------------------------------------------------
* Tooltip plugin for the jQuery-Plugin "Visualize"
* Tolltip by Iraê Carvalho, irae@irae.pro.br, http://irae.pro.br/en/
* Copyright (c) 2010 Iraê Carvalho
* Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
*
* Visualize plugin by Scott Jehl, scott@filamentgroup.com
* Copyright (c) 2009 Filament Group, http://www.filamentgroup.com
*
* --------------------------------------------------------------------
*/
(function($){
$.visualizePlugins.push(function visualizeTooltip(options,tableData) {
//configuration
var o = $.extend({
tooltip: false,
tooltipalign: 'auto', // also available 'left' and 'right'
tooltipvalign: 'top',
tooltipclass: 'visualize-tooltip',
tooltiphtml: function(data){
if(options.multiHover) {
var html='';
for(var i=0;i<data.point.length;i++){
html += '<p>'+data.point[i].value+' - '+data.point[i].yLabels[0]+'</p>';
}
return html;
} else {
return '<p>'+data.point.value+' - '+data.point.yLabels[0]+'</p>';
}
},
delay:false
},options);
// don't go any further if we are not to show anything
if(!o.tooltip) {return;}
var self = $(this),
canvasContain = self.next(),
scroller = canvasContain.find('.visualize-scroller'),
scrollerW = scroller.width(),
tracker = canvasContain.find('.visualize-interaction-tracker');
// IE needs background color and opacity white or the tracker stays behind the tooltip
tracker.css({
backgroundColor:'white',
opacity:0,
zIndex:100
});
var tooltip = $('<div class="'+o.tooltipclass+'"/>').css({
position:'absolute',
display:'none',
zIndex:90
})
.insertAfter(scroller.find('canvas'));
var usescroll = true;
if( typeof(G_vmlCanvasManager) != 'undefined' ){
scroller.css({'position':'absolute'});
tracker.css({marginTop:'-'+(o.height)+'px'});
}
self.bind('vizualizeOver',function visualizeTooltipOver(e,data){
if(data.canvasContain.get(0) != canvasContain.get(0)) {return;} // for multiple graphs originated from same table
if(o.multiHover) {
var p = data.point[0].canvasCords;
} else {
var p = data.point.canvasCords;
}
var left,right,top,clasRem,clasAd,bottom,x=Math.round(p[0]+data.tableData.zeroLocX),y=Math.round(p[1]+data.tableData.zeroLocY);
if(o.tooltipalign == 'left' || ( o.tooltipalign=='auto' && x-scroller.scrollLeft()<=scrollerW/2 ) ) {
if($.browser.msie && ($.browser.version == 7 || $.browser.version == 6) ) {usescroll=false;} else {usescroll=true;}
left = (x-(usescroll?scroller.scrollLeft():0))+'px';
right = '';
clasAdd="tooltipleft";
clasRem="tooltipright";
} else {
if($.browser.msie && $.browser.version == 7) {usescroll=false;} else {usescroll=true;}
left = '';
right = (Math.abs(x-o.width)- (o.width-(usescroll?scroller.scrollLeft():0)-scrollerW) )+'px';
clasAdd="tooltipright";
clasRem="tooltipleft";
}
tooltip
.addClass(clasAdd)
.removeClass(clasRem)
.html(o.tooltiphtml(data))
.css({
display:'block',
top: y+'px',
left: left,
right: right
});
});
self.bind('vizualizeOut',function visualizeTooltipOut(e,data){
tooltip.css({display:'none'});
});
});
})(jQuery);

View File

@ -0,0 +1,795 @@
/**
* --------------------------------------------------------------------
* jQuery-Plugin "visualize"
* by Scott Jehl, scott@filamentgroup.com
* http://www.filamentgroup.com
* Copyright (c) 2009 Filament Group
* Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
*
* --------------------------------------------------------------------
*/
(function($) {
$.fn.visualize = function(options, container){
return $(this).each(function(){
//configuration
var o = $.extend({
type: 'bar', //also available: area, pie, line
width: $(this).width(), //height of canvas - defaults to table height
height: $(this).height(), //height of canvas - defaults to table height
appendTitle: true, //table caption text is added to chart
title: null, //grabs from table caption if null
appendKey: true, //color key is added to chart
colors: ['#be1e2d','#666699','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744'],
textColors: [], //corresponds with colors array. null/undefined items will fall back to CSS
parseDirection: 'x', //which direction to parse the table data
pieMargin: 10, //pie charts only - spacing around pie
pieLabelsAsPercent: true,
pieLabelPos: 'inside',
lineWeight: 4, //for line and area - stroke weight
lineDots: false, //also available: 'single', 'double'
dotInnerColor: "#ffffff", // only used for lineDots:'double'
lineMargin: (options.lineDots?15:0), //for line and area - spacing around lines
barGroupMargin: 10,
chartId: '',
xLabelParser: null, // function to parse labels as values
valueParser: null, // function to parse values. must return a Number
chartId: '',
chartClass: '',
barMargin: 1, //space around bars in bar chart (added to both sides of bar)
yLabelInterval: 30, //distance between y labels
interaction: false // only used for lineDots != false -- triggers mouseover and mouseout on original table
},options);
//reset width, height to numbers
o.width = parseFloat(o.width);
o.height = parseFloat(o.height);
// reset padding if graph is not lines
if(o.type != 'line' && o.type != 'area' ) {
o.lineMargin = 0;
}
var self = $(this);
// scrape data from html table
var tableData = {};
var colors = o.colors;
var textColors = o.textColors;
var parseLabels = function(direction){
var labels = [];
if(direction == 'x'){
self.find('thead tr').each(function(i){
$(this).find('th').each(function(j){
if(!labels[j]) {
labels[j] = [];
}
labels[j][i] = $(this).text()
})
});
}
else {
self.find('tbody tr').each(function(i){
$(this).find('th').each(function(j) {
if(!labels[i]) {
labels[i] = [];
}
labels[i][j] = $(this).text()
});
});
}
return labels;
};
var fnParse = o.valueParser || parseFloat;
var dataGroups = tableData.dataGroups = [];
if(o.parseDirection == 'x'){
self.find('tbody tr').each(function(i,tr){
dataGroups[i] = {};
dataGroups[i].points = [];
dataGroups[i].color = colors[i];
if(textColors[i]){ dataGroups[i].textColor = textColors[i]; }
$(tr).find('td').each(function(j,td){
dataGroups[i].points.push( {
value: fnParse($(td).text()),
elem: td,
tableCords: [i,j]
} );
});
});
} else {
var cols = self.find('tbody tr:eq(0) td').size();
for(var i=0; i<cols; i++){
dataGroups[i] = {};
dataGroups[i].points = [];
dataGroups[i].color = colors[i];
if(textColors[i]){ dataGroups[i].textColor = textColors[i]; }
self.find('tbody tr').each(function(j){
dataGroups[i].points.push( {
value: $(this).find('td').eq(i).text()*1,
elem: this,
tableCords: [i,j]
} );
});
};
}
var allItems = tableData.allItems = [];
$(dataGroups).each(function(i,row){
var count = 0;
$.each(row.points,function(j,point){
allItems.push(point);
count += point.value;
});
row.groupTotal = count;
});
tableData.dataSum = 0;
tableData.topValue = 0;
tableData.bottomValue = Infinity;
$.each(allItems,function(i,item){
tableData.dataSum += fnParse(item.value);
if(fnParse(item.value,10)>tableData.topValue) {
tableData.topValue = fnParse(item.value,10);
}
if(item.value<tableData.bottomValue) {
tableData.bottomValue = fnParse(item.value);
}
});
var dataSum = tableData.dataSum;
var topValue = tableData.topValue;
var bottomValue = tableData.bottomValue;
var xAllLabels = tableData.xAllLabels = parseLabels(o.parseDirection);
var yAllLabels = tableData.yAllLabels = parseLabels(o.parseDirection==='x'?'y':'x');
var xLabels = tableData.xLabels = [];
$.each(tableData.xAllLabels,function(i,labels) {
tableData.xLabels.push(labels[0]);
});
var totalYRange = tableData.totalYRange = tableData.topValue - tableData.bottomValue;
var zeroLocX = tableData.zeroLocX = 0;
if($.isFunction(o.xLabelParser)) {
var xTopValue = null;
var xBottomValue = null;
$.each(xLabels,function(i,label) {
label = xLabels[i] = o.xLabelParser(label);
if(i === 0) {
xTopValue = label;
xBottomValue = label;
}
if(label>xTopValue) {
xTopValue = label;
}
if(label<xBottomValue) {
xBottomValue = label;
}
});
var totalXRange = tableData.totalXRange = xTopValue - xBottomValue;
var xScale = tableData.xScale = (o.width -2*o.lineMargin) / totalXRange;
var marginDiffX = 0;
if(o.lineMargin) {
var marginDiffX = -2*xScale-o.lineMargin;
}
zeroLocX = tableData.zeroLocX = xBottomValue + o.lineMargin;
tableData.xBottomValue = xBottomValue;
tableData.xTopValue = xTopValue;
tableData.totalXRange = totalXRange;
}
var yScale = tableData.yScale = (o.height - 2*o.lineMargin) / totalYRange;
var zeroLocY = tableData.zeroLocY = (o.height-2*o.lineMargin) * (tableData.topValue/tableData.totalYRange) + o.lineMargin;
var yLabels = tableData.yLabels = [];
var numLabels = Math.floor((o.height - 2*o.lineMargin) / 30);
var loopInterval = tableData.totalYRange / numLabels; //fix provided from lab
loopInterval = Math.round(parseFloat(loopInterval)/5)*5;
loopInterval = Math.max(loopInterval, 1);
// var start =
for(var j=Math.round(parseInt(tableData.bottomValue)/5)*5; j<=tableData.topValue+loopInterval; j+=loopInterval){
yLabels.push(j);
}
if(yLabels[yLabels.length-1] > tableData.topValue+loopInterval) {
yLabels.pop();
} else if (yLabels[yLabels.length-1] <= tableData.topValue-10) {
yLabels.push(tableData.topValue);
}
// populate some data
$.each(dataGroups,function(i,row){
row.yLabels = tableData.yAllLabels[i];
$.each(row.points, function(j,point){
point.zeroLocY = tableData.zeroLocY;
point.zeroLocX = tableData.zeroLocX;
point.xLabels = tableData.xAllLabels[j];
point.yLabels = tableData.yAllLabels[i];
point.color = row.color;
});
});
try{console.log(tableData);}catch(e){}
var charts = {};
charts.pie = {
interactionPoints: dataGroups,
setup: function() {
charts.pie.draw(true);
},
draw: function(drawHtml){
var centerx = Math.round(canvas.width()/2);
var centery = Math.round(canvas.height()/2);
var radius = centery - o.pieMargin;
var counter = 0.0;
if(drawHtml) {
canvasContain.addClass('visualize-pie');
if(o.pieLabelPos == 'outside'){ canvasContain.addClass('visualize-pie-outside'); }
var toRad = function(integer){ return (Math.PI/180)*integer; };
var labels = $('<ul class="visualize-labels"></ul>')
.insertAfter(canvas);
}
//draw the pie pieces
$.each(dataGroups, function(i,row){
var fraction = row.groupTotal / dataSum;
if (fraction <= 0 || isNaN(fraction))
return;
ctx.beginPath();
ctx.moveTo(centerx, centery);
ctx.arc(centerx, centery, radius,
counter * Math.PI * 2 - Math.PI * 0.5,
(counter + fraction) * Math.PI * 2 - Math.PI * 0.5,
false);
ctx.lineTo(centerx, centery);
ctx.closePath();
ctx.fillStyle = dataGroups[i].color;
ctx.fill();
// draw labels
if(drawHtml) {
var sliceMiddle = (counter + fraction/2);
var distance = o.pieLabelPos == 'inside' ? radius/1.5 : radius + radius / 5;
var labelx = Math.round(centerx + Math.sin(sliceMiddle * Math.PI * 2) * (distance));
var labely = Math.round(centery - Math.cos(sliceMiddle * Math.PI * 2) * (distance));
var leftRight = (labelx > centerx) ? 'right' : 'left';
var topBottom = (labely > centery) ? 'bottom' : 'top';
var percentage = parseFloat((fraction*100).toFixed(2));
// interaction variables
row.canvasCords = [labelx,labely];
row.zeroLocY = tableData.zeroLocY = 0; // related to zeroLocY and plugin API
row.zeroLocX = tableData.zeroLocX = 0; // related to zeroLocX and plugin API
row.value = row.groupTotal;
if(percentage){
var labelval = (o.pieLabelsAsPercent) ? percentage + '%' : row.groupTotal;
var labeltext = $('<span class="visualize-label">' + labelval +'</span>')
.css(leftRight, 0)
.css(topBottom, 0);
if(labeltext)
var label = $('<li class="visualize-label-pos"></li>')
.appendTo(labels)
.css({left: labelx, top: labely})
.append(labeltext);
labeltext
.css('font-size', radius / 8)
.css('margin-'+leftRight, -labeltext.width()/2)
.css('margin-'+topBottom, -labeltext.outerHeight()/2);
if(dataGroups[i].textColor){ labeltext.css('color', dataGroups[i].textColor); }
}
}
counter+=fraction;
});
}
};
(function(){
var xInterval;
var drawPoint = function (ctx,x,y,color,size) {
ctx.moveTo(x,y);
ctx.beginPath();
ctx.arc(x,y,size/2,0,2*Math.PI,false);
ctx.closePath();
ctx.fillStyle = color;
ctx.fill();
};
charts.line = {
interactionPoints: allItems,
setup: function(area){
if(area){ canvasContain.addClass('visualize-area'); }
else{ canvasContain.addClass('visualize-line'); }
//write X labels
var xlabelsUL = $('<ul class="visualize-labels-x"></ul>')
.width(canvas.width())
.height(canvas.height())
.insertBefore(canvas);
if(!o.customXLabels) {
xInterval = (canvas.width() - 2*o.lineMargin) / (xLabels.length -1);
$.each(xLabels, function(i){
var thisLi = $('<li><span>'+this+'</span></li>')
.prepend('<span class="line" />')
.css('left', o.lineMargin + xInterval * i)
.appendTo(xlabelsUL);
var label = thisLi.find('span:not(.line)');
var leftOffset = label.width()/-2;
if(i == 0){ leftOffset = 0; }
else if(i== xLabels.length-1){ leftOffset = -label.width(); }
label
.css('margin-left', leftOffset)
.addClass('label');
});
} else {
o.customXLabels(tableData,xlabelsUL);
}
//write Y labels
var liBottom = (canvas.height() - 2*o.lineMargin) / (yLabels.length-1);
var ylabelsUL = $('<ul class="visualize-labels-y"></ul>')
.width(canvas.width())
.height(canvas.height())
// .css('margin-top',-o.lineMargin)
.insertBefore(scroller);
$.each(yLabels, function(i){
var value = Math.floor(this);
var posB = (value-bottomValue)*yScale + o.lineMargin;
if(posB >= o.height-1 || posB < 0) {
return;
}
var thisLi = $('<li><span>'+value+'</span></li>')
.css('bottom', posB);
if(Math.abs(posB) < o.height-1) {
thisLi.prepend('<span class="line" />');
}
thisLi.prependTo(ylabelsUL);
var label = thisLi.find('span:not(.line)');
var topOffset = label.height()/-2;
if(!o.lineMargin) {
if(i == 0){ topOffset = -label.height(); }
else if(i== yLabels.length-1){ topOffset = 0; }
}
label
.css('margin-top', topOffset)
.addClass('label');
});
//start from the bottom left
ctx.translate(zeroLocX,zeroLocY);
charts.line.draw(area);
},
draw: function(area) {
// prevent drawing on top of previous draw
ctx.clearRect(-zeroLocX,-zeroLocY,o.width,o.height);
// Calculate each point properties before hand
var integer;
$.each(dataGroups,function(i,row){
integer = o.lineMargin; // the current offset
$.each(row.points, function(j,point){
if(o.xLabelParser) {
point.canvasCords = [(xLabels[j]-zeroLocX)*xScale - xBottomValue,-(point.value*yScale)];
} else {
point.canvasCords = [integer,-(point.value*yScale)];
}
if(o.lineDots) {
point.dotSize = o.dotSize||o.lineWeight*Math.PI;
point.dotInnerSize = o.dotInnerSize||o.lineWeight*Math.PI/2;
if(o.lineDots == 'double') {
point.innerColor = o.dotInnerColor;
}
}
integer+=xInterval;
});
});
// fire custom event so we can enable rich interaction
self.trigger('vizualizeBeforeDraw',{options:o,table:self,canvasContain:canvasContain,tableData:tableData});
// draw lines and areas
$.each(dataGroups,function(h){
// Draw lines
ctx.beginPath();
ctx.lineWidth = o.lineWeight;
ctx.lineJoin = 'round';
$.each(this.points, function(g){
var loc = this.canvasCords;
if(g == 0) {
ctx.moveTo(loc[0],loc[1]);
}
ctx.lineTo(loc[0],loc[1]);
});
ctx.strokeStyle = this.color;
ctx.stroke();
// Draw fills
if(area){
var integer = this.points[this.points.length-1].canvasCords[0];
if (isFinite(integer))
ctx.lineTo(integer,0);
ctx.lineTo(o.lineMargin,0);
ctx.closePath();
ctx.fillStyle = this.color;
ctx.globalAlpha = .3;
ctx.fill();
ctx.globalAlpha = 1.0;
}
else {ctx.closePath();}
});
// draw points
if(o.lineDots) {
$.each(dataGroups,function(h){
$.each(this.points, function(g){
drawPoint(ctx,this.canvasCords[0],this.canvasCords[1],this.color,this.dotSize);
if(o.lineDots === 'double') {
drawPoint(ctx,this.canvasCords[0],this.canvasCords[1],this.innerColor,this.dotInnerSize);
}
});
});
}
}
};
})();
charts.area = {
setup: function() {
charts.line.setup(true);
},
draw: charts.line.draw
};
(function(){
var horizontal,bottomLabels;
charts.bar = {
setup:function(){
/**
* We can draw horizontal or vertical bars depending on the
* value of the 'barDirection' option (which may be 'vertical' or
* 'horizontal').
*/
horizontal = (o.barDirection == 'horizontal');
canvasContain.addClass('visualize-bar');
/**
* Write labels along the bottom of the chart. If we're drawing
* horizontal bars, these will be the yLabels, otherwise they
* will be the xLabels. The positioning also varies slightly:
* yLabels are values, hence they will span the whole width of
* the canvas, whereas xLabels are supposed to line up with the
* bars.
*/
bottomLabels = horizontal ? yLabels : xLabels;
var xInterval = canvas.width() / (bottomLabels.length - (horizontal ? 1 : 0));
var xlabelsUL = $('<ul class="visualize-labels-x"></ul>')
.width(canvas.width())
.height(canvas.height())
.insertBefore(canvas);
$.each(bottomLabels, function(i){
var thisLi = $('<li><span class="label">'+this+'</span></li>')
.prepend('<span class="line" />')
.css('left', xInterval * i)
.width(xInterval)
.appendTo(xlabelsUL);
if (horizontal) {
var label = thisLi.find('span.label');
label.css("margin-left", -label.width() / 2);
}
});
/**
* Write labels along the left of the chart. Follows the same idea
* as the bottom labels.
*/
var leftLabels = horizontal ? xLabels : yLabels;
var liBottom = canvas.height() / (leftLabels.length - (horizontal ? 0 : 1));
var ylabelsUL = $('<ul class="visualize-labels-y"></ul>')
.width(canvas.width())
.height(canvas.height())
.insertBefore(canvas);
$.each(leftLabels, function(i){
var thisLi = $('<li><span>'+this+'</span></li>').prependTo(ylabelsUL);
var label = thisLi.find('span:not(.line)').addClass('label');
if (horizontal) {
/**
* For left labels, we want to vertically align the text
* to the middle of its container, but we don't know how
* many lines of text we will have, since the labels could
* be very long.
*
* So we set a min-height of liBottom, and a max-height
* of liBottom + 1, so we can then check the label's actual
* height to determine if it spans one line or more lines.
*/
label.css({
'min-height': liBottom,
'max-height': liBottom + 1,
'vertical-align': 'middle'
});
thisLi.css({'top': liBottom * i, 'min-height': liBottom});
var r = label[0].getClientRects()[0];
if (r.bottom - r.top == liBottom) {
/* This means we have only one line of text; hence
* we can centre the text vertically by setting the line-height,
* as described at:
* http://www.ampsoft.net/webdesign-l/vertical-aligned-nav-list.html
*
* (Although firefox has .height on the rectangle, IE doesn't,
* so we use r.bottom - r.top rather than r.height.)
*/
label.css('line-height', parseInt(liBottom) + 'px');
}
else {
/*
* If there is more than one line of text, then we shouldn't
* touch the line height, but we should make sure the text
* doesn't overflow the container.
*/
label.css("overflow", "hidden");
}
}
else {
thisLi.css('bottom', liBottom * i).prepend('<span class="line" />');
label.css('margin-top', -label.height() / 2)
}
});
charts.bar.draw();
},
draw: function() {
// Draw bars
if (horizontal) {
// for horizontal, keep the same code, but rotate everything 90 degrees
// clockwise.
ctx.rotate(Math.PI / 2);
}
else {
// for vertical, translate to the top left corner.
ctx.translate(0, zeroLocY);
}
// Don't attempt to draw anything if all the values are zero,
// otherwise we will get weird exceptions from the canvas methods.
if (totalYRange <= 0)
return;
var yScale = (horizontal ? canvas.width() : canvas.height()) / totalYRange;
var barWidth = horizontal ? (canvas.height() / xLabels.length) : (canvas.width() / (bottomLabels.length));
var linewidth = (barWidth - o.barGroupMargin*2) / dataGroups.length;
for(var h=0; h<dataGroups.length; h++){
ctx.beginPath();
var strokeWidth = linewidth - (o.barMargin*2);
ctx.lineWidth = strokeWidth;
var points = dataGroups[h].points;
var integer = 0;
for(var i=0; i<points.length; i++){
// If the last value is zero, IE will go nuts and not draw anything,
// so don't try to draw zero values at all.
if (points[i].value != 0) {
var xVal = (integer-o.barGroupMargin)+(h*linewidth)+linewidth/2;
xVal += o.barGroupMargin*2;
ctx.moveTo(xVal, 0);
ctx.lineTo(xVal, Math.round(-points[i].value*yScale));
}
integer+=barWidth;
}
ctx.strokeStyle = dataGroups[h].color;
ctx.stroke();
ctx.closePath();
}
}
};
})();
//create new canvas, set w&h attrs (not inline styles)
var canvasNode = document.createElement("canvas");
var canvas = $(canvasNode)
.attr({
'height': o.height,
'width': o.width
});
//get title for chart
var title = o.title || self.find('caption').text();
//create canvas wrapper div, set inline w&h, append
var canvasContain = (container || $('<div '+(o.chartId?'id="'+o.chartId+'" ':'')+'class="visualize '+o.chartClass+'" role="img" aria-label="Chart representing data from the table: '+ title +'" />'))
.height(o.height)
.width(o.width);
var scroller = $('<div class="visualize-scroller"></div>')
.appendTo(canvasContain)
.append(canvas);
//title/key container
if(o.appendTitle || o.appendKey){
var infoContain = $('<div class="visualize-info"></div>')
.appendTo(canvasContain);
}
//append title
if(o.appendTitle){
$('<div class="visualize-title">'+ title +'</div>').appendTo(infoContain);
}
//append key
if(o.appendKey){
var newKey = $('<ul class="visualize-key"></ul>');
$.each(yAllLabels, function(i,label){
$('<li><span class="visualize-key-color" style="background: '+dataGroups[i].color+'"></span><span class="visualize-key-label">'+ label +'</span></li>')
.appendTo(newKey);
});
newKey.appendTo(infoContain);
};
// init interaction
if(o.interaction) {
// sets the canvas to track interaction
// IE needs one div on top of the canvas since the VML shapes prevent mousemove from triggering correctly.
// Pie charts needs tracker because labels goes on top of the canvas and also messes up with mousemove
var tracker = $('<div class="visualize-interaction-tracker"/>')
.css({
'height': o.height + 'px',
'width': o.width + 'px',
'position':'relative',
'z-index': 200
})
.insertAfter(canvas);
var triggerInteraction = function(overOut,data) {
var data = $.extend({
canvasContain:canvasContain,
tableData:tableData
},data);
self.trigger('vizualize'+overOut,data);
};
var over=false, last=false, started=false;
tracker.mousemove(function(e){
var x,y,x1,y1,data,dist,i,current,selector,zLabel,elem,color,minDist,found,ev=e.originalEvent;
// get mouse position relative to the tracker/canvas
x = ev.layerX || ev.offsetX || 0;
y = ev.layerY || ev.offsetY || 0;
found = false;
minDist = started?30000:(o.type=='pie'?(Math.round(canvas.height()/2)-o.pieMargin)/3:o.lineWeight*4);
// iterate datagroups to find points with matching
$.each(charts[o.type].interactionPoints,function(i,current){
x1 = current.canvasCords[0] + zeroLocX;
y1 = current.canvasCords[1] + (o.type=="pie"?0:zeroLocY);
dist = Math.sqrt( (x1 - x)*(x1 - x) + (y1 - y)*(y1 - y) );
if(dist < minDist) {
found = current;
minDist = dist;
}
});
if(o.multiHover && found) {
x = found.canvasCords[0] + zeroLocX;
y = found.canvasCords[1] + (o.type=="pie"?0:zeroLocY);
found = [found];
$.each(charts[o.type].interactionPoints,function(i,current){
if(current == found[0]) {return;}
x1 = current.canvasCords[0] + zeroLocX;
y1 = current.canvasCords[1] + zeroLocY;
dist = Math.sqrt( (x1 - x)*(x1 - x) + (y1 - y)*(y1 - y) );
if(dist <= o.multiHover) {
found.push(current);
}
});
}
// trigger over and out only when state changes, instead of on every mousemove
over = found;
if(over != last) {
if(over) {
if(last) {
triggerInteraction('Out',{point:last});
}
triggerInteraction('Over',{point:over});
last = over;
}
if(last && !over) {
triggerInteraction('Out',{point:last});
last=false;
}
started=true;
}
});
tracker.mouseleave(function(){
triggerInteraction('Out',{
point:last,
mouseOutGraph:true
});
over = (last = false);
});
}
//append new canvas to page
if(!container){canvasContain.insertAfter(this); }
if( typeof(G_vmlCanvasManager) != 'undefined' ){ G_vmlCanvasManager.init(); G_vmlCanvasManager.initElement(canvas[0]); }
//set up the drawing board
var ctx = canvas[0].getContext('2d');
// Scroll graphs
scroller.scrollLeft(o.width-scroller.width());
// init plugins
$.each($.visualizePlugins,function(i,plugin){
plugin.call(self,o,tableData);
});
//create chart
charts[o.type].setup();
if(!container){
//add event for updating
self.bind('visualizeRefresh', function(){
self.visualize(o, $(this).empty());
});
//add event for redraw
self.bind('visualizeRedraw', function(){
charts[o.type].draw();
});
}
}).next(); //returns canvas(es)
};
// create array for plugins. if you wish to make a plugin,
// just push your init funcion into this array
$.visualizePlugins = [];
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,314 @@
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.8
* Revision: 1250
*
* Copyright (c) 2009-2013 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
*/
(function($) {
// Class: $.jqplot.BezierCurveRenderer.js
// Renderer which draws lines as stacked bezier curves.
// Data for the line will not be specified as an array of
// [x, y] data point values, but as a an array of [start piont, bezier curve]
// So, the line is specified as: [[xstart, ystart], [cp1x, cp1y, cp2x, cp2y, xend, yend]].
$.jqplot.BezierCurveRenderer = function(){
$.jqplot.LineRenderer.call(this);
};
$.jqplot.BezierCurveRenderer.prototype = new $.jqplot.LineRenderer();
$.jqplot.BezierCurveRenderer.prototype.constructor = $.jqplot.BezierCurveRenderer;
// Method: setGridData
// converts the user data values to grid coordinates and stores them
// in the gridData array.
// Called with scope of a series.
$.jqplot.BezierCurveRenderer.prototype.setGridData = function(plot) {
// recalculate the grid data
var xp = this._xaxis.series_u2p;
var yp = this._yaxis.series_u2p;
// this._plotData should be same as this.data
var data = this.data;
this.gridData = [];
this._prevGridData = [];
// if seriesIndex = 0, fill to x axis.
// if seriesIndex > 0, fill to previous series data.
var idx = this.index;
if (data.length == 2) {
if (idx == 0) {
this.gridData = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
[xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, this._yaxis.min)],
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
];
}
else {
var psd = plot.series[idx-1].data;
this.gridData = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
[xp.call(this._xaxis, psd[1][4]), yp.call(this._yaxis, psd[1][5])],
[xp.call(this._xaxis, psd[1][2]), yp.call(this._yaxis, psd[1][3]),
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
];
}
}
else {
if (idx == 0) {
this.gridData = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
[xp.call(this._xaxis, data[3][1]), yp.call(this._yaxis, this._yaxis.min)],
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
];
}
else {
var psd = plot.series[idx-1].data;
this.gridData = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
[xp.call(this._xaxis, psd[3][0]), yp.call(this._yaxis, psd[3][1])],
[xp.call(this._xaxis, psd[2][0]), yp.call(this._yaxis, psd[2][1]),
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
];
}
}
};
// Method: makeGridData
// converts any arbitrary data values to grid coordinates and
// returns them. This method exists so that plugins can use a series'
// linerenderer to generate grid data points without overwriting the
// grid data associated with that series.
// Called with scope of a series.
$.jqplot.BezierCurveRenderer.prototype.makeGridData = function(data, plot) {
// recalculate the grid data
var xp = this._xaxis.series_u2p;
var yp = this._yaxis.series_u2p;
var gd = [];
var pgd = [];
// if seriesIndex = 0, fill to x axis.
// if seriesIndex > 0, fill to previous series data.
var idx = this.index;
if (data.length == 2) {
if (idx == 0) {
gd = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
[xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, this._yaxis.min)],
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
];
}
else {
var psd = plot.series[idx-1].data;
gd = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
[xp.call(this._xaxis, psd[1][4]), yp.call(this._yaxis, psd[1][5])],
[xp.call(this._xaxis, psd[1][2]), yp.call(this._yaxis, psd[1][3]),
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
];
}
}
else {
if (idx == 0) {
gd = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
[xp.call(this._xaxis, data[3][1]), yp.call(this._yaxis, this._yaxis.min)],
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
];
}
else {
var psd = plot.series[idx-1].data;
gd = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
[xp.call(this._xaxis, psd[3][0]), yp.call(this._yaxis, psd[3][1])],
[xp.call(this._xaxis, psd[2][0]), yp.call(this._yaxis, psd[2][1]),
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
];
}
}
return gd;
};
// called within scope of series.
$.jqplot.BezierCurveRenderer.prototype.draw = function(ctx, gd, options) {
var i;
ctx.save();
if (gd.length) {
if (this.showLine) {
ctx.save();
var opts = (options != null) ? options : {};
ctx.fillStyle = opts.fillStyle || this.color;
ctx.beginPath();
ctx.moveTo(gd[0][0], gd[0][1]);
ctx.bezierCurveTo(gd[1][0], gd[1][1], gd[1][2], gd[1][3], gd[1][4], gd[1][5]);
ctx.lineTo(gd[2][0], gd[2][1]);
if (gd[3].length == 2) {
ctx.lineTo(gd[3][0], gd[3][1]);
}
else {
ctx.bezierCurveTo(gd[3][0], gd[3][1], gd[3][2], gd[3][3], gd[3][4], gd[3][5]);
}
ctx.closePath();
ctx.fill();
ctx.restore();
}
}
ctx.restore();
};
$.jqplot.BezierCurveRenderer.prototype.drawShadow = function(ctx, gd, options) {
// This is a no-op, shadows drawn with lines.
};
$.jqplot.BezierAxisRenderer = function() {
$.jqplot.LinearAxisRenderer.call(this);
};
$.jqplot.BezierAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
$.jqplot.BezierAxisRenderer.prototype.constructor = $.jqplot.BezierAxisRenderer;
// Axes on a plot with Bezier Curves
$.jqplot.BezierAxisRenderer.prototype.init = function(options){
$.extend(true, this, options);
var db = this._dataBounds;
// Go through all the series attached to this axis and find
// the min/max bounds for this axis.
for (var i=0; i<this._series.length; i++) {
var s = this._series[i];
var d = s.data;
if (d.length == 4) {
for (var j=0; j<d.length; j++) {
if (this.name == 'xaxis' || this.name == 'x2axis') {
if (d[j][0] < db.min || db.min == null) {
db.min = d[j][0];
}
if (d[j][0] > db.max || db.max == null) {
db.max = d[j][0];
}
}
else {
if (d[j][1] < db.min || db.min == null) {
db.min = d[j][1];
}
if (d[j][1] > db.max || db.max == null) {
db.max = d[j][1];
}
}
}
}
else {
if (this.name == 'xaxis' || this.name == 'x2axis') {
if (d[0][0] < db.min || db.min == null) {
db.min = d[0][0];
}
if (d[0][0] > db.max || db.max == null) {
db.max = d[0][0];
}
for (var j=0; j<5; j+=2) {
if (d[1][j] < db.min || db.min == null) {
db.min = d[1][j];
}
if (d[1][j] > db.max || db.max == null) {
db.max = d[1][j];
}
}
}
else {
if (d[0][1] < db.min || db.min == null) {
db.min = d[0][1];
}
if (d[0][1] > db.max || db.max == null) {
db.max = d[0][1];
}
for (var j=1; j<6; j+=2) {
if (d[1][j] < db.min || db.min == null) {
db.min = d[1][j];
}
if (d[1][j] > db.max || db.max == null) {
db.max = d[1][j];
}
}
}
}
}
};
// setup default renderers for axes and legend so user doesn't have to
// called with scope of plot
function preInit(target, data, options) {
options = options || {};
options.axesDefaults = $.extend(true, {pad:0}, options.axesDefaults);
options.seriesDefaults = options.seriesDefaults || {};
options.legend = $.extend(true, {placement:'outside'}, options.legend);
// only set these if there is a pie series
var setopts = false;
if (options.seriesDefaults.renderer == $.jqplot.BezierCurveRenderer) {
setopts = true;
}
else if (options.series) {
for (var i=0; i < options.series.length; i++) {
if (options.series[i].renderer == $.jqplot.BezierCurveRenderer) {
setopts = true;
}
}
}
if (setopts) {
options.axesDefaults.renderer = $.jqplot.BezierAxisRenderer;
}
}
$.jqplot.preInitHooks.push(preInit);
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,801 @@
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.8
* Revision: 1250
*
* Copyright (c) 2009-2013 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
*/
(function($) {
// Class: $.jqplot.BarRenderer
// A plugin renderer for jqPlot to draw a bar plot.
// Draws series as a line.
$.jqplot.BarRenderer = function(){
$.jqplot.LineRenderer.call(this);
};
$.jqplot.BarRenderer.prototype = new $.jqplot.LineRenderer();
$.jqplot.BarRenderer.prototype.constructor = $.jqplot.BarRenderer;
// called with scope of series.
$.jqplot.BarRenderer.prototype.init = function(options, plot) {
// Group: Properties
//
// prop: barPadding
// Number of pixels between adjacent bars at the same axis value.
this.barPadding = 8;
// prop: barMargin
// Number of pixels between groups of bars at adjacent axis values.
this.barMargin = 10;
// prop: barDirection
// 'vertical' = up and down bars, 'horizontal' = side to side bars
this.barDirection = 'vertical';
// prop: barWidth
// Width of the bar in pixels (auto by devaul). null = calculated automatically.
this.barWidth = null;
// prop: shadowOffset
// offset of the shadow from the slice and offset of
// each succesive stroke of the shadow from the last.
this.shadowOffset = 2;
// prop: shadowDepth
// number of strokes to apply to the shadow,
// each stroke offset shadowOffset from the last.
this.shadowDepth = 5;
// prop: shadowAlpha
// transparency of the shadow (0 = transparent, 1 = opaque)
this.shadowAlpha = 0.08;
// prop: waterfall
// true to enable waterfall plot.
this.waterfall = false;
// prop: groups
// group bars into this many groups
this.groups = 1;
// prop: varyBarColor
// true to color each bar of a series separately rather than
// have every bar of a given series the same color.
// If used for non-stacked multiple series bar plots, user should
// specify a separate 'seriesColors' array for each series.
// Otherwise, each series will set their bars to the same color array.
// This option has no Effect for stacked bar charts and is disabled.
this.varyBarColor = false;
// prop: highlightMouseOver
// True to highlight slice when moused over.
// This must be false to enable highlightMouseDown to highlight when clicking on a slice.
this.highlightMouseOver = true;
// prop: highlightMouseDown
// True to highlight when a mouse button is pressed over a slice.
// This will be disabled if highlightMouseOver is true.
this.highlightMouseDown = false;
// prop: highlightColors
// an array of colors to use when highlighting a bar.
this.highlightColors = [];
// prop: transposedData
// NOT IMPLEMENTED YET. True if this is a horizontal bar plot and
// x and y values are "transposed". Tranposed, or "swapped", data is
// required prior to rev. 894 builds of jqPlot with horizontal bars.
// Allows backward compatability of bar renderer horizontal bars with
// old style data sets.
this.transposedData = true;
this.renderer.animation = {
show: false,
direction: 'down',
speed: 3000,
_supported: true
};
this._type = 'bar';
// if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
if (options.highlightMouseDown && options.highlightMouseOver == null) {
options.highlightMouseOver = false;
}
//////
// This is probably wrong here.
// After going back and forth on whether renderer should be the thing
// or extend the thing, it seems that it it best if it is a property
// on the thing. This should be something that is commonized
// among series renderers in the future.
//////
$.extend(true, this, options);
// really should probably do this
$.extend(true, this.renderer, options);
// fill is still needed to properly draw the legend.
// bars have to be filled.
this.fill = true;
// if horizontal bar and animating, reset the default direction
if (this.barDirection === 'horizontal' && this.rendererOptions.animation && this.rendererOptions.animation.direction == null) {
this.renderer.animation.direction = 'left';
}
if (this.waterfall) {
this.fillToZero = false;
this.disableStack = true;
}
if (this.barDirection == 'vertical' ) {
this._primaryAxis = '_xaxis';
this._stackAxis = 'y';
this.fillAxis = 'y';
}
else {
this._primaryAxis = '_yaxis';
this._stackAxis = 'x';
this.fillAxis = 'x';
}
// index of the currenty highlighted point, if any
this._highlightedPoint = null;
// total number of values for all bar series, total number of bar series, and position of this series
this._plotSeriesInfo = null;
// Array of actual data colors used for each data point.
this._dataColors = [];
this._barPoints = [];
// set the shape renderer options
var opts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, strokeStyle:this.color, fillStyle:this.color, closePath:this.fill};
this.renderer.shapeRenderer.init(opts);
// set the shadow renderer options
var sopts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, closePath:this.fill};
this.renderer.shadowRenderer.init(sopts);
plot.postInitHooks.addOnce(postInit);
plot.postDrawHooks.addOnce(postPlotDraw);
plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
};
// called with scope of series
function barPreInit(target, data, seriesDefaults, options) {
if (this.rendererOptions.barDirection == 'horizontal') {
this._stackAxis = 'x';
this._primaryAxis = '_yaxis';
}
if (this.rendererOptions.waterfall == true) {
this._data = $.extend(true, [], this.data);
var sum = 0;
var pos = (!this.rendererOptions.barDirection || this.rendererOptions.barDirection === 'vertical' || this.transposedData === false) ? 1 : 0;
for(var i=0; i<this.data.length; i++) {
sum += this.data[i][pos];
if (i>0) {
this.data[i][pos] += this.data[i-1][pos];
}
}
this.data[this.data.length] = (pos == 1) ? [this.data.length+1, sum] : [sum, this.data.length+1];
this._data[this._data.length] = (pos == 1) ? [this._data.length+1, sum] : [sum, this._data.length+1];
}
if (this.rendererOptions.groups > 1) {
this.breakOnNull = true;
var l = this.data.length;
var skip = parseInt(l/this.rendererOptions.groups, 10);
var count = 0;
for (var i=skip; i<l; i+=skip) {
this.data.splice(i+count, 0, [null, null]);
this._plotData.splice(i+count, 0, [null, null]);
this._stackData.splice(i+count, 0, [null, null]);
count++;
}
for (i=0; i<this.data.length; i++) {
if (this._primaryAxis == '_xaxis') {
this.data[i][0] = i+1;
this._plotData[i][0] = i+1;
this._stackData[i][0] = i+1;
}
else {
this.data[i][1] = i+1;
this._plotData[i][1] = i+1;
this._stackData[i][1] = i+1;
}
}
}
}
$.jqplot.preSeriesInitHooks.push(barPreInit);
// needs to be called with scope of series, not renderer.
$.jqplot.BarRenderer.prototype.calcSeriesNumbers = function() {
var nvals = 0;
var nseries = 0;
var paxis = this[this._primaryAxis];
var s, series, pos;
// loop through all series on this axis
for (var i=0; i < paxis._series.length; i++) {
series = paxis._series[i];
if (series === this) {
pos = i;
}
// is the series rendered as a bar?
if (series.renderer.constructor == $.jqplot.BarRenderer) {
// gridData may not be computed yet, use data length insted
nvals += series.data.length;
nseries += 1;
}
}
// return total number of values for all bar series, total number of bar series, and position of this series
return [nvals, nseries, pos];
};
$.jqplot.BarRenderer.prototype.setBarWidth = function() {
// need to know how many data values we have on the approprate axis and figure it out.
var i;
var nvals = 0;
var nseries = 0;
var paxis = this[this._primaryAxis];
var s, series, pos;
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
nvals = temp[0];
nseries = temp[1];
var nticks = paxis.numberTicks;
var nbins = (nticks-1)/2;
// so, now we have total number of axis values.
if (paxis.name == 'xaxis' || paxis.name == 'x2axis') {
if (this._stack) {
this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals * nseries - this.barMargin;
}
else {
this.barWidth = ((paxis._offsets.max - paxis._offsets.min)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries;
// this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals - this.barPadding - this.barMargin/nseries;
}
}
else {
if (this._stack) {
this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals * nseries - this.barMargin;
}
else {
this.barWidth = ((paxis._offsets.min - paxis._offsets.max)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries;
// this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals - this.barPadding - this.barMargin/nseries;
}
}
return [nvals, nseries];
};
function computeHighlightColors (colors) {
var ret = [];
for (var i=0; i<colors.length; i++){
var rgba = $.jqplot.getColorComponents(colors[i]);
var newrgb = [rgba[0], rgba[1], rgba[2]];
var sum = newrgb[0] + newrgb[1] + newrgb[2];
for (var j=0; j<3; j++) {
// when darkening, lowest color component can be is 60.
newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
newrgb[j] = parseInt(newrgb[j], 10);
}
ret.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
}
return ret;
}
function getStart(sidx, didx, comp, plot, axis) {
// check if sign change
var seriesIndex = sidx,
prevSeriesIndex = sidx - 1,
start,
prevVal,
aidx = (axis === 'x') ? 0 : 1;
// is this not the first series?
if (seriesIndex > 0) {
prevVal = plot.series[prevSeriesIndex]._plotData[didx][aidx];
// is there a sign change
if ((comp * prevVal) < 0) {
start = getStart(prevSeriesIndex, didx, comp, plot, axis);
}
// no sign change.
else {
start = plot.series[prevSeriesIndex].gridData[didx][aidx];
}
}
// if first series, return value at 0
else {
start = (aidx === 0) ? plot.series[seriesIndex]._xaxis.series_u2p(0) : plot.series[seriesIndex]._yaxis.series_u2p(0);
}
return start;
}
$.jqplot.BarRenderer.prototype.draw = function(ctx, gridData, options, plot) {
var i;
// Ughhh, have to make a copy of options b/c it may be modified later.
var opts = $.extend({}, options);
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
var xaxis = this.xaxis;
var yaxis = this.yaxis;
var xp = this._xaxis.series_u2p;
var yp = this._yaxis.series_u2p;
var pointx, pointy;
// clear out data colors.
this._dataColors = [];
this._barPoints = [];
if (this.barWidth == null) {
this.renderer.setBarWidth.call(this);
}
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
var nvals = temp[0];
var nseries = temp[1];
var pos = temp[2];
var points = [];
if (this._stack) {
this._barNudge = 0;
}
else {
this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding);
}
if (showLine) {
var negativeColors = new $.jqplot.ColorGenerator(this.negativeSeriesColors);
var positiveColors = new $.jqplot.ColorGenerator(this.seriesColors);
var negativeColor = negativeColors.get(this.index);
if (! this.useNegativeColors) {
negativeColor = opts.fillStyle;
}
var positiveColor = opts.fillStyle;
var base;
var xstart;
var ystart;
if (this.barDirection == 'vertical') {
for (var i=0; i<gridData.length; i++) {
if (!this._stack && this.data[i][1] == null) {
continue;
}
points = [];
base = gridData[i][0] + this._barNudge;
// stacked
if (this._stack && this._prevGridData.length) {
ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y');
}
// not stacked
else {
if (this.fillToZero) {
ystart = this._yaxis.series_u2p(0);
}
else if (this.waterfall && i > 0 && i < this.gridData.length-1) {
ystart = this.gridData[i-1][1];
}
else if (this.waterfall && i == 0 && i < this.gridData.length-1) {
if (this._yaxis.min <= 0 && this._yaxis.max >= 0) {
ystart = this._yaxis.series_u2p(0);
}
else if (this._yaxis.min > 0) {
ystart = ctx.canvas.height;
}
else {
ystart = 0;
}
}
else if (this.waterfall && i == this.gridData.length - 1) {
if (this._yaxis.min <= 0 && this._yaxis.max >= 0) {
ystart = this._yaxis.series_u2p(0);
}
else if (this._yaxis.min > 0) {
ystart = ctx.canvas.height;
}
else {
ystart = 0;
}
}
else {
ystart = ctx.canvas.height;
}
}
if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) {
if (this.varyBarColor && !this._stack) {
if (this.useNegativeColors) {
opts.fillStyle = negativeColors.next();
}
else {
opts.fillStyle = positiveColors.next();
}
}
else {
opts.fillStyle = negativeColor;
}
}
else {
if (this.varyBarColor && !this._stack) {
opts.fillStyle = positiveColors.next();
}
else {
opts.fillStyle = positiveColor;
}
}
if (!this.fillToZero || this._plotData[i][1] >= 0) {
points.push([base-this.barWidth/2, ystart]);
points.push([base-this.barWidth/2, gridData[i][1]]);
points.push([base+this.barWidth/2, gridData[i][1]]);
points.push([base+this.barWidth/2, ystart]);
}
// for negative bars make sure points are always ordered clockwise
else {
points.push([base-this.barWidth/2, gridData[i][1]]);
points.push([base-this.barWidth/2, ystart]);
points.push([base+this.barWidth/2, ystart]);
points.push([base+this.barWidth/2, gridData[i][1]]);
}
this._barPoints.push(points);
// now draw the shadows if not stacked.
// for stacked plots, they are predrawn by drawShadow
if (shadow && !this._stack) {
var sopts = $.extend(true, {}, opts);
// need to get rid of fillStyle on shadow.
delete sopts.fillStyle;
this.renderer.shadowRenderer.draw(ctx, points, sopts);
}
var clr = opts.fillStyle || this.color;
this._dataColors.push(clr);
this.renderer.shapeRenderer.draw(ctx, points, opts);
}
}
else if (this.barDirection == 'horizontal'){
for (var i=0; i<gridData.length; i++) {
if (!this._stack && this.data[i][0] == null) {
continue;
}
points = [];
base = gridData[i][1] - this._barNudge;
xstart;
if (this._stack && this._prevGridData.length) {
xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x');
}
// not stacked
else {
if (this.fillToZero) {
xstart = this._xaxis.series_u2p(0);
}
else if (this.waterfall && i > 0 && i < this.gridData.length-1) {
xstart = this.gridData[i-1][0];
}
else if (this.waterfall && i == 0 && i < this.gridData.length-1) {
if (this._xaxis.min <= 0 && this._xaxis.max >= 0) {
xstart = this._xaxis.series_u2p(0);
}
else if (this._xaxis.min > 0) {
xstart = 0;
}
else {
xstart = 0;
}
}
else if (this.waterfall && i == this.gridData.length - 1) {
if (this._xaxis.min <= 0 && this._xaxis.max >= 0) {
xstart = this._xaxis.series_u2p(0);
}
else if (this._xaxis.min > 0) {
xstart = 0;
}
else {
xstart = ctx.canvas.width;
}
}
else {
xstart = 0;
}
}
if ((this.fillToZero && this._plotData[i][0] < 0) || (this.waterfall && this._data[i][0] < 0)) {
if (this.varyBarColor && !this._stack) {
if (this.useNegativeColors) {
opts.fillStyle = negativeColors.next();
}
else {
opts.fillStyle = positiveColors.next();
}
}
else {
opts.fillStyle = negativeColor;
}
}
else {
if (this.varyBarColor && !this._stack) {
opts.fillStyle = positiveColors.next();
}
else {
opts.fillStyle = positiveColor;
}
}
if (!this.fillToZero || this._plotData[i][0] >= 0) {
points.push([xstart, base + this.barWidth / 2]);
points.push([xstart, base - this.barWidth / 2]);
points.push([gridData[i][0], base - this.barWidth / 2]);
points.push([gridData[i][0], base + this.barWidth / 2]);
}
else {
points.push([gridData[i][0], base + this.barWidth / 2]);
points.push([gridData[i][0], base - this.barWidth / 2]);
points.push([xstart, base - this.barWidth / 2]);
points.push([xstart, base + this.barWidth / 2]);
}
this._barPoints.push(points);
// now draw the shadows if not stacked.
// for stacked plots, they are predrawn by drawShadow
if (shadow && !this._stack) {
var sopts = $.extend(true, {}, opts);
delete sopts.fillStyle;
this.renderer.shadowRenderer.draw(ctx, points, sopts);
}
var clr = opts.fillStyle || this.color;
this._dataColors.push(clr);
this.renderer.shapeRenderer.draw(ctx, points, opts);
}
}
}
if (this.highlightColors.length == 0) {
this.highlightColors = $.jqplot.computeHighlightColors(this._dataColors);
}
else if (typeof(this.highlightColors) == 'string') {
var temp = this.highlightColors;
this.highlightColors = [];
for (var i=0; i<this._dataColors.length; i++) {
this.highlightColors.push(temp);
}
}
};
// for stacked plots, shadows will be pre drawn by drawShadow.
$.jqplot.BarRenderer.prototype.drawShadow = function(ctx, gridData, options, plot) {
var i;
var opts = (options != undefined) ? options : {};
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
var xaxis = this.xaxis;
var yaxis = this.yaxis;
var xp = this._xaxis.series_u2p;
var yp = this._yaxis.series_u2p;
var pointx, points, pointy, nvals, nseries, pos;
if (this._stack && this.shadow) {
if (this.barWidth == null) {
this.renderer.setBarWidth.call(this);
}
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
nvals = temp[0];
nseries = temp[1];
pos = temp[2];
if (this._stack) {
this._barNudge = 0;
}
else {
this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding);
}
if (showLine) {
if (this.barDirection == 'vertical') {
for (var i=0; i<gridData.length; i++) {
if (this.data[i][1] == null) {
continue;
}
points = [];
var base = gridData[i][0] + this._barNudge;
var ystart;
if (this._stack && this._prevGridData.length) {
ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y');
}
else {
if (this.fillToZero) {
ystart = this._yaxis.series_u2p(0);
}
else {
ystart = ctx.canvas.height;
}
}
points.push([base-this.barWidth/2, ystart]);
points.push([base-this.barWidth/2, gridData[i][1]]);
points.push([base+this.barWidth/2, gridData[i][1]]);
points.push([base+this.barWidth/2, ystart]);
this.renderer.shadowRenderer.draw(ctx, points, opts);
}
}
else if (this.barDirection == 'horizontal'){
for (var i=0; i<gridData.length; i++) {
if (this.data[i][0] == null) {
continue;
}
points = [];
var base = gridData[i][1] - this._barNudge;
var xstart;
if (this._stack && this._prevGridData.length) {
xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x');
}
else {
if (this.fillToZero) {
xstart = this._xaxis.series_u2p(0);
}
else {
xstart = 0;
}
}
points.push([xstart, base+this.barWidth/2]);
points.push([gridData[i][0], base+this.barWidth/2]);
points.push([gridData[i][0], base-this.barWidth/2]);
points.push([xstart, base-this.barWidth/2]);
this.renderer.shadowRenderer.draw(ctx, points, opts);
}
}
}
}
};
function postInit(target, data, options) {
for (var i=0; i<this.series.length; i++) {
if (this.series[i].renderer.constructor == $.jqplot.BarRenderer) {
// don't allow mouseover and mousedown at same time.
if (this.series[i].highlightMouseOver) {
this.series[i].highlightMouseDown = false;
}
}
}
}
// called within context of plot
// create a canvas which we can draw on.
// insert it before the eventCanvas, so eventCanvas will still capture events.
function postPlotDraw() {
// Memory Leaks patch
if (this.plugins.barRenderer && this.plugins.barRenderer.highlightCanvas) {
this.plugins.barRenderer.highlightCanvas.resetCanvas();
this.plugins.barRenderer.highlightCanvas = null;
}
this.plugins.barRenderer = {highlightedSeriesIndex:null};
this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions, this));
this.plugins.barRenderer.highlightCanvas.setContext();
this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
}
function highlight (plot, sidx, pidx, points) {
var s = plot.series[sidx];
var canvas = plot.plugins.barRenderer.highlightCanvas;
canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
s._highlightedPoint = pidx;
plot.plugins.barRenderer.highlightedSeriesIndex = sidx;
var opts = {fillStyle: s.highlightColors[pidx]};
s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
canvas = null;
}
function unhighlight (plot) {
var canvas = plot.plugins.barRenderer.highlightCanvas;
canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
for (var i=0; i<plot.series.length; i++) {
plot.series[i]._highlightedPoint = null;
}
plot.plugins.barRenderer.highlightedSeriesIndex = null;
plot.target.trigger('jqplotDataUnhighlight');
canvas = null;
}
function handleMove(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
var evt1 = jQuery.Event('jqplotDataMouseOver');
evt1.pageX = ev.pageX;
evt1.pageY = ev.pageY;
plot.target.trigger(evt1, ins);
if (plot.series[ins[0]].show && plot.series[ins[0]].highlightMouseOver &&
!(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
var evt = jQuery.Event('jqplotDataHighlight');
evt.which = ev.which;
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
plot.target.trigger(evt, ins);
highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
}
}
else if (neighbor == null) {
unhighlight (plot);
}
}
function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
var evt = jQuery.Event('jqplotDataHighlight');
evt.which = ev.which;
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
plot.target.trigger(evt, ins);
highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
}
}
else if (neighbor == null) {
unhighlight (plot);
}
}
function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
var idx = plot.plugins.barRenderer.highlightedSeriesIndex;
if (idx != null && plot.series[idx].highlightMouseDown) {
unhighlight(plot);
}
}
function handleClick(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
var evt = jQuery.Event('jqplotDataClick');
evt.which = ev.which;
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
plot.target.trigger(evt, ins);
}
}
function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
var idx = plot.plugins.barRenderer.highlightedSeriesIndex;
if (idx != null && plot.series[idx].highlightMouseDown) {
unhighlight(plot);
}
var evt = jQuery.Event('jqplotDataRightClick');
evt.which = ev.which;
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
plot.target.trigger(evt, ins);
}
}
})(jQuery);

Some files were not shown because too many files have changed in this diff Show More