mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-02 11:18:56 +00:00
Fixed blank list view, updated Games.php and Steam.php
This commit is contained in:
@@ -561,8 +561,19 @@ class Games
|
||||
}
|
||||
|
||||
if (!empty($this->_gameResults['gamedetails']['Release Date'])) {
|
||||
$date = \DateTime::createFromFormat('j M Y', $this->_gameResults['gamedetails']['Release Date']);
|
||||
$con['releasedate'] = $this->pdo->escapeString((string)$date->format('Y-m-d'));
|
||||
$dateReleased = $this->_gameResults['gamedetails']['Release Date'];
|
||||
if (!preg_match('#^\s*(?P<month>\w+)\s+(?P<day>\d{1,2}),?\s+(?P<year>\d{4})\s*$#',
|
||||
$dateReleased)) {
|
||||
if (preg_match('#^\s*(?P<month>\w+)\s+(?P<year>\d{4})\s*$#',
|
||||
$dateReleased, $matches)) {
|
||||
$dateReleased = "{$matches['month']} 1, {$matches['year']}";
|
||||
}
|
||||
}
|
||||
|
||||
$date = \DateTime::createFromFormat('M/j/Y', $dateReleased);
|
||||
if ($date instanceof \DateTime) {
|
||||
$con['releasedate'] = (string)$date->format('Y-m-d');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->_gameResults['description'])) {
|
||||
|
||||
+182
-214
@@ -1,16 +1,11 @@
|
||||
<?php
|
||||
|
||||
require_once(WWW_DIR . "../misc/update_scripts/nix_scripts/tmux/lib/simple_html_dom.php");
|
||||
require_once(WWW_DIR . "lib/util.php");
|
||||
|
||||
Class Steam
|
||||
class Steam
|
||||
{
|
||||
|
||||
const STEAMURL = "http://store.steampowered.com";
|
||||
const STEAMVARS = "/search/?category1=998&os=win&sort_order=ASC&page=1&term=";
|
||||
const AGECHECKURL = "http://store.steampowered.com/agecheck/app/";
|
||||
const GAMEURL = "http://store.steampowered.com/app/";
|
||||
const CDNURL = "http://cdn.akamai.steamstatic.com/steam/apps/";
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
@@ -21,16 +16,17 @@ Class Steam
|
||||
*/
|
||||
public $searchTerm;
|
||||
|
||||
const AGECHECKURL = "http://store.steampowered.com/agecheck/app/";
|
||||
const CDNURL = "http://cdn.akamai.steamstatic.com/steam/apps/";
|
||||
const GAMEURL = "http://store.steampowered.com/app/";
|
||||
const STEAMURL = "http://store.steampowered.com";
|
||||
const STEAMVARS = "/search/?category1=998&os=win&sort_order=ASC&page=1&term=";
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $_ageCheckSet = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_directURL = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
@@ -41,6 +37,11 @@ Class Steam
|
||||
*/
|
||||
protected $_ch;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_directURL = '';
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
@@ -101,7 +102,7 @@ Class Steam
|
||||
$this->_html = new simple_html_dom();
|
||||
$this->_editHtml = new simple_html_dom();
|
||||
if (isset($this->cookie)) {
|
||||
@$this->_getURL(self::STEAMURL);
|
||||
$this->getUrl(self::STEAMURL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +118,47 @@ Class Steam
|
||||
unset($this->_response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Details of the game (Studio,Release Date, Developer)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function details()
|
||||
{
|
||||
if ($this->_ret = $this->_html->find("div.details_block", 0)) {
|
||||
$textarr = array();
|
||||
foreach ($this->_ret->find('text') as $text) {
|
||||
$text = trim($text->plaintext);
|
||||
if (!empty($text)) {
|
||||
$textarr[] = rtrim($text, ":");
|
||||
}
|
||||
}
|
||||
$totaldetails = count($textarr) - 1;
|
||||
for ($i = 0; $i <= $totaldetails;) {
|
||||
if ($textarr[$i] == "Release Date") {
|
||||
$pregmatchdate = $textarr[$i+1];
|
||||
if (preg_match_all('#(?P<day>[0-3]?\d)[^\d]|(?P<month>Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)|(?P<year>(19|20)\d{2})#i',
|
||||
$pregmatchdate,
|
||||
$matches)) {
|
||||
|
||||
$matches = array_map('array_filter', $matches);
|
||||
$matches = array_map('array_values', $matches);
|
||||
$matchday = isset($matches['day'][0]) ? $matches['day'][0] : '1';
|
||||
$matchmonth = isset($matches['month'][0]) ? $matches['month'][0] : '';
|
||||
$matchyear = isset($matches['year'][0]) ? $matches['year'][0] : '';
|
||||
if (!empty($matchday) && !empty($matchmonth) && !empty($matchyear)) {
|
||||
$textarr[$i + 1] = $matchmonth . '/' . $matchday . '/' . $matchyear;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_res['gamedetails'][$textarr[$i]] = $textarr[$i+1];
|
||||
$i = $i+2;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Game Description Snippet
|
||||
*
|
||||
@@ -131,194 +173,6 @@ Class Steam
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Game System Requirements - Minimum and Recommended
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function gameRequirements()
|
||||
{
|
||||
if ($this->_ret = $this->_html->find("div#game_area_sys_req_leftCol", 0)) {
|
||||
foreach ($this->_ret->find("li") as $req) {
|
||||
$this->_res['gamerequirements']['minimum'][] = trim($req->plaintext);
|
||||
}
|
||||
if (false !== $key = preg_grep("/Partner Requirements/",
|
||||
$this->_res['gamerequirements']['minimum']
|
||||
)
|
||||
) {
|
||||
$key = array_keys($key);
|
||||
if (isset($key[0])) {
|
||||
unset($this->_res['gamerequirements']['minimum'][$key[0]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->_ret = $this->_html->find("div#game_area_sys_req_rightCol", 0)) {
|
||||
foreach ($this->_ret->find("li") as $req) {
|
||||
$this->_res['gamerequirements']['recommended'][] = trim($req->plaintext);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the metacritic Rating
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rating()
|
||||
{
|
||||
if (isset($this->_response) && isset($this->_title)) {
|
||||
if ($this->_ret = $this->_html->find("div#game_area_metascore", 0)) {
|
||||
$this->_res['rating'] = (int)$this->_ret->plaintext;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the (cover and backdrop image)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function images()
|
||||
{
|
||||
if (isset($this->_response) && isset($this->_title)) {
|
||||
if ($this->_ret = $this->_html->find("img.game_header_image", 0)) {
|
||||
$this->_res['cover'] = $this->_ret->src;
|
||||
}
|
||||
if ($this->_ret = $this->_html->find("div.screenshot_holder", 0)) {
|
||||
if ($this->_ret = $this->_ret->find("a", 0)) {
|
||||
if (preg_match('/\?url\=(?<imgurl>.*)/', $this->_ret->href, $matches)) {
|
||||
$this->_res['backdrop'] = trim($matches['imgurl']);
|
||||
} else {
|
||||
$this->_res['backdrop'] = trim($this->_ret->href);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Details of the game (Studio,Release Date, Developer)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function details()
|
||||
{
|
||||
if ($this->_ret = $this->_html->find("div.details_block", 0)) {
|
||||
foreach ($this->_ret->find("br") as $b) {
|
||||
$this->_ret = rtrim($b->next_sibling()->innertext, ":");
|
||||
$ret2 = trim($b->next_sibling()->next_sibling()->innertext);
|
||||
if ($this->_ret !== "Languages") {
|
||||
if ($this->_ret === "Release Date") {
|
||||
preg_match('/(?<releasedate>[0-9]{1,2}\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+[0-9]{4})/i', $this->_response, $matches);
|
||||
if (isset($matches['releasedate'])) {
|
||||
$ret2 = $matches['releasedate'];
|
||||
}
|
||||
}
|
||||
$this->_res['gamedetails'][$this->_ret] = $ret2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Video for the game
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function trailer()
|
||||
{
|
||||
if (preg_match('/store.steampowered.com\/video\//', $this->_response)) {
|
||||
$this->_res['trailer'] = self::STEAMURL . '/video/' . $this->_steamGameID;
|
||||
@$this->_getURL($this->_res['trailer']);
|
||||
if (preg_match('@FILENAME\:\s+(?<videourl>\"\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))")@',
|
||||
$this->_response,
|
||||
$matches
|
||||
)
|
||||
) {
|
||||
if (isset($matches['videourl'])) {
|
||||
$this->_res['trailer'] = trim($matches['videourl'], '"');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (preg_match('/movie480.webm\?t\=(?<videoidentifier>\d+)/', $this->_response, $matches)) {
|
||||
$this->_res['trailer'] = self::CDNURL . $this->_steamGameID . '/movie480.webm?t=' . trim($matches['videoidentifier'], '"');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for a game for a 90% match
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
if (!isset($this->searchTerm)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->_getURL(self::STEAMURL . self::STEAMVARS . rawurlencode($this->searchTerm)) !== false) {
|
||||
$title = null;
|
||||
if ($this->_ret = $this->_html->find("div.search_pagination_left", 1)) {
|
||||
if (preg_match('/\d+ of (?<total>\d+)/', trim($this->_ret->plaintext), $matches)) {
|
||||
$this->_totalResults = (int)$matches['total'];
|
||||
}
|
||||
if ($this->_totalResults > 0) {
|
||||
foreach ($this->_html->find("a.search_result_row") as $result) {
|
||||
if (preg_match('/\<h4\>(?<name>.*)\<\/h4\>/i',
|
||||
$result->innertext,
|
||||
$matches
|
||||
)
|
||||
) {
|
||||
$title = $matches['name'];
|
||||
}
|
||||
if (isset($title)) {
|
||||
similar_text($title, $this->searchTerm, $p);
|
||||
if ($p > 90) {
|
||||
$this->_title = $title;
|
||||
if (isset($result->href)) {
|
||||
preg_match('/\/app\/(?<id>\d+)\//', $result->href, $matches);
|
||||
$this->_steamGameID = $matches['id'];
|
||||
$this->_directURL = self::GAMEURL . $this->_steamGameID . '/';
|
||||
@$this->_getURL($result->href);
|
||||
@$this->ageCheck();
|
||||
break;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($this->_title)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all Information for the game.
|
||||
*
|
||||
@@ -335,9 +189,6 @@ Class Steam
|
||||
if (is_array($this->gameDescription())) {
|
||||
$results = array_merge($results, $this->gameDescription());
|
||||
}
|
||||
if (is_array($this->gameRequirements())) {
|
||||
$results = array_merge($results, $this->gameRequirements());
|
||||
}
|
||||
if (is_array($this->details())) {
|
||||
$results = array_merge($results, $this->details());
|
||||
}
|
||||
@@ -354,6 +205,123 @@ Class Steam
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the (cover and backdrop image)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function images()
|
||||
{
|
||||
if ($this->_ret = $this->_html->find("img.game_header_image_full", 0)) {
|
||||
$this->_res['cover'] = $this->_ret->src;
|
||||
}
|
||||
if ($this->_ret = $this->_html->find("div.screenshot_holder", 0)) {
|
||||
if ($this->_ret = $this->_ret->find("a", 0)) {
|
||||
if(preg_match('/\?url\=(?<imgurl>.*)/', $this->_ret->href, $matches)){
|
||||
$this->_res['backdrop'] = trim($matches['imgurl']);
|
||||
}else{
|
||||
$this->_res['backdrop'] = trim($this->_ret->href);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the metacritic Rating
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rating()
|
||||
{
|
||||
if ($this->_ret = $this->_html->find("div#game_area_metascore", 0)) {
|
||||
$this->_res['rating'] = (int)$this->_ret->plaintext;
|
||||
}
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for a game for a 90% match
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
if (!isset($this->searchTerm)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->getUrl(self::STEAMURL . self::STEAMVARS . rawurlencode($this->searchTerm)) !== false) {
|
||||
$title = null;
|
||||
if ($this->_ret = $this->_html->find("div.search_pagination_left", 0)) {
|
||||
if (preg_match('/\d+ of (?<total>\d+)/', trim($this->_ret->plaintext), $matches)) {
|
||||
$this->_totalResults = (int)$matches['total'];
|
||||
}
|
||||
if ($this->_totalResults > 0) {
|
||||
foreach ($this->_html->find("a.search_result_row") as $result) {
|
||||
foreach ($result->find("span.title") as $searchtitle) {
|
||||
$title = (string)trim($searchtitle->innertext);
|
||||
}
|
||||
if (isset($title)) {
|
||||
similar_text(strtolower($title), strtolower($this->searchTerm), $p);
|
||||
if ($p > 90) {
|
||||
$this->_title = $title;
|
||||
if (isset($result->href)) {
|
||||
preg_match('/\/app\/(?<id>\d+)\//', $result->href, $matches);
|
||||
$this->_steamGameID = $matches['id'];
|
||||
$this->_directURL = self::GAMEURL . $this->_steamGameID . '/';
|
||||
$this->getUrl($result->href);
|
||||
$this->ageCheck();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($this->_title)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Video for the game
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function trailer()
|
||||
{
|
||||
if (preg_match('/store.steampowered.com\/video\//', $this->_response)) {
|
||||
$this->_res['trailer'] = self::STEAMURL . '/video/' . $this->_steamGameID;
|
||||
$this->getUrl($this->_res['trailer']);
|
||||
if (preg_match('@FILENAME\:\s+(?<videourl>\"\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))")@', $this->_response, $matches)
|
||||
) {
|
||||
if (isset($matches['videourl'])) {
|
||||
$this->_res['trailer'] = trim($matches['videourl'], '"');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (preg_match('/movie480.webm\?t\=(?<videoidentifier>\d+)/', $this->_response, $matches)
|
||||
) {
|
||||
$this->_res['trailer'] = self::CDNURL . $this->_steamGameID . '/movie480.webm?t=' . trim($matches['videoidentifier'], '"');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets agecheck, retreive agecheck cookie information
|
||||
*
|
||||
@@ -362,30 +330,29 @@ Class Steam
|
||||
{
|
||||
if (isset($this->cookie)) {
|
||||
$this->extractCookies(file_get_contents($this->cookie));
|
||||
if ($this->_ageCheckSet === false) {
|
||||
if($this->_ageCheckSet === false) {
|
||||
$this->_postParams = array(
|
||||
"snr" => "1_agecheck_agecheck__age-gate",
|
||||
"ageDay" => "1",
|
||||
"snr" => "1_agecheck_agecheck__age-gate",
|
||||
"ageDay" => "1",
|
||||
"ageMonth" => "May",
|
||||
"ageYear" => "1966"
|
||||
"ageYear" => "1966"
|
||||
);
|
||||
// Do twice so steam can set a birthtime/lastagecheckage cookie value
|
||||
@$this->_getURL(self::AGECHECKURL . $this->_steamGameID . '/', true);
|
||||
@$this->_getURL(self::AGECHECKURL . $this->_steamGameID . '/', true);
|
||||
|
||||
$this->getUrl(self::AGECHECKURL . $this->_steamGameID . '/', true);
|
||||
}
|
||||
}
|
||||
@$this->_getURL(self::GAMEURL . $this->_steamGameID . '/');
|
||||
$this->getUrl(self::GAMEURL . $this->_steamGameID . '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Raw Html
|
||||
*
|
||||
* @param string $fetchURL
|
||||
* @param bool $usePost
|
||||
* @param bool $usePost
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function _getURL($fetchURL, $usePost = false)
|
||||
private function getUrl($fetchURL, $usePost = false)
|
||||
{
|
||||
if (isset($fetchURL)) {
|
||||
$this->_ch = curl_init($fetchURL);
|
||||
@@ -403,6 +370,7 @@ Class Steam
|
||||
curl_setopt($this->_ch, CURLOPT_COOKIEJAR, $this->cookie);
|
||||
curl_setopt($this->_ch, CURLOPT_COOKIEFILE, $this->cookie);
|
||||
}
|
||||
curl_setopt_array($this->_ch, Utility::curlSslContextOptions());
|
||||
$this->_response = curl_exec($this->_ch);
|
||||
if (!$this->_response) {
|
||||
curl_close($this->_ch);
|
||||
|
||||
@@ -117,7 +117,7 @@ class TmuxOutput extends Tmux
|
||||
$buffer = '';
|
||||
$state = ($this->runVar['settings']['is_running'] == 1) ? 'Running' : 'Disabled';
|
||||
//$version = $this->_tvers . 'r' . $this->_vers;
|
||||
$tversion = '0.5r0030';
|
||||
$tversion = '0.5r0032';
|
||||
|
||||
$buffer .= sprintf($this->tmpMasks[2],
|
||||
"Monitor $state v$tversion @ $this->_tvers [" . $this->_vers ."]: ",
|
||||
|
||||
@@ -349,10 +349,10 @@ class Backfill
|
||||
sprintf('
|
||||
UPDATE groups
|
||||
SET first_record_postdate = %s, first_record = %s, last_updated = NOW()
|
||||
WHERE id = %d',
|
||||
WHERE ID = %d',
|
||||
$this->pdo->from_unixtime($newdate),
|
||||
$this->pdo->escapeString($first),
|
||||
$groupArr['id'])
|
||||
$groupArr['ID'])
|
||||
);
|
||||
if ($first == $targetpost) {
|
||||
$done = true;
|
||||
|
||||
+106
-112
@@ -342,125 +342,83 @@ class Releases
|
||||
|
||||
|
||||
/**
|
||||
* Get a count of releases for main browse pager.
|
||||
* Used for pager on browse page.
|
||||
*
|
||||
* @param array $cat
|
||||
* @param int $maxAge
|
||||
* @param array $excludedCats
|
||||
* @param string $groupName
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBrowseCount($cat, $maxage = -1, $excludedcats = array(), $grp = array())
|
||||
public function getBrowseCount($cat, $maxAge = -1, $excludedCats = [], $groupName = '')
|
||||
{
|
||||
|
||||
|
||||
$catsrch = "";
|
||||
if (count($cat) > 0 && $cat[0] != -1) {
|
||||
$catsrch = " and (";
|
||||
foreach ($cat as $category) {
|
||||
if ($category != -1) {
|
||||
$categ = new Categorize();
|
||||
if ($categ->isParent($category)) {
|
||||
$children = $categ->getChildren($category);
|
||||
$chlist = "-99";
|
||||
foreach ($children as $child)
|
||||
$chlist .= ", " . $child["ID"];
|
||||
|
||||
if ($chlist != "-99")
|
||||
$catsrch .= " releases.categoryID in (" . $chlist . ") or ";
|
||||
} else {
|
||||
$catsrch .= sprintf(" releases.categoryID = %d or ", $category);
|
||||
}
|
||||
}
|
||||
}
|
||||
$catsrch .= "1=2 )";
|
||||
}
|
||||
|
||||
if ($maxage > 0)
|
||||
$maxage = sprintf(" and postdate > now() - interval %d day ", $maxage);
|
||||
else
|
||||
$maxage = "";
|
||||
|
||||
$grpsql = "";
|
||||
if (count($grp) > 0) {
|
||||
$grpsql = " and (";
|
||||
foreach ($grp as $grpname) {
|
||||
$grpsql .= sprintf(" groups.name = %s or ", $this->pdo->escapeString(str_replace("a.b.", "alt.binaries.", $grpname)));
|
||||
}
|
||||
$grpsql .= "1=2 )";
|
||||
}
|
||||
|
||||
$exccatlist = "";
|
||||
if (count($excludedcats) > 0)
|
||||
$exccatlist = " and categoryID not in (" . implode(",", $excludedcats) . ")";
|
||||
|
||||
$sql = sprintf("SELECT count(releases.ID) AS num FROM releases LEFT OUTER JOIN groups ON groups.ID = releases.groupID WHERE releases.passwordstatus <= (SELECT value FROM site WHERE setting='showpasswordedrelease') %s %s %s %s", $catsrch, $maxage, $exccatlist, $grpsql);
|
||||
$res = $this->pdo->queryOneRow($sql, true);
|
||||
|
||||
return $res["num"];
|
||||
return $this->getPagerCount(
|
||||
sprintf(
|
||||
'SELECT r.id
|
||||
FROM releases r
|
||||
%s
|
||||
WHERE r.nzbstatus = %d
|
||||
AND r.passwordstatus %s
|
||||
%s %s %s %s',
|
||||
($groupName != '' ? 'INNER JOIN groups g ON g.ID = r.groupID' : ''),
|
||||
Enzebe::NZB_ADDED,
|
||||
$this->showPasswords(),
|
||||
($groupName != '' ? sprintf(' AND g.name = %s', $this->pdo->escapeString($groupName)) : ''),
|
||||
$this->categorySQL($cat),
|
||||
($maxAge > 0 ? (' AND r.postdate > NOW() - INTERVAL ' . $maxAge . ' DAY ') : ''),
|
||||
(count($excludedCats) ? (' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')') : '')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a releases for main browse pages.
|
||||
* Used for browse results.
|
||||
*
|
||||
* @param array $cat
|
||||
* @param $start
|
||||
* @param $num
|
||||
* @param string $orderBy
|
||||
* @param int $maxAge
|
||||
* @param array $excludedCats
|
||||
* @param string $groupName
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getBrowseRange($cat, $start, $num, $orderby, $maxage = -1, $excludedcats = array(), $grp = array())
|
||||
public function getBrowseRange($cat, $start, $num, $orderBy, $maxAge = -1, $excludedCats = [], $groupName = '')
|
||||
{
|
||||
|
||||
|
||||
if ($start === false)
|
||||
$limit = "";
|
||||
else
|
||||
$limit = " LIMIT " . $start . "," . $num;
|
||||
|
||||
$usecatindex = "";
|
||||
$catsrch = "";
|
||||
if (count($cat) > 0 && $cat[0] != -1) {
|
||||
$catsrch = " and (";
|
||||
foreach ($cat as $category) {
|
||||
if ($category != -1) {
|
||||
$categ = new Categorize();
|
||||
if ($categ->isParent($category)) {
|
||||
$children = $categ->getChildren($category);
|
||||
$chlist = "-99";
|
||||
foreach ($children as $child)
|
||||
$chlist .= ", " . $child["ID"];
|
||||
|
||||
if ($chlist != "-99")
|
||||
$catsrch .= " releases.categoryID in (" . $chlist . ") or ";
|
||||
} else {
|
||||
$catsrch .= sprintf(" releases.categoryID = %d or ", $category);
|
||||
}
|
||||
}
|
||||
}
|
||||
$catsrch .= "1=2 )";
|
||||
$usecatindex = " use index (ix_releases_categoryID) ";
|
||||
}
|
||||
|
||||
$maxagesql = "";
|
||||
if ($maxage > 0)
|
||||
$maxagesql = sprintf(" and postdate > now() - interval %d day ", $maxage);
|
||||
|
||||
$grpsql = "";
|
||||
if (count($grp) > 0) {
|
||||
$grpsql = "SELECT ID FROM groups WHERE (";
|
||||
foreach ($grp as $grpname)
|
||||
$grpsql .= sprintf(" groups.name = %s or ", $this->pdo->escapeString(str_replace("a.b.", "alt.binaries.", $grpname)));
|
||||
|
||||
$grpsql .= "1=2 )";
|
||||
|
||||
$grpres = $this->pdo->query($grpsql);
|
||||
if (count($grpsql) > 0) {
|
||||
$grpsql = " and ( ";
|
||||
foreach ($grpres as $grpresrow)
|
||||
$grpsql .= sprintf(" groups.ID = %d or ", $grpresrow["ID"]);
|
||||
|
||||
$grpsql = substr($grpsql, 0, strlen($grpsql) - 3) . " ) ";
|
||||
} else
|
||||
$grpsql = "";
|
||||
}
|
||||
|
||||
$exccatlist = "";
|
||||
if (count($excludedcats) > 0)
|
||||
$exccatlist = " and releases.categoryID not in (" . implode(",", $excludedcats) . ")";
|
||||
|
||||
$order = $this->getBrowseOrder($orderby);
|
||||
$sql = sprintf(" SELECT releases.*, concat(cp.title, ' > ', c.title) AS category_name, concat(cp.ID, ',', c.ID) AS category_ids, groups.name AS group_name, rn.ID AS nfoID, re.releaseID AS reID, pre.ctime, pre.nuketype, coalesce(movieinfo.ID,0) AS movieinfoID FROM releases %s LEFT OUTER JOIN groups ON groups.ID = releases.groupID LEFT OUTER JOIN movieinfo ON movieinfo.imdbID = releases.imdbID LEFT OUTER JOIN releaseaudio re ON re.releaseID = releases.ID AND re.audioID = 1 LEFT OUTER JOIN releasenfo rn ON rn.releaseID = releases.ID AND rn.nfo IS NOT NULL LEFT OUTER JOIN category c ON c.ID = releases.categoryID LEFT OUTER JOIN category cp ON cp.ID = c.parentID LEFT OUTER JOIN predb pre ON pre.ID = releases.preID WHERE releases.passwordstatus <= (SELECT VALUE FROM site WHERE setting='showpasswordedrelease') %s %s %s %s ORDER BY %s %s" . $limit, $usecatindex, $catsrch, $maxagesql, $exccatlist, $grpsql, $order[0], $order[1]);
|
||||
|
||||
return $this->pdo->query($sql, true);
|
||||
$orderBy = $this->getBrowseOrder($orderBy);
|
||||
return $this->pdo->query(
|
||||
sprintf(
|
||||
"SELECT r.*,
|
||||
CONCAT(cp.title, ' > ', c.title) AS category_name,
|
||||
CONCAT(cp.id, ',', c.ID) AS category_ids,
|
||||
g.name AS group_name,
|
||||
rn.ID AS nfoid,
|
||||
re.releaseID AS reid
|
||||
FROM releases r
|
||||
STRAIGHT_JOIN groups g ON g.ID = r.groupID
|
||||
STRAIGHT_JOIN category c ON c.ID = r.categoryID
|
||||
INNER JOIN category cp ON cp.ID = c.parentID
|
||||
LEFT OUTER JOIN releasevideo re ON re.releaseID = r.ID
|
||||
LEFT OUTER JOIN releasenfo rn ON rn.releaseID = r.ID
|
||||
AND rn.nfo IS NOT NULL
|
||||
WHERE r.nzbstatus = %d
|
||||
AND r.passwordstatus %s
|
||||
%s %s %s %s
|
||||
ORDER BY %s %s %s",
|
||||
Enzebe::NZB_ADDED,
|
||||
$this->showPasswords(),
|
||||
$this->categorySQL($cat),
|
||||
($maxAge > 0 ? (" AND postdate > NOW() - INTERVAL " . $maxAge . ' DAY ') : ''),
|
||||
(count($excludedCats) ? (' AND r.categoryID NOT IN (' . implode(',', $excludedCats) . ')') : ''),
|
||||
($groupName != '' ? sprintf(' AND g.name = %s ', $this->pdo->escapeString($groupName)) : ''),
|
||||
$orderBy[0],
|
||||
$orderBy[1],
|
||||
($start === false ? '' : ' LIMIT ' . $num . ' OFFSET ' . $start)
|
||||
),
|
||||
true, NN_CACHE_EXPIRY_MEDIUM
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3030,4 +2988,40 @@ class Releases
|
||||
{
|
||||
return sha1(uniqid('', true) . mt_rand());
|
||||
}
|
||||
|
||||
/**
|
||||
* Buffer of the password status string to form part of the query.
|
||||
* @var null|string
|
||||
*/
|
||||
private $passwordSettingBuffer = null;
|
||||
|
||||
/**
|
||||
* Return site setting for hiding/showing passworded releases.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function showPasswords()
|
||||
{
|
||||
if (!is_null($this->passwordSettingBuffer)) {
|
||||
return $this->passwordSettingBuffer;
|
||||
}
|
||||
$setting = $this->pdo->queryOneRow(
|
||||
"SELECT value
|
||||
FROM site
|
||||
WHERE setting = 'showpasswordedrelease'"
|
||||
);
|
||||
$passwordStatus = ('= ' . \Releases::PASSWD_NONE);
|
||||
if ($setting !== false) {
|
||||
switch ($setting['value']) {
|
||||
case 1:
|
||||
$passwordStatus = ('<= ' . \Releases::PASSWD_POTENTIAL);
|
||||
break;
|
||||
case 10:
|
||||
$passwordStatus = ('<= ' . \Releases::PASSWD_RAR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->passwordSettingBuffer = $passwordStatus;
|
||||
return $passwordStatus;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
require_once(WWW_DIR."/lib/releases.php");
|
||||
require_once(WWW_DIR."/lib/category.php");
|
||||
|
||||
$releases = new Releases;
|
||||
$releases = new Releases(['Settings' => $page->settings]);
|
||||
|
||||
if (!$users->isLoggedIn())
|
||||
$page->show403();
|
||||
@@ -11,9 +11,10 @@ $category = -1;
|
||||
if (isset($_REQUEST["t"]) && ctype_digit($_REQUEST["t"]))
|
||||
$category = $_REQUEST["t"];
|
||||
|
||||
$grp = array();
|
||||
if (isset($_REQUEST["g"]))
|
||||
$grp = explode(",", $_REQUEST["g"]);
|
||||
$grp = "";
|
||||
if (isset($_REQUEST["g"])) {
|
||||
$grp = $_REQUEST["g"];
|
||||
}
|
||||
|
||||
$catarray = array();
|
||||
$catarray[] = $category;
|
||||
@@ -31,47 +32,45 @@ $results = $releases->getBrowseRange($catarray, $offset, ITEMS_PER_PAGE, $orderb
|
||||
$page->smarty->assign('pagertotalitems',$browsecount);
|
||||
$page->smarty->assign('pageroffset',$offset);
|
||||
$page->smarty->assign('pageritemsperpage',ITEMS_PER_PAGE);
|
||||
$page->smarty->assign('pagerquerybase', WWW_TOP."/browse?t=".$category.(count($grp) > 0 ? "&g=".$grp[0] : "")."&ob=".$orderby."&offset=");
|
||||
$page->smarty->assign('pagerquerybase', WWW_TOP . "/browse?t=" . $category . "&g=" . $grp . "&ob=" . $orderby . "&offset=");
|
||||
$page->smarty->assign('pagerquerysuffix', "#results");
|
||||
|
||||
$pager = $page->smarty->fetch("pager.tpl");
|
||||
$page->smarty->assign('pager', $pager);
|
||||
|
||||
$section = '';
|
||||
if ($category == -1 && count($grp) == 0)
|
||||
$page->smarty->assign("catname","All");
|
||||
elseif ($category != -1 && count($grp) == 0)
|
||||
{
|
||||
$cat = new Category();
|
||||
$covgroup = '';
|
||||
if ($category == -1 && $grp == "") {
|
||||
$page->smarty->assign("catname", "All");
|
||||
} elseif ($category != -1 && $grp == "") {
|
||||
$cat = new Category(['Settings' => $releases->pdo]);
|
||||
$cdata = $cat->getById($category);
|
||||
|
||||
if ($cdata) {
|
||||
$page->smarty->assign('catname',$cdata["title"]);
|
||||
if ($cdata['parentID'] == Category::CAT_PARENT_GAME || $cdata['ID'] == Category::CAT_PARENT_GAME)
|
||||
$section = 'console';
|
||||
elseif ($cdata['ID'] == Category::CAT_BOOK_EBOOK)
|
||||
$section = 'books';
|
||||
elseif ($cdata['parentID'] == Category::CAT_PARENT_MOVIE || $cdata['ID'] == Category::CAT_PARENT_MOVIE)
|
||||
$section = 'movies';
|
||||
elseif ($cdata['parentID'] == Category::CAT_PARENT_PC || $cdata['ID'] == Category::CAT_PC_GAMES)
|
||||
$section = 'games';
|
||||
elseif ($cdata['parentID'] == Category::CAT_PARENT_XXX || $cdata['ID'] == Category::CAT_PARENT_XXX)
|
||||
$section = 'xxx';
|
||||
elseif ($cdata['parentID'] == Category::CAT_PARENT_MUSIC || $cdata['ID'] == Category::CAT_PARENT_MUSIC)
|
||||
$section = 'music';
|
||||
$page->smarty->assign('catname', $cdata["title"]);
|
||||
if ($cdata['parentID'] == Category::CAT_PARENT_GAME || $cdata['ID'] == Category::CAT_PARENT_GAME) {
|
||||
$covgroup = 'console';
|
||||
} elseif ($cdata['parentID'] == Category::CAT_PARENT_MOVIE || $cdata['ID'] == Category::CAT_PARENT_MOVIE) {
|
||||
$covgroup = 'movies';
|
||||
} elseif ($cdata['parentID'] == Category::CAT_PARENT_XXX || $cdata['ID'] == Category::CAT_PARENT_XXX) {
|
||||
$covgroup = 'xxx';
|
||||
} elseif ($cdata['parentID'] == Category::CAT_PARENT_PC || $cdata['ID'] == Category::CAT_PC_GAMES) {
|
||||
$covgroup = 'games';
|
||||
} elseif ($cdata['parentID'] == Category::CAT_PARENT_MUSIC || $cdata['ID'] == Category::CAT_PARENT_MUSIC) {
|
||||
$covgroup = 'music';
|
||||
} elseif ($cdata['parentID'] == Category::CAT_PARENT_BOOK || $cdata['ID'] == Category::CAT_PARENT_BOOK) {
|
||||
$covgroup = 'books';
|
||||
}
|
||||
} else {
|
||||
$page->show404();
|
||||
}
|
||||
} elseif ($grp != "") {
|
||||
$page->smarty->assign('catname', $grp);
|
||||
}
|
||||
elseif (count($grp) > 0)
|
||||
{
|
||||
$page->smarty->assign('catname',$grp[0]);
|
||||
|
||||
$page->smarty->assign('covgroup', $covgroup);
|
||||
|
||||
foreach ($ordering as $ordertype) {
|
||||
$page->smarty->assign('orderby' . $ordertype, WWW_TOP . "/browse?t=" . $category . "&g=" . $grp . "&ob=" . $ordertype . "&offset=0");
|
||||
}
|
||||
$page->smarty->assign('section',$section);
|
||||
|
||||
foreach($ordering as $ordertype)
|
||||
$page->smarty->assign('orderby'.$ordertype, WWW_TOP."/browse?t=".$category."&ob=".$ordertype."&offset=0".(count($grp) > 0 ? "&g=".$grp[0] : ""));
|
||||
|
||||
$page->smarty->assign('lastvisit',$page->userdata['lastlogin']);
|
||||
|
||||
$page->smarty->assign('results',$results);
|
||||
|
||||
@@ -0,0 +1,419 @@
|
||||
/*
|
||||
|
||||
Holder - 2.0 - client side image placeholders
|
||||
(c) 2012-2013 Ivan Malopinsky / http://imsky.co
|
||||
|
||||
Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
Commercial use requires attribution.
|
||||
|
||||
*/
|
||||
|
||||
var Holder = Holder || {};
|
||||
(function (app, win) {
|
||||
|
||||
var preempted = false,
|
||||
fallback = false,
|
||||
canvas = document.createElement('canvas');
|
||||
|
||||
//getElementsByClassName polyfill
|
||||
document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s})
|
||||
|
||||
//getComputedStyle polyfill
|
||||
window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this})
|
||||
|
||||
//http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications
|
||||
function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}};
|
||||
|
||||
//https://gist.github.com/991057 by Jed Schmidt with modifications
|
||||
function selector(a){
|
||||
a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]);
|
||||
var ret=[]; b!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]); return ret;
|
||||
}
|
||||
|
||||
//shallow object property extend
|
||||
function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}
|
||||
|
||||
//hasOwnProperty polyfill
|
||||
if (!Object.prototype.hasOwnProperty)
|
||||
Object.prototype.hasOwnProperty = function(prop) {
|
||||
var proto = this.__proto__ || this.constructor.prototype;
|
||||
return (prop in this) && (!(prop in proto) || proto[prop] !== this[prop]);
|
||||
}
|
||||
|
||||
function text_size(width, height, template) {
|
||||
height = parseInt(height,10);
|
||||
width = parseInt(width,10);
|
||||
var bigSide = Math.max(height, width)
|
||||
var smallSide = Math.min(height, width)
|
||||
var scale = 1 / 12;
|
||||
var newHeight = Math.min(smallSide * 0.75, 0.75 * bigSide * scale);
|
||||
return {
|
||||
height: Math.round(Math.max(template.size, newHeight))
|
||||
}
|
||||
}
|
||||
|
||||
function draw(ctx, dimensions, template, ratio) {
|
||||
var ts = text_size(dimensions.width, dimensions.height, template);
|
||||
var text_height = ts.height;
|
||||
var width = dimensions.width * ratio,
|
||||
height = dimensions.height * ratio;
|
||||
var font = template.font ? template.font : "sans-serif";
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillStyle = template.background;
|
||||
ctx.fillRect(0, 0, width, height);
|
||||
ctx.fillStyle = template.foreground;
|
||||
ctx.font = "bold " + text_height + "px " + font;
|
||||
var text = template.text ? template.text : (Math.floor(dimensions.width) + "x" + Math.floor(dimensions.height));
|
||||
var text_width = ctx.measureText(text).width;
|
||||
if (text_width / width >= 0.75) {
|
||||
text_height = Math.floor(text_height * 0.75 * (width/text_width));
|
||||
}
|
||||
//Resetting font size if necessary
|
||||
ctx.font = "bold " + (text_height * ratio) + "px " + font;
|
||||
ctx.fillText(text, (width / 2), (height / 2), width);
|
||||
return canvas.toDataURL("image/png");
|
||||
}
|
||||
|
||||
function render(mode, el, holder, src) {
|
||||
var dimensions = holder.dimensions,
|
||||
theme = holder.theme,
|
||||
text = holder.text ? decodeURIComponent(holder.text) : holder.text;
|
||||
var dimensions_caption = dimensions.width + "x" + dimensions.height;
|
||||
theme = (text ? extend(theme, {
|
||||
text: text
|
||||
}) : theme);
|
||||
theme = (holder.font ? extend(theme, {
|
||||
font: holder.font
|
||||
}) : theme);
|
||||
if (mode == "image") {
|
||||
el.setAttribute("data-src", src);
|
||||
el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption);
|
||||
if (fallback || !holder.auto) {
|
||||
el.style.width = dimensions.width + "px";
|
||||
el.style.height = dimensions.height + "px";
|
||||
}
|
||||
if (fallback) {
|
||||
el.style.backgroundColor = theme.background;
|
||||
} else {
|
||||
el.setAttribute("src", draw(ctx, dimensions, theme, ratio));
|
||||
}
|
||||
} else if (mode == "background") {
|
||||
if (!fallback) {
|
||||
el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")";
|
||||
el.style.backgroundSize = dimensions.width + "px " + dimensions.height + "px";
|
||||
}
|
||||
} else if (mode == "fluid") {
|
||||
el.setAttribute("data-src", src);
|
||||
el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption);
|
||||
if (dimensions.height.substr(-1) == "%") {
|
||||
el.style.height = dimensions.height
|
||||
} else {
|
||||
el.style.height = dimensions.height + "px"
|
||||
}
|
||||
if (dimensions.width.substr(-1) == "%") {
|
||||
el.style.width = dimensions.width
|
||||
} else {
|
||||
el.style.width = dimensions.width + "px"
|
||||
}
|
||||
if (el.style.display == "inline" || el.style.display == "") {
|
||||
el.style.display = "block";
|
||||
}
|
||||
if (fallback) {
|
||||
el.style.backgroundColor = theme.background;
|
||||
} else {
|
||||
el.holderData = holder;
|
||||
fluid_images.push(el);
|
||||
fluid_update(el);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function fluid_update(element) {
|
||||
var images;
|
||||
if (element.nodeType == null) {
|
||||
images = fluid_images;
|
||||
} else {
|
||||
images = [element]
|
||||
}
|
||||
for (i in images) {
|
||||
var el = images[i]
|
||||
if (el.holderData) {
|
||||
var holder = el.holderData;
|
||||
el.setAttribute("src", draw(ctx, {
|
||||
height: el.clientHeight,
|
||||
width: el.clientWidth
|
||||
}, holder.theme, ratio));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parse_flags(flags, options) {
|
||||
|
||||
var ret = {
|
||||
theme: settings.themes.gray
|
||||
}, render = false;
|
||||
|
||||
for (sl = flags.length, j = 0; j < sl; j++) {
|
||||
var flag = flags[j];
|
||||
if (app.flags.dimensions.match(flag)) {
|
||||
render = true;
|
||||
ret.dimensions = app.flags.dimensions.output(flag);
|
||||
} else if (app.flags.fluid.match(flag)) {
|
||||
render = true;
|
||||
ret.dimensions = app.flags.fluid.output(flag);
|
||||
ret.fluid = true;
|
||||
} else if (app.flags.colors.match(flag)) {
|
||||
ret.theme = app.flags.colors.output(flag);
|
||||
} else if (options.themes[flag]) {
|
||||
//If a theme is specified, it will override custom colors
|
||||
ret.theme = options.themes[flag];
|
||||
} else if (app.flags.text.match(flag)) {
|
||||
ret.text = app.flags.text.output(flag);
|
||||
} else if (app.flags.font.match(flag)) {
|
||||
ret.font = app.flags.font.output(flag);
|
||||
} else if (app.flags.auto.match(flag)) {
|
||||
ret.auto = true;
|
||||
}
|
||||
}
|
||||
|
||||
return render ? ret : false;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (!canvas.getContext) {
|
||||
fallback = true;
|
||||
} else {
|
||||
if (canvas.toDataURL("image/png")
|
||||
.indexOf("data:image/png") < 0) {
|
||||
//Android doesn't support data URI
|
||||
fallback = true;
|
||||
} else {
|
||||
var ctx = canvas.getContext("2d");
|
||||
}
|
||||
}
|
||||
|
||||
var dpr = 1, bsr = 1;
|
||||
|
||||
if(!fallback){
|
||||
dpr = window.devicePixelRatio || 1,
|
||||
bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;
|
||||
}
|
||||
|
||||
var ratio = dpr / bsr;
|
||||
|
||||
var fluid_images = [];
|
||||
|
||||
var settings = {
|
||||
domain: "holder.js",
|
||||
images: "img",
|
||||
bgnodes: ".holderjs",
|
||||
themes: {
|
||||
"gray": {
|
||||
background: "#eee",
|
||||
foreground: "#aaa",
|
||||
size: 12
|
||||
},
|
||||
"social": {
|
||||
background: "#3a5a97",
|
||||
foreground: "#fff",
|
||||
size: 12
|
||||
},
|
||||
"industrial": {
|
||||
background: "#434A52",
|
||||
foreground: "#C2F200",
|
||||
size: 12
|
||||
}
|
||||
},
|
||||
stylesheet: ""
|
||||
};
|
||||
|
||||
|
||||
app.flags = {
|
||||
dimensions: {
|
||||
regex: /^(\d+)x(\d+)$/,
|
||||
output: function (val) {
|
||||
var exec = this.regex.exec(val);
|
||||
return {
|
||||
width: +exec[1],
|
||||
height: +exec[2]
|
||||
}
|
||||
}
|
||||
},
|
||||
fluid: {
|
||||
regex: /^([0-9%]+)x([0-9%]+)$/,
|
||||
output: function (val) {
|
||||
var exec = this.regex.exec(val);
|
||||
return {
|
||||
width: exec[1],
|
||||
height: exec[2]
|
||||
}
|
||||
}
|
||||
},
|
||||
colors: {
|
||||
regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i,
|
||||
output: function (val) {
|
||||
var exec = this.regex.exec(val);
|
||||
return {
|
||||
size: settings.themes.gray.size,
|
||||
foreground: "#" + exec[2],
|
||||
background: "#" + exec[1]
|
||||
}
|
||||
}
|
||||
},
|
||||
text: {
|
||||
regex: /text\:(.*)/,
|
||||
output: function (val) {
|
||||
return this.regex.exec(val)[1];
|
||||
}
|
||||
},
|
||||
font: {
|
||||
regex: /font\:(.*)/,
|
||||
output: function (val) {
|
||||
return this.regex.exec(val)[1];
|
||||
}
|
||||
},
|
||||
auto: {
|
||||
regex: /^auto$/
|
||||
}
|
||||
}
|
||||
|
||||
for (var flag in app.flags) {
|
||||
if (!app.flags.hasOwnProperty(flag)) continue;
|
||||
app.flags[flag].match = function (val) {
|
||||
return val.match(this.regex)
|
||||
}
|
||||
}
|
||||
|
||||
app.add_theme = function (name, theme) {
|
||||
name != null && theme != null && (settings.themes[name] = theme);
|
||||
return app;
|
||||
};
|
||||
|
||||
app.add_image = function (src, el) {
|
||||
var node = selector(el);
|
||||
if (node.length) {
|
||||
for (var i = 0, l = node.length; i < l; i++) {
|
||||
var img = document.createElement("img")
|
||||
img.setAttribute("data-src", src);
|
||||
node[i].appendChild(img);
|
||||
}
|
||||
}
|
||||
return app;
|
||||
};
|
||||
|
||||
app.run = function (o) {
|
||||
var options = extend(settings, o),
|
||||
images = [], imageNodes = [], bgnodes = [];
|
||||
|
||||
if(typeof(options.images) == "string"){
|
||||
imageNodes = selector(options.images);
|
||||
}
|
||||
else if (window.NodeList && options.images instanceof window.NodeList) {
|
||||
imageNodes = options.images;
|
||||
} else if (window.Node && options.images instanceof window.Node) {
|
||||
imageNodes = [options.images];
|
||||
}
|
||||
|
||||
if(typeof(options.bgnodes) == "string"){
|
||||
bgnodes = selector(options.bgnodes);
|
||||
} else if (window.NodeList && options.elements instanceof window.NodeList) {
|
||||
bgnodes = options.bgnodes;
|
||||
} else if (window.Node && options.bgnodes instanceof window.Node) {
|
||||
bgnodes = [options.bgnodes];
|
||||
}
|
||||
|
||||
preempted = true;
|
||||
|
||||
for (i = 0, l = imageNodes.length; i < l; i++) images.push(imageNodes[i]);
|
||||
|
||||
var holdercss = document.getElementById("holderjs-style");
|
||||
if (!holdercss) {
|
||||
holdercss = document.createElement("style");
|
||||
holdercss.setAttribute("id", "holderjs-style");
|
||||
holdercss.type = "text/css";
|
||||
document.getElementsByTagName("head")[0].appendChild(holdercss);
|
||||
}
|
||||
|
||||
if (!options.nocss) {
|
||||
if (holdercss.styleSheet) {
|
||||
holdercss.styleSheet.cssText += options.stylesheet;
|
||||
} else {
|
||||
holdercss.appendChild(document.createTextNode(options.stylesheet));
|
||||
}
|
||||
}
|
||||
|
||||
var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)");
|
||||
|
||||
for (var l = bgnodes.length, i = 0; i < l; i++) {
|
||||
var src = window.getComputedStyle(bgnodes[i], null)
|
||||
.getPropertyValue("background-image");
|
||||
var flags = src.match(cssregex);
|
||||
var bgsrc = bgnodes[i].getAttribute("data-background-src");
|
||||
|
||||
if (flags) {
|
||||
var holder = parse_flags(flags[1].split("/"), options);
|
||||
if (holder) {
|
||||
render("background", bgnodes[i], holder, src);
|
||||
}
|
||||
}
|
||||
else if(bgsrc != null){
|
||||
var holder = parse_flags(bgsrc.substr(bgsrc.lastIndexOf(options.domain) + options.domain.length + 1)
|
||||
.split("/"), options);
|
||||
if(holder){
|
||||
render("background", bgnodes[i], holder, src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (l = images.length, i = 0; i < l; i++) {
|
||||
|
||||
var attr_src = attr_data_src = src = null;
|
||||
|
||||
try{
|
||||
attr_src = images[i].getAttribute("src");
|
||||
attr_datasrc = images[i].getAttribute("data-src");
|
||||
}catch(e){}
|
||||
|
||||
if (attr_datasrc == null && !! attr_src && attr_src.indexOf(options.domain) >= 0) {
|
||||
src = attr_src;
|
||||
} else if ( !! attr_datasrc && attr_datasrc.indexOf(options.domain) >= 0) {
|
||||
src = attr_datasrc;
|
||||
}
|
||||
|
||||
if (src) {
|
||||
var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1)
|
||||
.split("/"), options);
|
||||
if (holder) {
|
||||
if (holder.fluid) {
|
||||
render("fluid", images[i], holder, src)
|
||||
} else {
|
||||
render("image", images[i], holder, src);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return app;
|
||||
};
|
||||
|
||||
contentLoaded(win, function () {
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("resize", fluid_update, false);
|
||||
window.addEventListener("orientationchange", fluid_update, false);
|
||||
} else {
|
||||
window.attachEvent("onresize", fluid_update)
|
||||
}
|
||||
preempted || app.run();
|
||||
});
|
||||
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define("Holder", [], function () {
|
||||
return app;
|
||||
});
|
||||
}
|
||||
|
||||
})(Holder, window);
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
|
||||
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
|
||||
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
|
||||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
|
||||
for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
/*!
|
||||
jQuery Autosize v1.16.7
|
||||
(c) 2013 Jack Moore - jacklmoore.com
|
||||
updated: 2013-03-20
|
||||
Autosize v1.17.1 - 2013-06-23
|
||||
Automatically adjust textarea height based on user input.
|
||||
(c) 2013 Jack Moore - http://www.jacklmoore.com/autosize
|
||||
license: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
(function(e){var t,o,n={className:"autosizejs",append:"",callback:!1},i="hidden",s="border-box",a="lineHeight",l='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',r=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],c="oninput",h="onpropertychange",p=e(l).data("autosize",!0)[0];p.style.lineHeight="99px","99px"===e(p).css(a)&&r.push(a),p.style.lineHeight="",e.fn.autosize=function(a){return a=e.extend({},n,a||{}),p.parentNode!==document.body&&(e(document.body).append(p),p.value="\n\n\n",p.scrollTop=9e4,t=p.scrollHeight===p.scrollTop+p.clientHeight),this.each(function(){function n(){o=b,p.className=a.className,e.each(r,function(e,t){p.style[t]=f.css(t)})}function l(){var e,s,l;if(o!==b&&n(),!d){d=!0,p.value=b.value+a.append,p.style.overflowY=b.style.overflowY,l=parseInt(b.style.height,10),p.style.width=Math.max(f.width(),0)+"px",t?e=p.scrollHeight:(p.scrollTop=0,p.scrollTop=9e4,e=p.scrollTop);var r=parseInt(f.css("maxHeight"),10);r=r&&r>0?r:9e4,e>r?(e=r,s="scroll"):u>e&&(e=u),e+=x,b.style.overflowY=s||i,l!==e&&(b.style.height=e+"px",w&&a.callback.call(b)),setTimeout(function(){d=!1},1)}}var u,d,g,b=this,f=e(b),x=0,w=e.isFunction(a.callback);f.data("autosize")||((f.css("box-sizing")===s||f.css("-moz-box-sizing")===s||f.css("-webkit-box-sizing")===s)&&(x=f.outerHeight()-f.height()),u=Math.max(parseInt(f.css("minHeight"),10)-x,f.height()),g="none"===f.css("resize")||"vertical"===f.css("resize")?"none":"horizontal",f.css({overflow:i,overflowY:i,wordWrap:"break-word",resize:g}).data("autosize",!0),h in b?c in b?b[c]=b.onkeyup=l:b[h]=l:b[c]=l,e(window).on("resize",function(){d=!1,l()}),f.on("autosize",function(){d=!1,l()}),l())})}})(window.jQuery||window.Zepto);
|
||||
(function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var o,a={};if(t=u,s.className=i.className,l=parseInt(h.css("maxHeight"),10),e.each(n,function(e,t){a[t]=h.css(t)}),e(s).css(a),"oninput"in u){var r=u.style.width;u.style.width="0px",o=u.offsetWidth,u.style.width=r}}function a(){var n,a,r,c;t!==u&&o(),s.value=u.value+i.append,s.style.overflowY=u.style.overflowY,a=parseInt(u.style.height,10),"getComputedStyle"in window?(c=window.getComputedStyle(u),r=u.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,t){r-=parseInt(c[t],10)}),s.style.width=r+"px"):s.style.width=Math.max(h.width(),0)+"px",s.scrollTop=0,s.scrollTop=9e4,n=s.scrollTop,l&&n>l?(u.style.overflowY="scroll",n=l):(u.style.overflowY="hidden",d>n&&(n=d)),n+=p,a!==n&&(u.style.height=n+"px",w&&i.callback.call(u,u))}function r(){clearTimeout(c),c=setTimeout(function(){h.width()!==z&&a()},parseInt(i.resizeDelay,10))}var l,d,c,u=this,h=e(u),p=0,w=e.isFunction(i.callback),f={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},z=h.width();h.data("autosize")||(h.data("autosize",!0),("border-box"===h.css("box-sizing")||"border-box"===h.css("-moz-box-sizing")||"border-box"===h.css("-webkit-box-sizing"))&&(p=h.outerHeight()-h.height()),d=Math.max(parseInt(h.css("minHeight"),10)-p||0,h.height()),h.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===h.css("resize")||"vertical"===h.css("resize")?"none":"horizontal"}),"onpropertychange"in u?"oninput"in u?h.on("input.autosize keyup.autosize",a):h.on("propertychange.autosize",function(){"value"===event.propertyName&&a()}):h.on("input.autosize",a),i.resizeDelay!==!1&&e(window).on("resize.autosize",r),h.on("autosize.resize",a),h.on("autosize.resizeIncludeStyle",function(){t=null,a()}),h.on("autosize.destroy",function(){t=null,clearTimeout(c),e(window).off("resize",r),h.off("autosize").off(".autosize").css(f).removeData("autosize")}),a())})}})(window.jQuery||window.Zepto);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,532 @@
|
||||
/*
|
||||
* MultiSelect v0.9.11
|
||||
* Copyright (c) 2012 Louis Cuny
|
||||
*
|
||||
* This program is free software. It comes without any warranty, to
|
||||
* the extent permitted by applicable law. You can redistribute it
|
||||
* and/or modify it under the terms of the Do What The Fuck You Want
|
||||
* To Public License, Version 2, as published by Sam Hocevar. See
|
||||
* http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
*/
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/* MULTISELECT CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var MultiSelect = function (element, options) {
|
||||
this.options = options;
|
||||
this.$element = $(element);
|
||||
this.$container = $('<div/>', { 'class': "ms-container" });
|
||||
this.$selectableContainer = $('<div/>', { 'class': 'ms-selectable' });
|
||||
this.$selectionContainer = $('<div/>', { 'class': 'ms-selection' });
|
||||
this.$selectableUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
|
||||
this.$selectionUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
|
||||
this.scrollTo = 0;
|
||||
this.elemsSelector = 'li:visible:not(.ms-optgroup-label,.ms-optgroup-container,.'+options.disabledClass+')';
|
||||
};
|
||||
|
||||
MultiSelect.prototype = {
|
||||
constructor: MultiSelect,
|
||||
|
||||
init: function(){
|
||||
var that = this,
|
||||
ms = this.$element;
|
||||
|
||||
if (ms.next('.ms-container').length === 0){
|
||||
ms.css({ position: 'absolute', left: '-9999px' });
|
||||
ms.attr('id', ms.attr('id') ? ms.attr('id') : Math.ceil(Math.random()*1000)+'multiselect');
|
||||
this.$container.attr('id', 'ms-'+ms.attr('id'));
|
||||
this.$container.addClass(that.options.cssClass);
|
||||
ms.find('option').each(function(){
|
||||
that.generateLisFromOption(this);
|
||||
});
|
||||
|
||||
this.$selectionUl.find('.ms-optgroup-label').hide();
|
||||
|
||||
if (that.options.selectableHeader){
|
||||
that.$selectableContainer.append(that.options.selectableHeader);
|
||||
}
|
||||
that.$selectableContainer.append(that.$selectableUl);
|
||||
if (that.options.selectableFooter){
|
||||
that.$selectableContainer.append(that.options.selectableFooter);
|
||||
}
|
||||
|
||||
if (that.options.selectionHeader){
|
||||
that.$selectionContainer.append(that.options.selectionHeader);
|
||||
}
|
||||
that.$selectionContainer.append(that.$selectionUl);
|
||||
if (that.options.selectionFooter){
|
||||
that.$selectionContainer.append(that.options.selectionFooter);
|
||||
}
|
||||
|
||||
that.$container.append(that.$selectableContainer);
|
||||
that.$container.append(that.$selectionContainer);
|
||||
ms.after(that.$container);
|
||||
|
||||
that.activeMouse(that.$selectableUl);
|
||||
that.activeKeyboard(that.$selectableUl);
|
||||
|
||||
var action = that.options.dblClick ? 'dblclick' : 'click';
|
||||
|
||||
that.$selectableUl.on(action, '.ms-elem-selectable', function(){
|
||||
that.select($(this).data('ms-value'));
|
||||
});
|
||||
that.$selectionUl.on(action, '.ms-elem-selection', function(){
|
||||
that.deselect($(this).data('ms-value'));
|
||||
});
|
||||
|
||||
that.activeMouse(that.$selectionUl);
|
||||
that.activeKeyboard(that.$selectionUl);
|
||||
|
||||
ms.on('focus', function(){
|
||||
that.$selectableUl.focus();
|
||||
})
|
||||
}
|
||||
|
||||
var selectedValues = ms.find('option:selected').map(function(){ return $(this).val(); }).get();
|
||||
that.select(selectedValues, 'init');
|
||||
|
||||
if (typeof that.options.afterInit === 'function') {
|
||||
that.options.afterInit.call(this, this.$container);
|
||||
}
|
||||
},
|
||||
|
||||
'generateLisFromOption' : function(option, index, $container){
|
||||
var that = this,
|
||||
ms = that.$element,
|
||||
attributes = "",
|
||||
$option = $(option);
|
||||
|
||||
for (var cpt = 0; cpt < option.attributes.length; cpt++){
|
||||
var attr = option.attributes[cpt];
|
||||
|
||||
if(attr.name !== 'value' && attr.name !== 'disabled'){
|
||||
attributes += attr.name+'="'+attr.value+'" ';
|
||||
}
|
||||
}
|
||||
var selectableLi = $('<li '+attributes+'><span>'+that.escapeHTML($option.text())+'</span></li>'),
|
||||
selectedLi = selectableLi.clone(),
|
||||
value = $option.val(),
|
||||
elementId = that.sanitize(value);
|
||||
|
||||
selectableLi
|
||||
.data('ms-value', value)
|
||||
.addClass('ms-elem-selectable')
|
||||
.attr('id', elementId+'-selectable');
|
||||
|
||||
selectedLi
|
||||
.data('ms-value', value)
|
||||
.addClass('ms-elem-selection')
|
||||
.attr('id', elementId+'-selection')
|
||||
.hide();
|
||||
|
||||
if ($option.prop('disabled') || ms.prop('disabled')){
|
||||
selectedLi.addClass(that.options.disabledClass);
|
||||
selectableLi.addClass(that.options.disabledClass);
|
||||
}
|
||||
|
||||
var $optgroup = $option.parent('optgroup');
|
||||
|
||||
if ($optgroup.length > 0){
|
||||
var optgroupLabel = $optgroup.attr('label'),
|
||||
optgroupId = that.sanitize(optgroupLabel),
|
||||
$selectableOptgroup = that.$selectableUl.find('#optgroup-selectable-'+optgroupId),
|
||||
$selectionOptgroup = that.$selectionUl.find('#optgroup-selection-'+optgroupId);
|
||||
|
||||
if ($selectableOptgroup.length === 0){
|
||||
var optgroupContainerTpl = '<li class="ms-optgroup-container"></li>',
|
||||
optgroupTpl = '<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+optgroupLabel+'</span></li></ul>';
|
||||
|
||||
$selectableOptgroup = $(optgroupContainerTpl);
|
||||
$selectionOptgroup = $(optgroupContainerTpl);
|
||||
$selectableOptgroup.attr('id', 'optgroup-selectable-'+optgroupId);
|
||||
$selectionOptgroup.attr('id', 'optgroup-selection-'+optgroupId);
|
||||
$selectableOptgroup.append($(optgroupTpl));
|
||||
$selectionOptgroup.append($(optgroupTpl));
|
||||
if (that.options.selectableOptgroup){
|
||||
$selectableOptgroup.find('.ms-optgroup-label').on('click', function(){
|
||||
var values = $optgroup.children(':not(:selected, :disabled)').map(function(){ return $(this).val() }).get();
|
||||
that.select(values);
|
||||
});
|
||||
$selectionOptgroup.find('.ms-optgroup-label').on('click', function(){
|
||||
var values = $optgroup.children(':selected:not(:disabled)').map(function(){ return $(this).val() }).get();
|
||||
that.deselect(values);
|
||||
});
|
||||
}
|
||||
that.$selectableUl.append($selectableOptgroup);
|
||||
that.$selectionUl.append($selectionOptgroup);
|
||||
}
|
||||
index = index == undefined ? $selectableOptgroup.find('ul').children().length : index + 1;
|
||||
selectableLi.insertAt(index, $selectableOptgroup.children());
|
||||
selectedLi.insertAt(index, $selectionOptgroup.children());
|
||||
} else {
|
||||
index = index == undefined ? that.$selectableUl.children().length : index;
|
||||
|
||||
selectableLi.insertAt(index, that.$selectableUl);
|
||||
selectedLi.insertAt(index, that.$selectionUl);
|
||||
}
|
||||
},
|
||||
|
||||
'addOption' : function(options){
|
||||
var that = this;
|
||||
|
||||
if (options.value) options = [options];
|
||||
$.each(options, function(index, option){
|
||||
if (option.value && that.$element.find("option[value='"+option.value+"']").length === 0){
|
||||
var $option = $('<option value="'+option.value+'">'+option.text+'</option>'),
|
||||
index = parseInt((typeof option.index === 'undefined' ? that.$element.children().length : option.index)),
|
||||
$container = option.nested == undefined ? that.$element : $("optgroup[label='"+option.nested+"']")
|
||||
|
||||
$option.insertAt(index, $container);
|
||||
that.generateLisFromOption($option.get(0), index, option.nested);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
'escapeHTML' : function(text){
|
||||
return $("<div>").text(text).html();
|
||||
},
|
||||
|
||||
'activeKeyboard' : function($list){
|
||||
var that = this;
|
||||
|
||||
$list.on('focus', function(){
|
||||
$(this).addClass('ms-focus');
|
||||
})
|
||||
.on('blur', function(){
|
||||
$(this).removeClass('ms-focus');
|
||||
})
|
||||
.on('keydown', function(e){
|
||||
switch (e.which) {
|
||||
case 40:
|
||||
case 38:
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
|
||||
return;
|
||||
case 37:
|
||||
case 39:
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.switchList($list);
|
||||
return;
|
||||
case 9:
|
||||
if(that.$element.is('[tabindex]')){
|
||||
e.preventDefault();
|
||||
var tabindex = parseInt(that.$element.attr('tabindex'), 10);
|
||||
tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
|
||||
$('[tabindex="'+(tabindex)+'"]').focus();
|
||||
return;
|
||||
}else{
|
||||
if(e.shiftKey){
|
||||
that.$element.trigger('focus');
|
||||
}
|
||||
}
|
||||
}
|
||||
if($.inArray(e.which, that.options.keySelect) > -1){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.selectHighlighted($list);
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
'moveHighlight': function($list, direction){
|
||||
var $elems = $list.find(this.elemsSelector),
|
||||
$currElem = $elems.filter('.ms-hover'),
|
||||
$nextElem = null,
|
||||
elemHeight = $elems.first().outerHeight(),
|
||||
containerHeight = $list.height(),
|
||||
containerSelector = '#'+this.$container.prop('id');
|
||||
|
||||
$elems.removeClass('ms-hover');
|
||||
if (direction === 1){ // DOWN
|
||||
|
||||
$nextElem = $currElem.nextAll(this.elemsSelector).first();
|
||||
if ($nextElem.length === 0){
|
||||
var $optgroupUl = $currElem.parent();
|
||||
|
||||
if ($optgroupUl.hasClass('ms-optgroup')){
|
||||
var $optgroupLi = $optgroupUl.parent(),
|
||||
$nextOptgroupLi = $optgroupLi.next(':visible');
|
||||
|
||||
if ($nextOptgroupLi.length > 0){
|
||||
$nextElem = $nextOptgroupLi.find(this.elemsSelector).first();
|
||||
} else {
|
||||
$nextElem = $elems.first();
|
||||
}
|
||||
} else {
|
||||
$nextElem = $elems.first();
|
||||
}
|
||||
}
|
||||
} else if (direction === -1){ // UP
|
||||
|
||||
$nextElem = $currElem.prevAll(this.elemsSelector).first();
|
||||
if ($nextElem.length === 0){
|
||||
var $optgroupUl = $currElem.parent();
|
||||
|
||||
if ($optgroupUl.hasClass('ms-optgroup')){
|
||||
var $optgroupLi = $optgroupUl.parent(),
|
||||
$prevOptgroupLi = $optgroupLi.prev(':visible');
|
||||
|
||||
if ($prevOptgroupLi.length > 0){
|
||||
$nextElem = $prevOptgroupLi.find(this.elemsSelector).last();
|
||||
} else {
|
||||
$nextElem = $elems.last();
|
||||
}
|
||||
} else {
|
||||
$nextElem = $elems.last();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($nextElem.length > 0){
|
||||
$nextElem.addClass('ms-hover');
|
||||
var scrollTo = $list.scrollTop() + $nextElem.position().top -
|
||||
containerHeight / 2 + elemHeight / 2;
|
||||
|
||||
$list.scrollTop(scrollTo);
|
||||
}
|
||||
},
|
||||
|
||||
'selectHighlighted' : function($list){
|
||||
var $elems = $list.find(this.elemsSelector),
|
||||
$highlightedElem = $elems.filter('.ms-hover').first();
|
||||
|
||||
if ($highlightedElem.length > 0){
|
||||
if ($list.parent().hasClass('ms-selectable')){
|
||||
this.select($highlightedElem.data('ms-value'));
|
||||
} else {
|
||||
this.deselect($highlightedElem.data('ms-value'));
|
||||
}
|
||||
$elems.removeClass('ms-hover');
|
||||
}
|
||||
},
|
||||
|
||||
'switchList' : function($list){
|
||||
$list.blur();
|
||||
this.$container.find(this.elemsSelector).removeClass('ms-hover');
|
||||
if ($list.parent().hasClass('ms-selectable')){
|
||||
this.$selectionUl.focus();
|
||||
} else {
|
||||
this.$selectableUl.focus();
|
||||
}
|
||||
},
|
||||
|
||||
'activeMouse' : function($list){
|
||||
var that = this;
|
||||
|
||||
$('body').on('mouseenter', that.elemsSelector, function(){
|
||||
$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
|
||||
$(this).addClass('ms-hover');
|
||||
});
|
||||
|
||||
$('body').on('mouseleave', that.elemsSelector, function () {
|
||||
$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');;
|
||||
});
|
||||
},
|
||||
|
||||
'refresh' : function() {
|
||||
this.destroy();
|
||||
this.$element.multiSelect(this.options);
|
||||
},
|
||||
|
||||
'destroy' : function(){
|
||||
$("#ms-"+this.$element.attr("id")).remove();
|
||||
this.$element.css('position', '').css('left', '')
|
||||
this.$element.removeData('multiselect');
|
||||
},
|
||||
|
||||
'select' : function(value, method){
|
||||
if (typeof value === 'string'){ value = [value]; }
|
||||
|
||||
var that = this,
|
||||
ms = this.$element,
|
||||
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),
|
||||
options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
|
||||
|
||||
if (method === 'init'){
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');
|
||||
}
|
||||
|
||||
if (selectables.length > 0){
|
||||
selectables.addClass('ms-selected').hide();
|
||||
selections.addClass('ms-selected').show();
|
||||
|
||||
options.prop('selected', true);
|
||||
|
||||
that.$container.find(that.elemsSelector).removeClass('ms-hover');
|
||||
|
||||
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
|
||||
if (selectableOptgroups.length > 0){
|
||||
selectableOptgroups.each(function(){
|
||||
var selectablesLi = $(this).find('.ms-elem-selectable');
|
||||
if (selectablesLi.length === selectablesLi.filter('.ms-selected').length){
|
||||
$(this).find('.ms-optgroup-label').hide();
|
||||
}
|
||||
});
|
||||
|
||||
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
|
||||
selectionOptgroups.each(function(){
|
||||
var selectionsLi = $(this).find('.ms-elem-selection');
|
||||
if (selectionsLi.filter('.ms-selected').length > 0){
|
||||
$(this).find('.ms-optgroup-label').show();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (that.options.keepOrder && method !== 'init'){
|
||||
var selectionLiLast = that.$selectionUl.find('.ms-selected');
|
||||
if((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {
|
||||
selections.insertAfter(selectionLiLast.last());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (method !== 'init'){
|
||||
ms.trigger('change');
|
||||
if (typeof that.options.afterSelect === 'function') {
|
||||
that.options.afterSelect.call(this, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'deselect' : function(value){
|
||||
if (typeof value === 'string'){ value = [value]; }
|
||||
|
||||
var that = this,
|
||||
ms = this.$element,
|
||||
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),
|
||||
options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
|
||||
|
||||
if (selections.length > 0){
|
||||
selectables.removeClass('ms-selected').show();
|
||||
selections.removeClass('ms-selected').hide();
|
||||
options.prop('selected', false);
|
||||
|
||||
that.$container.find(that.elemsSelector).removeClass('ms-hover');
|
||||
|
||||
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
|
||||
if (selectableOptgroups.length > 0){
|
||||
selectableOptgroups.each(function(){
|
||||
var selectablesLi = $(this).find('.ms-elem-selectable');
|
||||
if (selectablesLi.filter(':not(.ms-selected)').length > 0){
|
||||
$(this).find('.ms-optgroup-label').show();
|
||||
}
|
||||
});
|
||||
|
||||
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
|
||||
selectionOptgroups.each(function(){
|
||||
var selectionsLi = $(this).find('.ms-elem-selection');
|
||||
if (selectionsLi.filter('.ms-selected').length === 0){
|
||||
$(this).find('.ms-optgroup-label').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
ms.trigger('change');
|
||||
if (typeof that.options.afterDeselect === 'function') {
|
||||
that.options.afterDeselect.call(this, value);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'select_all' : function(){
|
||||
var ms = this.$element,
|
||||
values = ms.val();
|
||||
|
||||
ms.find('option:not(":disabled")').prop('selected', true);
|
||||
this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();
|
||||
this.$selectionUl.find('.ms-optgroup-label').show();
|
||||
this.$selectableUl.find('.ms-optgroup-label').hide();
|
||||
this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();
|
||||
this.$selectionUl.focus();
|
||||
ms.trigger('change');
|
||||
if (typeof this.options.afterSelect === 'function') {
|
||||
var selectedValues = $.grep(ms.val(), function(item){
|
||||
return $.inArray(item, values) < 0;
|
||||
});
|
||||
this.options.afterSelect.call(this, selectedValues);
|
||||
}
|
||||
},
|
||||
|
||||
'deselect_all' : function(){
|
||||
var ms = this.$element,
|
||||
values = ms.val();
|
||||
|
||||
ms.find('option').prop('selected', false);
|
||||
this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();
|
||||
this.$selectionUl.find('.ms-optgroup-label').hide();
|
||||
this.$selectableUl.find('.ms-optgroup-label').show();
|
||||
this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();
|
||||
this.$selectableUl.focus();
|
||||
ms.trigger('change');
|
||||
if (typeof this.options.afterDeselect === 'function') {
|
||||
this.options.afterDeselect.call(this, values);
|
||||
}
|
||||
},
|
||||
|
||||
sanitize: function(value){
|
||||
var hash = 0, i, character;
|
||||
if (value.length == 0) return hash;
|
||||
var ls = 0;
|
||||
for (i = 0, ls = value.length; i < ls; i++) {
|
||||
character = value.charCodeAt(i);
|
||||
hash = ((hash<<5)-hash)+character;
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
|
||||
/* MULTISELECT PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
$.fn.multiSelect = function () {
|
||||
var option = arguments[0],
|
||||
args = arguments;
|
||||
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('multiselect'),
|
||||
options = $.extend({}, $.fn.multiSelect.defaults, $this.data(), typeof option === 'object' && option);
|
||||
|
||||
if (!data){ $this.data('multiselect', (data = new MultiSelect(this, options))); }
|
||||
|
||||
if (typeof option === 'string'){
|
||||
data[option](args[1]);
|
||||
} else {
|
||||
data.init();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.multiSelect.defaults = {
|
||||
keySelect: [32],
|
||||
selectableOptgroup: false,
|
||||
disabledClass : 'disabled',
|
||||
dblClick : false,
|
||||
keepOrder: false,
|
||||
cssClass: ''
|
||||
};
|
||||
|
||||
$.fn.multiSelect.Constructor = MultiSelect;
|
||||
|
||||
$.fn.insertAt = function(index, $parent) {
|
||||
return this.each(function() {
|
||||
if (index === 0) {
|
||||
$parent.prepend(this);
|
||||
} else {
|
||||
$parent.children().eq(index - 1).after(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* jQuery Pines Notify (pnotify) Plugin 1.2.0
|
||||
*
|
||||
* http://pinesframework.org/pnotify/
|
||||
* Copyright (c) 2009-2012 Hunter Perrin
|
||||
*
|
||||
* Triple license under the GPL, LGPL, and MPL:
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*/
|
||||
(function(d){var q,j,r,i=d(window),u={jqueryui:{container:"ui-widget ui-widget-content ui-corner-all",notice:"ui-state-highlight",notice_icon:"ui-icon ui-icon-info",info:"",info_icon:"ui-icon ui-icon-info",success:"ui-state-default",success_icon:"ui-icon ui-icon-circle-check",error:"ui-state-error",error_icon:"ui-icon ui-icon-alert",closer:"ui-icon ui-icon-close",pin_up:"ui-icon ui-icon-pin-w",pin_down:"ui-icon ui-icon-pin-s",hi_menu:"ui-state-default ui-corner-bottom",hi_btn:"ui-state-default ui-corner-all",
|
||||
hi_btnhov:"ui-state-hover",hi_hnd:"ui-icon ui-icon-grip-dotted-horizontal"},bootstrap:{container:"alert",notice:"",notice_icon:"icon-exclamation-sign",info:"alert-info",info_icon:"icon-info-sign",success:"alert-success",success_icon:"icon-ok-sign",error:"alert-error",error_icon:"icon-warning-sign",closer:"icon-remove",pin_up:"icon-pause",pin_down:"icon-play",hi_menu:"well",hi_btn:"btn",hi_btnhov:"",hi_hnd:"icon-chevron-down"}},s=function(){r=d("body");i=d(window);i.bind("resize",function(){j&&clearTimeout(j);
|
||||
j=setTimeout(d.pnotify_position_all,10)})};document.body?s():d(s);d.extend({pnotify_remove_all:function(){var e=i.data("pnotify");e&&e.length&&d.each(e,function(){this.pnotify_remove&&this.pnotify_remove()})},pnotify_position_all:function(){j&&clearTimeout(j);j=null;var e=i.data("pnotify");e&&e.length&&(d.each(e,function(){var d=this.opts.stack;if(d)d.nextpos1=d.firstpos1,d.nextpos2=d.firstpos2,d.addpos2=0,d.animation=true}),d.each(e,function(){this.pnotify_position()}))},pnotify:function(e){var g,
|
||||
a;typeof e!="object"?(a=d.extend({},d.pnotify.defaults),a.text=e):a=d.extend({},d.pnotify.defaults,e);for(var p in a)typeof p=="string"&&p.match(/^pnotify_/)&&(a[p.replace(/^pnotify_/,"")]=a[p]);if(a.before_init&&a.before_init(a)===false)return null;var k,o=function(a,c){b.css("display","none");var f=document.elementFromPoint(a.clientX,a.clientY);b.css("display","block");var e=d(f),g=e.css("cursor");b.css("cursor",g!="auto"?g:"default");if(!k||k.get(0)!=f)k&&(n.call(k.get(0),"mouseleave",a.originalEvent),
|
||||
n.call(k.get(0),"mouseout",a.originalEvent)),n.call(f,"mouseenter",a.originalEvent),n.call(f,"mouseover",a.originalEvent);n.call(f,c,a.originalEvent);k=e},f=u[a.styling],b=d("<div />",{"class":"ui-pnotify "+a.addclass,css:{display:"none"},mouseenter:function(l){a.nonblock&&l.stopPropagation();a.mouse_reset&&g=="out"&&(b.stop(true),g="in",b.css("height","auto").animate({width:a.width,opacity:a.nonblock?a.nonblock_opacity:a.opacity},"fast"));a.nonblock&&b.animate({opacity:a.nonblock_opacity},"fast");
|
||||
a.hide&&a.mouse_reset&&b.pnotify_cancel_remove();a.sticker&&!a.nonblock&&b.sticker.trigger("pnotify_icon").css("visibility","visible");a.closer&&!a.nonblock&&b.closer.css("visibility","visible")},mouseleave:function(l){a.nonblock&&l.stopPropagation();k=null;b.css("cursor","auto");a.nonblock&&g!="out"&&b.animate({opacity:a.opacity},"fast");a.hide&&a.mouse_reset&&b.pnotify_queue_remove();a.sticker_hover&&b.sticker.css("visibility","hidden");a.closer_hover&&b.closer.css("visibility","hidden");d.pnotify_position_all()},
|
||||
mouseover:function(b){a.nonblock&&b.stopPropagation()},mouseout:function(b){a.nonblock&&b.stopPropagation()},mousemove:function(b){a.nonblock&&(b.stopPropagation(),o(b,"onmousemove"))},mousedown:function(b){a.nonblock&&(b.stopPropagation(),b.preventDefault(),o(b,"onmousedown"))},mouseup:function(b){a.nonblock&&(b.stopPropagation(),b.preventDefault(),o(b,"onmouseup"))},click:function(b){a.nonblock&&(b.stopPropagation(),o(b,"onclick"))},dblclick:function(b){a.nonblock&&(b.stopPropagation(),o(b,"ondblclick"))}});
|
||||
b.opts=a;b.container=d("<div />",{"class":f.container+" ui-pnotify-container "+(a.type=="error"?f.error:a.type=="info"?f.info:a.type=="success"?f.success:f.notice)}).appendTo(b);a.cornerclass!=""&&b.container.removeClass("ui-corner-all").addClass(a.cornerclass);a.shadow&&b.container.addClass("ui-pnotify-shadow");b.pnotify_version="1.2.0";b.pnotify=function(l){var c=a;typeof l=="string"?a.text=l:a=d.extend({},a,l);for(var e in a)typeof e=="string"&&e.match(/^pnotify_/)&&(a[e.replace(/^pnotify_/,"")]=
|
||||
a[e]);b.opts=a;a.cornerclass!=c.cornerclass&&b.container.removeClass("ui-corner-all").addClass(a.cornerclass);a.shadow!=c.shadow&&(a.shadow?b.container.addClass("ui-pnotify-shadow"):b.container.removeClass("ui-pnotify-shadow"));a.addclass===false?b.removeClass(c.addclass):a.addclass!==c.addclass&&b.removeClass(c.addclass).addClass(a.addclass);a.title===false?b.title_container.slideUp("fast"):a.title!==c.title&&(a.title_escape?b.title_container.text(a.title).slideDown(200):b.title_container.html(a.title).slideDown(200));
|
||||
a.text===false?b.text_container.slideUp("fast"):a.text!==c.text&&(a.text_escape?b.text_container.text(a.text).slideDown(200):b.text_container.html(a.insert_brs?String(a.text).replace(/\n/g,"<br />"):a.text).slideDown(200));b.pnotify_history=a.history;b.pnotify_hide=a.hide;a.type!=c.type&&b.container.removeClass(f.error+" "+f.notice+" "+f.success+" "+f.info).addClass(a.type=="error"?f.error:a.type=="info"?f.info:a.type=="success"?f.success:f.notice);if(a.icon!==c.icon||a.icon===true&&a.type!=c.type)b.container.find("div.ui-pnotify-icon").remove(),
|
||||
a.icon!==false&&d("<div />",{"class":"ui-pnotify-icon"}).append(d("<span />",{"class":a.icon===true?a.type=="error"?f.error_icon:a.type=="info"?f.info_icon:a.type=="success"?f.success_icon:f.notice_icon:a.icon})).prependTo(b.container);a.width!==c.width&&b.animate({width:a.width});a.min_height!==c.min_height&&b.container.animate({minHeight:a.min_height});a.opacity!==c.opacity&&b.fadeTo(a.animate_speed,a.opacity);!a.closer||a.nonblock?b.closer.css("display","none"):b.closer.css("display","block");
|
||||
!a.sticker||a.nonblock?b.sticker.css("display","none"):b.sticker.css("display","block");b.sticker.trigger("pnotify_icon");a.sticker_hover?b.sticker.css("visibility","hidden"):a.nonblock||b.sticker.css("visibility","visible");a.closer_hover?b.closer.css("visibility","hidden"):a.nonblock||b.closer.css("visibility","visible");a.hide?c.hide||b.pnotify_queue_remove():b.pnotify_cancel_remove();b.pnotify_queue_position();return b};b.pnotify_position=function(a){var c=b.opts.stack;if(c){if(!c.nextpos1)c.nextpos1=
|
||||
c.firstpos1;if(!c.nextpos2)c.nextpos2=c.firstpos2;if(!c.addpos2)c.addpos2=0;var d=b.css("display")=="none";if(!d||a){var f,e={},g;switch(c.dir1){case "down":g="top";break;case "up":g="bottom";break;case "left":g="right";break;case "right":g="left"}a=parseInt(b.css(g));isNaN(a)&&(a=0);if(typeof c.firstpos1=="undefined"&&!d)c.firstpos1=a,c.nextpos1=c.firstpos1;var h;switch(c.dir2){case "down":h="top";break;case "up":h="bottom";break;case "left":h="right";break;case "right":h="left"}f=parseInt(b.css(h));
|
||||
isNaN(f)&&(f=0);if(typeof c.firstpos2=="undefined"&&!d)c.firstpos2=f,c.nextpos2=c.firstpos2;if(c.dir1=="down"&&c.nextpos1+b.height()>i.height()||c.dir1=="up"&&c.nextpos1+b.height()>i.height()||c.dir1=="left"&&c.nextpos1+b.width()>i.width()||c.dir1=="right"&&c.nextpos1+b.width()>i.width())c.nextpos1=c.firstpos1,c.nextpos2+=c.addpos2+(typeof c.spacing2=="undefined"?25:c.spacing2),c.addpos2=0;if(c.animation&&c.nextpos2<f)switch(c.dir2){case "down":e.top=c.nextpos2+"px";break;case "up":e.bottom=c.nextpos2+
|
||||
"px";break;case "left":e.right=c.nextpos2+"px";break;case "right":e.left=c.nextpos2+"px"}else b.css(h,c.nextpos2+"px");switch(c.dir2){case "down":case "up":if(b.outerHeight(true)>c.addpos2)c.addpos2=b.height();break;case "left":case "right":if(b.outerWidth(true)>c.addpos2)c.addpos2=b.width()}if(c.nextpos1)if(c.animation&&(a>c.nextpos1||e.top||e.bottom||e.right||e.left))switch(c.dir1){case "down":e.top=c.nextpos1+"px";break;case "up":e.bottom=c.nextpos1+"px";break;case "left":e.right=c.nextpos1+"px";
|
||||
break;case "right":e.left=c.nextpos1+"px"}else b.css(g,c.nextpos1+"px");(e.top||e.bottom||e.right||e.left)&&b.animate(e,{duration:500,queue:false});switch(c.dir1){case "down":case "up":c.nextpos1+=b.height()+(typeof c.spacing1=="undefined"?25:c.spacing1);break;case "left":case "right":c.nextpos1+=b.width()+(typeof c.spacing1=="undefined"?25:c.spacing1)}}}};b.pnotify_queue_position=function(a){j&&clearTimeout(j);a||(a=10);j=setTimeout(d.pnotify_position_all,a)};b.pnotify_display=function(){b.parent().length||
|
||||
b.appendTo(r);a.before_open&&a.before_open(b)===false||(a.stack.push!="top"&&b.pnotify_position(true),a.animation=="fade"||a.animation.effect_in=="fade"?b.show().fadeTo(0,0).hide():a.opacity!=1&&b.show().fadeTo(0,a.opacity).hide(),b.animate_in(function(){a.after_open&&a.after_open(b);b.pnotify_queue_position();a.hide&&b.pnotify_queue_remove()}))};b.pnotify_remove=function(){if(b.timer)window.clearTimeout(b.timer),b.timer=null;a.before_close&&a.before_close(b)===false||b.animate_out(function(){a.after_close&&
|
||||
a.after_close(b)===false||(b.pnotify_queue_position(),a.remove&&b.detach())})};b.animate_in=function(d){g="in";var c;c=typeof a.animation.effect_in!="undefined"?a.animation.effect_in:a.animation;c=="none"?(b.show(),d()):c=="show"?b.show(a.animate_speed,d):c=="fade"?b.show().fadeTo(a.animate_speed,a.opacity,d):c=="slide"?b.slideDown(a.animate_speed,d):typeof c=="function"?c("in",d,b):b.show(c,typeof a.animation.options_in=="object"?a.animation.options_in:{},a.animate_speed,d)};b.animate_out=function(d){g=
|
||||
"out";var c;c=typeof a.animation.effect_out!="undefined"?a.animation.effect_out:a.animation;c=="none"?(b.hide(),d()):c=="show"?b.hide(a.animate_speed,d):c=="fade"?b.fadeOut(a.animate_speed,d):c=="slide"?b.slideUp(a.animate_speed,d):typeof c=="function"?c("out",d,b):b.hide(c,typeof a.animation.options_out=="object"?a.animation.options_out:{},a.animate_speed,d)};b.pnotify_cancel_remove=function(){b.timer&&window.clearTimeout(b.timer)};b.pnotify_queue_remove=function(){b.pnotify_cancel_remove();b.timer=
|
||||
window.setTimeout(function(){b.pnotify_remove()},isNaN(a.delay)?0:a.delay)};b.closer=d("<div />",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:a.closer_hover?"hidden":"visible"},click:function(){b.pnotify_remove();b.sticker.css("visibility","hidden");b.closer.css("visibility","hidden")}}).append(d("<span />",{"class":f.closer})).appendTo(b.container);(!a.closer||a.nonblock)&&b.closer.css("display","none");b.sticker=d("<div />",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:a.sticker_hover?
|
||||
"hidden":"visible"},click:function(){a.hide=!a.hide;a.hide?b.pnotify_queue_remove():b.pnotify_cancel_remove();d(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){d(this).children().removeClass(f.pin_up+" "+f.pin_down).addClass(a.hide?f.pin_up:f.pin_down)}).append(d("<span />",{"class":f.pin_up})).appendTo(b.container);(!a.sticker||a.nonblock)&&b.sticker.css("display","none");a.icon!==false&&d("<div />",{"class":"ui-pnotify-icon"}).append(d("<span />",{"class":a.icon===true?a.type=="error"?
|
||||
f.error_icon:a.type=="info"?f.info_icon:a.type=="success"?f.success_icon:f.notice_icon:a.icon})).prependTo(b.container);b.title_container=d("<h4 />",{"class":"ui-pnotify-title"}).appendTo(b.container);a.title===false?b.title_container.hide():a.title_escape?b.title_container.text(a.title):b.title_container.html(a.title);b.text_container=d("<div />",{"class":"ui-pnotify-text"}).appendTo(b.container);a.text===false?b.text_container.hide():a.text_escape?b.text_container.text(a.text):b.text_container.html(a.insert_brs?
|
||||
String(a.text).replace(/\n/g,"<br />"):a.text);typeof a.width=="string"&&b.css("width",a.width);typeof a.min_height=="string"&&b.container.css("min-height",a.min_height);b.pnotify_history=a.history;b.pnotify_hide=a.hide;var h=i.data("pnotify");if(h==null||typeof h!="object")h=[];h=a.stack.push=="top"?d.merge([b],h):d.merge(h,[b]);i.data("pnotify",h);a.stack.push=="top"&&b.pnotify_queue_position(1);a.after_init&&a.after_init(b);if(a.history){var m=i.data("pnotify_history");typeof m=="undefined"&&(m=
|
||||
d("<div />",{"class":"ui-pnotify-history-container "+f.hi_menu,mouseleave:function(){m.animate({top:"-"+q+"px"},{duration:100,queue:false})}}).append(d("<div />",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(d("<button />",{"class":"ui-pnotify-history-all "+f.hi_btn,text:"All",mouseenter:function(){d(this).addClass(f.hi_btnhov)},mouseleave:function(){d(this).removeClass(f.hi_btnhov)},click:function(){d.each(h,function(){this.pnotify_history&&(this.is(":visible")?this.pnotify_hide&&
|
||||
this.pnotify_queue_remove():this.pnotify_display&&this.pnotify_display())});return false}})).append(d("<button />",{"class":"ui-pnotify-history-last "+f.hi_btn,text:"Last",mouseenter:function(){d(this).addClass(f.hi_btnhov)},mouseleave:function(){d(this).removeClass(f.hi_btnhov)},click:function(){var a=-1,b;do{b=a==-1?h.slice(a):h.slice(a,a+1);if(!b[0])break;a--}while(!b[0].pnotify_history||b[0].is(":visible"));if(!b[0])return false;b[0].pnotify_display&&b[0].pnotify_display();return false}})).appendTo(r),
|
||||
q=d("<span />",{"class":"ui-pnotify-history-pulldown "+f.hi_hnd,mouseenter:function(){m.animate({top:"0"},{duration:100,queue:false})}}).appendTo(m).offset().top+2,m.css({top:"-"+q+"px"}),i.data("pnotify_history",m))}a.stack.animation=false;b.pnotify_display();return b}});var t=/^on/,v=/^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,w=/^(focus|blur|select|change|reset)$|^key(press|down|up)$/,x=/^(scroll|resize|(un)?load|abort|error)$/,n=function(e,g){var a,e=e.toLowerCase();
|
||||
document.createEvent&&this.dispatchEvent?(e=e.replace(t,""),e.match(v)?(d(this).offset(),a=document.createEvent("MouseEvents"),a.initMouseEvent(e,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)):e.match(w)?(a=document.createEvent("UIEvents"),a.initUIEvent(e,g.bubbles,g.cancelable,g.view,g.detail)):e.match(x)&&(a=document.createEvent("HTMLEvents"),a.initEvent(e,g.bubbles,g.cancelable)),a&&this.dispatchEvent(a)):
|
||||
(e.match(t)||(e="on"+e),a=document.createEventObject(g),this.fireEvent(e,a))};d.pnotify.defaults={title:false,title_escape:false,text:false,text_escape:false,styling:"bootstrap",addclass:"",cornerclass:"",nonblock:false,nonblock_opacity:0.2,history:true,width:"300px",min_height:"16px",type:"notice",icon:true,animation:"fade",animate_speed:"slow",opacity:1,shadow:true,closer:true,closer_hover:true,sticker:true,sticker_hover:true,hide:true,delay:8E3,mouse_reset:true,remove:true,insert_brs:true,stack:{dir1:"down",
|
||||
dir2:"left",push:"bottom",spacing1:25,spacing2:25}}})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,6 @@
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document);
|
||||
|
||||
/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
|
||||
(function(a){"use strict";function x(){u(!0)}var b={};a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,b.mediaQueriesSupported;var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var a=m.shift();v(a.href,function(b){p(b,a.href,a.media),h[a.href]=!0,setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(a){var b="clientWidth",h=d[b],k="CSS1Compat"===c.compatMode&&h||c.body[b]||h,m={},n=l[l.length-1],o=(new Date).getTime();if(a&&q&&i>o-q)return clearTimeout(r),r=setTimeout(u,i),void 0;q=o;for(var p in e)if(e.hasOwnProperty(p)){var v=e[p],w=v.minw,x=v.maxw,y=null===w,z=null===x,A="em";w&&(w=parseFloat(w)*(w.indexOf(A)>-1?t||s():1)),x&&(x=parseFloat(x)*(x.indexOf(A)>-1?t||s():1)),v.hasquery&&(y&&z||!(y||k>=w)||!(z||x>=k))||(m[v.media]||(m[v.media]=[]),m[v.media].push(f[v.rules]))}for(var B in g)g.hasOwnProperty(B)&&g[B]&&g[B].parentNode===j&&j.removeChild(g[B]);for(var C in m)if(m.hasOwnProperty(C)){var D=c.createElement("style"),E=m[C].join("\n");D.type="text/css",D.media=C,j.insertBefore(D,n.nextSibling),D.styleSheet?D.styleSheet.cssText=E:D.appendChild(c.createTextNode(E)),g.push(D)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)})(this);
|
||||
@@ -6,7 +6,7 @@ addEvent(window, "load", sortables_init);
|
||||
|
||||
var SORT_COLUMN_INDEX;
|
||||
|
||||
function sortables_init()
|
||||
function sortables_init()
|
||||
{
|
||||
// Find all tables with class sortable and make them sortable
|
||||
if (!document.getElementsByTagName) { alert ( "cannot" ); return; }
|
||||
@@ -24,23 +24,23 @@ function ts_makeSortable(table) {
|
||||
var firstRow = table.rows[0];
|
||||
}
|
||||
if (!firstRow) return;
|
||||
|
||||
|
||||
// We have a first row: assume it's the header, and make its contents clickable links
|
||||
for (var i=0;i<firstRow.cells.length;i++) {
|
||||
var cell = firstRow.cells[i];
|
||||
var txt = ts_getInnerText(cell);
|
||||
var str_HTML = '<a href="#" onclick="ts_resortTable(this, ' + i + ');return false;" ' +
|
||||
'title="Sort by ' + txt + ' >>" >' + txt + '<span class="SortArrow"';
|
||||
|
||||
|
||||
// adjust the first column so it displays as selected
|
||||
if ( i==0 ) {
|
||||
cell.className = "Selected";
|
||||
str_HTML += ' sortdir="down"><img src="' + WWW_TOP + '/templates/nntmux/images/sorting/arrow_down.gif" alt="" />';
|
||||
str_HTML += ' sortdir="down"><img src="' + WWW_TOP + '/themes_shared/images/sorting/arrow_down.gif" alt="" />';
|
||||
}
|
||||
else str_HTML += '>';
|
||||
|
||||
else str_HTML += '>';
|
||||
|
||||
str_HTML += '</span></a>';
|
||||
|
||||
|
||||
// insert new html into cell
|
||||
cell.innerHTML = str_HTML;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ function ts_getInnerText(el) {
|
||||
if ( typeof el == "undefined") { return el };
|
||||
if ( el.innerText ) return el.innerText; //Not needed but it is faster
|
||||
var str = "";
|
||||
|
||||
|
||||
var cs = el.childNodes;
|
||||
var l = cs.length;
|
||||
for (var i = 0; i < l; i++)
|
||||
@@ -80,7 +80,7 @@ function ts_resortTable(lnk,clid) {
|
||||
var td = lnk.parentNode;
|
||||
var column = clid || td.cellIndex;
|
||||
var table = getParent(td,'TABLE');
|
||||
|
||||
|
||||
// Work out a type for the column
|
||||
if (table.rows.length <= 1) return;
|
||||
var itm = ts_getInnerText(table.rows[1].cells[column]);
|
||||
@@ -96,32 +96,32 @@ function ts_resortTable(lnk,clid) {
|
||||
for (j=1;j<table.rows.length;j++) { newRows[j-1] = table.rows[j]; }
|
||||
|
||||
newRows.sort(sortfn);
|
||||
|
||||
|
||||
// set the class of the header to "selected", but first remove any class from all columns
|
||||
for (r=0; r<table.rows[0].cells.length; r++ ) table.rows[0].cells[r].className = "";
|
||||
table.rows[0].cells[column].className = table.rows[0].cells[column].className = "Selected";
|
||||
|
||||
|
||||
// configures the up/down arrow
|
||||
if (span.getAttribute("sortdir") == 'down')
|
||||
{
|
||||
// ARROW = ' ↑';
|
||||
ARROW = '<img src="' + WWW_TOP + '/templates/nntmux/images/sorting/arrow_up.gif" />';
|
||||
// ARROW = ' ↑';
|
||||
ARROW = '<img src="' + WWW_TOP + '/themes_shared/images/sorting/arrow_up.gif" />';
|
||||
newRows.reverse();
|
||||
span.setAttribute('sortdir','up');
|
||||
}
|
||||
else
|
||||
{
|
||||
//ARROW = ' ↓';
|
||||
ARROW = '<img src="' + WWW_TOP + '/templates/nntmux/images/sorting/arrow_down.gif" alt="" />';
|
||||
ARROW = '<img src="' + WWW_TOP + '/themes_shared/images/sorting/arrow_down.gif" alt="" />';
|
||||
span.setAttribute('sortdir','down');
|
||||
}
|
||||
|
||||
|
||||
// We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
|
||||
// don't do sortbottom rows
|
||||
for (i=0;i<newRows.length;i++) { if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) table.tBodies[0].appendChild(newRows[i]);}
|
||||
// do sortbottom rows only
|
||||
for (i=0;i<newRows.length;i++) { if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1)) table.tBodies[0].appendChild(newRows[i]);}
|
||||
|
||||
|
||||
// Delete any other arrows there may be showing
|
||||
var allspans = document.getElementsByTagName("span");
|
||||
for (var ci=0;ci<allspans.length;ci++)
|
||||
@@ -134,9 +134,9 @@ function ts_resortTable(lnk,clid) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
span.innerHTML = ARROW;
|
||||
|
||||
|
||||
F_ColourRows(table);
|
||||
}
|
||||
|
||||
@@ -170,16 +170,16 @@ function ts_sort_date(a,b) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
function ts_sort_currency(a,b) {
|
||||
function ts_sort_currency(a,b) {
|
||||
aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
|
||||
bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
|
||||
return parseFloat(aa) - parseFloat(bb);
|
||||
}
|
||||
|
||||
function ts_sort_numeric(a,b) {
|
||||
function ts_sort_numeric(a,b) {
|
||||
aa = parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));
|
||||
if (isNaN(aa)) aa = 0;
|
||||
bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX]));
|
||||
bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX]));
|
||||
if (isNaN(bb)) bb = 0;
|
||||
return aa-bb;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ function addEvent(elm, evType, fn, useCapture)
|
||||
} else {
|
||||
alert("Handler could not be removed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -232,4 +232,3 @@ function F_ColourRows ( objTable )
|
||||
n_AltCount ++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
(function ($) {
|
||||
|
||||
$(function(){
|
||||
|
||||
// fix sub nav on scroll
|
||||
var $win = $(window),
|
||||
$body = $('body'),
|
||||
$nav = $('.subnav'),
|
||||
navHeight = $('.navbar').first().height(),
|
||||
subnavHeight = $('.subnav').first().height(),
|
||||
subnavTop = $('.subnav').length && $('.subnav').offset().top - navHeight,
|
||||
marginTop = parseInt($body.css('margin-top'), 10);
|
||||
isFixed = 0;
|
||||
|
||||
processScroll();
|
||||
|
||||
$win.on('scroll', processScroll);
|
||||
|
||||
function processScroll() {
|
||||
var i, scrollTop = $win.scrollTop();
|
||||
|
||||
if (scrollTop >= subnavTop && !isFixed) {
|
||||
isFixed = 1;
|
||||
$nav.addClass('subnav-fixed');
|
||||
$body.css('margin-top', marginTop + subnavHeight + 'px');
|
||||
} else if (scrollTop <= subnavTop && isFixed) {
|
||||
isFixed = 0;
|
||||
$nav.removeClass('subnav-fixed');
|
||||
$body.css('margin-top', marginTop + 'px');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})(window.jQuery);
|
||||
@@ -0,0 +1,93 @@
|
||||
.ms-container{
|
||||
background: transparent url('../images/icons/switch.png') no-repeat 50% 50%;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.ms-container:after{
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
line-height: 0;
|
||||
font-size: 0;
|
||||
clear: both;
|
||||
min-height: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.ms-container .ms-selectable, .ms-container .ms-selection{
|
||||
background: #fff;
|
||||
color: #555555;
|
||||
float: left;
|
||||
width: 45%;
|
||||
}
|
||||
.ms-container .ms-selection{
|
||||
float: right;
|
||||
}
|
||||
|
||||
.ms-container .ms-list{
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
border: 1px solid #ccc;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
height: 200px;
|
||||
padding: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.ms-container .ms-list.ms-focus{
|
||||
border-color: rgba(82, 168, 236, 0.8);
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
|
||||
outline: 0;
|
||||
outline: thin dotted \9;
|
||||
}
|
||||
|
||||
.ms-container ul{
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ms-container .ms-optgroup-container{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ms-container .ms-optgroup-label{
|
||||
margin: 0;
|
||||
padding: 5px 0px 0px 5px;
|
||||
cursor: pointer;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.ms-container .ms-selectable li.ms-elem-selectable,
|
||||
.ms-container .ms-selection li.ms-elem-selection{
|
||||
border-bottom: 1px #eee solid;
|
||||
padding: 2px 10px;
|
||||
color: #555;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.ms-container .ms-selectable li.ms-hover,
|
||||
.ms-container .ms-selection li.ms-hover{
|
||||
cursor: pointer;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
background-color: #08c;
|
||||
}
|
||||
|
||||
.ms-container .ms-selectable li.disabled,
|
||||
.ms-container .ms-selection li.disabled{
|
||||
background-color: #eee;
|
||||
color: #aaa;
|
||||
cursor: text;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
Document : jquery.pnotify.default.css
|
||||
Created on : Nov 23, 2009, 3:14:10 PM
|
||||
Author : Hunter Perrin
|
||||
Version : 1.2.0
|
||||
Link : http://pinesframework.org/pnotify/
|
||||
Description:
|
||||
Default styling for Pines Notify jQuery plugin.
|
||||
*/
|
||||
/* -- Notice */
|
||||
.ui-pnotify {
|
||||
top: 25px;
|
||||
right: 25px;
|
||||
position: absolute;
|
||||
height: auto;
|
||||
/* Ensures notices are above everything */
|
||||
z-index: 9999;
|
||||
}
|
||||
/* Hides position: fixed from IE6 */
|
||||
html > body .ui-pnotify {
|
||||
position: fixed;
|
||||
}
|
||||
.ui-pnotify .ui-pnotify-shadow {
|
||||
-webkit-box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5);
|
||||
-moz-box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5);
|
||||
box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5);
|
||||
}
|
||||
.ui-pnotify-container {
|
||||
background-position: 0 0;
|
||||
padding: .8em;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
.ui-pnotify-sharp {
|
||||
-webkit-border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
.ui-pnotify-closer, .ui-pnotify-sticker {
|
||||
float: right;
|
||||
margin-left: .2em;
|
||||
}
|
||||
.ui-pnotify-title {
|
||||
display: block;
|
||||
margin-bottom: .4em;
|
||||
}
|
||||
.ui-pnotify-text {
|
||||
display: block;
|
||||
}
|
||||
.ui-pnotify-icon, .ui-pnotify-icon span {
|
||||
display: block;
|
||||
float: left;
|
||||
margin-right: .2em;
|
||||
}
|
||||
/* -- History Pulldown */
|
||||
.ui-pnotify-history-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 18px;
|
||||
width: 70px;
|
||||
border-top: none;
|
||||
padding: 0;
|
||||
-webkit-border-top-left-radius: 0;
|
||||
-moz-border-top-left-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
-webkit-border-top-right-radius: 0;
|
||||
-moz-border-top-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
/* Ensures history container is above notices. */
|
||||
z-index: 10000;
|
||||
}
|
||||
.ui-pnotify-history-container .ui-pnotify-history-header {
|
||||
padding: 2px;
|
||||
}
|
||||
.ui-pnotify-history-container button {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.ui-pnotify-history-container .ui-pnotify-history-pulldown {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
@@ -1,99 +1,92 @@
|
||||
/*
|
||||
* qTip2 - Pretty powerful tooltips
|
||||
* http://craigsworks.com/projects/qtip2/
|
||||
*
|
||||
* Version: nightly
|
||||
* Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com
|
||||
*
|
||||
* Dual licensed under MIT or GPLv2 licenses
|
||||
* http://en.wikipedia.org/wiki/MIT_License
|
||||
* http://en.wikipedia.org/wiki/GNU_General_Public_License
|
||||
*
|
||||
* Date: Wed Mar 9 02:39:53 PST 2011
|
||||
*/
|
||||
|
||||
/* Fluid class for determining actual width in IE */
|
||||
.ui-tooltip-fluid{
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
position: static !important;
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
.ui-tooltip, .qtip, .ui-tooltip-hidden{
|
||||
* qTip2 - Pretty powerful tooltips - v2.2.0
|
||||
* http://qtip2.com
|
||||
*
|
||||
* Copyright (c) 2013 Craig Michael Thompson
|
||||
* Released under the MIT, GPL licenses
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: Sun Dec 15 2013 12:33 EST-0500
|
||||
* Plugins: tips viewport imagemap svg modal ie6
|
||||
* Styles: basic css3
|
||||
*/
|
||||
.qtip{
|
||||
position: absolute;
|
||||
left: -31000px;
|
||||
top: -31000px;
|
||||
display: block;
|
||||
left: -28000px;
|
||||
top: -28000px;
|
||||
display: none;
|
||||
|
||||
max-width: 280px;
|
||||
min-width: 50px;
|
||||
|
||||
|
||||
font-size: 10.5px;
|
||||
line-height: 12px;
|
||||
|
||||
direction: ltr;
|
||||
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-tooltip-content{
|
||||
.qtip-content{
|
||||
position: relative;
|
||||
padding: 5px 9px;
|
||||
overflow: hidden;
|
||||
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
|
||||
|
||||
text-align: left;
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ui-tooltip-titlebar{
|
||||
.qtip-titlebar{
|
||||
position: relative;
|
||||
min-height: 14px;
|
||||
padding: 5px 35px 5px 10px;
|
||||
overflow: hidden;
|
||||
|
||||
border-width: 1px 1px 0;
|
||||
border-style: solid;
|
||||
|
||||
border-width: 0 0 1px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ui-tooltip-titlebar + .ui-tooltip-content{ border-top-width: 0px !important; }
|
||||
.qtip-titlebar + .qtip-content{ border-top-width: 0 !important; }
|
||||
|
||||
/*! Default close button class */
|
||||
.ui-tooltip-titlebar .ui-state-default{
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
top: 50%;
|
||||
/* Default close button class */
|
||||
.qtip-close{
|
||||
position: absolute;
|
||||
right: -9px; top: -9px;
|
||||
|
||||
cursor: pointer;
|
||||
outline: medium none;
|
||||
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.qtip-titlebar .qtip-close{
|
||||
right: 4px; top: 50%;
|
||||
margin-top: -9px;
|
||||
|
||||
cursor: pointer;
|
||||
outline: medium none;
|
||||
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
* html .ui-tooltip-titlebar .ui-state-default{
|
||||
top: 16px;
|
||||
}
|
||||
|
||||
.ui-tooltip-titlebar .ui-icon,
|
||||
.ui-tooltip-icon .ui-icon{
|
||||
* html .qtip-titlebar .qtip-close{ top: 16px; } /* IE fix */
|
||||
|
||||
.qtip-titlebar .ui-icon,
|
||||
.qtip-icon .ui-icon{
|
||||
display: block;
|
||||
text-indent: -1000em;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.ui-tooltip-icon, .ui-tooltip-icon .ui-icon{
|
||||
.qtip-icon, .qtip-icon .ui-icon{
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.ui-tooltip-icon .ui-icon{
|
||||
.qtip-icon .ui-icon{
|
||||
width: 18px;
|
||||
height: 14px;
|
||||
|
||||
line-height: 14px;
|
||||
text-align: center;
|
||||
text-indent: 0;
|
||||
font: normal bold 10px/13px Tahoma,sans-serif;
|
||||
@@ -102,271 +95,218 @@
|
||||
background: transparent none no-repeat -100em -100em;
|
||||
}
|
||||
|
||||
|
||||
/* Applied to 'focused' tooltips e.g. most recently displayed/interacted with */
|
||||
.ui-tooltip-focus{
|
||||
.qtip-focus{}
|
||||
|
||||
}
|
||||
/* Applied on hover of tooltips i.e. added/removed on mouseenter/mouseleave respectively */
|
||||
.qtip-hover{}
|
||||
|
||||
|
||||
/*! Default tooltip style */
|
||||
.ui-tooltip-titlebar,
|
||||
.ui-tooltip-content{
|
||||
/* Default tooltip style */
|
||||
.qtip-default{
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #F1D031;
|
||||
|
||||
background-color: #FFFFA3;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.ui-tooltip-titlebar{
|
||||
.qtip-default .qtip-titlebar{
|
||||
background-color: #FFEF93;
|
||||
}
|
||||
|
||||
.ui-tooltip-titlebar .ui-tooltip-icon{
|
||||
.qtip-default .qtip-icon{
|
||||
border-color: #CCC;
|
||||
background: #F1F1F1;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.ui-tooltip-titlebar .ui-state-hover{
|
||||
|
||||
.qtip-default .qtip-titlebar .qtip-close{
|
||||
border-color: #AAA;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*! Light tooltip style */
|
||||
.ui-tooltip-light .ui-tooltip-titlebar,
|
||||
.ui-tooltip-light .ui-tooltip-content{
|
||||
.qtip-light{
|
||||
background-color: white;
|
||||
border-color: #E2E2E2;
|
||||
color: #454545;
|
||||
}
|
||||
|
||||
.ui-tooltip-light .ui-tooltip-content{
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.ui-tooltip-light .ui-tooltip-titlebar{
|
||||
.qtip-light .qtip-titlebar{
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
|
||||
/*! Dark tooltip style */
|
||||
.ui-tooltip-dark .ui-tooltip-titlebar,
|
||||
.ui-tooltip-dark .ui-tooltip-content{
|
||||
.qtip-dark{
|
||||
background-color: #505050;
|
||||
border-color: #303030;
|
||||
color: #f3f3f3;
|
||||
}
|
||||
|
||||
.ui-tooltip-dark .ui-tooltip-content{
|
||||
background-color: #505050;
|
||||
}
|
||||
|
||||
.ui-tooltip-dark .ui-tooltip-titlebar{
|
||||
.qtip-dark .qtip-titlebar{
|
||||
background-color: #404040;
|
||||
}
|
||||
|
||||
.ui-tooltip-dark .ui-tooltip-icon{
|
||||
.qtip-dark .qtip-icon{
|
||||
border-color: #444;
|
||||
}
|
||||
|
||||
.ui-tooltip-dark .ui-tooltip-titlebar .ui-state-hover{
|
||||
.qtip-dark .qtip-titlebar .ui-state-hover{
|
||||
border-color: #303030;
|
||||
}
|
||||
|
||||
|
||||
/*! Cream tooltip style */
|
||||
.ui-tooltip-cream .ui-tooltip-titlebar,
|
||||
.ui-tooltip-cream .ui-tooltip-content{
|
||||
.qtip-cream{
|
||||
background-color: #FBF7AA;
|
||||
border-color: #F9E98E;
|
||||
color: #A27D35;
|
||||
}
|
||||
|
||||
.ui-tooltip-cream .ui-tooltip-content{
|
||||
background-color: #FBF7AA;
|
||||
}
|
||||
|
||||
.ui-tooltip-cream .ui-tooltip-titlebar{
|
||||
.qtip-cream .qtip-titlebar{
|
||||
background-color: #F0DE7D;
|
||||
}
|
||||
|
||||
.ui-tooltip-cream .ui-state-default .ui-tooltip-icon{
|
||||
.qtip-cream .qtip-close .qtip-icon{
|
||||
background-position: -82px 0;
|
||||
}
|
||||
|
||||
|
||||
/*! Red tooltip style */
|
||||
.ui-tooltip-red .ui-tooltip-titlebar,
|
||||
.ui-tooltip-red .ui-tooltip-content{
|
||||
.qtip-red{
|
||||
background-color: #F78B83;
|
||||
border-color: #D95252;
|
||||
color: #912323;
|
||||
}
|
||||
|
||||
.ui-tooltip-red .ui-tooltip-content{
|
||||
background-color: #F78B83;
|
||||
}
|
||||
|
||||
.ui-tooltip-red .ui-tooltip-titlebar{
|
||||
.qtip-red .qtip-titlebar{
|
||||
background-color: #F06D65;
|
||||
}
|
||||
|
||||
.ui-tooltip-red .ui-state-default .ui-tooltip-icon{
|
||||
.qtip-red .qtip-close .qtip-icon{
|
||||
background-position: -102px 0;
|
||||
}
|
||||
|
||||
.ui-tooltip-red .ui-tooltip-icon{
|
||||
.qtip-red .qtip-icon{
|
||||
border-color: #D95252;
|
||||
}
|
||||
|
||||
.ui-tooltip-red .ui-tooltip-titlebar .ui-state-hover{
|
||||
.qtip-red .qtip-titlebar .ui-state-hover{
|
||||
border-color: #D95252;
|
||||
}
|
||||
|
||||
|
||||
/*! Green tooltip style */
|
||||
.ui-tooltip-green .ui-tooltip-titlebar,
|
||||
.ui-tooltip-green .ui-tooltip-content{
|
||||
.qtip-green{
|
||||
background-color: #CAED9E;
|
||||
border-color: #90D93F;
|
||||
color: #3F6219;
|
||||
}
|
||||
|
||||
.ui-tooltip-green .ui-tooltip-content{
|
||||
background-color: #CAED9E;
|
||||
}
|
||||
|
||||
.ui-tooltip-green .ui-tooltip-titlebar{
|
||||
.qtip-green .qtip-titlebar{
|
||||
background-color: #B0DE78;
|
||||
}
|
||||
|
||||
.ui-tooltip-green .ui-state-default .ui-tooltip-icon{
|
||||
.qtip-green .qtip-close .qtip-icon{
|
||||
background-position: -42px 0;
|
||||
}
|
||||
|
||||
|
||||
/*! Blue tooltip style */
|
||||
.ui-tooltip-blue .ui-tooltip-titlebar,
|
||||
.ui-tooltip-blue .ui-tooltip-content{
|
||||
.qtip-blue{
|
||||
background-color: #E5F6FE;
|
||||
border-color: #ADD9ED;
|
||||
color: #5E99BD;
|
||||
}
|
||||
|
||||
.ui-tooltip-blue .ui-tooltip-content{
|
||||
background-color: #E5F6FE;
|
||||
}
|
||||
|
||||
.ui-tooltip-blue .ui-tooltip-titlebar{
|
||||
.qtip-blue .qtip-titlebar{
|
||||
background-color: #D0E9F5;
|
||||
}
|
||||
|
||||
.ui-tooltip-blue .ui-state-default .ui-tooltip-icon{
|
||||
.qtip-blue .qtip-close .qtip-icon{
|
||||
background-position: -2px 0;
|
||||
}.ui-tooltip .ui-tooltip-tip{
|
||||
position: absolute;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
|
||||
background: transparent !important;
|
||||
border: 0px dashed transparent !important;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.ui-tooltip .ui-tooltip-tip,
|
||||
.ui-tooltip .ui-tooltip-tip *{
|
||||
line-height: 0.1px !important;
|
||||
font-size: 0.1px !important;
|
||||
color: #123456;
|
||||
|
||||
background: transparent;
|
||||
border: 0px dashed transparent;
|
||||
}
|
||||
|
||||
#qtip-overlay{
|
||||
position: absolute;
|
||||
left: -10000em;
|
||||
top: -10000em;
|
||||
|
||||
background-color: black;
|
||||
|
||||
opacity: 0.7;
|
||||
filter:alpha(opacity=70);
|
||||
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
||||
}
|
||||
|
||||
/*! Add shadows to your tooltips in: FF3+, Chrome 2+, Opera 10.6+, IE6+, Safari 2+ */
|
||||
.ui-tooltip-shadow{
|
||||
.qtip-shadow{
|
||||
-webkit-box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15);
|
||||
-moz-box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15);
|
||||
box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.ui-tooltip-shadow .ui-tooltip-titlebar,
|
||||
.ui-tooltip-shadow .ui-tooltip-content{
|
||||
filter: progid:DXImageTransform.Microsoft.Shadow(Color='gray', Direction=135, Strength=3);
|
||||
-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(Color='gray', Direction=135, Strength=3)";
|
||||
}
|
||||
|
||||
|
||||
/*! Add rounded corners to your tooltips in: FF3+, Chrome 2+, Opera 10.6+, IE9+, Safari 2+ */
|
||||
.ui-tooltip-rounded,
|
||||
.ui-tooltip-rounded .ui-tooltip-content,
|
||||
.ui-tooltip-tipsy,
|
||||
.ui-tooltip-tipsy .ui-tooltip-content,
|
||||
.ui-tooltip-youtube,
|
||||
.ui-tooltip-youtube .ui-tooltip-content{
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
/* Add rounded corners to your tooltips in: FF3+, Chrome 2+, Opera 10.6+, IE9+, Safari 2+ */
|
||||
.qtip-rounded,
|
||||
.qtip-tipsy,
|
||||
.qtip-bootstrap{
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.ui-tooltip-rounded .ui-tooltip-titlebar,
|
||||
.ui-tooltip-tipsy .ui-tooltip-titlebar,
|
||||
.ui-tooltip-youtube .ui-tooltip-titlebar{
|
||||
-moz-border-radius: 5px 5px 0 0;
|
||||
-webkit-border-radius: 5px 5px 0 0;
|
||||
border-radius: 5px 5px 0 0;
|
||||
.qtip-rounded .qtip-titlebar{
|
||||
-moz-border-radius: 4px 4px 0 0;
|
||||
-webkit-border-radius: 4px 4px 0 0;
|
||||
border-radius: 4px 4px 0 0;
|
||||
}
|
||||
|
||||
.ui-tooltip-rounded .ui-tooltip-titlebar + .ui-tooltip-content,
|
||||
.ui-tooltip-tipsy .ui-tooltip-titlebar + .ui-tooltip-content,
|
||||
.ui-tooltip-youtube .ui-tooltip-titlebar + .ui-tooltip-content{
|
||||
-moz-border-radius: 0 0 5px 5px;
|
||||
-webkit-border-radius: 0 0 5px 5px;
|
||||
border-radius: 0 0 5px 5px;
|
||||
}
|
||||
/* Youtube tooltip style */
|
||||
.qtip-youtube{
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
|
||||
|
||||
/*! Youtube tooltip style */
|
||||
.ui-tooltip-youtube{
|
||||
-webkit-box-shadow: 0 0 3px #333;
|
||||
-moz-box-shadow: 0 0 3px #333;
|
||||
box-shadow: 0 0 3px #333;
|
||||
|
||||
color: white;
|
||||
border-width: 0;
|
||||
|
||||
background: #4A4A4A;
|
||||
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,black));
|
||||
background-image: -webkit-linear-gradient(top,#4A4A4A 0,black 100%);
|
||||
background-image: -moz-linear-gradient(top,#4A4A4A 0,black 100%);
|
||||
background-image: -ms-linear-gradient(top,#4A4A4A 0,black 100%);
|
||||
background-image: -o-linear-gradient(top,#4A4A4A 0,black 100%);
|
||||
}
|
||||
|
||||
.ui-tooltip-youtube .ui-tooltip-titlebar,
|
||||
.ui-tooltip-youtube .ui-tooltip-content{
|
||||
background: transparent;
|
||||
background: rgba(0, 0, 0, 0.85);
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)";
|
||||
|
||||
color: white;
|
||||
border-color: #CCCCCC;
|
||||
.qtip-youtube .qtip-titlebar{
|
||||
background-color: #4A4A4A;
|
||||
background-color: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
.ui-tooltip-youtube .ui-tooltip-icon{
|
||||
.qtip-youtube .qtip-content{
|
||||
padding: .75em;
|
||||
font: 12px arial,sans-serif;
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#4a4a4a,EndColorStr=#000000);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#4a4a4a,EndColorStr=#000000);";
|
||||
}
|
||||
|
||||
.qtip-youtube .qtip-icon{
|
||||
border-color: #222;
|
||||
}
|
||||
|
||||
.ui-tooltip-youtube .ui-tooltip-titlebar .ui-state-hover{
|
||||
.qtip-youtube .qtip-titlebar .ui-state-hover{
|
||||
border-color: #303030;
|
||||
}
|
||||
|
||||
|
||||
/* jQuery TOOLS Tooltip style */
|
||||
.ui-tooltip-jtools{
|
||||
.qtip-jtools{
|
||||
background: #232323;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
background-image: -moz-linear-gradient(top, #717171, #232323);
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#717171), to(#232323));
|
||||
|
||||
background-image: -moz-linear-gradient(top, #717171, #232323);
|
||||
background-image: -webkit-linear-gradient(top, #717171, #232323);
|
||||
background-image: -ms-linear-gradient(top, #717171, #232323);
|
||||
background-image: -o-linear-gradient(top, #717171, #232323);
|
||||
|
||||
border: 2px solid #ddd;
|
||||
border: 2px solid rgba(241,241,241,1);
|
||||
|
||||
@@ -378,145 +318,306 @@
|
||||
-moz-box-shadow: 0 0 12px #333;
|
||||
box-shadow: 0 0 12px #333;
|
||||
}
|
||||
|
||||
/* IE Specific */
|
||||
.ui-tooltip-jtools .ui-tooltip-titlebar{
|
||||
.qtip-jtools .qtip-titlebar{
|
||||
background-color: transparent;
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)";
|
||||
}
|
||||
|
||||
.ui-tooltip-jtools .ui-tooltip-content{
|
||||
.qtip-jtools .qtip-content{
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)";
|
||||
}
|
||||
|
||||
.ui-tooltip-jtools .ui-tooltip-titlebar,
|
||||
.ui-tooltip-jtools .ui-tooltip-content{
|
||||
.qtip-jtools .qtip-titlebar,
|
||||
.qtip-jtools .qtip-content{
|
||||
background: transparent;
|
||||
color: white;
|
||||
border: 0 dashed transparent;
|
||||
}
|
||||
|
||||
.ui-tooltip-jtools .ui-tooltip-icon{
|
||||
.qtip-jtools .qtip-icon{
|
||||
border-color: #555;
|
||||
}
|
||||
|
||||
.ui-tooltip-jtools .ui-tooltip-titlebar .ui-state-hover{
|
||||
.qtip-jtools .qtip-titlebar .ui-state-hover{
|
||||
border-color: #333;
|
||||
}
|
||||
|
||||
|
||||
/* Cluetip style */
|
||||
.ui-tooltip-cluetip{
|
||||
.qtip-cluetip{
|
||||
-webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
|
||||
-moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
|
||||
box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
|
||||
|
||||
background-color: #D9D9C2;
|
||||
color: #111;
|
||||
border: 0 dashed transparent;
|
||||
}
|
||||
|
||||
.ui-tooltip-cluetip .ui-tooltip-titlebar{
|
||||
.qtip-cluetip .qtip-titlebar{
|
||||
background-color: #87876A;
|
||||
color: white;
|
||||
border: 0 dashed transparent;
|
||||
}
|
||||
|
||||
.ui-tooltip-cluetip .ui-tooltip-content{
|
||||
background-color: #D9D9C2;
|
||||
color: #111;
|
||||
border: 0 dashed transparent;
|
||||
}
|
||||
|
||||
.ui-tooltip-cluetip .ui-tooltip-icon{
|
||||
.qtip-cluetip .qtip-icon{
|
||||
border-color: #808064;
|
||||
}
|
||||
|
||||
.ui-tooltip-cluetip .ui-tooltip-titlebar .ui-state-hover{
|
||||
|
||||
.qtip-cluetip .qtip-titlebar .ui-state-hover{
|
||||
border-color: #696952;
|
||||
color: #696952;
|
||||
}
|
||||
|
||||
|
||||
/* Tipsy style */
|
||||
.ui-tooltip-tipsy{
|
||||
border: 0 solid #000;
|
||||
border: 0 solid rgba(0,0,0,.87);
|
||||
.qtip-tipsy{
|
||||
background: black;
|
||||
background: rgba(0, 0, 0, .87);
|
||||
|
||||
color: white;
|
||||
border: 0 solid transparent;
|
||||
|
||||
font-size: 11px;
|
||||
font-family: 'Lucida Grande', sans-serif;
|
||||
font-weight: bold;
|
||||
line-height: 16px;
|
||||
text-shadow: 0 1px black;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipsy .ui-tooltip-titlebar,
|
||||
.ui-tooltip-tipsy .ui-tooltip-content{
|
||||
background: transparent;
|
||||
background: rgba(0, 0, 0, .87);
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)";
|
||||
|
||||
color: white;
|
||||
border: 0 dashed transparent;
|
||||
|
||||
font-size: 11px;
|
||||
font-family: 'Lucida Grande', sans-serif;
|
||||
font-weight: bold;
|
||||
line-height: 16px;
|
||||
text-shadow: 0 1px black;
|
||||
.qtip-tipsy .qtip-titlebar{
|
||||
padding: 6px 35px 0 10px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipsy .ui-tooltip-titlebar{
|
||||
padding: 6px 35px 0 10;
|
||||
.qtip-tipsy .qtip-content{
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipsy .ui-tooltip-content{
|
||||
padding: 6px 10;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipsy .ui-tooltip-icon{
|
||||
.qtip-tipsy .qtip-icon{
|
||||
border-color: #222;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipsy .ui-tooltip-titlebar .ui-state-hover{
|
||||
.qtip-tipsy .qtip-titlebar .ui-state-hover{
|
||||
border-color: #303030;
|
||||
}
|
||||
|
||||
|
||||
/* Tipped style */
|
||||
.ui-tooltip-tipped{
|
||||
.qtip-tipped{
|
||||
border: 3px solid #959FA9;
|
||||
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
|
||||
background-color: #F9F9F9;
|
||||
color: #454545;
|
||||
|
||||
font-weight: normal;
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipped .ui-tooltip-titlebar,
|
||||
.ui-tooltip-tipped .ui-tooltip-content{
|
||||
border: 3px solid #959FA9;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipped .ui-tooltip-titlebar{
|
||||
background: #3A79B8;
|
||||
background-image: -moz-linear-gradient(top, #3A79B8, #2E629D);
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#3A79B8), to(#2E629D));
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)";
|
||||
.qtip-tipped .qtip-titlebar{
|
||||
border-bottom-width: 0;
|
||||
|
||||
color: white;
|
||||
font-weight: normal;
|
||||
font-family: serif;
|
||||
|
||||
border-bottom-width: 0;
|
||||
-moz-border-radius: 3px 3px 0 0;
|
||||
-webkit-border-radius: 3px 3px 0 0;
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipped .ui-tooltip-content{
|
||||
background-color: #F9F9F9;
|
||||
color: #454545;
|
||||
|
||||
-moz-border-radius: 0 0 3px 3px;
|
||||
-webkit-border-radius: 0 0 3px 3px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
background: #3A79B8;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#3A79B8), to(#2E629D));
|
||||
background-image: -webkit-linear-gradient(top, #3A79B8, #2E629D);
|
||||
background-image: -moz-linear-gradient(top, #3A79B8, #2E629D);
|
||||
background-image: -ms-linear-gradient(top, #3A79B8, #2E629D);
|
||||
background-image: -o-linear-gradient(top, #3A79B8, #2E629D);
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)";
|
||||
}
|
||||
|
||||
.ui-tooltip-tipped .ui-tooltip-icon{
|
||||
.qtip-tipped .qtip-icon{
|
||||
border: 2px solid #285589;
|
||||
background: #285589;
|
||||
}
|
||||
|
||||
.ui-tooltip-tipped .ui-tooltip-icon .ui-icon{
|
||||
|
||||
.qtip-tipped .qtip-icon .ui-icon{
|
||||
background-color: #FBFBFB;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Twitter Bootstrap style.
|
||||
*
|
||||
* Tested with IE 8, IE 9, Chrome 18, Firefox 9, Opera 11.
|
||||
* Does not work with IE 7.
|
||||
*/
|
||||
.qtip-bootstrap{
|
||||
/** Taken from Bootstrap body */
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
color: #333333;
|
||||
|
||||
/** Taken from Bootstrap .popover */
|
||||
padding: 1px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
.qtip-bootstrap .qtip-titlebar{
|
||||
/** Taken from Bootstrap .popover-title */
|
||||
padding: 8px 14px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
line-height: 18px;
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
-webkit-border-radius: 5px 5px 0 0;
|
||||
-moz-border-radius: 5px 5px 0 0;
|
||||
border-radius: 5px 5px 0 0;
|
||||
}
|
||||
|
||||
.qtip-bootstrap .qtip-titlebar .qtip-close{
|
||||
/**
|
||||
* Overrides qTip2:
|
||||
* .qtip-titlebar .qtip-close{
|
||||
* [...]
|
||||
* right: 4px;
|
||||
* top: 50%;
|
||||
* [...]
|
||||
* border-style: solid;
|
||||
* }
|
||||
*/
|
||||
right: 11px;
|
||||
top: 45%;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
.qtip-bootstrap .qtip-content{
|
||||
/** Taken from Bootstrap .popover-content */
|
||||
padding: 9px 14px;
|
||||
}
|
||||
|
||||
.qtip-bootstrap .qtip-icon{
|
||||
/**
|
||||
* Overrides qTip2:
|
||||
* .qtip-default .qtip-icon {
|
||||
* border-color: #CCC;
|
||||
* background: #F1F1F1;
|
||||
* color: #777;
|
||||
* }
|
||||
*/
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.qtip-bootstrap .qtip-icon .ui-icon{
|
||||
/**
|
||||
* Overrides qTip2:
|
||||
* .qtip-icon .ui-icon{
|
||||
* width: 18px;
|
||||
* height: 14px;
|
||||
* }
|
||||
*/
|
||||
width: auto;
|
||||
height: auto;
|
||||
|
||||
/* Taken from Bootstrap .close */
|
||||
float: right;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
line-height: 18px;
|
||||
color: #000000;
|
||||
text-shadow: 0 1px 0 #ffffff;
|
||||
opacity: 0.2;
|
||||
filter: alpha(opacity=20);
|
||||
}
|
||||
|
||||
.qtip-bootstrap .qtip-icon .ui-icon:hover{
|
||||
/* Taken from Bootstrap .close:hover */
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
opacity: 0.4;
|
||||
filter: alpha(opacity=40);
|
||||
}
|
||||
|
||||
|
||||
/* IE9 fix - removes all filters */
|
||||
.qtip:not(.ie9haxors) div.qtip-content,
|
||||
.qtip:not(.ie9haxors) div.qtip-titlebar{
|
||||
filter: none;
|
||||
-ms-filter: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.qtip .qtip-tip{
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
z-index: 10;
|
||||
|
||||
}
|
||||
|
||||
/* Opera bug #357 - Incorrect tip position
|
||||
https://github.com/Craga89/qTip2/issues/367 */
|
||||
x:-o-prefocus, .qtip .qtip-tip{
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.qtip .qtip-tip,
|
||||
.qtip .qtip-tip .qtip-vml,
|
||||
.qtip .qtip-tip canvas{
|
||||
position: absolute;
|
||||
|
||||
color: #123456;
|
||||
background: transparent;
|
||||
border: 0 dashed transparent;
|
||||
}
|
||||
|
||||
.qtip .qtip-tip canvas{ top: 0; left: 0; }
|
||||
|
||||
.qtip .qtip-tip .qtip-vml{
|
||||
behavior: url(#default#VML);
|
||||
display: inline-block;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
#qtip-overlay{
|
||||
position: fixed;
|
||||
left: 0; top: 0;
|
||||
width: 100%; height: 100%;
|
||||
}
|
||||
|
||||
/* Applied to modals with show.modal.blur set to true */
|
||||
#qtip-overlay.blurs{ cursor: pointer; }
|
||||
|
||||
/* Change opacity of overlay here */
|
||||
#qtip-overlay div{
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
width: 100%; height: 100%;
|
||||
|
||||
background-color: black;
|
||||
|
||||
opacity: 0.7;
|
||||
filter:alpha(opacity=70);
|
||||
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
||||
}
|
||||
|
||||
|
||||
|
||||
.qtipmodal-ie6fix{
|
||||
position: absolute !important;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user