diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1cc4572 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..1996db0 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +simple-ads-manager \ No newline at end of file diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 0000000..cab819f --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..1162f43 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..d5b6f67 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/simple-ads-manager.iml b/.idea/simple-ads-manager.iml new file mode 100644 index 0000000..a273e97 --- /dev/null +++ b/.idea/simple-ads-manager.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..c80f219 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.idea/webResources.xml b/.idea/webResources.xml new file mode 100644 index 0000000..a9bf725 --- /dev/null +++ b/.idea/webResources.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 2553bf3..b8c458f 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,16 @@ Do not upgrade this plugin from Update page! Upgrade it from Plugins page! Change log ========== +1.8.71 +* Javascript output of ads (for caching compatibility) is added +* Custom Taxonomies restrictions are added +* Building query for SQL request is optimised +* Admin interface is improved +* Loading/Selecting banners (Image Mode) from Wordpress Media Library is added +* Updater is fixed and improved +* Language pack folder is added +* bbPress support is added + 1.7.63 * Some bugs (Ads Block style, Click Tracker) are resolved. diff --git a/ad.class.php b/ad.class.php index 466fb68..a282390 100644 --- a/ad.class.php +++ b/ad.class.php @@ -4,6 +4,9 @@ class SamAd { private $args = array(); private $useCodes = false; private $crawler = false; + public $id = null; + public $pid = null; + public $cid = null; public $ad = ''; public function __construct($args = null, $useCodes = false, $crawler = false) { @@ -34,40 +37,46 @@ private function buildAd( $args = null, $useCodes = false ) { $pTable = $wpdb->prefix . "sam_places"; $aTable = $wpdb->prefix . "sam_ads"; - $settings = $this->getSettings(); - if(!empty($args['id'])) $wid = "$aTable.id = {$args['id']}"; - else $wid = "$aTable.name = '{$args['name']}'"; + $settings = self::getSettings(); + $rId = rand(1111, 9999); + if(!empty($args['id'])) $wid = "sa.id = {$args['id']}"; + else $wid = "sa.name = '{$args['name']}'"; $output = ''; $aSql = "SELECT - $aTable.id, - $aTable.pid, - $aTable.code_mode, - $aTable.ad_code, - $aTable.ad_img, - $aTable.ad_alt, - $aTable.ad_no, - $aTable.ad_target, - $aTable.ad_swf, - $aTable.ad_swf_flashvars, - $aTable.ad_swf_params, - $aTable.ad_swf_attributes, - $aTable.count_clicks, - $aTable.code_type, - $pTable.code_before, - $pTable.code_after, - $pTable.place_size, - $pTable.place_custom_width, - $pTable.place_custom_height - FROM $aTable - INNER JOIN $pTable - ON $aTable.pid = $pTable.id + sa.id, + sa.pid, + sa.code_mode, + sa.ad_code, + sa.ad_img, + sa.ad_alt, + sa.ad_no, + sa.ad_target, + sa.ad_swf, + sa.ad_swf_flashvars, + sa.ad_swf_params, + sa.ad_swf_attributes, + sa.count_clicks, + sa.code_type, + sp.code_before, + sp.code_after, + sp.place_size, + sp.place_custom_width, + sp.place_custom_height + FROM $aTable sa + INNER JOIN $pTable sp + ON sa.pid = sp.id WHERE $wid;"; $ad = $wpdb->get_row($aSql, ARRAY_A); + + $this->id = $ad['id']; + $this->pid = $ad['pid']; + $this->cid = "c{$rId}_{$ad['id']}_{$ad['pid']}"; + if($ad['code_mode'] == 0) { if((int)$ad['ad_swf']) { - $id = "ad-".$ad['id'].'-'.rand(1111, 9999); + $id = "ad-".$ad['id'].'-'.$rId; $file = $ad['ad_img']; $sizes = self::getSize($ad['place_size'], $ad['place_custom_width'], $ad['place_custom_height']); $width = $sizes['width']; @@ -90,7 +99,7 @@ private function buildAd( $args = null, $useCodes = false ) { "; } else { - $outId = ((int) $ad['count_clicks'] == 1) ? " id='a".rand(10, 99)."_".$ad['id']."' class='sam_ad'" : ''; + $outId = ((int) $ad['count_clicks'] == 1) ? " id='a".$rId."_".$ad['id']."' class='sam_ad'" : ''; $aStart =''; $aEnd =''; $iTag = ''; @@ -115,8 +124,9 @@ private function buildAd( $args = null, $useCodes = false ) { } else $output = $ad['ad_code']; } - if(!$this->crawler && !is_admin()) - $wpdb->query("UPDATE $aTable SET $aTable.ad_hits = $aTable.ad_hits+1 WHERE $aTable.id = {$ad['id']};"); + $output = "
{$output}
"; + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE $aTable SET $aTable.ad_hits = $aTable.ad_hits+1 WHERE $aTable.id = {$ad['id']};"); if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; elseif($useCodes) $output = $ad['code_before'].$output.$ad['code_after']; @@ -131,9 +141,13 @@ class SamAdPlace { private $useCodes = false; private $crawler = false; public $ad = ''; + public $id = null; + public $pid = null; + public $cid = null; private $clauses; + private $force; - public function __construct($args = null, $useCodes = false, $crawler = false, $clauses = null) { + public function __construct($args = null, $useCodes = false, $crawler = false, $clauses = null, $ajax = false) { global $SAM_Query; $this->args = $args; @@ -141,6 +155,8 @@ public function __construct($args = null, $useCodes = false, $crawler = false, $ $this->crawler = $crawler; if(is_null( $clauses )) $this->clauses = $SAM_Query['clauses']; else $this->clauses = $clauses; + $this->force = $ajax; + $this->ad = $this->buildAd($this->args, $this->useCodes); } @@ -149,6 +165,13 @@ private function getSettings() { return $options; } + private function prepareCodes( $codes, $ind = null ) { + $index = (is_null($ind)) ? rand(1111, 9999) : $ind; + $out = str_replace('{samIndex}', $index, $codes); + + return $out; + } + private function getSize($ss, $width, $height) { if($ss == 'custom') return array('width' => $width, 'height' => $height); else { @@ -197,7 +220,9 @@ private function buildAd( $args = null, $useCodes = false ) { if(empty($args['id']) && empty($args['name'])) return ''; if( is_null($this->clauses) ) return ''; - $settings = $this->getSettings(); + $settings = self::getSettings(); + $data = intval($useCodes); + $rId = rand(1111, 9999); if($settings['adCycle'] == 0) $cycle = 1000; else $cycle = $settings['adCycle']; $el = (integer)$settings['errorlogFS']; @@ -212,30 +237,30 @@ private function buildAd( $args = null, $useCodes = false ) { $whereClauseW = $this->clauses['WCW']; $whereClause2W = $this->clauses['WC2W']; - if(!empty($args['id'])) $pId = "$pTable.id = {$args['id']}"; - else $pId = "$pTable.name = '{$args['name']}'"; + if(!empty($args['id'])) $pId = "sp.id = {$args['id']}"; + else $pId = "sp.name = '{$args['name']}'"; $pSql = "SELECT - $pTable.id, - $pTable.name, - $pTable.description, - $pTable.code_before, - $pTable.code_after, - $pTable.place_size, - $pTable.place_custom_width, - $pTable.place_custom_height, - $pTable.patch_img, - $pTable.patch_link, - $pTable.patch_code, - $pTable.patch_adserver, - $pTable.patch_dfp, - $pTable.patch_source, - $pTable.trash, - (SELECT COUNT(*) FROM $aTable WHERE $aTable.pid = $pTable.id AND $aTable.trash IS FALSE) AS ad_count, - (SELECT COUNT(*) FROM $aTable WHERE $aTable.pid = $pTable.id AND $aTable.trash IS FALSE AND $whereClause $whereClauseT $whereClause2W) AS ad_logic_count, - (SELECT COUNT(*) FROM $aTable WHERE $aTable.pid = $pTable.id AND $aTable.trash IS FALSE AND $whereClause $whereClauseT $whereClauseW) AS ad_full_count - FROM $pTable - WHERE $pId AND $pTable.trash IS FALSE;"; + sp.id, + sp.name, + sp.description, + sp.code_before, + sp.code_after, + sp.place_size, + sp.place_custom_width, + sp.place_custom_height, + sp.patch_img, + sp.patch_link, + sp.patch_code, + sp.patch_adserver, + sp.patch_dfp, + sp.patch_source, + sp.trash, + (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id AND sa.trash IS FALSE) AS ad_count, + (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id AND sa.trash IS FALSE AND $whereClause $whereClauseT $whereClause2W) AS ad_logic_count, + (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id AND sa.trash IS FALSE AND $whereClause $whereClauseT $whereClauseW) AS ad_full_count + FROM $pTable sp + WHERE $pId AND sp.trash IS FALSE;"; $place = $wpdb->get_row($pSql, ARRAY_A); @@ -252,21 +277,33 @@ private function buildAd( $args = null, $useCodes = false ) { $output .= ""."\n"; if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; + + $output = "
{$output}
"; } else $output = ''; - if(!$this->crawler) - $wpdb->query("UPDATE {$pTable} SET {$pTable}.patch_hits = {$pTable}.patch_hits+1 WHERE {$pTable}.id = {$place['id']}"); + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE {$pTable} SET {$pTable}.patch_hits = {$pTable}.patch_hits+1 WHERE {$pTable}.id = {$place['id']}"); return $output; } if(($place['patch_source'] == 1) && (abs($place['patch_adserver']) == 1)) { - $output = $place['patch_code']; + $output = self::prepareCodes($place['patch_code'], $rId); if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; - if(!$this->crawler) - $wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); + $output = "
{$output}
"; return $output; } + + if(($settings['adShow'] == 'js') && !$this->force) { + //$data = "{id: 0, pid: {$place['id']}, codes: $codes}"; + return "
"; + } + + $this->pid = $place['id']; + $this->id = 0; + $this->cid = "c{$rId}_0_{$this->pid}"; if((abs($place['ad_count']) == 0) || (abs($place['ad_logic_count']) == 0)) { if($place['patch_source'] == 0) { @@ -283,8 +320,13 @@ private function buildAd( $args = null, $useCodes = false ) { $output = $aStart.$iTag.$aEnd; } else $output = $place['patch_code']; - if(!$this->crawler) - $wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); + //$data = "{id: 0, pid: {$place['id']}, codes: $codes}"; + $output = "
{$output}
"; + if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; + elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; + return $output; } if((abs($place['ad_logic_count']) > 0) && (abs($place['ad_full_count']) == 0)) { @@ -292,25 +334,25 @@ private function buildAd( $args = null, $useCodes = false ) { } $aSql = "SELECT - $aTable.id, - $aTable.pid, - $aTable.code_mode, - $aTable.ad_code, - $aTable.ad_img, - $aTable.ad_alt, - $aTable.ad_no, - $aTable.ad_target, - $aTable.ad_swf, - $aTable.ad_swf_flashvars, - $aTable.ad_swf_params, - $aTable.ad_swf_attributes, - $aTable.count_clicks, - $aTable.code_type, - $aTable.ad_hits, - $aTable.ad_weight_hits, - IF($aTable.ad_weight, ($aTable.ad_weight_hits*10/($aTable.ad_weight*$cycle)), 0) AS ad_cycle - FROM $aTable - WHERE $aTable.pid = {$place['id']} AND $aTable.trash IS FALSE AND $whereClause $whereClauseT $whereClauseW + sa.id, + sa.pid, + sa.code_mode, + sa.ad_code, + sa.ad_img, + sa.ad_alt, + sa.ad_no, + sa.ad_target, + sa.ad_swf, + sa.ad_swf_flashvars, + sa.ad_swf_params, + sa.ad_swf_attributes, + sa.count_clicks, + sa.code_type, + sa.ad_hits, + sa.ad_weight_hits, + IF(sa.ad_weight, (sa.ad_weight_hits*10/(sa.ad_weight*$cycle)), 0) AS ad_cycle + FROM $aTable sa + WHERE sa.pid = {$place['id']} AND sa.trash IS FALSE AND $whereClause $whereClauseT $whereClauseW ORDER BY ad_cycle LIMIT 1;"; @@ -322,9 +364,12 @@ private function buildAd( $args = null, $useCodes = false ) { return ''; } + $this->id = $ad['id']; + $this->cid = "c{$rId}_{$this->id}_{$this->pid}"; + if($ad['code_mode'] == 0) { if((int)$ad['ad_swf']) { - $id = "ad-".$ad['id'].'-'.rand(1111, 9999); + $id = "ad-".$ad['id'].'-'.$rId; $file = $ad['ad_img']; $sizes = self::getSize($place['place_size'], $place['place_custom_width'], $place['place_custom_height']); $width = $sizes['width']; @@ -332,7 +377,7 @@ private function buildAd( $args = null, $useCodes = false ) { $flashvars = (!empty($ad['ad_swf_flashvars'])) ? $ad['ad_swf_flashvars'] : '{}'; $params = (!empty($ad['ad_swf_params'])) ? $ad['ad_swf_params'] : '{}'; $attributes = (!empty($ad['ad_swf_attributes'])) ? $ad['ad_swf_attributes'] : '{}'; - $text = __('Flash ad').' ID:'.$ad['id']; + $text = 'Flash ad ID:'.$ad['id']; //__('Flash ad').' ID:'.$ad['id']; $output = " +

-

Payoneer:

-
- - - +
+ Click here to lend your support to: Funds to complete the development of plugin Simple Ads Manager 2 and make a donation at pledgie.com !
-

- '.__(' You can change it to any value you want!', SAM_DOMAIN).''; - $str = '$200'; - printf($format, $str); - ?> -

-

PayPal:

@@ -993,11 +1270,15 @@ public function samAdminPage() {
- doSettingsSections('sam-settings'); ?> + doSettingsSections('sam-settings', $this->settingsTabs); ?>

- + +

-

Simple Ads Manager plugin for Wordpress. Copyright © 2010 - 2011, minimus. All rights reserved.

+

Copyright © 2010 - 2014, minimus.

diff --git a/block.editor.admin.class.php b/block.editor.admin.class.php index 65332e9..49ccf18 100644 --- a/block.editor.admin.class.php +++ b/block.editor.admin.class.php @@ -75,7 +75,7 @@ private function drawItem($line, $column, $data = null) {
' id='item--place' value='0' > - ' id='place_id_' style="width: 100%;"> freeItems['places'] as $value) { @@ -85,10 +85,10 @@ private function drawItem($line, $column, $data = null) { } ?> -
+

' id='item--ad' value='1' > - ' id='ad_id_' style="width: 100%;"> freeItems['ads'] as $value) { @@ -98,10 +98,10 @@ private function drawItem($line, $column, $data = null) { } ?> -
+

' id='item--zone' value='2' > - ' id='zone_id_' style="width: 100%"> freeItems['zones'] as $value) { @@ -401,7 +401,7 @@ public function page() {

-

+

buildEditorItems($row['b_lines'], $row['b_cols'], $data); ?>

diff --git a/css/color-buttons.css b/css/color-buttons.css index 3ea71dc..2b018ce 100644 --- a/css/color-buttons.css +++ b/css/color-buttons.css @@ -16,11 +16,11 @@ border:1px solid #ccc; border-radius:2px; background:#f5f5f5; - background:linear-gradient(to top,#f5f5f5,#ddd); - background:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#ddd)); - background:-moz-linear-gradient(top,#f5f5f5,#ddd); - background:-ms-linear-gradient(top,#f5f5f5,#ddd); - background:-o-linear-gradient(top,#f5f5f5,#ddd); + background-image:linear-gradient(to top,#f5f5f5,#ddd); + background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#ddd)); + background-image:-moz-linear-gradient(top,#f5f5f5,#ddd); + background-image:-ms-linear-gradient(top,#f5f5f5,#ddd); + background-image:-o-linear-gradient(top,#f5f5f5,#ddd); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5',endColorstr='#dddddd'); -moz-box-shadow:-1px 2px 3px rgba(0,0,0,0.1); -webkit-box-shadow:-1px 2px 3px rgba(0,0,0,0.1); @@ -29,11 +29,11 @@ .color-btn:hover,.color-btn:active { background:#fdfdfd; - background:linear-gradient(top,#fdfdfd,#eee); - background:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee)); - background:-moz-linear-gradient(top,#fdfdfd,#eee); - background:-ms-linear-gradient(top,#fdfdfd,#eee); - background:-o-linear-gradient(top,#fdfdfd,#eee); + background-image:linear-gradient(top,#fdfdfd,#eee); + background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee)); + background-image:-moz-linear-gradient(top,#fdfdfd,#eee); + background-image:-ms-linear-gradient(top,#fdfdfd,#eee); + background-image:-o-linear-gradient(top,#fdfdfd,#eee); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdfdfd',endColorstr='#eeeeee'); border:1px solid #ddd } @@ -124,11 +124,11 @@ border-bottom:1px solid transparent; border-right:0; background:rgba(0,0,0,0); - background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.1))); - background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.1))); + background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); -moz-box-shadow:none; -webkit-box-shadow:none; box-shadow:none @@ -136,11 +136,11 @@ .color-btn-left:hover b,.color-btn-left:active b { background:rgba(0,0,0,0); - background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.05))); - background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)) + background-image:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.05))); + background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)) } .color-btn-left:active b { @@ -172,11 +172,11 @@ border-bottom:1px solid transparent; border-right:0; background:rgba(0,0,0,0); - background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.1))); - background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.1))); + background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); -moz-box-shadow:none; -webkit-box-shadow:none; box-shadow:none @@ -184,11 +184,11 @@ .color-btn-right:hover b, .color-btn-right:active b { background:rgba(0,0,0,0); - background:linear-gradient(to top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.05))); - background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)) + background-image:linear-gradient(to top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.05))); + background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)) } .color-btn-right:active b { diff --git a/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png deleted file mode 100644 index 4ac8be8..0000000 Binary files a/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png and /dev/null differ diff --git a/css/images/ui-bg_diagonals-thick_20_666666_40x40.png b/css/images/ui-bg_diagonals-thick_20_666666_40x40.png deleted file mode 100644 index 6f18467..0000000 Binary files a/css/images/ui-bg_diagonals-thick_20_666666_40x40.png and /dev/null differ diff --git a/css/images/ui-bg_flat_100_f5f5f5_40x100.png b/css/images/ui-bg_flat_100_f5f5f5_40x100.png new file mode 100644 index 0000000..c926114 Binary files /dev/null and b/css/images/ui-bg_flat_100_f5f5f5_40x100.png differ diff --git a/css/images/ui-bg_flat_10_000000_40x100.png b/css/images/ui-bg_flat_10_000000_40x100.png deleted file mode 100644 index d742a36..0000000 Binary files a/css/images/ui-bg_flat_10_000000_40x100.png and /dev/null differ diff --git a/css/images/ui-bg_flat_65_ffffff_40x100.png b/css/images/ui-bg_flat_65_ffffff_40x100.png new file mode 100644 index 0000000..46e1425 Binary files /dev/null and b/css/images/ui-bg_flat_65_ffffff_40x100.png differ diff --git a/css/images/ui-bg_flat_75_e6e6e6_40x100.png b/css/images/ui-bg_flat_75_e6e6e6_40x100.png new file mode 100644 index 0000000..f187c6f Binary files /dev/null and b/css/images/ui-bg_flat_75_e6e6e6_40x100.png differ diff --git a/css/images/ui-bg_flat_75_f5f5f5_40x100.png b/css/images/ui-bg_flat_75_f5f5f5_40x100.png new file mode 100644 index 0000000..712d72c Binary files /dev/null and b/css/images/ui-bg_flat_75_f5f5f5_40x100.png differ diff --git a/css/images/ui-bg_glass_100_f6f6f6_1x400.png b/css/images/ui-bg_glass_100_f6f6f6_1x400.png deleted file mode 100644 index bca2693..0000000 Binary files a/css/images/ui-bg_glass_100_f6f6f6_1x400.png and /dev/null differ diff --git a/css/images/ui-bg_glass_100_fdf5ce_1x400.png b/css/images/ui-bg_glass_100_fdf5ce_1x400.png deleted file mode 100644 index 31b742f..0000000 Binary files a/css/images/ui-bg_glass_100_fdf5ce_1x400.png and /dev/null differ diff --git a/css/images/ui-bg_glass_65_f5f5f5_1x400.png b/css/images/ui-bg_glass_65_f5f5f5_1x400.png new file mode 100644 index 0000000..faca9ff Binary files /dev/null and b/css/images/ui-bg_glass_65_f5f5f5_1x400.png differ diff --git a/css/images/ui-bg_glass_65_ffffff_1x400.png b/css/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 13140f5..0000000 Binary files a/css/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png deleted file mode 100644 index 7325020..0000000 Binary files a/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png and /dev/null differ diff --git a/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png deleted file mode 100644 index 920d979..0000000 Binary files a/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and /dev/null differ diff --git a/css/images/ui-bg_highlight-soft_55_fbf3c8_1x100.png b/css/images/ui-bg_highlight-soft_55_fbf3c8_1x100.png new file mode 100644 index 0000000..476eb51 Binary files /dev/null and b/css/images/ui-bg_highlight-soft_55_fbf3c8_1x100.png differ diff --git a/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png deleted file mode 100644 index d819aa5..0000000 Binary files a/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png and /dev/null differ diff --git a/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png deleted file mode 100644 index 065c3db..0000000 Binary files a/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and /dev/null differ diff --git a/css/images/ui-bg_highlight-soft_95_cccccc_1x100.png b/css/images/ui-bg_highlight-soft_95_cccccc_1x100.png new file mode 100644 index 0000000..2f68f0e Binary files /dev/null and b/css/images/ui-bg_highlight-soft_95_cccccc_1x100.png differ diff --git a/css/images/ui-bg_highlight-soft_95_fcbca3_1x100.png b/css/images/ui-bg_highlight-soft_95_fcbca3_1x100.png new file mode 100644 index 0000000..ba8a702 Binary files /dev/null and b/css/images/ui-bg_highlight-soft_95_fcbca3_1x100.png differ diff --git a/css/images/ui-icons_228ef1_256x240.png b/css/images/ui-icons_228ef1_256x240.png deleted file mode 100644 index 3a0140c..0000000 Binary files a/css/images/ui-icons_228ef1_256x240.png and /dev/null differ diff --git a/css/images/ui-icons_ef8c08_256x240.png b/css/images/ui-icons_ef8c08_256x240.png deleted file mode 100644 index 036ee07..0000000 Binary files a/css/images/ui-icons_ef8c08_256x240.png and /dev/null differ diff --git a/css/images/ui-icons_ffd27a_256x240.png b/css/images/ui-icons_ffd27a_256x240.png deleted file mode 100644 index 8b6c058..0000000 Binary files a/css/images/ui-icons_ffd27a_256x240.png and /dev/null differ diff --git a/css/images/ui-icons_ffffff_256x240.png b/css/images/ui-icons_ffffff_256x240.png deleted file mode 100644 index 4f624bb..0000000 Binary files a/css/images/ui-icons_ffffff_256x240.png and /dev/null differ diff --git a/css/index.html b/css/index.html new file mode 100644 index 0000000..25d941d --- /dev/null +++ b/css/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/css/jquery-ui-sam.css b/css/jquery-ui-sam.css new file mode 100644 index 0000000..61a5ef9 --- /dev/null +++ b/css/jquery-ui-sam.css @@ -0,0 +1,1177 @@ +/*! jQuery UI - v1.10.3 - 2013-11-17 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=11px&cornerRadius=4px&bgColorHeader=%23cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=95&borderColorHeader=%23dfdfdf&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23f5f5f5&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23dfdfdf&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=%23dfdfdf&fcDefault=%23555555&iconColorDefault=%23888888&bgColorHover=%23dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=%23999999&fcHover=%23212121&iconColorHover=%23454545&bgColorActive=%23f5f5f5&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=%23dfdfdf&fcActive=%23212121&iconColorActive=%23454545&bgColorHighlight=%23fbf3c8&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=55&borderColorHighlight=%23fbe352&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fcbca3&bgTextureError=highlight_soft&bgImgOpacityError=95&borderColorError=%23f82727&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; + /* support: IE10, see #8844 */ + list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 11px; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #dfdfdf; + background: #f5f5f5 url(images/ui-bg_flat_75_f5f5f5_40x100.png) 50% 50% repeat-x; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #dfdfdf; + background: #cccccc url(images/ui-bg_highlight-soft_95_cccccc_1x100.png) 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #dfdfdf; + background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #999999; + background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #212121; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #dfdfdf; + background: #f5f5f5 url(images/ui-bg_glass_65_f5f5f5_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fbe352; + background: #fbf3c8 url(images/ui-bg_highlight-soft_55_fbf3c8_1x100.png) 50% top repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #f82727; + background: #fcbca3 url(images/ui-bg_highlight-soft_95_fcbca3_1x100.png) 50% top repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_888888_256x240.png); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_2e83ff_256x240.png); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_cd0a0a_256x240.png); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); +} +.ui-widget-shadow { + margin: -8px 0 0 -8px; + padding: 8px; + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); + border-radius: 8px; +} diff --git a/css/jquery-ui-sam.min.css b/css/jquery-ui-sam.min.css new file mode 100644 index 0000000..e7ad842 --- /dev/null +++ b/css/jquery-ui-sam.min.css @@ -0,0 +1,7 @@ +/*! jQuery UI - v1.10.3 - 2013-11-17 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=11px&cornerRadius=4px&bgColorHeader=%23cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=95&borderColorHeader=%23dfdfdf&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23f5f5f5&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23dfdfdf&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=%23dfdfdf&fcDefault=%23555555&iconColorDefault=%23888888&bgColorHover=%23dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=%23999999&fcHover=%23212121&iconColorHover=%23454545&bgColorActive=%23f5f5f5&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=%23dfdfdf&fcActive=%23212121&iconColorActive=%23454545&bgColorHighlight=%23fbf3c8&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=55&borderColorHighlight=%23fbe352&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fcbca3&bgTextureError=highlight_soft&bgImgOpacityError=95&borderColorError=%23f82727&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:11px}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #dfdfdf;background:#f5f5f5 url(images/ui-bg_flat_75_f5f5f5_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #dfdfdf;background:#ccc url(images/ui-bg_highlight-soft_95_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #dfdfdf;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #dfdfdf;background:#f5f5f5 url(images/ui-bg_glass_65_f5f5f5_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fbe352;background:#fbf3c8 url(images/ui-bg_highlight-soft_55_fbf3c8_1x100.png) 50% top repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f82727;background:#fcbca3 url(images/ui-bg_highlight-soft_95_fcbca3_1x100.png) 50% top repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} \ No newline at end of file diff --git a/css/jquery-ui-wp38.css b/css/jquery-ui-wp38.css new file mode 100644 index 0000000..e0cceb2 --- /dev/null +++ b/css/jquery-ui-wp38.css @@ -0,0 +1,1177 @@ +/*! jQuery UI - v1.10.3 - 2013-12-12 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=11px&cornerRadius=0px&bgColorHeader=%23f5f5f5&bgTextureHeader=flat&bgImgOpacityHeader=100&borderColorHeader=%23dedede&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23dedede&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e6e6e6&bgTextureDefault=flat&bgImgOpacityDefault=75&borderColorDefault=%23dedede&fcDefault=%23777777&iconColorDefault=%23888888&bgColorHover=%23ffffff&bgTextureHover=flat&bgImgOpacityHover=75&borderColorHover=%23dedede&fcHover=%231e8cbe&iconColorHover=%23454545&bgColorActive=%23ffffff&bgTextureActive=flat&bgImgOpacityActive=65&borderColorActive=%23dedede&fcActive=%23555555&iconColorActive=%23454545&bgColorHighlight=%23fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=%23fcefa1&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=%23cd0a0a&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; + /* support: IE10, see #8844 */ + list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 11px; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #dedede; + background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #dedede; + background: #f5f5f5 url(images/ui-bg_flat_100_f5f5f5_40x100.png) 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #dedede; + background: #e6e6e6 url(images/ui-bg_flat_75_e6e6e6_40x100.png) 50% 50% repeat-x; + font-weight: normal; + color: #777777; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #777777; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #dedede; + background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; + font-weight: normal; + color: #1e8cbe; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #1e8cbe; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #dedede; + background: #ffffff url(images/ui-bg_flat_65_ffffff_40x100.png) 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #555555; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_888888_256x240.png); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_2e83ff_256x240.png); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_cd0a0a_256x240.png); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 0px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 0px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 0px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 0px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); +} +.ui-widget-shadow { + margin: -8px 0 0 -8px; + padding: 8px; + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); + border-radius: 8px; +} diff --git a/css/jquery-ui.css b/css/jquery-ui.css index 2bf4881..adc7591 100644 --- a/css/jquery-ui.css +++ b/css/jquery-ui.css @@ -1,9 +1,16 @@ -/*! jQuery UI - v1.10.3 - 2013-10-30 +/*! jQuery UI - v1.10.3 - 2013-10-25 * http://jqueryui.com * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=%22Open%20Sans%22%2C%20sans-serif&fwDefault=normal&fsDefault=13px&cornerRadius=0&bgColorHeader=%23333&bgTextureHeader=flat&bgImgOpacityHeader=0&borderColorHeader=%23333&fcHeader=%23eee&iconColorHeader=%23eee&bgColorContent=%23fff&bgTextureContent=flat&bgImgOpacityContent=0&borderColorContent=%23eee&fcContent=%23333333&iconColorContent=%23cccccc&bgColorDefault=%23333&bgTextureDefault=flat&bgImgOpacityDefault=0&borderColorDefault=%23333&fcDefault=%23eee&iconColorDefault=%23eee&bgColorHover=%23222&bgTextureHover=flat&bgImgOpacityHover=0&borderColorHover=%23222&fcHover=%232EA2CC&iconColorHover=%232EA2CC&bgColorActive=%230074A2&bgTextureActive=flat&bgImgOpacityActive=65&borderColorActive=%230074A2&fcActive=%23fff&iconColorActive=%23fff&bgColorHighlight=%23222&bgTextureHighlight=flat&bgImgOpacityHighlight=55&borderColorHighlight=%23222&fcHighlight=%232EA2CC&iconColorHighlight=%232EA2CC&bgColorError=%23D54E21&bgTextureError=flat&bgImgOpacityError=0&borderColorError=%23D54E21&fcError=%23eee&iconColorError=%23eee&bgColorOverlay=%23333&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=2px&offsetTopShadow=-2px&offsetLeftShadow=-2px&cornerRadiusShadow=2px * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +/* + * Copyright 2013, Benjamin Intal http://gambit.ph @bfintal + * Released under the GPL v2 License + * + * Date: Oct 29, 2013 + */ + /* Layout helpers ----------------------------------*/ .ui-helper-hidden { @@ -344,7 +351,7 @@ button.ui-button::-moz-focus-inner { text-align: center; } .ui-datepicker .ui-datepicker-title select { - font-size: 1em; + font-size: 13px; margin: 1px 0; } .ui-datepicker select.ui-datepicker-month-year { @@ -786,35 +793,35 @@ body .ui-tooltip { /* Component containers ----------------------------------*/ .ui-widget { - font-family: Verdana,Arial,sans-serif; - font-size: 11px; /*1.1em*/; + font-family: "Open Sans", sans-serif; + font-size: 13px; } .ui-widget .ui-widget { - font-size: 11px; /*1em;*/ + font-size: 13px; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { - font-family: Verdana,Arial,sans-serif; - font-size: 11px; /*1em;*/ + font-family: "Open Sans", sans-serif; + font-size: 13px; } .ui-widget-content { - border: 1px solid #aaaaaa; - background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; - color: #222222; + border: 1px solid #eee; + background: #fff url(images/ui-bg_flat_0_fff_40x100.png) 50% 50% repeat-x; + color: #333333; } .ui-widget-content a { - color: #222222; + color: #333333; } .ui-widget-header { - border: 1px solid #aaaaaa; - background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; - color: #222222; + border: 1px solid #333; + background: #333 url(images/ui-bg_flat_0_333_40x100.png) 50% 50% repeat-x; + color: #eee; font-weight: bold; } .ui-widget-header a { - color: #222222; + color: #eee; } /* Interaction states @@ -822,15 +829,15 @@ body .ui-tooltip { .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { - border: 1px solid #d3d3d3; - background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; + border: 1px solid #333; + background: #333 url(images/ui-bg_flat_0_333_40x100.png) 50% 50% repeat-x; font-weight: normal; - color: #555555; + color: #eee; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { - color: #555555; + color: #eee; text-decoration: none; } .ui-state-hover, @@ -839,30 +846,30 @@ body .ui-tooltip { .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { - border: 1px solid #999999; - background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; + border: 1px solid #222; + background: #222 url(images/ui-bg_flat_0_222_40x100.png) 50% 50% repeat-x; font-weight: normal; - color: #212121; + color: #2EA2CC; } .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { - color: #212121; + color: #2EA2CC; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { - border: 1px solid #aaaaaa; - background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; + border: 1px solid #0074A2; + background: #0074A2 url(images/ui-bg_flat_65_0074A2_40x100.png) 50% 50% repeat-x; font-weight: normal; - color: #212121; + color: #fff; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { - color: #212121; + color: #fff; text-decoration: none; } @@ -871,31 +878,31 @@ body .ui-tooltip { .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { - border: 1px solid #fcefa1; - background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; - color: #363636; + border: 1px solid #222; + background: #222 url(images/ui-bg_flat_55_222_40x100.png) 50% 50% repeat-x; + color: #2EA2CC; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a { - color: #363636; + color: #2EA2CC; } .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { - border: 1px solid #cd0a0a; - background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; - color: #cd0a0a; + border: 1px solid #D54E21; + background: #D54E21 url(images/ui-bg_flat_0_D54E21_40x100.png) 50% 50% repeat-x; + color: #eee; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { - color: #cd0a0a; + color: #eee; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { - color: #cd0a0a; + color: #eee; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, @@ -930,27 +937,27 @@ body .ui-tooltip { } .ui-icon, .ui-widget-content .ui-icon { - background-image: url(images/ui-icons_222222_256x240.png); + background-image: url(images/ui-icons_cccccc_256x240.png); } .ui-widget-header .ui-icon { - background-image: url(images/ui-icons_222222_256x240.png); + background-image: url(images/ui-icons_eee_256x240.png); } .ui-state-default .ui-icon { - background-image: url(images/ui-icons_888888_256x240.png); + background-image: url(images/ui-icons_eee_256x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon { - background-image: url(images/ui-icons_454545_256x240.png); + background-image: url(images/ui-icons_2EA2CC_256x240.png); } .ui-state-active .ui-icon { - background-image: url(images/ui-icons_454545_256x240.png); + background-image: url(images/ui-icons_fff_256x240.png); } .ui-state-highlight .ui-icon { - background-image: url(images/ui-icons_2e83ff_256x240.png); + background-image: url(images/ui-icons_2EA2CC_256x240.png); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { - background-image: url(images/ui-icons_cd0a0a_256x240.png); + background-image: url(images/ui-icons_eee_256x240.png); } /* positioning */ @@ -1140,38 +1147,155 @@ body .ui-tooltip { .ui-corner-top, .ui-corner-left, .ui-corner-tl { - border-top-left-radius: 4px; + border-top-left-radius: 0; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { - border-top-right-radius: 4px; + border-top-right-radius: 0; } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { - border-bottom-left-radius: 4px; + border-bottom-left-radius: 0; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { - border-bottom-right-radius: 4px; + border-bottom-right-radius: 0; } /* Overlays */ .ui-widget-overlay { - background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + background: #333 url(images/ui-bg_flat_0_333_40x100.png) 50% 50% repeat-x; opacity: .3; filter: Alpha(Opacity=30); } .ui-widget-shadow { - margin: -8px 0 0 -8px; - padding: 8px; + margin: -2px 0 0 -2px; + padding: 2px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3; filter: Alpha(Opacity=30); - border-radius: 8px; + border-radius: 2px; +} + + +/* + * secondary buttons + */ +.ui-button.ui-widget.ui-state-default:not(.ui-button-icon-only) { + color: #555; + border-color: #CCC; + background: #F7F7F7; + -webkit-box-shadow: inset 0 1px 0 #FFF, 0 1px 0 rgba(0, 0, 0, 0.08); + box-shadow: inset 0 1px 0 #FFF, 0 1px 0 rgba(0, 0, 0, 0.08); + vertical-align: top; + border-width: 1px; + border-style: solid; + -webkit-border-radius: 3px; + -webkit-appearance: none; + border-radius: 3px; + white-space: nowrap; +} +.ui-button-text-only .ui-button-text { + padding: 0 10px; + line-height: 26px; +} +.ui-button.ui-widget.ui-state-hover:not(.ui-button-icon-only) { + background: #FAFAFA; + border-color: #999; + color: #222; +} + +/** + * primary buttons. must have the class "primary" + */ +.ui-button.primary.ui-widget.ui-state-default:not(.ui-button-icon-only) { + background: #2EA2CC; + border-color: #0074A2; + -webkit-box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.5), 0 1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.5), 0 1px 0 rgba(0, 0, 0, 0.15); + color: #FFF; + text-decoration: none; +} +.ui-button.primary.ui-widget.ui-state-hover:not(.ui-button-icon-only) { + background: #1E8CBE; + border-color: #0074A2; + -webkit-box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.6); + box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.6); + color: #FFF; +} + + +/** + * REMOVE OUTLINE ON FOCUSED CLICKABLES + */ +.ui-widget:hover, .ui-state-focus { + outline: none; +} + +/** + * Align buttons with text inputs + */ +input + .ui-button { + margin-top: 0; +} + + +/** + * Tooltips + */ +body .ui-tooltip { + border: 0; + padding: 10px 14px; + background: rgba(0, 0, 0, 0.7); + border-radius: 3px; + z-index: 10; + color: #FFF; + -webkit-box-shadow: none; + box-shadow: none; +} + + +/** + * DIALOG WIDGET + */ +.ui-widget-content { + padding: 0px; + border: 0px; +} +.ui-dialog .ui-dialog-buttonpane { + border-top: 1px solid #eee; +} + +/** + * DIALOG WIDGET TITLES + */ +.ui-dialog .ui-dialog-title { + font-size: 14px; + line-height: 1.4; + font-weight: 600; +} + + +/** + * COLOR PICKER FIX IN DIALOGS + */ +.iris-slider .ui-slider-vertical { + width: inherit; + height: auto; + border: inherit; + background: inherit; + background-image: none; +} +.iris-slider .ui-slider-vertical .ui-slider-handle { + margin-bottom: inherit; +} +.iris-square-value.ui-state-focus, .ui-widget-content .iris-square-value.ui-state-focus { + border: 0; + background: transparent; } diff --git a/css/jslider.css b/css/jslider.css index c982e13..04fe3d7 100644 --- a/css/jslider.css +++ b/css/jslider.css @@ -1,6 +1,6 @@ .jslider .jslider-bg i, - .jslider .jslider-pointer { background: url(../img/jslider.png) no-repeat 0 0; } + .jslider .jslider-pointer { background: url(../images/jslider.png) no-repeat 0 0; } .jslider { display: block; width: 100%; height: 1em; position: relative; top: 0.6em; font-family: Arial, sans-serif; } .jslider table { width: 100%; border-collapse: collapse; border: 0; } diff --git a/css/sam-admin-edit.css b/css/sam-admin-edit.css index d83132a..6222a23 100644 --- a/css/sam-admin-edit.css +++ b/css/sam-admin-edit.css @@ -12,7 +12,7 @@ vertical-align: middle; } -.postbox .inside input { +.postbox .inside input, .postbox .inside select { font-size: 11px; } @@ -47,20 +47,20 @@ .sub-content { padding: 3px 7px; - margin: 0px 5px 0px 15px; + margin: 0 5px 0 15px; line-height: 140%; - background-color: #EEEEEE; - border-radius: 5px; - -moz-border-radius: 5px 5px 5px 5px; + background-color: #F7F7F7; + border-radius: 3px; + -moz-border-radius: 3px 3px 3px 3px; } .sub-content-level-2 { padding: 3px 7px; - margin: 0px 7px 0px 15px; + margin: 0 7px 0 15px; line-height: 140%; - background-color: #E0E0E0; - border-radius: 5px; - -moz-border-radius: 5px 5px 5px 5px; + background-color: #F0F0F0; + border-radius: 3px; + -moz-border-radius: 3px 3px 3px 3px; } .ad-example { @@ -69,7 +69,7 @@ #source_tools { background: #F4F4F4; - padding: 2px 5px 5px; + padding: 2px 15px 15px; margin: 6px 5px 8px 7px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; @@ -79,6 +79,10 @@ border: 1px solid #DFDFDF; } +#source_tools p { + margin: 0.5em; +} + #files { display: block; padding: 5px; @@ -90,15 +94,55 @@ font-size: 11px !important; } +.sam2-warning { + display: block; + margin: 5px 0 15px; + padding: 1px 10px; + background-color: #FFFFFF; + border-left: 4px solid #E6DB55; + -webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1); + box-shadow:1px 1px 1px 1px rgba(0,0,0,.1); +} + +.sam2-info { + display: block; + margin: 5px 0 15px; + padding: 1px 10px; + background-color: #FFFFFF; + border-left: 4px solid #7AD03A; + -webkit-box-shadow:1px 1px 1px 1px rgba(0,0,0,.1); + box-shadow:1px 1px 1px 1px rgba(0,0,0,.1); +} + +.sam2-info p, .sam2-warning p { + margin: .5em 0; + padding: 2px; +} + .sam-warning { + display: block; margin: 6px 6px 8px; - padding: 0 5px; - background-color: #FFFFE0; + padding: 0 12px; + background-color: #F8F8D7; border-radius: 5px; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #E6DB55; } +.sam-info { + display: block; + margin: 6px 6px 8px; + padding: 0 12px; + background-color: #DAF5CB; + border-radius: 5px; + -moz-border-radius: 5px 5px 5px 5px; + border: 1px solid #5BA756; +} + +.sam-warning p, .sam-info p { + line-height: 1.0em; +} + .block-editor-line { padding: 0px; margin: 0px; @@ -144,45 +188,57 @@ input.button-primary, input.button-secondary, font-size: 11px !important; } -.slick-cell-checkboxsel { - background: #f0f0f0; - border-right-color: silver; - border-right-style: solid; - text-align: center; -} - #posts-grid, #x-posts-grid, #cats-grid, #x-cats-grid, #auth-grid, #x-auth-grid, #tags-grid, #x-tags-grid, #cust-grid, #x-cust-grid, -#users-grid { - border-bottom: 1px solid #DFDFDF; - border-left: 1px solid #DFDFDF; - border-right: 1px solid #DFDFDF; -} - -.cell-move-handle:hover { - background: #b6b9bd; -} - -.slick-row.selected .cell-move-handle { - background: #D5DC8D; +#users-grid, #ctt-grid, +#x-ctt-grid { + width: 100%; + height: 197px; } -.slick-cell.selected { - background: #F4F8FE !important; +.sam-section { + min-width: 763px; } -.slick-row .cell-actions { - text-align: left; +.sam-section textarea, .sam-section input, .sam-section select, .sam-section button { + font-size: 11px; } -.slick-row.complete { - background-color: #DFD; - color: #555; +.totals { + display: block; + margin: 15px; } -.slick-checkbox-column { - text-align: center; -} +.graph-container { + box-sizing: border-box; + /*width: 850px; + height: 450px;*/ + padding: 20px 15px 15px 15px; + margin: 15px auto 30px auto; + border: 1px solid #ddd; + border-radius: 3px; + background: #fff; + background-image: linear-gradient(#f6f6f6 0, #fff 50px); + background-image: -o-linear-gradient(#f6f6f6 0, #fff 50px); + background-image: -ms-linear-gradient(#f6f6f6 0, #fff 50px); + background-image: -moz-linear-gradient(#f6f6f6 0, #fff 50px); + background-image: -webkit-linear-gradient(#f6f6f6 0, #fff 50px); + box-shadow: 0 3px 10px rgba(0,0,0,0.15); + -o-box-shadow: 0 3px 10px rgba(0,0,0,0.1); + -ms-box-shadow: 0 3px 10px rgba(0,0,0,0.1); + -moz-box-shadow: 0 3px 10px rgba(0,0,0,0.1); + -webkit-box-shadow: 0 3px 10px rgba(0,0,0,0.1); +} + +/*.itab { + width: 100%; + height: 400px; + border: 1px solid silver; + border-top: 0px; + display: none; + padding: 10px; + overflow: auto; +}*/ diff --git a/css/slick.grid.css b/css/slick.grid.css deleted file mode 100644 index e5ef44c..0000000 --- a/css/slick.grid.css +++ /dev/null @@ -1,158 +0,0 @@ -/* -IMPORTANT: -In order to preserve the uniform grid appearance, all cell styles need to have padding, margin and border sizes. -No built-in (selected, editable, highlight, flashing, invalid, loading, :focus) or user-specified CSS -classes should alter those! -*/ - -.slick-header.ui-state-default, .slick-headerrow.ui-state-default { - width: 100%; - overflow: hidden; - border-left: 0px; -} - -.slick-header-columns, .slick-headerrow-columns { - width: 999999px; - position: relative; - white-space: nowrap; - cursor: default; - overflow: hidden; -} - -.slick-header-column.ui-state-default { - position: relative; - display: inline-block; - overflow: hidden; - text-overflow: ellipsis; - height: 16px; - line-height: 16px; - margin: 0; - padding: 4px; - border-right: 1px solid silver; - border-left: 0px; - border-top: 0px; - border-bottom: 0px; - float: left; -} - -.slick-headerrow-column.ui-state-default { - padding: 4px; -} - -.slick-header-column-sorted { - font-style: italic; -} - -.slick-sort-indicator { - display: inline-block; - width: 8px; - height: 5px; - margin-left: 4px; -} - -.slick-sort-indicator-desc { - background: url(images/sort-desc.gif); -} - -.slick-sort-indicator-asc { - background: url(images/sort-asc.gif); -} - -.slick-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - cursor: col-resize; - width: 4px; - right: 0px; - top: 0; - height: 100%; -} - -.slick-sortable-placeholder { - background: silver; -} - -.grid-canvas { - position: relative; - outline: 0; -} - -.slick-row.ui-widget-content, .slick-row.ui-state-active { - position: absolute; - border: 0px; - width: 100%; -} - -.slick-cell, .slick-headerrow-column { - position: absolute; - - border: 1px solid transparent; - border-right: 1px dotted silver; - border-bottom-color: silver; - - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - vertical-align: middle; - z-index: 1; - padding: 1px 2px 2px 1px; - margin: 0; - - white-space: nowrap; - - cursor: default; -} - -.slick-group { -} - -.slick-group-toggle { - display: inline-block; -} - -.slick-cell.highlighted { - background: lightskyblue; - background: rgba(0, 0, 255, 0.2); - -webkit-transition: all 0.5s; - -moz-transition: all 0.5s; - transition: all 0.5s; -} - -.slick-cell.flashing { - border: 1px solid red !important; -} - -.slick-cell.editable { - z-index: 11; - overflow: visible; - background: white; - border-color: black; - border-style: solid; -} - -.slick-cell:focus { - outline: none; -} - -.slick-reorder-proxy { - display: inline-block; - background: blue; - opacity: 0.15; - filter: alpha(opacity = 15); - cursor: move; -} - -.slick-reorder-guide { - display: inline-block; - height: 2px; - background: blue; - opacity: 0.7; - filter: alpha(opacity = 70); -} - -.slick-selection { - z-index: 10; - position: absolute; - border: 2px dashed black; -} \ No newline at end of file diff --git a/css/slick.pager.css b/css/slick.pager.css deleted file mode 100644 index e360ec6..0000000 --- a/css/slick.pager.css +++ /dev/null @@ -1,41 +0,0 @@ -.slick-pager { - width: 100%; - height: 26px; - border: 1px solid gray; - border-top: 0; - background: url('../images/header-columns-bg.gif') repeat-x center bottom; - vertical-align: middle; -} - -.slick-pager .slick-pager-status { - display: inline-block; - padding: 6px; -} - -.slick-pager .ui-icon-container { - display: inline-block; - margin: 2px; - border-color: gray; -} - -.slick-pager .slick-pager-nav { - display: inline-block; - float: left; - padding: 2px; -} - -.slick-pager .slick-pager-settings { - display: block; - float: right; - padding: 2px; -} - -.slick-pager .slick-pager-settings * { - vertical-align: middle; -} - -.slick-pager .slick-pager-settings a { - padding: 2px; - text-decoration: underline; - cursor: pointer; -} diff --git a/css/w2ui.min.css b/css/w2ui.min.css new file mode 100644 index 0000000..76743fc --- /dev/null +++ b/css/w2ui.min.css @@ -0,0 +1,2 @@ +/* w2ui 1.3 (c) http://w2ui.com, vitmalina@gmail.com */ +.w2ui-reset{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-reset *{color:default;font-family:Verdana,Arial;font-size:11px;line-height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0}.w2ui-reset table{max-width:none;background-color:transparent;border-collapse:separate;border-spacing:0}.w2ui-reset input,.w2ui-reset textarea{width:auto;/*height:auto;*/vertical-align:baseline;padding:4px}.w2ui-reset select{padding:1px;height:23px}.w2ui-centered{display:table;width:100%;height:100%}.w2ui-centered>div{display:table-cell;padding:10px 20px 20px 10px;text-align:center;vertical-align:middle}input[type=text],input[type=password],select,textarea{padding:4px;border:1px solid #dfdfdf;border-radius:3px;color:#000;background-color:#fff}input[type=text]:focus,input[type=password]:focus,select:focus,textarea:focus{outline-color:#72b2ff}input[type=text]:disabled,input[type=password]:disabled,select:disabled,textarea:disabled,input[type=text][readonly],input[type=password][readonly],select[readonly],textarea[readonly]{background-color:#f1f1f1;color:#888}select{padding:2px}.w2ui-overlay{position:absolute;margin-top:6px;margin-left:-17px;display:none;z-index:1300;color:inherit;background-color:#fbfbfb;border:3px solid #777;box-shadow:0 2px 10px #999;border-radius:4px;text-align:left}.w2ui-overlay table td{color:inherit}.w2ui-overlay:before{content:"";position:absolute;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);width:10px;height:10px;border:3px solid #777;border-color:inherit;background-color:inherit;border-left:1px solid transparent;border-bottom:1px solid transparent;border-bottom-left-radius:50px;margin:-9px 0 0 32px}.w2ui-overlay.w2ui-overlay-popup{z-index:1700}.w2ui-tag{position:absolute;z-index:1300;opacity:0;-webkit-transition:opacity .3s;-moz-transition:opacity .3s;-ms-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}.w2ui-tag .w2ui-tag-body{background-color:rgba(60,60,60,.82);display:inline-block;position:absolute;border-radius:4px;padding:4px 10px;margin-left:10px;margin-top:0;color:#fff!important;box-shadow:1px 1px 3px #000;line-height:normal;font-size:11px;font-family:Verdana,Arial}.w2ui-tag .w2ui-tag-body:before{content:"";position:absolute;width:0;height:0;border-top:5px solid transparent;border-right:5px solid rgba(60,60,60,.82);border-bottom:5px solid transparent;margin:2px 0 0 -15px}.w2ui-tag.w2ui-tag-popup{z-index:1700}.w2ui-marker{color:#444;background-color:#FFF8B0}.w2ui-spinner{display:inline-block;background-size:100%;background-repeat:no-repeat;background-image:url(data:image/gif;base64,R0lGODlhgACAAKIAAP///93d3bu7u5mZmQAA/wAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFBQAEACwCAAIAfAB8AAAD/0i63P4wygYqmDjrzbtflvWNZGliYXiubKuloivPLlzReD7al+7/Eh5wSFQIi8hHYBkwHUmD6CD5YTJLz49USuVYraRsZ7vtar7XnQ1Kjpoz6LRHvGlz35O4nEPP2O94EnpNc2sef1OBGIOFMId/inB6jSmPdpGScR19EoiYmZobnBCIiZ95k6KGGp6ni4wvqxilrqBfqo6skLW2YBmjDa28r6Eosp27w8Rov8ekycqoqUHODrTRvXsQwArC2NLF29UM19/LtxO5yJd4Au4CK7DUNxPebG4e7+8n8iv2WmQ66BtoYpo/dvfacBjIkITBE9DGlMvAsOIIZjIUAixliv9ixYZVtLUos5GjwI8gzc3iCGghypQqrbFsme8lwZgLZtIcYfNmTJ34WPTUZw5oRxdD9w0z6iOpO15MgTh1BTTJUKos39jE+o/KS64IFVmsFfYT0aU7capdy7at27dw48qdS7eu3bt480I02vUbX2F/JxYNDImw4GiGE/P9qbhxVpWOI/eFKtlNZbWXuzlmG1mv58+gQ4seTbq06dOoU6vGQZJy0FNlMcV+czhQ7SQmYd8eMhPs5BxVdfcGEtV3buDBXQ+fURxx8oM6MT9P+Fh6dOrH2zavc13u9JXVJb520Vp8dvC76wXMuN5Sepm/1WtkEZHDefnzR9Qvsd9+/wi8+en3X0ntYVcSdAE+UN4zs7ln24CaLagghIxBaGF8kFGoIYV+Ybghh841GIyI5ICIFoklJsigihmimJOLEbLYIYwxSgigiZ+8l2KB+Ml4oo/w8dijjcrouCORKwIpnJIjMnkkksalNeR4fuBIm5UEYImhIlsGCeWNNJphpJdSTlkml1jWeOY6TnaRpppUctcmFW9mGSaZceYopH9zkjnjUe59iR5pdapWaGqHopboaYua1qije67GJ6CuJAAAIfkEBQUABAAsCgACAFcAMAAAA/9Iutz+ML5Ag7w46z0r5WAoSp43nihXVmnrdusrv+s332dt4Tyo9yOBUJD6oQBIQGs4RBlHySSKyczVTtHoidocPUNZaZAr9F5FYbGI3PWdQWn1mi36buLKFJvojsHjLnshdhl4L4IqbxqGh4gahBJ4eY1kiX6LgDN7fBmQEJI4jhieD4yhdJ2KkZk8oiSqEaatqBekDLKztBG2CqBACq4wJRi4PZu1sA2+v8C6EJexrBAD1AOBzsLE0g/V1UvYR9sN3eR6lTLi4+TlY1wz6Qzr8u1t6FkY8vNzZTxaGfn6mAkEGFDgL4LrDDJDyE4hEIbdHB6ESE1iD4oVLfLAqPETIsOODwmCDJlv5MSGJklaS6khAQAh+QQFBQAEACwfAAIAVwAwAAAD/0i63P5LSAGrvTjrNuf+YKh1nWieIumhbFupkivPBEzR+GnnfLj3ooFwwPqdAshAazhEGUXJJIrJ1MGOUamJ2jQ9QVltkCv0XqFh5IncBX01afGYnDqD40u2z76JK/N0bnxweC5sRB9vF34zh4gjg4uMjXobihWTlJUZlw9+fzSHlpGYhTminKSepqebF50NmTyor6qxrLO0L7YLn0ALuhCwCrJAjrUqkrjGrsIkGMW/BMEPJcphLgDaABjUKNEh29vdgTLLIOLpF80s5xrp8ORVONgi8PcZ8zlRJvf40tL8/QPYQ+BAgjgMxkPIQ6E6hgkdjoNIQ+JEijMsasNY0RQix4gKP+YIKXKkwJIFF6JMudFEAgAh+QQFBQAEACw8AAIAQgBCAAAD/kg0PPowykmrna3dzXvNmSeOFqiRaGoyaTuujitv8Gx/661HtSv8gt2jlwIChYtc0XjcEUnMpu4pikpv1I71astytkGh9wJGJk3QrXlcKa+VWjeSPZHP4Rtw+I2OW81DeBZ2fCB+UYCBfWRqiQp0CnqOj4J1jZOQkpOUIYx/m4oxg5cuAaYBO4Qop6c6pKusrDevIrG2rkwptrupXB67vKAbwMHCFcTFxhLIt8oUzLHOE9Cy0hHUrdbX2KjaENzey9Dh08jkz8Tnx83q66bt8PHy8/T19vf4+fr6AP3+/wADAjQmsKDBf6AOKjS4aaHDgZMeSgTQcKLDhBYPEswoA1BBAgAh+QQFBQAEACxOAAoAMABXAAAD7Ei6vPOjyUkrhdDqfXHm4OZ9YSmNpKmiqVqykbuysgvX5o2HcLxzup8oKLQQix0UcqhcVo5ORi+aHFEn02sDeuWqBGCBkbYLh5/NmnldxajX7LbPBK+PH7K6narfO/t+SIBwfINmUYaHf4lghYyOhlqJWgqDlAuAlwyBmpVnnaChoqOkpaanqKmqKgGtrq+wsbA1srW2ry63urasu764Jr/CAb3Du7nGt7TJsqvOz9DR0tPU1TIA2ACl2dyi3N/aneDf4uPklObj6OngWuzt7u/d8fLY9PXr9eFX+vv8+PnYlUsXiqC3c6PmUUgAACH5BAUFAAQALE4AHwAwAFcAAAPpSLrc/m7IAau9bU7MO9GgJ0ZgOI5leoqpumKt+1axPJO1dtO5vuM9yi8TlAyBvSMxqES2mo8cFFKb8kzWqzDL7Xq/4LB4TC6bz1yBes1uu9uzt3zOXtHv8xN+Dx/x/wJ6gHt2g3Rxhm9oi4yNjo+QkZKTCgGWAWaXmmOanZhgnp2goaJdpKGmp55cqqusrZuvsJays6mzn1m4uRAAvgAvuBW/v8GwvcTFxqfIycA3zA/OytCl0tPPO7HD2GLYvt7dYd/ZX99j5+Pi6tPh6+bvXuTuzujxXens9fr7YPn+7egRI9PPHrgpCQAAIfkEBQUABAAsPAA8AEIAQgAAA/lIutz+UI1Jq7026h2x/xUncmD5jehjrlnqSmz8vrE8u7V5z/m5/8CgcEgsGo/IpHLJbDqf0Kh0ShBYBdTXdZsdbb/Yrgb8FUfIYLMDTVYz2G13FV6Wz+lX+x0fdvPzdn9WeoJGAYcBN39EiIiKeEONjTt0kZKHQGyWl4mZdREAoQAcnJhBXBqioqSlT6qqG6WmTK+rsa1NtaGsuEu6o7yXubojsrTEIsa+yMm9SL8osp3PzM2cStDRykfZ2tfUtS/bRd3ewtzV5pLo4eLjQuUp70Hx8t9E9eqO5Oku5/ztdkxi90qPg3x2EMpR6IahGocPCxp8AGtigwQAIfkEBQUABAAsHwBOAFcAMAAAA/9Iutz+MMo36pg4682J/V0ojs1nXmSqSqe5vrDXunEdzq2ta3i+/5DeCUh0CGnF5BGULC4tTeUTFQVONYAs4CfoCkZPjFar83rBx8l4XDObSUL1Ott2d1U4yZwcs5/xSBB7dBMBhgEYfncrTBGDW4WHhomKUY+QEZKSE4qLRY8YmoeUfkmXoaKInJ2fgxmpqqulQKCvqRqsP7WooriVO7u8mhu5NacasMTFMMHCm8qzzM2RvdDRK9PUwxzLKdnaz9y/Kt8SyR3dIuXmtyHpHMcd5+jvWK4i8/TXHff47SLjQvQLkU+fG29rUhQ06IkEG4X/Rryp4mwUxSgLL/7IqFETB8eONT6ChCFy5ItqJomES6kgAQAh+QQFBQAEACwKAE4AVwAwAAAD/0i63A4QuEmrvTi3yLX/4MeNUmieITmibEuppCu3sDrfYG3jPKbHveDktxIaF8TOcZmMLI9NyBPanFKJp4A2IBx4B5lkdqvtfb8+HYpMxp3Pl1qLvXW/vWkli16/3dFxTi58ZRcChwIYf3hWBIRchoiHiotWj5AVkpIXi4xLjxiaiJR/T5ehoomcnZ+EGamqq6VGoK+pGqxCtaiiuJVBu7yaHrk4pxqwxMUzwcKbyrPMzZG90NGDrh/JH8t72dq3IN1jfCHb3L/e5ebh4ukmxyDn6O8g08jt7tf26ybz+m/W9GNXzUQ9fm1Q/APoSWAhhfkMAmpEbRhFKwsvCsmosRIHx444PoKcIXKkjIImjTzjkQAAIfkEBQUABAAsAgA8AEIAQgAAA/VIBNz+8KlJq72Yxs1d/uDVjVxogmQqnaylvkArT7A63/V47/m2/8CgcEgsGo/IpHLJbDqf0Kh0Sj0FroGqDMvVmrjgrDcTBo8v5fCZki6vCW33Oq4+0832O/at3+f7fICBdzsChgJGeoWHhkV0P4yMRG1BkYeOeECWl5hXQ5uNIAOjA1KgiKKko1CnqBmqqk+nIbCkTq20taVNs7m1vKAnurtLvb6wTMbHsUq4wrrFwSzDzcrLtknW16tI2tvERt6pv0fi48jh5h/U6Zs77EXSN/BE8jP09ZFA+PmhP/xvJgAMSGBgQINvEK5ReIZhQ3QEMTBLAAAh+QQFBQAEACwCAB8AMABXAAAD50i6DA4syklre87qTbHn4OaNYSmNqKmiqVqyrcvBsazRpH3jmC7yD98OCBF2iEXjBKmsAJsWHDQKmw571l8my+16v+CweEwum8+hgHrNbrvbtrd8znbR73MVfg838f8BeoB7doN0cYZvaIuMjY6PkJGSk2gClgJml5pjmp2YYJ6dX6GeXaShWaeoVqqlU62ir7CXqbOWrLafsrNctjIDwAMWvC7BwRWtNsbGFKc+y8fNsTrQ0dK3QtXAYtrCYd3eYN3c49/a5NVj5eLn5u3s6e7x8NDo9fbL+Mzy9/T5+tvUzdN3Zp+GBAAh+QQJBQAEACwCAAIAfAB8AAAD/0i63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPdArcQK2TOL7/nl4PSMwIfcUk5YhUOh3M5nNKiOaoWCuWqt1Ou16l9RpOgsvEMdocXbOZ7nQ7DjzTaeq7zq6P5fszfIASAYUBIYKDDoaGIImKC4ySH3OQEJKYHZWWi5iZG0ecEZ6eHEOio6SfqCaqpaytrpOwJLKztCO2jLi1uoW8Ir6/wCHCxMG2x7muysukzb230M6H09bX2Nna29zd3t/g4cAC5OXm5+jn3Ons7eba7vHt2fL16tj2+QL0+vXw/e7WAUwnrqDBgwgTKlzIsKHDh2gGSBwAccHEixAvaqTYcFCjRoYeNyoM6REhyZIHT4o0qPIjy5YTTcKUmHImx5cwE85cmJPnSYckK66sSAAj0aNIkypdyrSp06dQo0qdSrWq1atYs2rdyrWr169gwxZJAAA7)}.w2ui-icon{background-repeat:no-repeat;height:16px;width:16px;overflow:hidden;margin:2px;display:inline-block}.w2ui-icon.icon-reload{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAI/SURBVDjLjZPbS9NhHMYH+zNidtCSQrqwQtY5y2QtT2QGrTZf13TkoYFlzsWa/tzcoR3cSc2xYUlGJfzAaIRltY0N12H5I+jaOxG8De+evhtdOP1hu3hv3sPzPO/z4SsBIPnfuvG8cbBlWiEVO5OUItA0VS8oxi9EdhXo+6yV3V3UGHRvVXHNfNv6zRfNuBZVoiFcB/3LdnQ8U+Gk+bhPVKB3qUOuf6/muaQR/qwDkZ9BRFdCmMr5EPz6BN7lMYylLGgNNaKqt3K0SKDnQ7us690t3rNsxeyvaUz+8OJpzo/QNzd8WTtcaQ7WlBmPvxhx1V2Pg7oDziIBimwwf3qAGWESkVwQ7owNujk1ztvk+cg4NnAUTT4FrrjqUKHdF9jxBfXr1rgjaSk4OlMcLrnOrJ7latxbL1V2lgvlbG9MtMTrMw1r1PImtfyn1n5q47TlBLf90n5NmalMtUdKZoyQMkLKlIGLjMyYhFpmlz3nGEVmFJlRZNaf7pIaEndM24XIjCOzjX9mm2S2JsqdkMYIqbB1j5C6yWzVk7YRFTsGFu7l+4nveExIA9aMCcOJh6DIoMigyOh+o4UryRWQOtIjaJtoziM1FD0mpE4uZcTc72gBaUyYKEI6khgqINXO3saR7kM8IZUVCRDS0Ucf+xFbCReQhr97MZ51wpWxYnhpCD3zOrT4lTisr+AJqVx0Fiiyr4/vhP4VyyMFIUWNqRrV96vWKXKckBoIqWzXYcoPDrUslDJoopuEVEpIB0sR+AuErIiZ6OqMKAAAAABJRU5ErkJggg==) no-repeat center}.w2ui-icon.icon-columns{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFwSURBVBgZpcG9apNhHMbh3/ORWiztpLSrQ86gmw6egkuXjE7i5CQ0OAZxUSj0DCxiB8/A07BDBXEoKEoGbaP45n/f9im+SwhCyXUl26wiPXjy9vG9+7svpjNv2ICEJUKBZWThCGTjCEJia627ODk5e/ru5d5h3b27ezBY38jb61zHxsUsDoDDOuucZ9NzrutX50yz//rUy4zffPT/PHz+3peotmjGR6f0JqMhven5b2JuYm7C4k+YOzubhIImY9PbvrXJoloqdZCpNzJra5Wbg0qjedDUUND7+v0ni0qGnAo1QSQTWTQK0VTLNJPRkGVKAiVwAnKiqNBIQVOloBkfndKbjIb0Us1UCRkyoMQVSTR53nX0dm5vsSgDKWdKyaScyIUr825OUx2i9+XbDxbllGgElJSwRGOJpkqimYyGLFNSoin8UwqNbJp69unz8aNX3Z4iUIiIQBLRdYyefUA2VuAwsrCERHPMpWSbVWRW9Bcyl/ydiZeC0gAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-search,.w2ui-icon.icon-search-down{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAgCAYAAAB+ZAqzAAACuElEQVRYw9WXSWhTQRjHR0UKLqhFaV0OUih68GAOWjyJKypCpAoV8aIiioIICiKiB1GMtE3MYmry2moXDz1UDx7sUXHBhQpSaRVxrYpWcMO9avx/8AJh/CbznHkxdeB3Cd/8589kvuUJkWcdjCTHghUgAi6DJ+AVeAqugSQIggniXywcNBJsB70g44EHYBcYXUhTM8EFj4ZkboKqQpiqAv2GprK8o7/f75t6pjn0M3gNPmri3vtycxAZA64qDvkJ2kENqAQTQQWoBg74qth3B4y3NbZDIX4fzNfsnQtuK/YfsjFVCh4pMq3Co0Y5uMVoUGkpy8aFT5xaeSzVEo45bXdBt4LeaLq1k0RXMYJfdDfFmAuAD4zWlty4UNyZEkm19MUb2zMw8Sfp1u+IWSrcIimLnTG8/SijdU6OO5poDESdtgHZVBzUHm/amhW7zoitMTS2mNHqASPk2FDCCcLMYK6p+obmulyxfiYLA4bGKFvfSnrUvkq5+Lpk8z4yRH8r3l/X4WiqJFfspSQ0CGYZGpsMnkt6L+h31Z76hpMdeOwPQ7H0NFnssST0C8wxNDaDKb6kP06150gsHahNNlVzYheZd7HJ0BiX4VRGhpmIhRixKyZilM2M1mnTArtIUbU3/qVO0H0GvmQ4CY4C3YopYYlHjXlggNG4R33Ypi2tVtwaPeTdNMkq9pVQZQdvFPs32zbx4aAjzxhDRfIAWAeWg7VgrzsY5ht/zoNJtubKwA3LITGjSKRyW3NTwaUCmKOSMd3WHH0ZJRQZZkOP1zFKZ3CB++4+aQ6kEeksWAb2a2L7qDv49S1Q6T72MOgEXa6RGFhP3wpS/B6NOWpRs0UxFg7eqTFHjX1hscxtAz/ymEuIYi0cvgF8Y0w5Ro3dZ3M1boJkTaXEUFlug6fsdsRQWzTj0cey+N/Xb2sj5lTh2M6OAAAAAElFTkSuQmCC) no-repeat center!important;background-size:14px 12px!important;opacity:.9}.w2ui-icon.icon-add{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJvSURBVDjLpZPrS5NhGIf9W7YvBYOkhlkoqCklWChv2WyKik7blnNris72bi6dus0DLZ0TDxW1odtopDs4D8MDZuLU0kXq61CijSIIasOvv94VTUfLiB74fXngup7nvrnvJABJ/5PfLnTTdcwOj4RsdYmo5glBWP6iOtzwvIKSWstI0Wgx80SBblpKtE9KQs/We7EaWoT/8wbWP61gMmCH0lMDvokT4j25TiQU/ITFkek9Ow6+7WH2gwsmahCPdwyw75uw9HEO2gUZSkfyI9zBPCJOoJ2SMmg46N61YO/rNoa39Xi41oFuXysMfh36/Fp0b7bAfWAH6RGi0HglWNCbzYgJaFjRv6zGuy+b9It96N3SQvNKiV9HvSaDfFEIxXItnPs23BzJQd6DDEVM0OKsoVwBG/1VMzpXVWhbkUM2K4oJBDYuGmbKIJ0qxsAbHfRLzbjcnUbFBIpx/qH3vQv9b3U03IQ/HfFkERTzfFj8w8jSpR7GBE123uFEYAzaDRIqX/2JAtJbDat/COkd7CNBva2cMvq0MGxp0PRSCPF8BXjWG3FgNHc9XPT71Ojy3sMFdfJRCeKxEsVtKwFHwALZfCUk3tIfNR8XiJwc1LmL4dg141JPKtj3WUdNFJqLGFVPC4OkR4BxajTWsChY64wmCnMxsWPCHcutKBxMVp5mxA1S+aMComToaqTRUQknLTH62kHOVEE+VQnjahscNCy0cMBWsSI0TCQcZc5ALkEYckL5A5noWSBhfm2AecMAjbcRWV0pUTh0HE64TNf0mczcnnQyu/MilaFJCae1nw2fbz1DnVOxyGTlKeZft/Ff8x1BRssfACjTwQAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-delete{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJdSURBVDjLpZP7S1NhGMf9W7YfogSJboSEUVCY8zJ31trcps6zTI9bLGJpjp1hmkGNxVz4Q6ildtXKXzJNbJRaRmrXoeWx8tJOTWptnrNryre5YCYuI3rh+8vL+/m8PA/PkwIg5X+y5mJWrxfOUBXm91QZM6UluUmthntHqplxUml2lciF6wrmdHriI0Wx3xw2hAediLwZRWRkCPzdDswaSvGqkGCfq8VEUsEyPF1O8Qu3O7A09RbRvjuIttsRbT6HHzebsDjcB4/JgFFlNv9MnkmsEszodIIY7Oaut2OJcSF68Qx8dgv8tmqEL1gQaaARtp5A+N4NzB0lMXxon/uxbI8gIYjB9HytGYuusfiPIQcN71kjgnW6VeFOkgh3XcHLvAwMSDPohOADdYQJdF1FtLMZPmslvhZJk2ahkgRvq4HHUoWHRDqTEDDl2mDkfheiDgt8pw340/EocuClCuFvboQzb0cwIZgki4KhzlaE6w0InipbVzBfqoK/qRH94i0rgokSFeO11iBkp8EdV8cfJo0yD75aE2ZNRvSJ0lZKcBXLaUYmQrCzDT6tDN5SyRqYlWeDLZAg0H4JQ+Jt6M3atNLE10VSwQsN4Z6r0CBwqzXesHmV+BeoyAUri8EyMfi2FowXS5dhd7doo2DVII0V5BAjigP89GEVAtda8b2ehodU4rNaAW+dGfzlFkyo89GTlcrHYCLpKD+V7yeeHNzLjkp24Uu1Ed6G8/F8qjqGRzlbl2H2dzjpMg1KdwsHxOlmJ7GTeZC/nesXbeZ6c9OYnuxUc3fmBuFft/Ff8xMd0s65SXIb/gAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-save{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKfSURBVDjLpZPrS1NhHMf9O3bOdmwDCWREIYKEUHsVJBI7mg3FvCxL09290jZj2EyLMnJexkgpLbPUanNOberU5taUMnHZUULMvelCtWF0sW/n7MVMEiN64AsPD8/n83uucQDi/id/DBT4Dolypw/qsz0pTMbj/WHpiDgsdSUyUmeiPt2+V7SrIM+bSss8ySGdR4abQQv6lrui6VxsRonrGCS9VEjSQ9E7CtiqdOZ4UuTqnBHO1X7YXl6Daa4yGq7vWO1D40wVDtj4kWQbn94myPGkCDPdSesczE2sCZShwl8CzcwZ6NiUs6n2nYX99T1cnKqA2EKui6+TwphA5k4yqMayopU5mANV3lNQTBdCMVUA9VQh3GuDMHiVcLCS3J4jSLhCGmKCjBEx0xlshjXYhApfMZRP5CyYD+UkG08+xt+4wLVQZA1tzxthm2tEfD3JxARH7QkbD1ZuozaggdZbxK5kAIsf5qGaKMTY2lAU/rH5HW3PLsEwUYy+YCcERmIjJpDcpzb6l7th9KtQ69fi09ePUej9l7cx2DJbD7UrG3r3afQHOyCo+V3QQzE35pvQvnAZukk5zL5qRL59jsKbPzdheXoBZc4saFhBS6AO7V4zqCpiawuptwQG+UAa7Ct3UT0hh9p9EnXT5Vh6t4C22QaUDh6HwnECOmcO7K+6kW49DKqS2DrEZCtfuI+9GrNHg4fMHVSO5kE7nAPVkAxKBxcOzsajpS4Yh4ohUPPWKTUh3PaQEptIOr6BiJjcZXCwktaAGfrRIpwblqOV3YKdhfXOIvBLeREWpnd8ynsaSJoyESFphwTtfjN6X1jRO2+FxWtCWksqBApeiFIR9K6fiTpPiigDoadqCEag5YUFKl6Yrciw0VOlhOivv/Ff8wtn0KzlebrUYwAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-edit{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFUSURBVDjLrZM/SAJxGIZdWwuDlnCplkAEm1zkaIiGFFpyMIwGK5KGoK2lphDKkMDg3LLUSIJsSKhIi+684CokOtTiMizCGuzEU5K3vOEgKvtBDe/2Pc8H3x8NAM1fQlx4H9M3pcOWp6TXWmM8A7j0629v1nraiAVC0IrrwATKIgs5xyG5QiE+Z4iQdoeU2oAsnqCSO1NSTu+D9VhqRLD8nIB8F0Q2MgmJDyipCzjvYJkIfpN2UBLG8MpP4dxvQ3ZzGuyyBQ2H+AnOOCBd9aL6soh81A5hyYSGWyCFvxUcerqI4S+CvYVOFPMHxLAq8I3qdHVY5LbBhJzEsCrwutpRFBlUHy6wO2tEYtWAzLELPN2P03kjfj3luqDycV2F8AgefWbEnVqEHa2IznSD6BdsVDNStB0lfh0FPoQjdx8RrAqGzC0YprSgxzsUMOY2bf37N/6Ud1Vc9yYcH50CAAAAAElFTkSuQmCC) no-repeat center!important}.w2ui-icon.icon-bullet-black{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABlSURBVCjPY/jPgB8yDC4FilKKDfJXZa6KNwhKYVfQkPW/63/b/+T/XA1YFchd7fqf/j/2f+N/5qtYFUhe7fif9D/sf91/BuwKhBoS/jcBpcP/M2C3gluKrYHhKhA2MEgN2pDEDgEb0f5zlvXgVgAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-folder{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLxZO7ihRBFIa/6u0ZW7GHBUV0UQQTZzd3QdhMQxOfwMRXEANBMNQX0MzAzFAwEzHwARbNFDdwEd31Mj3X7a6uOr9BtzNjYjKBJ6nicP7v3KqcJFaxhBVtZUAK8OHlld2st7Xl3DJPVONP+zEUV4HqL5UDYHr5xvuQAjgl/Qs7TzvOOVAjxjlC+ePSwe6DfbVegLVuT4r14eTr6zvA8xSAoBLzx6pvj4l+DZIezuVkG9fY2H7YRQIMZIBwycmzH1/s3F8AapfIPNF3kQk7+kw9PWBy+IZOdg5Ug3mkAATy/t0usovzGeCUWTjCz0B+Sj0ekfdvkZ3abBv+U4GaCtJ1iEm6ANQJ6fEzrG/engcKw/wXQvEKxSEKQxRGKE7Izt+DSiwBJMUSm71rguMYhQKrBygOIRStf4TiFFRBvbRGKiQLWP29yRSHKBTtfdBmHs0BUpgvtgF4yRFR+NUKi0XZcYjCeCG2smkzLAHkbRBmP0/Uk26O5YnUActBp1GsAI+S5nRJJJal5K1aAMrq0d6Tm9uI6zjyf75dAe6tx/SsWeD//o2/Ab6IH3/h25pOAAAAAElFTkSuQmCC) no-repeat center!important}.w2ui-icon.icon-page{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAINSURBVBgZBcG/r55zGAfg6/4+z3va01NHlYgzEfE7MdCIGISFgS4Gk8ViYyM2Mdlsko4GSf8Do0FLRCIkghhYJA3aVBtEz3nP89wf11VJvPDepdd390+8Nso5nESBQoq0pfvXm9fzWf19453LF85vASqJlz748vInb517dIw6EyYBIIG49u+xi9/c9MdvR//99MPPZ7+4cP4IZhhTPbwzT2d+vGoaVRRp1rRliVvHq+cfvM3TD82+7mun0o/ceO7NT+/4/KOXjwZU1ekk0840bAZzMQ2mooqh0A72d5x/6sB9D5zYnff3PoYBoWBgFKPKqDKqjCpjKr//dcu9p489dra88cydps30KswACfNEKanSaxhlntjJ8Mv12Paie+vZ+0+oeSwwQ0Iw1xAR1CiFNJkGO4wu3ZMY1AAzBI0qSgmCNJsJUEOtJSMaCTBDLyQ0CknAGOgyTyFFiLI2awMzdEcSQgSAAKVUmAeNkxvWJWCGtVlDmgYQ0GFtgg4pNtOwbBcwQy/Rife/2yrRRVI0qYCEBly8Z+P4qMEMy7JaVw72N568e+iwhrXoECQkfH91kY7jwwXMsBx1L93ZruqrK6uuiAIdSnTIKKPLPFcvay8ww/Hh+ufeznTXu49v95IMoQG3784gYXdTqvRmqn/Wpa/ADFX58MW3L71SVU9ETgEIQQQIOOzub+fhIvwPRDgeVjWDahIAAAAASUVORK5CYII=) no-repeat center!important}.w2ui-lock{opacity:.15;filter:alpha(opacity=15);background-color:#333;position:absolute;z-index:1400;display:none}.w2ui-lock-msg{position:absolute;z-index:1400;width:200px;height:80px;padding:30px 8px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:13px;font-family:Verdana,Arial;opacity:.8;filter:alpha(opacity=15);background-color:#555;color:#fff;text-align:center;border-radius:5px;border:2px solid #444;display:none}.w2ui-lock-msg .w2ui-spinner{display:inline-block;width:24px;height:24px;margin:-3px 8px -7px -10px}.w2ui-form{position:relative;color:#000;background-color:#f5f6f7;border:1px solid silver;border-radius:3px;padding:0;overflow:hidden!important}.w2ui-form>div{position:absolute;overflow:hidden}.w2ui-form .w2ui-form-header{position:absolute;left:0;right:0;border-bottom:1px solid #99bbe8!important;overflow:hidden;color:#444;font-size:13px;text-align:center;padding:8px;background-image:-webkit-linear-gradient(#dae6f3,#c2d5ed);background-image:-moz-linear-gradient(#dae6f3,#c2d5ed);background-image:-ms-linear-gradient(#dae6f3,#c2d5ed);background-image:-o-linear-gradient(#dae6f3,#c2d5ed);background-image:linear-gradient(#dae6f3,#c2d5ed);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffdae6f3', endColorstr='#ffc2d5ed', GradientType=0);border-top-left-radius:3px;border-top-right-radius:3px}.w2ui-form .w2ui-form-toolbar{position:absolute;left:0;right:0;margin:0;padding:6px 3px;border-bottom:1px solid #d5d8d8}.w2ui-form .w2ui-form-tabs{margin:0;padding:0}.w2ui-form .w2ui-tabs{position:absolute;left:0;right:0;border-top-left-radius:3px;border-top-right-radius:3px;padding-top:5px!important;background-color:#fafafa}.w2ui-form .w2ui-tabs .w2ui-tab.active{background-color:#f5f6f7}.w2ui-form .w2ui-page{position:absolute;left:0;right:0;overflow:auto;padding:10px;border-left:1px solid inherit;border-right:1px solid inherit;background-color:inherit;border-radius:3px}.w2ui-form .w2ui-buttons{position:absolute;left:0;right:0;bottom:0;text-align:center;border-top:1px solid #d5d8d8;border-bottom:0 solid #d5d8d8;background-color:#fafafa;padding:15px 0!important;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.w2ui-form .w2ui-buttons input[type=button],.w2ui-form .w2ui-buttons button{width:80px;margin-right:5px}.w2ui-form input[type=checkbox]{margin-top:4px;margin-bottom:4px}.w2ui-group{background-color:#ebecef;margin:5px 0 10px;padding:10px 5px;border-top:1px solid #cedcea;border-bottom:1px solid #cedcea}.w2ui-label{float:left;margin-top:6px;margin-bottom:3px;width:120px;padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right;min-height:20px}.w2ui-label.w2ui-span1{width:20px;float:left}.w2ui-label.w2ui-span2{width:40px;float:left}.w2ui-label.w2ui-span3{width:60px;float:left}.w2ui-label.w2ui-span4{width:80px;float:left}.w2ui-label.w2ui-span5{width:100px;float:left}.w2ui-label.w2ui-span6{width:120px;float:left}.w2ui-label.w2ui-span7{width:140px;float:left}.w2ui-label.w2ui-span8{width:160px;float:left}.w2ui-label.w2ui-span9{width:180px;float:left}.w2ui-label.w2ui-span10{width:200px;float:left}.w2ui-field{margin-bottom:3px;margin-left:128px;padding:3px;min-height:20px}.w2ui-field.w2ui-span1{margin-left:28px;float:none}.w2ui-field.w2ui-span2{margin-left:48px;float:none}.w2ui-field.w2ui-span3{margin-left:68px;float:none}.w2ui-field.w2ui-span4{margin-left:88px;float:none}.w2ui-field.w2ui-span5{margin-left:108px;float:none}.w2ui-field.w2ui-span6{margin-left:128px;float:none}.w2ui-field.w2ui-span7{margin-left:148px;float:none}.w2ui-field.w2ui-span8{margin-left:168px;float:none}.w2ui-field.w2ui-span9{margin-left:188px;float:none}.w2ui-field.w2ui-span10{margin-left:208px;float:none}.w2ui-required{position:relative}.w2ui-required::before{content:'*';position:absolute;margin-top:5px;margin-left:-9px;color:red}.w2ui-error{border:1px solid #ffa8a8!important;background-color:#fff4eb!important}.w2ui-field-helper{position:absolute;display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.w2ui-field-helper .w2ui-field-up{position:absolute;top:0;padding:2px 3px}.w2ui-field-helper .w2ui-field-down{position:absolute;bottom:0;padding:2px 3px}.w2ui-field-helper .arrow-up:hover{border-bottom-color:#81C6FF}.w2ui-field-helper .arrow-down:hover{border-top-color:#81C6FF}.w2ui-field-helper .arrow-up{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:5px solid #777;font-size:0;line-height:0}.w2ui-field-helper .arrow-down{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid #777;font-size:0;line-height:0}.w2ui-field-helper .arrow-left{width:0;height:0;border-bottom:4px solid transparent;border-top:4px solid transparent;border-right:5px solid #777;font-size:0;line-height:0}.w2ui-field-helper .arrow-right{width:0;height:0;border-bottom:4px solid transparent;border-top:4px solid transparent;border-left:5px solid #777;font-size:0;line-height:0}.w2ui-color{padding:5px;background-color:#fff;border-radius:3px}.w2ui-color>table{table-layout:fixed;width:160px}.w2ui-color>table td{width:20px;height:20px}.w2ui-color>table td div{cursor:pointer;display:inline-block;width:16px;height:17px;padding:1px 4px;border:1px solid transparent;color:#fff;text-shadow:0 0 2px #000}.w2ui-color>table td div:hover{outline:1px solid #666;border:1px solid #fff}.w2ui-calendar{position:absolute;z-index:1600;display:none;margin:3px 0 0 -2px;padding:0;border:1px solid #aaa;border-radius:4px;box-shadow:2px 2px 8px #bbb;line-height:108%}.w2ui-calendar .w2ui-calendar-title{padding:5px 1px 6px;border-top-left-radius:4px;border-top-right-radius:4px;background-image:-webkit-linear-gradient(#e6e6e6,#c2c4c4);background-image:-moz-linear-gradient(#e6e6e6,#c2c4c4);background-image:-ms-linear-gradient(#e6e6e6,#c2c4c4);background-image:-o-linear-gradient(#e6e6e6,#c2c4c4);background-image:linear-gradient(#e6e6e6,#c2c4c4);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc2c4c4', GradientType=0);border-bottom:1px solid #999;color:#000;text-align:center;font-weight:700}.w2ui-calendar .w2ui-calendar-previous,.w2ui-calendar .w2ui-calendar-next{width:24px;height:20px;color:#666;border:1px solid transparent;border-radius:3px;padding:2px 3px 1px 2px;margin:-4px 0 0 0;cursor:default}.w2ui-calendar .w2ui-calendar-previous:hover,.w2ui-calendar .w2ui-calendar-next:hover{border:1px solid silver;background-color:#efefef}.w2ui-calendar .w2ui-calendar-previous{float:left}.w2ui-calendar .w2ui-calendar-next{float:right}.w2ui-calendar table.w2ui-calendar-days{border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:0}.w2ui-calendar table.w2ui-calendar-days td{border:1px solid #e8e8e8;color:#000;background-color:#f4f4fe;padding:5px;cursor:default;text-align:right}.w2ui-calendar table.w2ui-calendar-days td.w2ui-saturday,.w2ui-calendar table.w2ui-calendar-days td.w2ui-sunday{border:1px solid #e8e8e8;color:#c8493b;background-color:#f4f4fe}.w2ui-calendar table.w2ui-calendar-days td.w2ui-saturday:hover,.w2ui-calendar table.w2ui-calendar-days td.w2ui-sunday:hover{border:1px solid #aaa;color:#000;background-color:#ff0}.w2ui-calendar table.w2ui-calendar-days td.w2ui-today{border:1px solid #8cb067;color:#000;background-color:#e2f7cd}.w2ui-calendar table.w2ui-calendar-days td:hover{border:1px solid #aaa;color:#000;background-color:#ff0}.w2ui-calendar table.w2ui-calendar-days td.w2ui-blocked-date{text-decoration:line-through;border:1px solid #e8e8e8;color:gray;background-color:#e8e8e8}.w2ui-calendar table.w2ui-calendar-days td.w2ui-day-empty{border:1px solid #e8e8e8;background-color:#f4f4fe}.w2ui-calendar table.w2ui-calendar-days tr.w2ui-day-title td{border:1px solid #e8e8e8;color:gray;background-color:#e8e8e8;text-align:center;padding:5px}.w2ui-list{color:inherit;position:absolute;padding:0;margin:0;min-height:25px;overflow:auto;border:1px solid silver;border-radius:3px;font-size:6px;line-height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;background-color:#fff}.w2ui-list input[type=text]{-webkit-box-shadow:none;-moz-box-shadow:none;-ms-box-shadow:none;-o-box-shadow:none;box-shadow:none}.w2ui-list ul{list-style-type:none;background-color:#000;margin:0;padding:0}.w2ui-list ul li{float:left;margin:2px 1px 0 2px;border-radius:3px;width:auto;padding:1px 5px;border:1px solid #88b0d6;background-color:#eff3f5;white-space:nowrap;cursor:default;font-family:verdana;font-size:11px;line-height:normal}.w2ui-list ul li:hover{background-color:#d0dbe1}.w2ui-list ul li:last-child{border-radius:0;border:1px solid transparent;background-color:transparent}.w2ui-list ul li:last-child input{padding:0;margin:0;outline:0;border:0}.w2ui-list ul li div{float:right;width:15px;height:16px;margin:-1px -3px 0 4px;border-radius:15px}.w2ui-list ul li div:hover{background-color:#D77F7F;color:#fff}.w2ui-list ul li div:before{position:relative;top:1px;left:4px;color:inherit;opacity:.6;text-shadow:inherit;content:'x'}.w2ui-list ul li input{width:10px;background-color:transparent}.w2ui-items{position:absolute;margin-top:6px;display:none;z-index:1600;background-color:#fff;border:3px solid #777;box-shadow:0 3px 8px #999;border-radius:4px;text-align:left}.w2ui-items:before{content:"";position:absolute;z-index:1601;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid transparent;border-bottom-color:inherit;margin:-8px 0 0 5px}.w2ui-items .w2ui-items-list{border-radius:4px;padding:3px}.w2ui-items .w2ui-empty-list{padding:5px 2px;text-align:center;color:gray}.w2ui-items ul li{display:block;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s;padding:5px;cursor:pointer}.w2ui-items ul li.w2ui-item-even{color:inherit;background-color:#fff}.w2ui-items ul li.w2ui-item-odd{color:inherit;background-color:#f3f6fa}.w2ui-items ul li.w2ui-item-group{color:#444;font-weight:700;background-color:#ECEDF0;border-bottom:1px solid #D3D2D4}.w2ui-items ul li.selected{color:inherit;background-color:#b6d5ff}.w2ui-upload{position:absolute;background-color:#fff;border:1px solid silver!important;border-radius:3px;text-align:center;overflow:auto}.w2ui-upload>span:first-child{pointer-events:none;margin:0;padding:0;font-size:14px!important;color:#999}.w2ui-upload.dragover{background-color:#D9FFD5;border:1px solid #93E07D}.w2ui-upload .file-list{margin:0;padding:0;margin-bottom:6px}.w2ui-upload .file-list li{padding:2px 5px;font-family:verdana;font-size:11px;line-height:normal;float:left;display:inline-block;border:1px solid #88b0d6;background-color:#eff3f5;border-radius:3px;margin:2px 0 2px 2px;text-align:left;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;width:auto;max-width:400px}.w2ui-upload .file-list li:hover{background-color:#d0dbe1}.w2ui-upload .file-list li>span.file-size{pointer-events:none;color:#777}.w2ui-upload .file-list li>span.file-name{pointer-events:none}.w2ui-upload .file-list li>div.file-delete{float:right;z-index:1;width:16px;height:16px;margin:-1px -4px 0 4px;border-radius:15px}.w2ui-upload .file-list li>div.file-delete:hover{background-color:#D77F7F;color:#fff}.w2ui-upload .file-list li>div.file-delete:before{position:relative;top:1px;left:5px;opacity:.6;color:inherit;text-shadow:inherit;content:'x'}.w2ui-layout{overflow:hidden!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-layout *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-layout>div{position:absolute;overflow:hidden;border:0;margin:0;padding:0;outline:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-layout>div .w2ui-panel{display:none;position:absolute;z-index:120}.w2ui-layout>div .w2ui-panel .w2ui-panel-tabs{position:absolute;left:0;top:0;right:0;z-index:2;display:none;overflow:hidden;background-color:#fafafa;padding:4px 0}.w2ui-layout>div .w2ui-panel .w2ui-panel-tabs>.w2ui-tab.active{background-color:#f5f6f7}.w2ui-layout>div .w2ui-panel .w2ui-panel-toolbar{position:absolute;left:0;top:0;right:0;z-index:2;display:none;overflow:hidden;background-color:#fafafa;border-bottom:1px solid silver;padding:4px}.w2ui-layout>div .w2ui-panel .w2ui-panel-content{position:absolute;left:0;top:0;right:0;bottom:0;z-index:1;color:inherit;background-color:#f5f6f7}.w2ui-layout>div .w2ui-resizer{display:none;position:absolute;z-index:121;background-color:transparent}.w2ui-layout>div .w2ui-resizer:hover,.w2ui-layout>div .w2ui-resizer.active{background-color:#d7e4f2}.w2ui-grid{position:relative;border:1px solid silver;border-radius:2px;overflow:hidden!important}.w2ui-grid>div{position:absolute;overflow:hidden}.w2ui-grid .w2ui-grid-header{position:absolute;border-bottom:1px solid #99bbe8!important;height:28px;overflow:hidden;color:#444;font-size:13px;text-align:center;padding:7px;background-image:-webkit-linear-gradient(#dae6f3,#c2d5ed);background-image:-moz-linear-gradient(#dae6f3,#c2d5ed);background-image:-ms-linear-gradient(#dae6f3,#c2d5ed);background-image:-o-linear-gradient(#dae6f3,#c2d5ed);background-image:linear-gradient(#dae6f3,#c2d5ed);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffdae6f3', endColorstr='#ffc2d5ed', GradientType=0);border-top-left-radius:2px;border-top-right-radius:2px}.w2ui-grid .w2ui-grid-toolbar{position:absolute;border-bottom:1px solid silver;background-color:#dee0e4;height:38px;padding:7px 3px 4px;margin:0;box-shadow:0 1px 2px #ddd}.w2ui-grid .w2ui-toolbar-search{width:160px}.w2ui-grid .w2ui-toolbar-search .w2ui-search-all{outline:0;width:160px;border-radius:10px;line-height:100%;height:22px;border:1px solid #999;color:#000;background-color:#fff;padding:3px 18px 3px 23px;margin:0}.w2ui-grid .w2ui-toolbar-search .w2ui-search-down{position:absolute;margin-top:-7px;margin-left:6px}.w2ui-grid .w2ui-toolbar-search .w2ui-search-clear{position:absolute;width:16px;height:16px;margin-top:-8px;margin-left:-20px;border-radius:15px}.w2ui-grid .w2ui-toolbar-search .w2ui-search-clear:hover{background-color:#D77F7F;color:#fff}.w2ui-grid .w2ui-toolbar-search .w2ui-search-clear:before{position:relative;top:1px;left:5px;opacity:.6;color:inherit;text-shadow:inherit;content:'x'}.w2ui-grid .w2ui-grid-body{position:absolute;overflow:hidden;padding:0;background-color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.w2ui-grid .w2ui-grid-body input,.w2ui-grid .w2ui-grid-body select,.w2ui-grid .w2ui-grid-body textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;-o-user-select:text;user-select:text}.w2ui-grid .w2ui-grid-body .w2ui-grid-columns{overflow:hidden;position:absolute;left:0;top:0;right:0;box-shadow:0 1px 4px #ddd;height:auto}.w2ui-grid .w2ui-grid-body .w2ui-grid-columns table{height:auto}.w2ui-grid .w2ui-grid-body .w2ui-grid-columns .w2ui-resizer{position:absolute;display:block;background-image:none;background-color:rgba(0,0,0,0);padding:0;margin:0;width:6px;height:12px;cursor:col-resize}.w2ui-grid .w2ui-grid-body .w2ui-grid-records{position:absolute;left:0;right:0;top:0;bottom:0}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd{color:inherit;background-color:#fff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd:hover{color:inherit;background-color:#e6f0ff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd.w2ui-empty-record:hover{background-color:#fff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even{color:inherit;background-color:#f3f6fa}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even:hover{color:inherit;background-color:#e6f0ff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even.w2ui-empty-record:hover{background-color:#f3f6fa}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-selected,.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr td.w2ui-selected{color:#000!important;background-color:#b6d5ff!important}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded{background-color:#CCDCF0!important}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded1{height:0;border-bottom:1px solid #b2bac0;background-color:#CCDCF0}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded1>div{height:100%;margin:0;padding:0}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded2{height:0;border-radius:0;border-bottom:1px solid #b2bac0}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded2>div{height:0;border:0;transition:height .3s,opacity .3s}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-load-more{border-top:1px solid #d6d5d7;cursor:pointer}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-load-more>div{text-align:center;color:#777;background-color:rgba(233,237,243,.5);padding:10px 0 15px;border-top:1px solid #fff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-load-more>div:hover{color:inherit;background-color:#e6f0ff}.w2ui-grid .w2ui-grid-body table{border-spacing:0;border-collapse:collapse;table-layout:fixed;width:1px}.w2ui-grid .w2ui-grid-body table .w2ui-head{margin:0;padding:0;border-right:1px solid #c5c5c5;border-bottom:1px solid #c5c5c5;color:#000;background-image:-webkit-linear-gradient(#f9f9f9,#e4e4e4);background-image:-moz-linear-gradient(#f9f9f9,#e4e4e4);background-image:-ms-linear-gradient(#f9f9f9,#e4e4e4);background-image:-o-linear-gradient(#f9f9f9,#e4e4e4);background-image:linear-gradient(#f9f9f9,#e4e4e4);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#ffe4e4e4', GradientType=0)}.w2ui-grid .w2ui-grid-body table .w2ui-head>div{padding:7px 3px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.w2ui-grid .w2ui-grid-body table td{border-right:1px solid #d6d5d7;border-bottom:0 solid #d6d5d7;cursor:default;overflow:hidden}.w2ui-grid .w2ui-grid-body table td.w2ui-grid-data{margin:0;padding:0}.w2ui-grid .w2ui-grid-body table td.w2ui-grid-data>div{padding:3px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.w2ui-grid .w2ui-grid-body table td.w2ui-grid-data>div.flexible-record{height:auto;overflow:visible;white-space:normal}.w2ui-grid .w2ui-grid-body table td:last-child{border-right:0}.w2ui-grid .w2ui-grid-body table .w2ui-col-number{width:34px;color:#777;background-color:rgba(233,237,243,.5)}.w2ui-grid .w2ui-grid-body table .w2ui-col-number div{padding:0 7px 0 3px;text-align:right}.w2ui-grid .w2ui-grid-body table .w2ui-col-select{width:26px}.w2ui-grid .w2ui-grid-body table .w2ui-col-select div{padding:0;text-align:center;overflow:hidden}.w2ui-grid .w2ui-grid-body table .w2ui-col-select div input[type=checkbox]{margin-top:2px;position:relative}.w2ui-grid .w2ui-grid-body table .w2ui-col-expand{width:26px}.w2ui-grid .w2ui-grid-body table .w2ui-col-expand div{padding:0;text-align:center;font-weight:700}.w2ui-grid .w2ui-grid-body div.w2ui-sort-up{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAICAYAAADN5B7xAAAACXBIWXMAAAOUAAADlAFKEakrAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHRJREFUeNpi/P//PwMpgImBRMACY6QX109jZGDIxKboPyNj18yehnIUG97zMRUwMP6vx1DMxNA4q7exHMZnhPmBkZGRITQ0lFlITqOa4T9jI1xxT1MDAwMDA9yv////Z0D3eFpRXVNaSV0Dik1QdYw0DyXAAMW0LzgWrYMxAAAAAElFTkSuQmCC) no-repeat center right!important;height:auto!important;width:100%;overflow:hidden}.w2ui-grid .w2ui-grid-body div.w2ui-sort-down{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAICAYAAADN5B7xAAAACXBIWXMAAAOUAAADlAFKEakrAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHlJREFUeNpi/P//PwMpgImBRMACYzAyMsIF04rqmhiYGP7N6mlqgInBXMIIZzAyMoSGhjILyWlUM/xnbGRgYGD4z8TQCNOEoSGssZFN6PPfCphiuMlQTTB1cCcJfvo3gYGBMRPdzYz/GOrTius5GRgYylFsoFkoAQYAPsMwVrH0kTAAAAAASUVORK5CYII=) no-repeat center right!important;height:auto!important;width:100%;overflow:hidden}.w2ui-grid .w2ui-grid-body .w2ui-col-group{text-align:center}.w2ui-grid .w2ui-changed{background:url(data:image/gif;base64,R0lGODlhCgAKAJEAALAABf///wAAAAAAACH5BAEAAAIALAAAAAAKAAoAAAIPlI8Hy8mbxIsSUnup3rQAADs=) no-repeat top right}.w2ui-grid .w2ui-editable{overflow:hidden;height:100%!important;margin:0!important;padding:0!important}.w2ui-grid .w2ui-editable input{border:0;border-radius:0;margin:0;padding:4px 3px;width:100%;height:100%}.w2ui-grid .w2ui-grid-summary{position:absolute;box-shadow:0 -1px 4px #aaa}.w2ui-grid .w2ui-grid-summary table{color:inherit}.w2ui-grid .w2ui-grid-summary table .w2ui-odd{background-color:#eef5eb}.w2ui-grid .w2ui-grid-summary table .w2ui-even{background-color:#f8fff5}.w2ui-grid .w2ui-grid-footer{position:absolute;margin:0;padding:0;text-align:center;height:24px;overflow:hidden;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;-o-user-select:text;user-select:text;box-shadow:0 -1px 4px #eee;color:#444;background-color:#f8f8f8;border-top:1px solid #ddd;border-bottom-left-radius:2px;border-bottom-right-radius:2px}.w2ui-grid .w2ui-grid-footer .w2ui-footer-left{float:left;padding-top:5px;padding-left:5px}.w2ui-grid .w2ui-grid-footer .w2ui-footer-right{float:right;padding-top:5px;padding-right:5px}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center{padding:2px;text-align:center}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center .w2ui-footer-nav{width:110px;margin:0 auto;padding:0;text-align:center}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center .w2ui-footer-nav input[type=text]{padding:1px 2px 2px;border-radius:3px;width:40px;text-align:center}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center .w2ui-footer-nav a.w2ui-footer-btn{display:inline-block;border-radius:3px;cursor:pointer;font-size:11px;line-height:16px;padding:1px 5px;width:30px;height:18px;margin-top:-1px;color:#000;background-color:transparent}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center .w2ui-footer-nav a.w2ui-footer-btn:hover{color:#000;background-color:#aec8ff}.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd,.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even,.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd:hover,.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even:hover{background-color:inherit}.w2ui-ss .w2ui-grid-records table td{border-right-width:1px;border-bottom:1px solid #efefef}.w2ui-ss .w2ui-grid-records table tr:first-child td{border-bottom:0}.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-selected,.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr td.w2ui-selected{background-color:#EEF4FE!important}.w2ui-ss .w2ui-changed{background:inherit}.w2ui-ss .w2ui-grid-body .w2ui-selection{position:absolute;border:2px solid #6299DA;pointer-events:none}.w2ui-ss .w2ui-grid-body .w2ui-selection .w2ui-selection-resizer{cursor:crosshair;position:absolute;bottom:0;right:0;width:6px;height:6px;margin-right:-3px;margin-bottom:-3px;background-color:#457FC2;border:.5px solid #fff;outline:1px solid #fff;pointer-events:auto}.w2ui-overlay .w2ui-select-field{padding:8px 5px;cursor:default}.w2ui-overlay .w2ui-select-field table{font-size:11px;font-family:Verdana,Arial;border-spacing:0;border-collapse:border-collapse}.w2ui-overlay .w2ui-select-field table tr:hover{background-color:#b6d5ff}.w2ui-overlay .w2ui-select-field table td:nth-child(1){padding:3px 3px 3px 6px}.w2ui-overlay .w2ui-select-field table td:nth-child(1) input{margin:3px 2px 2px}.w2ui-overlay .w2ui-select-field table td:nth-child(2){padding:3px 15px 3px 3px}.w2ui-overlay .w2ui-col-on-off{padding:4px 0}.w2ui-overlay .w2ui-col-on-off table{border-spacing:0;border-collapse:border-collapse}.w2ui-overlay .w2ui-col-on-off table tr:hover{background-color:#b6d5ff}.w2ui-overlay .w2ui-col-on-off table td input[type=checkbox]{margin:3px 2px 2px}.w2ui-overlay .w2ui-col-on-off table td label{display:block;padding:3px 0;padding-right:10px}.w2ui-overlay .w2ui-col-on-off table td:first-child{padding:4px 0 4px 6px}.w2ui-overlay .w2ui-col-on-off table td:last-child{padding:4px 6px 4px 0}.w2ui-overlay .w2ui-grid-searches{text-align:left;padding:0;border-top:0;background-color:#f3f1d9}.w2ui-overlay .w2ui-grid-searches table{padding:4px;padding-top:8px;border-collapse:border-collapse}.w2ui-overlay .w2ui-grid-searches table td{padding:4px}.w2ui-overlay .w2ui-grid-searches table td.close-btn{width:20px;padding-right:20px}.w2ui-overlay .w2ui-grid-searches table td.close-btn input{width:25px!important}.w2ui-overlay .w2ui-grid-searches table td.caption{text-align:right;padding-right:5px;border-right:1px solid silver}.w2ui-overlay .w2ui-grid-searches table td.operator{text-align:left;padding:0 10px;padding-right:5px;border-right:1px solid silver}.w2ui-overlay .w2ui-grid-searches table td.value{padding-right:5px;padding-left:5px;background-color:#f7f6f0}.w2ui-overlay .w2ui-grid-searches table td.value input[type=text]{border-radius:3px;padding:3px;margin-right:3px;height:23px}.w2ui-overlay .w2ui-grid-searches table td.value select{padding:3px;margin-right:3px;height:23px}.w2ui-overlay .w2ui-grid-searches table td.actions{border-right:0;padding:20px 0 10px;text-align:center}.w2ui-overlay .w2ui-grid-searches table td input[type=button]{width:70px;margin:0 2px}.w2ui-popup{position:fixed;z-index:1600;overflow:hidden;font-family:Verdana,Arial;border-radius:6px;padding:0;margin:0;border:1px solid #777;background-color:#eee;box-shadow:0 0 25px #555}.w2ui-popup,.w2ui-popup *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-popup .w2ui-msg-title{padding:6px;border-radius:6px 6px 0 0;background-image:-webkit-linear-gradient(#ececec,#dfdfdf);background-image:-moz-linear-gradient(#ececec,#dfdfdf);background-image:-ms-linear-gradient(#ececec,#dfdfdf);background-image:-o-linear-gradient(#ececec,#dfdfdf);background-image:linear-gradient(#ececec,#dfdfdf);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffececec', endColorstr='#ffdfdfdf', GradientType=0);border-bottom:2px solid #bfbfbf;position:absolute;overflow:hidden;height:32px;left:0;right:0;top:0;text-overflow:ellipsis;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:move;font-size:15px;color:#555;z-index:300}.w2ui-popup .w2ui-msg-button{float:right;width:18px;height:18px;cursor:pointer;overflow:hidden;padding:0;margin:0 3px 0 0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAQCAYAAABQrvyxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAj1JREFUeNrslr9rFFEQxz/zZi/qxSgW2lsqkiYoBku5Ro1o4UFKEYkgSaxSCLYqdv5IEVPYCMJJwERWrK0CKhoQ8hdobQTjXW7njcXlYnLunQQu0YDTLOy+Nzvfme98Z8Td2ckW2OGWdMvRvYfT/RGfBPoBBVpLK0AEPgVkdGL06vt/CoB5nBaRE8AXYKXNsQIwaB4fAwOtH+88mn4m7ifN4vUYebWBKkFKqjIV3N9NjI2Uuw5ARI45fBanH+F77iFnN8JHETmS68P9NHBQNTwHL8foaSN4SqoyA/SZyL4tqQAQBVYCLOFYlNxmq0WorVLpN9Oe5LKt1CsgRVWpAOfB66phBuhTkepSdfnKVjaxNJMSWn/iawmTtpeDp6pWBpaBoqrMqoYU6AOqIbFhxGa3R4V8nfNNKLUESzXJhoCvQC+wF/gW1C5IiC+2XUbD5jA3rd4C26NR3945IA2iRzqRJgdElJJlSQocAKrAD2A/6Ev3cLajjN59MDWHyKl2voOI1zKbv3Xj2lCHJFoz+LXuBoIAjnUklEvJrDDT5LwmdhG8blkyBxRjXSu4loE0X4VEznXKV3SnoOFMB7YUolBcbcKNdxuPXUBPu8pbLXsK0ghebVjEXgNoYmXLtGLuxd6ePU+AQ20AaIrb4DpFycmSv81/7YsiMgAstB1kQgE47O4LuQmCNwGOB7VxCb/URsRSTbhkmU4ifGiZHd1Z5m7fnxoIQSaBo39YJRZj9LGb4yPzXWm1/9voX7afAwAC5tacDTA2XgAAAABJRU5ErkJggg==) no-repeat center left;background-position:0 0;color:transparent!important;border-radius:3px;border:1px solid transparent}.w2ui-popup .w2ui-msg-close{margin-top:0;background-position:-32px 0}.w2ui-popup .w2ui-msg-close:hover{background-color:#ccc;border:1px solid #aaa}.w2ui-popup .w2ui-msg-max{background-position:-16px 0}.w2ui-popup .w2ui-msg-max:hover{background-color:#ccc;border:1px solid #aaa}.w2ui-popup .w2ui-box1,.w2ui-popup .w2ui-box2{position:absolute;left:0;right:0;top:32px;bottom:35px;z-index:100}.w2ui-popup .w2ui-msg-body{font-size:13px;line-height:130%;padding:0 7px 7px;color:#000;background-color:#eee;position:absolute;overflow:auto;width:100%;height:100%}.w2ui-popup .w2ui-popup-message{position:absolute;z-index:250;background-color:#f9f9f9;border:1px solid #999;box-shadow:0 0 15px #aaa;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;border-top:0;border-radius:0 0 6px 6px;overflow:auto}.w2ui-popup .w2ui-msg-buttons{padding:8px;border-radius:0 0 6px 6px;border-top:1px solid #d5d8d8;background-color:#f1f1f1;text-align:center;position:absolute;overflow:hidden;height:42px;left:0;right:0;bottom:0;z-index:200}.w2ui-popup .w2ui-popup-button{width:70px;margin:0 5px}.w2ui-popup .w2ui-msg-no-title{border-top-left-radius:6px;border-top-right-radius:6px;top:0!important}.w2ui-popup .w2ui-msg-no-buttons{border-bottom-left-radius:6px;border-bottom-right-radius:6px;bottom:0!important}.w2ui-sidebar{cursor:default;overflow:hidden!important;background-color:#edf1f6!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-sidebar *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-sidebar>div{position:relative;overflow:hidden}.w2ui-sidebar .w2ui-sidebar-top{position:absolute;z-index:2;top:0;left:0;right:0}.w2ui-sidebar .w2ui-sidebar-bottom{position:absolute;z-index:2;bottom:0;left:0;right:0}.w2ui-sidebar .w2ui-sidebar-div{position:absolute;z-index:1;overflow:auto;top:0;bottom:0;left:0;right:0;padding:2px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.w2ui-sidebar .w2ui-sidebar-div table{width:100%}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node{background-image:-webkit-linear-gradient(#edf1f6,#edf1f6);background-image:-moz-linear-gradient(#edf1f6,#edf1f6);background-image:-ms-linear-gradient(#edf1f6,#edf1f6);background-image:-o-linear-gradient(#edf1f6,#edf1f6);background-image:linear-gradient(#edf1f6,#edf1f6);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffedf1f6', endColorstr='#ffedf1f6', GradientType=0);border-top:1px solid transparent;border-bottom:1px solid transparent;margin:0;padding:1px 0}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node table{pointer-events:none}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node td.w2ui-node-dots{color:#000;text-shadow:0 0 0 #fff;pointer-events:none}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-caption:hover,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image:hover,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image>span:hover,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node td.w2ui-node-dots:hover{color:inherit}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node:hover{border-top:1px solid #f9f9f9;border-bottom:1px solid #f9f9f9;background-image:-webkit-linear-gradient(#d7e1ef,#d7e1ef);background-image:-moz-linear-gradient(#d7e1ef,#d7e1ef);background-image:-ms-linear-gradient(#d7e1ef,#d7e1ef);background-image:-o-linear-gradient(#d7e1ef,#d7e1ef);background-image:linear-gradient(#d7e1ef,#d7e1ef);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffd7e1ef', endColorstr='#ffd7e1ef', GradientType=0)}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image{width:22px;text-align:center;pointer-events:none}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image>span{color:#516173!important}.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover{background-image:-webkit-linear-gradient(#69b1e0,#4a96d3);background-image:-moz-linear-gradient(#69b1e0,#4a96d3);background-image:-ms-linear-gradient(#69b1e0,#4a96d3);background-image:-o-linear-gradient(#69b1e0,#4a96d3);background-image:linear-gradient(#69b1e0,#4a96d3);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff69b1e0', endColorstr='#ff4a96d3', GradientType=0);border-top:1px solid #5295cd;border-bottom:1px solid #2661a6}.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected td.w2ui-node-dots,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover td.w2ui-node-dots{color:#fff!important;text-shadow:1px 1px 2px #666!important}.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover{background-image:-webkit-linear-gradient(#edf1f6,#edf1f6);background-image:-moz-linear-gradient(#edf1f6,#edf1f6);background-image:-ms-linear-gradient(#edf1f6,#edf1f6);background-image:-o-linear-gradient(#edf1f6,#edf1f6);background-image:linear-gradient(#edf1f6,#edf1f6);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffedf1f6', endColorstr='#ffedf1f6', GradientType=0);border-top:1px solid transparent;border-bottom:1px solid transparent}.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled td.w2ui-node-dots,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover td.w2ui-node-dots{opacity:.4;filter:alpha(opacity=15);color:#000!important;text-shadow:0 0 0 #fff!important}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-caption{white-space:nowrap;padding:5px 0 5px 3px;margin:1px 0 1px 22px;position:relative;z-index:1;font-size:12px}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-group{white-space:nowrap;overflow:hidden;padding:10px 0 10px 10px;margin:0;cursor:default;color:#868b92;background-color:transparent}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-group :nth-child(1){margin-right:10px;float:right;color:transparent}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-group :nth-child(2){font-weight:400;text-transform:uppercase}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-sub{overflow:hidden}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-dots{width:18px;padding:0 0 1px 7px;text-align:center}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-dots .w2ui-expand{width:16px;margin-top:-3px;pointer-events:auto}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data{padding:1px 1px 3px}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data .w2ui-node-image{padding:3px 0 0;float:left}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data .w2ui-node-image>span{font-size:16px;color:#000;text-shadow:0 0 0 #fff}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data .w2ui-node-image.w2ui-icon{margin-top:3px}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data .w2ui-node-count{float:right;border:1px solid #9da4af;border-radius:20px;width:auto;height:18px;padding:2px 7px;margin:3px 4px -2px 0;background-color:#e7f0fc;color:#667274;box-shadow:0 0 2px #fff;text-shadow:1px 1px 1px #e6e6e6;position:relative;z-index:2}.w2ui-tabs{cursor:default;overflow:hidden!important;background-color:#fafafa;padding:3px 0;padding-bottom:0!important}.w2ui-tabs table{border-bottom:1px solid silver;padding:0 7px}.w2ui-tabs .w2ui-tab{padding:6px 20px;text-align:center;color:#000;background-color:transparent;border:1px solid silver;border-bottom:1px solid silver;white-space:nowrap;margin:1px 1px -1px 0;border-top-left-radius:4px;border-top-right-radius:4px;cursor:default}.w2ui-tabs .w2ui-tab.active{color:#000;background-color:#fff;border:1px solid silver;border-bottom:1px solid transparent}.w2ui-tabs .w2ui-tab.closable{padding:6px 28px 6px 20px}.w2ui-tabs .w2ui-tab-close{color:#555;text-shadow:1px 1px 1px #bbb;float:right;margin:6px 4px 0 0;padding:0 0 0 5px;width:16px;height:16px;opacity:.9;border:0;border-top:3px solid transparent;border-radius:9px}.w2ui-tabs .w2ui-tab-close:hover{background-color:#D77F7F;color:#fff}.w2ui-tabs .w2ui-tab-close:before{position:relative;top:-2px;left:0;opacity:.6;color:inherit;text-shadow:inherit;content:'x'}.w2ui-toolbar{margin:0;padding:2px;outline:0;background-color:#efefef;overflow:hidden!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.w2ui-toolbar .disabled{opacity:.3;filter:alpha(opacity=15)}.w2ui-toolbar table{table-layout:auto!important}.w2ui-toolbar table td{border:0!important}.w2ui-toolbar table.w2ui-button{margin:0 1px;border-radius:4px;height:24px;border:1px solid transparent;background-color:transparent}.w2ui-toolbar table.w2ui-button .w2ui-tb-image{width:16px;height:16px;padding:0;margin:3px!important;border:0!important;text-align:center}.w2ui-toolbar table.w2ui-button .w2ui-tb-image>span{font-size:16px;color:#516173}.w2ui-toolbar table.w2ui-button .w2ui-tb-caption{color:#000;padding:0 4px 0 2px}.w2ui-toolbar table.w2ui-button .w2ui-tb-down{width:12px;height:24px;display:block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAICAYAAADN5B7xAAAACXBIWXMAAAOUAAADlAFKEakrAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHRJREFUeNpi/P//PwMpgImBRMACY6QX109jZGDIxKboPyNj18yehnIUG97zMRUwMP6vx1DMxNA4q7exHMZnhPmBkZGRITQ0lFlITqOa4T9jI1xxT1MDAwMDA9yv////Z0D3eFpRXVNaSV0Dik1QdYw0DyXAAMW0LzgWrYMxAAAAAElFTkSuQmCC) no-repeat center right}.w2ui-toolbar table.w2ui-button.over{border:1px solid #ccc;background-color:#eee}.w2ui-toolbar table.w2ui-button.over .w2ui-tb-caption{color:#000}.w2ui-toolbar table.w2ui-button.down{border:1px solid #aaa;background-color:#ddd}.w2ui-toolbar table.w2ui-button.down .w2ui-tb-caption{color:#666}.w2ui-toolbar table.w2ui-button.checked{border:1px solid #aaa;background-color:#fff}.w2ui-toolbar table.w2ui-button.checked .w2ui-tb-caption{color:#000}.w2ui-toolbar table.w2ui-button table{height:17px;border-radius:4px;cursor:default}.w2ui-toolbar .w2ui-break{background-image:-webkit-linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);background-image:-moz-linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);background-image:-ms-linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);background-image:-o-linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);background-image:linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff999999', endColorstr='#ff999999', GradientType=0);width:1px!important;height:22px;padding:0;margin:0 6px}.w2ui-overlay table.w2ui-drop-menu{width:100%;color:#000;background-color:#fff;padding:5px 0;cursor:default}.w2ui-overlay table.w2ui-drop-menu td:first-child{padding:4px 0 4px 6px}.w2ui-overlay table.w2ui-drop-menu td:last-child{padding:10px 15px 10px 5px}.w2ui-overlay table.w2ui-drop-menu tr.w2ui-selected{background-color:#d7e4f2}.w2ui-overlay table.w2ui-drop-menu tr.w2ui-selected td{color:inherit}.w2ui-overlay table.w2ui-drop-menu .w2ui-tb-image>span{font-size:16px;color:#516173;display:inline-block;padding-top:4px} diff --git a/editor.admin.class.php b/editor.admin.class.php index d1b838d..34adf0a 100644 --- a/editor.admin.class.php +++ b/editor.admin.class.php @@ -11,7 +11,7 @@ private function sanitizeSettings($input) { global $wpdb; $pTable = $wpdb->prefix . "sam_places"; - $sql = "SELECT $pTable.patch_dfp FROM $pTable WHERE $pTable.patch_source = 2"; + $sql = "SELECT sp.patch_dfp FROM $pTable sp WHERE sp.patch_source = 2"; $rows = $wpdb->get_results($sql, ARRAY_A); $blocks = array(); foreach($rows as $value) array_push($blocks, $value['patch_dfp']); @@ -218,11 +218,77 @@ private function adSizes($size = '468x60') { +
+

+
+
    +
  • +
  • +
  • +
+
+

+ +

+ +

+ +

+
+
+

+ +    +

+ +

+ +

+
+
+

+ +

+ + + +

+ +

+
+
+
+ prefix . "sam_places"; $aTable = $wpdb->prefix . "sam_ads"; + $sTable = $wpdb->prefix . "sam_stats"; $options = $this->settings; @@ -247,21 +313,16 @@ public function page() { 'code_before' => stripslashes($_POST['code_before']), 'code_after' => stripslashes($_POST['code_after']), 'place_size' => $_POST['place_size'], - //FIXED 'place_custom_width' => $_POST['place_custom_width'], 'place_custom_width' => (isset($_POST['place_custom_width']) ? $_POST['place_custom_width'] : 0), - //FIXED 'place_custom_height' => $_POST['place_custom_height'], 'place_custom_height' => (isset($_POST['place_custom_height']) ? $_POST['place_custom_height'] : 0), 'patch_img' => $_POST['patch_img'], 'patch_link' => stripslashes($_POST['patch_link']), 'patch_code' => stripslashes($_POST['patch_code']), - //FIXED 'patch_adserver' => $_POST['patch_adserver'], 'patch_adserver' => (isset($_POST['patch_adserver']) ? 1 : 0), 'patch_dfp' => $_POST['patch_dfp'], 'patch_source' => $_POST['patch_source'], - //FIXED 'trash' => ($_POST['trash'] === 'true') 'trash' => ($_POST['trash'] === 'true' ? 1 : 0) ); - //FIXED $formatRow = array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d', '%d'); $formatRow = array( '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%s', '%d', '%s', '%d', '%d'); if($placeId === __('Undefined', SAM_DOMAIN)) { $wpdb->insert($pTable, $updateRow); @@ -321,7 +382,7 @@ public function page() { ?>
"> -

+

-

+

@@ -351,19 +412,19 @@ public function page() {
- +
-
+
-
+
-
+
@@ -382,7 +443,7 @@ public function page() { - +
@@ -396,136 +457,167 @@ public function page() {
- +
-

+

- +

-
-
-

-

-
-

-

- adSizes($row['place_size']); ?> -

-

- - -

-

- - -

-

+
+
    +
  • +
  • +
  • +
+
+
+
+

+

+
+

+

+ adSizes($row['place_size']); ?> +

+

+ + +

+

+ + +

+

+
+
-
-
-
-
-

-

-
-

-

-      -

-
-

- - -

-

- -

-

- - -

-

- -

-
-

+
+
+

+

+
+

- -    -
- + +

- - - -
- + +

+

-
-

-      -

-
-

- - -

-

- > - -

-

- -

+
+
+
+
+
+

+

+
+

+

+      +

+
+

+ + + +

+

+ +

+

+ + +

+

+ +

+ +
+
+

+      +

+
+

+ + +

+

+ > + +

+

+ +

+
+
+

+      +

+
+

+ + '> +

+

+ +

+
+

+
-
-

-      -

-
-

- - '> -

-

- -

-
-

+
+ +

+ + + +

+
+
+
+

+
+ :
+ :
+

+ +
-
-

-

+
+

+

-

-

- - -

-

- - -

-

+
@@ -564,74 +656,52 @@ public function page() { 'pid' => $_POST['place_id'], 'name' => stripslashes($_POST['item_name']), 'description' => stripslashes($_POST['item_description']), - //FIXED 'code_type' => $_POST['code_type'], 'code_type' => (isset($_POST['code_type']) ? $_POST['code_type'] : 0), 'code_mode' => $_POST['code_mode'], 'ad_code' => stripslashes($_POST['ad_code']), 'ad_img' => $_POST['ad_img'], 'ad_alt' => $_POST['ad_alt'], - //FIXED 'ad_no' => $_POST['ad_no'], 'ad_no' => (isset($_POST['ad_no']) ? $_POST['ad_no'] : 0), 'ad_target' => stripslashes($_POST['ad_target']), - //FIXED 'ad_swf' => $_POST['ad_swf'], 'ad_swf' => (isset($_POST['ad_swf']) ? $_POST['ad_swf'] : 0), 'ad_swf_flashvars' => (!empty($_POST['ad_swf_flashvars'])) ? stripslashes($_POST['ad_swf_flashvars']) : '{}', 'ad_swf_params' => (!empty($_POST['ad_swf_params'])) ? stripslashes($_POST['ad_swf_params']) : '{}', 'ad_swf_attributes' => (!empty($_POST['ad_swf_attributes'])) ? stripslashes($_POST['ad_swf_attributes']) : '{}', - //FIXED 'count_clicks' => $_POST['count_clicks'], 'count_clicks' => (isset($_POST['count_clicks']) ? $_POST['count_clicks'] : 0), 'ad_users' => $_POST['ad_users'], - //FIXED 'ad_users_unreg' => $_POST['ad_users_unreg'], 'ad_users_unreg' => (isset($_POST['ad_users_unreg']) ? $_POST['ad_users_unreg'] : 0), - //FIXED 'ad_users_reg' => $_POST['ad_users_reg'], 'ad_users_reg' => (isset($_POST['ad_users_reg']) ? $_POST['ad_users_reg'] : 0), - //FIXED 'x_ad_users' => $_POST['x_ad_users'], 'x_ad_users' => (isset($_POST['x_ad_users']) ? $_POST['x_ad_users'] : 0), - 'x_view_users' => $this->removeTrailingComma( stripcslashes($_POST['x_view_users'])), - //FIXED 'ad_users_adv' => $_POST['ad_users_adv'], + 'x_view_users' => self::removeTrailingComma( stripcslashes($_POST['x_view_users'])), 'ad_users_adv' => (isset($_POST['ad_users_adv']) ? $_POST['ad_users_adv'] : 0), 'view_type' => $_POST['view_type'], 'view_pages' => $viewPages, 'view_id' => $_POST['view_id'], - //FIXED 'ad_cats' => $_POST['ad_cats'], 'ad_cats' => (isset($_POST['ad_cats']) ? $_POST['ad_cats'] : 0), - 'view_cats' => $this->removeTrailingComma( stripcslashes( $_POST['view_cats'] )), - //FIXED 'ad_authors' => $_POST['ad_authors'], + 'view_cats' => self::removeTrailingComma( stripcslashes( $_POST['view_cats'] )), 'ad_authors' => (isset($_POST['ad_authors']) ? $_POST['ad_authors'] : 0), 'view_authors' => $this->removeTrailingComma(stripcslashes( $_POST['view_authors'])), - //FIXED 'ad_tags' => $_POST['ad_tags'], 'ad_tags' => (isset($_POST['ad_tags']) ? $_POST['ad_tags'] : 0), - 'view_tags' => $this->removeTrailingComma( stripcslashes($_POST['view_tags']) ), - //FIXED 'ad_custom' => $_POST['ad_custom'], + 'view_tags' => self::removeTrailingComma( stripcslashes($_POST['view_tags']) ), 'ad_custom' => (isset($_POST['ad_custom']) ? $_POST['ad_custom'] : 0), - 'view_custom' => $this->removeTrailingComma( stripcslashes( $_POST['view_custom'] ) ), - //FIXED 'x_id' => $_POST['x_id'], + 'view_custom' => self::removeTrailingComma( stripcslashes( $_POST['view_custom'] ) ), 'x_id' => (isset($_POST['x_id']) ? $_POST['x_id'] : 0), 'x_view_id' => $_POST['x_view_id'], - //FIXED 'x_cats' => $_POST['x_cats'], 'x_cats' => (isset($_POST['x_cats']) ? $_POST['x_cats'] : 0), - 'x_view_cats' => $this->removeTrailingComma(stripslashes($_POST['x_view_cats'])), - //FIXED 'x_authors' => $_POST['x_authors'], + 'x_view_cats' => self::removeTrailingComma(stripslashes($_POST['x_view_cats'])), 'x_authors' => (isset($_POST['x_authors']) ? $_POST['x_authors'] : 0), - 'x_view_authors' => $this->removeTrailingComma(stripcslashes($_POST['x_view_authors'])), - //FIXED 'x_tags' => $_POST['x_tags'], + 'x_view_authors' => self::removeTrailingComma(stripcslashes($_POST['x_view_authors'])), 'x_tags' => (isset($_POST['x_tags']) ? $_POST['x_tags'] : 0), - 'x_view_tags' => $this->removeTrailingComma(stripcslashes($_POST['x_view_tags'])), - //FIXED 'x_custom' => $_POST['x_custom'], + 'x_view_tags' => self::removeTrailingComma(stripcslashes($_POST['x_view_tags'])), 'x_custom' => (isset($_POST['x_custom']) ? $_POST['x_custom'] : 0), - 'x_view_custom' => $this->removeTrailingComma(stripcslashes($_POST['x_view_custom'])), - //FIXED 'ad_start_date' => $_POST['ad_start_date'], + 'x_view_custom' => self::removeTrailingComma(stripcslashes($_POST['x_view_custom'])), 'ad_start_date' => (empty($_POST['ad_start_date']) ? '0000-00-00' :$_POST['ad_start_date']), - //FIXED 'ad_end_date' => $_POST['ad_end_date'], 'ad_end_date' => (empty($_POST['ad_end_date']) ? '0000-00-00' : $_POST['ad_end_date']), - //FIXED 'ad_schedule' => $_POST['ad_schedule'], 'ad_schedule' => (isset($_POST['ad_schedule']) ? $_POST['ad_schedule'] : 0), 'ad_weight' => $_POST['ad_weight'], - //FIXED 'limit_hits' => $_POST['limit_hits'], 'limit_hits' => (isset($_POST['limit_hits']) ? $_POST['limit_hits'] : 0), 'hits_limit' => $_POST['hits_limit'], - //FIXED 'limit_clicks' => $_POST['limit_clicks'], - 'limit_clicks' => (isset($_POST['limit_clicks']) ? $_POST['limit_hits'] : 0), + 'limit_clicks' => (isset($_POST['limit_clicks']) ? $_POST['limit_clicks'] : 0), 'clicks_limit' => $_POST['clicks_limit'], 'adv_nick' => $_POST['adv_nick'], 'adv_name' => $_POST['adv_name'], @@ -639,12 +709,21 @@ public function page() { 'cpm' => $_POST['cpm'], 'cpc' => $_POST['cpc'], 'per_month' => $_POST['per_month'], - //FIXED 'trash' => ($_POST['trash'] === 'true') - 'trash' => ($_POST['trash'] === 'true' ? 1 : 0) + 'trash' => ($_POST['trash'] === 'true' ? 1 : 0), + 'ad_custom_tax_terms' => ((isset($_POST['ad_custom_tax_terms'])) ? $_POST['ad_custom_tax_terms'] : 0), + 'view_custom_tax_terms' => self::removeTrailingComma(stripslashes($_POST['view_custom_tax_terms'])), + 'x_ad_custom_tax_terms' => ((isset($_POST['x_ad_custom_tax_terms'])) ? $_POST['x_ad_custom_tax_terms'] : 0), + 'x_view_custom_tax_terms' => self::removeTrailingComma(stripslashes($_POST['x_view_custom_tax_terms'])) + ); + $formatRow = array( + '%d', '%s', '%s', '%d', '%d', '%s', '%s', '%s', '%d', '%s', + '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', + '%d', '%d', '%s', '%s', '%d', '%s', '%d', '%s', '%d', '%s', + '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', + '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', + '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', + '%s' ); - //FIXED $formatRow = array( '%d', '%s', '%s', '%d', '%d', '%s', '%s', '%s', '%d', '%s', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d'); - // ad_no count_click view_pages x_id x_tags ad_weight adv_nick - $formatRow = array( '%d', '%s', '%s', '%d', '%d', '%s', '%s', '%s', '%d', '%s', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%s', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d'); if($itemId === __('Undefined', SAM_DOMAIN)) { $wpdb->insert($aTable, $updateRow); $item = $wpdb->insert_id; @@ -653,7 +732,7 @@ public function page() { if(is_null($item)) $item = $itemId; $wpdb->update($aTable, $updateRow, array( 'id' => $item ), $formatRow, array( '%d' )); } - $wpdb->query("UPDATE {$aTable} SET {$aTable}.ad_weight_hits = 0 WHERE {$aTable}.pid = {$placeId}"); + $wpdb->query("UPDATE $aTable sa SET sa.ad_weight_hits = 0 WHERE sa.pid = {$placeId};"); $action = 'edit'; ?>

@@ -662,72 +741,81 @@ public function page() { if($action !== 'new') { $row = $wpdb->get_row( - "SELECT id, - pid, - name, - description, - code_type, - code_mode, - ad_code, - ad_img, - ad_alt, - ad_no, - ad_target, - ad_swf, - ad_swf_flashvars, - ad_swf_params, - ad_swf_attributes, - count_clicks, - ad_users, - ad_users_unreg, - ad_users_reg, - x_ad_users, - x_view_users, - ad_users_adv, - (SELECT place_size FROM $pTable WHERE $pTable.id = $aTable.pid) AS ad_size, - (SELECT place_custom_width FROM $pTable WHERE $pTable.id = $aTable.pid) AS ad_custom_width, - (SELECT place_custom_height FROM $pTable WHERE $pTable.id = $aTable.pid) AS ad_custom_height, - view_type, - (view_pages+0) AS view_pages, - view_id, - ad_cats, - view_cats, - ad_authors, - view_authors, - ad_tags, - view_tags, - ad_custom, - view_custom, - x_id, - x_view_id, - x_cats, - x_view_cats, - x_authors, - x_view_authors, - x_tags, - x_view_tags, - x_custom, - x_view_custom, - ad_start_date, - ad_end_date, - ad_schedule, - limit_hits, - hits_limit, - limit_clicks, - clicks_limit, - ad_hits, - ad_clicks, - ad_weight, - ad_weight_hits, - adv_nick, - adv_name, - adv_mail, - cpm, - cpc, - per_month, - trash, - IF(DATEDIFF($aTable.ad_end_date, NOW()) IS NULL OR DATEDIFF($aTable.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired - FROM $aTable WHERE id = $item", + "SELECT sa.id, + sa.pid, + sa.name, + sa.description, + sa.code_type, + sa.code_mode, + sa.ad_code, + sa.ad_img, + sa.ad_alt, + sa.ad_no, + sa.ad_target, + sa.ad_swf, + sa.ad_swf_flashvars, + sa.ad_swf_params, + sa.ad_swf_attributes, + sa.count_clicks, + sa.ad_users, + sa.ad_users_unreg, + sa.ad_users_reg, + sa.x_ad_users, + sa.x_view_users, + sa.ad_users_adv, + sp.place_size AS ad_size, + sp.place_custom_width AS ad_custom_width, + sp.place_custom_height AS ad_custom_height, + sa.view_type, + (sa.view_pages+0) AS view_pages, + sa.view_id, + sa.ad_cats, + sa.view_cats, + sa.ad_authors, + sa.view_authors, + sa.ad_tags, + sa.view_tags, + sa.ad_custom, + sa.view_custom, + sa.x_id, + sa.x_view_id, + sa.x_cats, + sa.x_view_cats, + sa.x_authors, + sa.x_view_authors, + sa.x_tags, + sa.x_view_tags, + sa.x_custom, + sa.x_view_custom, + sa.ad_start_date, + sa.ad_end_date, + sa.ad_schedule, + sa.limit_hits, + sa.hits_limit, + sa.limit_clicks, + sa.clicks_limit, + (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, + (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, + sa.ad_weight, + sa.ad_weight_hits, + sa.adv_nick, + sa.adv_name, + sa.adv_mail, + sa.cpm, + sa.cpc, + sa.per_month, + sa.trash, + IF(DATEDIFF(sa.ad_end_date, NOW()) IS NULL OR DATEDIFF(sa.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired, + sp.code_before, + sp.code_after, + sa.ad_custom_tax_terms, + sa.view_custom_tax_terms, + sa.x_ad_custom_tax_terms, + sa.x_view_custom_tax_terms + FROM $aTable sa + INNER JOIN $pTable sp + ON sa.pid = sp.id + WHERE sa.id = $item;", ARRAY_A); if($row['ad_size'] === 'custom') $aSize = $this->getAdSize($row['ad_size'], $row['ad_custom_width'], $row['ad_custom_height']); @@ -796,7 +884,11 @@ public function page() { 'cpc' => 0.0, 'per_month' => 0.0, 'trash' => 0, - 'expired' => 0 + 'expired' => 0, + 'ad_custom_tax_terms' => 0, + 'view_custom_tax_terms' => '', + 'x_ad_custom_tax_terms' => 0, + 'x_view_custom_tax_terms' => '' ); $aSize = array( 'name' => __('Undefined', SAM_DOMAIN), @@ -807,7 +899,7 @@ public function page() { ?>
"> -

+

-

+

@@ -837,30 +929,30 @@ public function page() {
- - + +
- 0) && !$row['trash'] && !$row['expired']) ? __('Ad is Active', SAM_DOMAIN) : __('Ad is Inactive', SAM_DOMAIN); ?>
+ 0) && !$row['trash'] && !$row['expired']) ? __('Ad is Active', SAM_DOMAIN) : __('Ad is Inactive', SAM_DOMAIN); ?>
-
+
-
+
-
+
- /> -
- /> + > +
+ >
@@ -879,7 +971,7 @@ public function page() { - +
@@ -893,17 +985,17 @@ public function page() {
- +
-

+

- +

@@ -915,12 +1007,14 @@ public function page() {

  • -
  • +
  • +
  • +
-

+

@@ -930,23 +1024,24 @@ public function page() {

- + +

- +

- +

- /> + >

- /> + >

@@ -970,24 +1065,7 @@ public function page() {

-
-

-

- -    -
- -

-

- - - -
- -

-
+

@@ -1006,7 +1084,7 @@ public function page() {

-

+

@@ -1048,38 +1126,38 @@ public function page() {

checkViewPages($row['view_pages'], SAM_IS_HOME)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_SINGULAR)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_SINGLE)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_PAGE)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_POST_TYPE)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_ATTACHMENT)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_SEARCH)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_404)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_ARCHIVE)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_TAX)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_CATEGORY)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_TAG)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_AUTHOR)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_POST_TYPE_ARCHIVE)); ?>> -
+
checkViewPages($row['view_pages'], SAM_IS_DATE)); ?>> -
+

@@ -1089,10 +1167,10 @@ public function page() {

- '/> + '>

-
+

@@ -1104,51 +1182,9 @@ public function page() {

-
-

-

-
-

-

- /> - -

-
-

- /> - -

-
-

- /> - -

-

- /> - -

-
-

- /> - -

-
- - -
-
-
-
-

- /> - -

-
-
-
-
+
-

+

@@ -1158,10 +1194,10 @@ public function page() {

- +

-
+

@@ -1174,9 +1210,9 @@ public function page() {

- +
-
+

@@ -1194,24 +1230,57 @@ public function page() {

- +
-
+

+

+ > + +

+
+ +
+
+
+
+

+ +

+
+

+ +

+
+
+

+ > + +

+
+ +
+
+
+
+

+ +

+

>

- +
-
+

@@ -1229,9 +1298,9 @@ public function page() {

- +
-
+

@@ -1244,9 +1313,9 @@ public function page() {

- +
-
+

@@ -1264,9 +1333,9 @@ public function page() {

- +
-
+

@@ -1279,9 +1348,9 @@ public function page() {

- +
-
+

@@ -1299,9 +1368,9 @@ public function page() {

- +
-
+

@@ -1358,9 +1427,56 @@ public function page() {

+
+
+

+

+
+

+

+ > + +

+
+

+ > + +

+
+

+ > + +

+

+ > + +

+
+

+ > + +

+
+ + +
+
+
+
+

+ > + +

+
+
+
+
+
+
+
-

+

@@ -1380,7 +1496,7 @@ public function page() {

-

+

@@ -1408,16 +1524,45 @@ public function page() {

+
+
+ +

+ + + +

+
+
+
+

+
+ :
+ :
+

+ +
+
-

+

(integer) $row['id']), true, false); + $sample = new SamAd(array('id' => (integer) $row['id']), true, true); echo $sample->ad; ?>
diff --git a/errorlog.admin.class.php b/errorlog.admin.class.php index cc2a295..e66439c 100644 --- a/errorlog.admin.class.php +++ b/errorlog.admin.class.php @@ -35,8 +35,8 @@ public function page() { } if($iaction === 'kill-em-all') $wpdb->query("DELETE FROM $eTable"); if($iaction === 'kill-resolved') $wpdb->query("DELETE FROM $eTable WHERE resolved = TRUE;"); - $resolved_num = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM %s WHERE resolved = TRUE", $eTable)); - $active_num = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM %s WHERE resolved = FALSE", $eTable)); + $resolved_num = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $eTable WHERE resolved = %d", 1)); + $active_num = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $eTable WHERE resolved = %d", 0)); if(is_null($active_num)) $active_num = 0; if(is_null($resolved_num)) $resolved_num = 0; $all_num = $resolved_num + $active_num; @@ -101,16 +101,16 @@ public function page() { get_results($eSql, ARRAY_A); $eTypes = array(__('Warning', SAM_DOMAIN), __('Update Error', SAM_DOMAIN), __('Output Error', SAM_DOMAIN)); @@ -156,12 +156,6 @@ public function page() { ?> - - - - - ' /> -
@@ -187,6 +181,11 @@ public function page() {
get_results('DESCRIBE wp_sam_blocks;', ARRAY_A); + foreach($struct as $var) { + $out = " '{$var['Field']}' => array('Type' => \"{$var['Type']}\", 'Null' => '{$var['Null']}', 'Key' => '{$var['Key']}', 'Default' => '{$var['Default']}', 'Extra' => '{$var['Extra']}'),"; + echo $out."
"; + }*/ } } } diff --git a/errors.class.php b/errors.class.php index 03e184c..5158f31 100644 --- a/errors.class.php +++ b/errors.class.php @@ -8,66 +8,74 @@ public function __construct($rows = null) { } public function getErrors($rows = array(), $dir = '') { - global $wpdb; - $errors = array( - 'dir' => false, - 'tables' => array( - 'places' => 0, - 'ads' => 0, - 'zones' => 0, - 'blocks' => 0 - ), - 'prefix' => $wpdb->prefix - ); + global $wpdb; + $errors = array( + 'dir' => false, + 'tables' => array( + 'places' => 0, + 'ads' => 0, + 'zones' => 0, + 'blocks' => 0 + ), + 'prefix' => $wpdb->prefix + ); - if(is_null($dir)) $dir = SAM_AD_IMG; - if(!is_dir($dir)) $errors['dir'] = true; + if(is_null($dir)) $dir = SAM_AD_IMG; + if(!is_dir($dir)) $errors['dir'] = true; - foreach($rows as $key => $value) { - $table = $wpdb->prefix . 'sam_' . $key; - if($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) $errors['tables'][$key] = 1; - if($errors['tables'][$key] != 1) { - $result = $wpdb->get_results("DESCRIBE $table", ARRAY_A); - if($rows[$key] != count($result)) $errors['tables'][$key] = 2; + foreach($rows as $key => $value) { + $table = $wpdb->prefix . 'sam_' . $key; + if($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) $errors['tables'][$key] = 1; + if($errors['tables'][$key] != 1) { + $result = $wpdb->get_results("DESCRIBE $table", ARRAY_A); + if($rows[$key] != count($result)) $errors['tables'][$key] = 2; + } } - } - return $errors; - } + return $errors; + } - public function checkShell($rows = null) { - $dirError = ''; - $oError = ''; - $output = ''; + public function checkShell($rows = null) { + global $sam_tables_defs; + + $dirError = ''; + $oError = ''; + $output = ''; - if(is_null($rows)) $rows = array('places' => 16, 'ads' => 62, 'zones' => 24, 'blocks' => 15); - $errors = $this->getErrors($rows, SAM_AD_IMG); - if($errors['dir']) { - $dirError = '

'.__("Simple Ads Manager Images Folder hasn't been created!", SAM_DOMAIN).'

'; - $dirError .= '

'.__("Try to reactivate plugin or create folder manually.", SAM_DOMAIN).'
'.__("Manually creation: Create folder 'sam-images' in 'wp-content/plugins' folder. Don't forget to set folder's permissions to 777.", SAM_DOMAIN).'

'; - } + if(is_null($rows)) + $rows = array( + 'places' => count($sam_tables_defs['places']), + 'ads' => count($sam_tables_defs['ads']), + 'zones' => count($sam_tables_defs['zones']), + 'blocks' => count($sam_tables_defs['blocks']) + ); + $errors = self::getErrors($rows, SAM_AD_IMG); + if($errors['dir']) { + $dirError = '

'.__("Simple Ads Manager Images Folder hasn't been created!", SAM_DOMAIN).'

'; + $dirError .= '

'.__("Try to reactivate plugin or create folder manually.", SAM_DOMAIN).'
'.__("Manually creation: Create folder 'sam-images' in 'wp-content/plugins' folder. Don't forget to set folder's permissions to 777.", SAM_DOMAIN).'

'; + } - foreach($errors['tables'] as $key => $value) { - $table = $errors['prefix'].'sam_'.$key; - switch($value) { - case 1: - $oError .= '

'.sprintf(__("Database table %s hasn't been created!", SAM_DOMAIN), $table).'

'; - break; + foreach($errors['tables'] as $key => $value) { + $table = $errors['prefix'].'sam_'.$key; + switch($value) { + case 1: + $oError .= '

'.sprintf(__("Database table %s hasn't been created!", SAM_DOMAIN), $table).'

'; + break; - case 2: - $oError .= '

'.sprintf(__("Database table %s hasn't been upgraded!", SAM_DOMAIN), $table).'

'; - break; + case 2: + $oError .= '

'.sprintf(__("Database table %s hasn't been upgraded!", SAM_DOMAIN), $table).'

'; + break; - default: - $oError .= ''; - break; + default: + $oError .= ''; + break; + } } - } - if(!empty($oError) || !empty($dirError)) - $output = '
'.$dirError.$oError.'
'; - return $output; - } + if(!empty($oError) || !empty($dirError)) + $output = '
'.$dirError.$oError.'
'; + return $output; + } } } ?> diff --git a/images/index.html b/images/index.html new file mode 100644 index 0000000..25d941d --- /dev/null +++ b/images/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/images/jslider.png b/images/jslider.png new file mode 100644 index 0000000..6f72a0f Binary files /dev/null and b/images/jslider.png differ diff --git a/images/ok-32.png b/images/ok-32.png index 539ecda..c3e13ba 100644 Binary files a/images/ok-32.png and b/images/ok-32.png differ diff --git a/images/ok.png b/images/ok.png index 31d09fe..3e57dd8 100644 Binary files a/images/ok.png and b/images/ok.png differ diff --git a/images/sam-icon.png b/images/sam-icon.png index fe070fc..20460db 100644 Binary files a/images/sam-icon.png and b/images/sam-icon.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..25d941d --- /dev/null +++ b/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/js/dialog-ad.php b/js/dialog-ad.php index 147d6d1..3041335 100644 --- a/js/dialog-ad.php +++ b/js/dialog-ad.php @@ -32,6 +32,11 @@ + diff --git a/js/dialog-block.php b/js/dialog-block.php index 53ee236..67ec3f6 100644 --- a/js/dialog-block.php +++ b/js/dialog-block.php @@ -32,6 +32,11 @@ + diff --git a/js/dialog-zone.php b/js/dialog-zone.php index f8d10a1..18d7107 100644 --- a/js/dialog-zone.php +++ b/js/dialog-zone.php @@ -32,6 +32,11 @@ + diff --git a/js/dialog.php b/js/dialog.php index a2b9571..7edea20 100644 --- a/js/dialog.php +++ b/js/dialog.php @@ -32,6 +32,11 @@ + diff --git a/js/index.html b/js/index.html new file mode 100644 index 0000000..25d941d --- /dev/null +++ b/js/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/js/jquery.flot.categories.min.js b/js/jquery.flot.categories.min.js new file mode 100644 index 0000000..552dd90 --- /dev/null +++ b/js/jquery.flot.categories.min.js @@ -0,0 +1 @@ +(function($){var options={xaxis:{categories:null},yaxis:{categories:null}};function processRawData(plot,series,data,datapoints){var xCategories=series.xaxis.options.mode=="categories",yCategories=series.yaxis.options.mode=="categories";if(!(xCategories||yCategories))return;var format=datapoints.format;if(!format){var s=series;format=[];format.push({x:true,number:true,required:true});format.push({y:true,number:true,required:true});if(s.bars.show||s.lines.show&&s.lines.fill){var autoscale=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);format.push({y:true,number:true,required:false,defaultValue:0,autoscale:autoscale});if(s.bars.horizontal){delete format[format.length-1].y;format[format.length-1].x=true}}datapoints.format=format}for(var m=0;mindex)index=categories[v];return index+1}function categoriesTickGenerator(axis){var res=[];for(var label in axis.categories){var v=axis.categories[label];if(v>=axis.min&&v<=axis.max)res.push([v,label])}res.sort(function(a,b){return a[0]-b[0]});return res}function setupCategoriesForAxis(series,axis,datapoints){if(series[axis].options.mode!="categories")return;if(!series[axis].categories){var c={},o=series[axis].options.categories||{};if($.isArray(o)){for(var i=0;i=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function($){var hasOwnProperty=Object.prototype.hasOwnProperty;function Canvas(cls,container){var element=container.children("."+cls)[0];if(element==null){element=document.createElement("canvas");element.className=cls;$(element).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(container);if(!element.getContext){if(window.G_vmlCanvasManager){element=window.G_vmlCanvasManager.initElement(element)}else{throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.")}}}this.element=element;var context=this.context=element.getContext("2d");var devicePixelRatio=window.devicePixelRatio||1,backingStoreRatio=context.webkitBackingStorePixelRatio||context.mozBackingStorePixelRatio||context.msBackingStorePixelRatio||context.oBackingStorePixelRatio||context.backingStorePixelRatio||1;this.pixelRatio=devicePixelRatio/backingStoreRatio;this.resize(container.width(),container.height());this.textContainer=null;this.text={};this._textCache={}}Canvas.prototype.resize=function(width,height){if(width<=0||height<=0){throw new Error("Invalid dimensions for plot, width = "+width+", height = "+height)}var element=this.element,context=this.context,pixelRatio=this.pixelRatio;if(this.width!=width){element.width=width*pixelRatio;element.style.width=width+"px";this.width=width}if(this.height!=height){element.height=height*pixelRatio;element.style.height=height+"px";this.height=height}context.restore();context.save();context.scale(pixelRatio,pixelRatio)};Canvas.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};Canvas.prototype.render=function(){var cache=this._textCache;for(var layerKey in cache){if(hasOwnProperty.call(cache,layerKey)){var layer=this.getTextLayer(layerKey),layerCache=cache[layerKey];layer.hide();for(var styleKey in layerCache){if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache){if(hasOwnProperty.call(styleCache,key)){var positions=styleCache[key].positions;for(var i=0,position;position=positions[i];i++){if(position.active){if(!position.rendered){layer.append(position.element);position.rendered=true}}else{positions.splice(i--,1);if(position.rendered){position.element.detach()}}}if(positions.length==0){delete styleCache[key]}}}}}layer.show()}}};Canvas.prototype.getTextLayer=function(classes){var layer=this.text[classes];if(layer==null){if(this.textContainer==null){this.textContainer=$("
").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)}layer=this.text[classes]=$("
").addClass(classes).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)}return layer};Canvas.prototype.getTextInfo=function(layer,text,font,angle,width){var textStyle,layerCache,styleCache,info;text=""+text;if(typeof font==="object"){textStyle=font.style+" "+font.variant+" "+font.weight+" "+font.size+"px/"+font.lineHeight+"px "+font.family}else{textStyle=font}layerCache=this._textCache[layer];if(layerCache==null){layerCache=this._textCache[layer]={}}styleCache=layerCache[textStyle];if(styleCache==null){styleCache=layerCache[textStyle]={}}info=styleCache[text];if(info==null){var element=$("
").html(text).css({position:"absolute","max-width":width,top:-9999}).appendTo(this.getTextLayer(layer));if(typeof font==="object"){element.css({font:textStyle,color:font.color})}else if(typeof font==="string"){element.addClass(font)}info=styleCache[text]={width:element.outerWidth(true),height:element.outerHeight(true),element:element,positions:[]};element.detach()}return info};Canvas.prototype.addText=function(layer,x,y,text,font,angle,width,halign,valign){var info=this.getTextInfo(layer,text,font,angle,width),positions=info.positions;if(halign=="center"){x-=info.width/2}else if(halign=="right"){x-=info.width}if(valign=="middle"){y-=info.height/2}else if(valign=="bottom"){y-=info.height}for(var i=0,position;position=positions[i];i++){if(position.x==x&&position.y==y){position.active=true;return}}position={active:true,rendered:false,element:positions.length?info.element.clone():info.element,x:x,y:y};positions.push(position);position.element.css({top:Math.round(y),left:Math.round(x),"text-align":halign})};Canvas.prototype.removeText=function(layer,x,y,text,font,angle){if(text==null){var layerCache=this._textCache[layer];if(layerCache!=null){for(var styleKey in layerCache){if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache){if(hasOwnProperty.call(styleCache,key)){var positions=styleCache[key].positions;for(var i=0,position;position=positions[i];i++){position.active=false}}}}}}}else{var positions=this.getTextInfo(layer,text,font,angle).positions;for(var i=0,position;position=positions[i];i++){if(position.x==x&&position.y==y){position.active=false}}}};function Plot(placeholder,data_,options_,plugins){var series=[],options={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false,zero:true},shadowSize:3,highlightColor:null},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},surface=null,overlay=null,eventHolder=null,ctx=null,octx=null,xaxes=[],yaxes=[],plotOffset={left:0,right:0,top:0,bottom:0},plotWidth=0,plotHeight=0,hooks={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},plot=this;plot.setData=setData;plot.setupGrid=setupGrid;plot.draw=draw;plot.getPlaceholder=function(){return placeholder};plot.getCanvas=function(){return surface.element};plot.getPlotOffset=function(){return plotOffset};plot.width=function(){return plotWidth};plot.height=function(){return plotHeight};plot.offset=function(){var o=eventHolder.offset();o.left+=plotOffset.left;o.top+=plotOffset.top;return o};plot.getData=function(){return series};plot.getAxes=function(){var res={},i;$.each(xaxes.concat(yaxes),function(_,axis){if(axis)res[axis.direction+(axis.n!=1?axis.n:"")+"axis"]=axis});return res};plot.getXAxes=function(){return xaxes};plot.getYAxes=function(){return yaxes};plot.c2p=canvasToAxisCoords;plot.p2c=axisToCanvasCoords;plot.getOptions=function(){return options};plot.highlight=highlight;plot.unhighlight=unhighlight;plot.triggerRedrawOverlay=triggerRedrawOverlay;plot.pointOffset=function(point){return{left:parseInt(xaxes[axisNumber(point,"x")-1].p2c(+point.x)+plotOffset.left,10),top:parseInt(yaxes[axisNumber(point,"y")-1].p2c(+point.y)+plotOffset.top,10)}};plot.shutdown=shutdown;plot.destroy=function(){shutdown();placeholder.removeData("plot").empty();series=[];options=null;surface=null;overlay=null;eventHolder=null;ctx=null;octx=null;xaxes=[];yaxes=[];hooks=null;highlights=[];plot=null};plot.resize=function(){var width=placeholder.width(),height=placeholder.height();surface.resize(width,height);overlay.resize(width,height)};plot.hooks=hooks;initPlugins(plot);parseOptions(options_);setupCanvases();setData(data_);setupGrid();draw();bindEvents();function executeHooks(hook,args){args=[plot].concat(args);for(var i=0;imaxIndex){maxIndex=sc}}}if(neededColors<=maxIndex){neededColors=maxIndex+1}var c,colors=[],colorPool=options.colors,colorPoolSize=colorPool.length,variation=0;for(i=0;i=0){if(variation<.5){variation=-variation-.2}else variation=0}else variation=-variation}colors[i]=c.scale("rgb",1+variation)}var colori=0,s;for(i=0;iaxis.datamax&&max!=fakeInfinity)axis.datamax=max}$.each(allAxes(),function(_,axis){axis.datamin=topSentry;axis.datamax=bottomSentry;axis.used=false});for(i=0;i0&&points[k-ps]!=null&&points[k-ps]!=points[k]&&points[k-ps+1]!=points[k+1]){for(m=0;mxmax)xmax=val}if(f.y){if(valymax)ymax=val}}}if(s.bars.show){var delta;switch(s.bars.align){case"left":delta=0;break;case"right":delta=-s.bars.barWidth;break;default:delta=-s.bars.barWidth/2}if(s.bars.horizontal){ymin+=delta;ymax+=delta+s.bars.barWidth}else{xmin+=delta;xmax+=delta+s.bars.barWidth}}updateAxis(s.xaxis,xmin,xmax);updateAxis(s.yaxis,ymin,ymax)}$.each(allAxes(),function(_,axis){if(axis.datamin==topSentry)axis.datamin=null;if(axis.datamax==bottomSentry)axis.datamax=null})}function setupCanvases(){placeholder.css("padding",0).children().filter(function(){return!$(this).hasClass("flot-overlay")&&!$(this).hasClass("flot-base")}).remove();if(placeholder.css("position")=="static")placeholder.css("position","relative");surface=new Canvas("flot-base",placeholder);overlay=new Canvas("flot-overlay",placeholder);ctx=surface.context;octx=overlay.context;eventHolder=$(overlay.element).unbind();var existing=placeholder.data("plot");if(existing){existing.shutdown();overlay.clear()}placeholder.data("plot",plot)}function bindEvents(){if(options.grid.hoverable){eventHolder.mousemove(onMouseMove);eventHolder.bind("mouseleave",onMouseLeave)}if(options.grid.clickable)eventHolder.click(onClick);executeHooks(hooks.bindEvents,[eventHolder])}function shutdown(){if(redrawTimeout)clearTimeout(redrawTimeout);eventHolder.unbind("mousemove",onMouseMove);eventHolder.unbind("mouseleave",onMouseLeave);eventHolder.unbind("click",onClick);executeHooks(hooks.shutdown,[eventHolder])}function setTransformationHelpers(axis){function identity(x){return x}var s,m,t=axis.options.transform||identity,it=axis.options.inverseTransform;if(axis.direction=="x"){s=axis.scale=plotWidth/Math.abs(t(axis.max)-t(axis.min));m=Math.min(t(axis.max),t(axis.min))}else{s=axis.scale=plotHeight/Math.abs(t(axis.max)-t(axis.min));s=-s;m=Math.max(t(axis.max),t(axis.min))}if(t==identity)axis.p2c=function(p){return(p-m)*s};else axis.p2c=function(p){return(t(p)-m)*s};if(!it)axis.c2p=function(c){return m+c/s};else axis.c2p=function(c){return it(m+c/s)}}function measureTickLabels(axis){var opts=axis.options,ticks=axis.ticks||[],labelWidth=opts.labelWidth||0,labelHeight=opts.labelHeight||0,maxWidth=labelWidth||(axis.direction=="x"?Math.floor(surface.width/(ticks.length||1)):null),legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=opts.font||"flot-tick-label tickLabel";for(var i=0;i=0;--i)allocateAxisBoxFirstPhase(allocatedAxes[i]);adjustLayoutForThingsStickingOut();$.each(allocatedAxes,function(_,axis){allocateAxisBoxSecondPhase(axis)})}plotWidth=surface.width-plotOffset.left-plotOffset.right;plotHeight=surface.height-plotOffset.bottom-plotOffset.top;$.each(axes,function(_,axis){setTransformationHelpers(axis)});if(showGrid){drawAxisLabels()}insertLegend()}function setRange(axis){var opts=axis.options,min=+(opts.min!=null?opts.min:axis.datamin),max=+(opts.max!=null?opts.max:axis.datamax),delta=max-min;if(delta==0){var widen=max==0?1:.01;if(opts.min==null)min-=widen;if(opts.max==null||opts.min!=null)max+=widen}else{var margin=opts.autoscaleMargin;if(margin!=null){if(opts.min==null){min-=delta*margin;if(min<0&&axis.datamin!=null&&axis.datamin>=0)min=0}if(opts.max==null){max+=delta*margin;if(max>0&&axis.datamax!=null&&axis.datamax<=0)max=0}}}axis.min=min;axis.max=max}function setupTickGeneration(axis){var opts=axis.options;var noTicks;if(typeof opts.ticks=="number"&&opts.ticks>0)noTicks=opts.ticks;else noTicks=.3*Math.sqrt(axis.direction=="x"?surface.width:surface.height);var delta=(axis.max-axis.min)/noTicks,dec=-Math.floor(Math.log(delta)/Math.LN10),maxDec=opts.tickDecimals;if(maxDec!=null&&dec>maxDec){dec=maxDec}var magn=Math.pow(10,-dec),norm=delta/magn,size;if(norm<1.5){size=1}else if(norm<3){size=2;if(norm>2.25&&(maxDec==null||dec+1<=maxDec)){size=2.5;++dec}}else if(norm<7.5){size=5}else{size=10}size*=magn;if(opts.minTickSize!=null&&size0){if(opts.min==null)axis.min=Math.min(axis.min,niceTicks[0]);if(opts.max==null&&niceTicks.length>1)axis.max=Math.max(axis.max,niceTicks[niceTicks.length-1])}axis.tickGenerator=function(axis){var ticks=[],v,i;for(i=0;i1&&/\..*0$/.test((ts[1]-ts[0]).toFixed(extraDec))))axis.tickDecimals=extraDec}}}}function setTicks(axis){var oticks=axis.options.ticks,ticks=[];if(oticks==null||typeof oticks=="number"&&oticks>0)ticks=axis.tickGenerator(axis);else if(oticks){if($.isFunction(oticks))ticks=oticks(axis);else ticks=oticks}var i,v;axis.ticks=[];for(i=0;i1)label=t[1]}else v=+t;if(label==null)label=axis.tickFormatter(v,axis);if(!isNaN(v))axis.ticks.push({v:v,label:label})}}function snapRangeToTicks(axis,ticks){if(axis.options.autoscaleMargin&&ticks.length>0){if(axis.options.min==null)axis.min=Math.min(axis.min,ticks[0].v);if(axis.options.max==null&&ticks.length>1)axis.max=Math.max(axis.max,ticks[ticks.length-1].v)}}function draw(){surface.clear();executeHooks(hooks.drawBackground,[ctx]);var grid=options.grid;if(grid.show&&grid.backgroundColor)drawBackground();if(grid.show&&!grid.aboveData){drawGrid()}for(var i=0;ito){var tmp=from;from=to;to=tmp}return{from:from,to:to,axis:axis}}function drawBackground(){ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.fillStyle=getColorOrGradient(options.grid.backgroundColor,plotHeight,0,"rgba(255, 255, 255, 0)");ctx.fillRect(0,0,plotWidth,plotHeight);ctx.restore()}function drawGrid(){var i,axes,bw,bc;ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var markings=options.grid.markings;if(markings){if($.isFunction(markings)){axes=plot.getAxes();axes.xmin=axes.xaxis.min;axes.xmax=axes.xaxis.max;axes.ymin=axes.yaxis.min;axes.ymax=axes.yaxis.max;markings=markings(axes)}for(i=0;ixrange.axis.max||yrange.toyrange.axis.max)continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max); +yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);if(xrange.from==xrange.to&&yrange.from==yrange.to)continue;xrange.from=xrange.axis.p2c(xrange.from);xrange.to=xrange.axis.p2c(xrange.to);yrange.from=yrange.axis.p2c(yrange.from);yrange.to=yrange.axis.p2c(yrange.to);if(xrange.from==xrange.to||yrange.from==yrange.to){ctx.beginPath();ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.lineWidth=m.lineWidth||options.grid.markingsLineWidth;ctx.moveTo(xrange.from,yrange.from);ctx.lineTo(xrange.to,yrange.to);ctx.stroke()}else{ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to)}}}axes=allAxes();bw=options.grid.borderWidth;for(var j=0;jaxis.max||t=="full"&&(typeof bw=="object"&&bw[axis.position]>0||bw>0)&&(v==axis.min||v==axis.max))continue;if(axis.direction=="x"){x=axis.p2c(v);yoff=t=="full"?-plotHeight:t;if(axis.position=="top")yoff=-yoff}else{y=axis.p2c(v);xoff=t=="full"?-plotWidth:t;if(axis.position=="left")xoff=-xoff}if(ctx.lineWidth==1){if(axis.direction=="x")x=Math.floor(x)+.5;else y=Math.floor(y)+.5}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff)}ctx.stroke()}if(bw){bc=options.grid.borderColor;if(typeof bw=="object"||typeof bc=="object"){if(typeof bw!=="object"){bw={top:bw,right:bw,bottom:bw,left:bw}}if(typeof bc!=="object"){bc={top:bc,right:bc,bottom:bc,left:bc}}if(bw.top>0){ctx.strokeStyle=bc.top;ctx.lineWidth=bw.top;ctx.beginPath();ctx.moveTo(0-bw.left,0-bw.top/2);ctx.lineTo(plotWidth,0-bw.top/2);ctx.stroke()}if(bw.right>0){ctx.strokeStyle=bc.right;ctx.lineWidth=bw.right;ctx.beginPath();ctx.moveTo(plotWidth+bw.right/2,0-bw.top);ctx.lineTo(plotWidth+bw.right/2,plotHeight);ctx.stroke()}if(bw.bottom>0){ctx.strokeStyle=bc.bottom;ctx.lineWidth=bw.bottom;ctx.beginPath();ctx.moveTo(plotWidth+bw.right,plotHeight+bw.bottom/2);ctx.lineTo(0,plotHeight+bw.bottom/2);ctx.stroke()}if(bw.left>0){ctx.strokeStyle=bc.left;ctx.lineWidth=bw.left;ctx.beginPath();ctx.moveTo(0-bw.left/2,plotHeight+bw.bottom);ctx.lineTo(0-bw.left/2,0);ctx.stroke()}}else{ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw)}}ctx.restore()}function drawAxisLabels(){$.each(allAxes(),function(_,axis){var box=axis.box,legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=axis.options.font||"flot-tick-label tickLabel",tick,x,y,halign,valign;surface.removeText(layer);if(!axis.show||axis.ticks.length==0)return;for(var i=0;iaxis.max)continue;if(axis.direction=="x"){halign="center";x=plotOffset.left+axis.p2c(tick.v);if(axis.position=="bottom"){y=box.top+box.padding}else{y=box.top+box.height-box.padding;valign="bottom"}}else{valign="middle";y=plotOffset.top+axis.p2c(tick.v);if(axis.position=="left"){x=box.left+box.width-box.padding;halign="right"}else{x=box.left+box.padding}}surface.addText(layer,x,y,tick.label,font,null,null,halign,valign)}})}function drawSeries(series){if(series.lines.show)drawSeriesLines(series);if(series.bars.show)drawSeriesBars(series);if(series.points.show)drawSeriesPoints(series)}function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i=y2&&y1>axisy.max){if(y2>axisy.max)continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max}else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max)continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max}if(x1<=x2&&x1=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max}if(x1!=prevx||y1!=prevy)ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset);prevx=x2;prevy=y2;ctx.lineTo(axisx.p2c(x2)+xoffset,axisy.p2c(y2)+yoffset)}ctx.stroke()}function plotLineArea(datapoints,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,bottom=Math.min(Math.max(0,axisy.min),axisy.max),i=0,top,areaOpen=false,ypos=1,segmentStart=0,segmentEnd=0;while(true){if(ps>0&&i>points.length+ps)break;i+=ps;var x1=points[i-ps],y1=points[i-ps+ypos],x2=points[i],y2=points[i+ypos];if(areaOpen){if(ps>0&&x1!=null&&x2==null){segmentEnd=i;ps=-ps;ypos=2;continue}if(ps<0&&i==segmentStart+ps){ctx.fill();areaOpen=false;ps=-ps;ypos=1;i=segmentStart=segmentEnd+ps;continue}}if(x1==null||x2==null)continue;if(x1<=x2&&x1=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max}if(!areaOpen){ctx.beginPath();ctx.moveTo(axisx.p2c(x1),axisy.p2c(bottom));areaOpen=true}if(y1>=axisy.max&&y2>=axisy.max){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.max));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.max));continue}else if(y1<=axisy.min&&y2<=axisy.min){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.min));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.min));continue}var x1old=x1,x2old=x2;if(y1<=y2&&y1=axisy.min){x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min}else if(y2<=y1&&y2=axisy.min){x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min}if(y1>=y2&&y1>axisy.max&&y2<=axisy.max){x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max}else if(y2>=y1&&y2>axisy.max&&y1<=axisy.max){x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max}if(x1!=x1old){ctx.lineTo(axisx.p2c(x1old),axisy.p2c(y1))}ctx.lineTo(axisx.p2c(x1),axisy.p2c(y1));ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));if(x2!=x2old){ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));ctx.lineTo(axisx.p2c(x2old),axisy.p2c(y2))}}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.lineJoin="round";var lw=series.lines.lineWidth,sw=series.shadowSize;if(lw>0&&sw>0){ctx.lineWidth=sw;ctx.strokeStyle="rgba(0,0,0,0.1)";var angle=Math.PI/18;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/2),Math.cos(angle)*(lw/2+sw/2),series.xaxis,series.yaxis);ctx.lineWidth=sw/2;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/4),Math.cos(angle)*(lw/2+sw/4),series.xaxis,series.yaxis)}ctx.lineWidth=lw;ctx.strokeStyle=series.color;var fillStyle=getFillStyle(series.lines,series.color,0,plotHeight);if(fillStyle){ctx.fillStyle=fillStyle;plotLineArea(series.datapoints,series.xaxis,series.yaxis)}if(lw>0)plotLine(series.datapoints,0,0,series.xaxis,series.yaxis);ctx.restore()}function drawSeriesPoints(series){function plotPoints(datapoints,radius,fillStyle,offset,shadow,axisx,axisy,symbol){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;iaxisx.max||yaxisy.max)continue;ctx.beginPath();x=axisx.p2c(x);y=axisy.p2c(y)+offset;if(symbol=="circle")ctx.arc(x,y,radius,0,shadow?Math.PI:Math.PI*2,false);else symbol(ctx,x,y,radius,shadow);ctx.closePath();if(fillStyle){ctx.fillStyle=fillStyle;ctx.fill()}ctx.stroke()}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var lw=series.points.lineWidth,sw=series.shadowSize,radius=series.points.radius,symbol=series.points.symbol;if(lw==0)lw=1e-4;if(lw>0&&sw>0){var w=sw/2;ctx.lineWidth=w;ctx.strokeStyle="rgba(0,0,0,0.1)";plotPoints(series.datapoints,radius,null,w+w/2,true,series.xaxis,series.yaxis,symbol);ctx.strokeStyle="rgba(0,0,0,0.2)";plotPoints(series.datapoints,radius,null,w/2,true,series.xaxis,series.yaxis,symbol)}ctx.lineWidth=lw;ctx.strokeStyle=series.color;plotPoints(series.datapoints,radius,getFillStyle(series.points,series.color),0,false,series.xaxis,series.yaxis,symbol);ctx.restore()}function drawBar(x,y,b,barLeft,barRight,fillStyleCallback,axisx,axisy,c,horizontal,lineWidth){var left,right,bottom,top,drawLeft,drawRight,drawTop,drawBottom,tmp;if(horizontal){drawBottom=drawRight=drawTop=true;drawLeft=false;left=b;right=x;top=y+barLeft;bottom=y+barRight;if(rightaxisx.max||topaxisy.max)return;if(leftaxisx.max){right=axisx.max;drawRight=false}if(bottomaxisy.max){top=axisy.max;drawTop=false}left=axisx.p2c(left);bottom=axisy.p2c(bottom);right=axisx.p2c(right);top=axisy.p2c(top);if(fillStyleCallback){c.fillStyle=fillStyleCallback(bottom,top);c.fillRect(left,top,right-left,bottom-top)}if(lineWidth>0&&(drawLeft||drawRight||drawTop||drawBottom)){c.beginPath();c.moveTo(left,bottom);if(drawLeft)c.lineTo(left,top);else c.moveTo(left,top);if(drawTop)c.lineTo(right,top);else c.moveTo(right,top);if(drawRight)c.lineTo(right,bottom);else c.moveTo(right,bottom);if(drawBottom)c.lineTo(left,bottom);else c.moveTo(left,bottom);c.stroke()}}function drawSeriesBars(series){function plotBars(datapoints,barLeft,barRight,fillStyleCallback,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;i");fragments.push("");rowStarted=true}fragments.push('
'+''+entry.label+"")}if(rowStarted)fragments.push("");if(fragments.length==0)return;var table=''+fragments.join("")+"
";if(options.legend.container!=null)$(options.legend.container).html(table);else{var pos="",p=options.legend.position,m=options.legend.margin;if(m[0]==null)m=[m,m];if(p.charAt(0)=="n")pos+="top:"+(m[1]+plotOffset.top)+"px;";else if(p.charAt(0)=="s")pos+="bottom:"+(m[1]+plotOffset.bottom)+"px;";if(p.charAt(1)=="e")pos+="right:"+(m[0]+plotOffset.right)+"px;";else if(p.charAt(1)=="w")pos+="left:"+(m[0]+plotOffset.left)+"px;";var legend=$('
'+table.replace('style="','style="position:absolute;'+pos+";")+"
").appendTo(placeholder);if(options.legend.backgroundOpacity!=0){var c=options.legend.backgroundColor;if(c==null){c=options.grid.backgroundColor;if(c&&typeof c=="string")c=$.color.parse(c);else c=$.color.extract(legend,"background-color");c.a=1;c=c.toString()}var div=legend.children();$('
').prependTo(legend).css("opacity",options.legend.backgroundOpacity)}}}var highlights=[],redrawTimeout=null;function findNearbyItem(mouseX,mouseY,seriesFilter){var maxDistance=options.grid.mouseActiveRadius,smallestDistance=maxDistance*maxDistance+1,item=null,foundPoint=false,i,j,ps;for(i=series.length-1;i>=0;--i){if(!seriesFilter(series[i]))continue;var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,mx=axisx.c2p(mouseX),my=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;ps=s.datapoints.pointsize;if(axisx.options.inverseTransform)maxx=Number.MAX_VALUE;if(axisy.options.inverseTransform)maxy=Number.MAX_VALUE;if(s.lines.show||s.points.show){for(j=0;jmaxx||x-mx<-maxx||y-my>maxy||y-my<-maxy)continue;var dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy;if(dist=Math.min(b,x)&&my>=y+barLeft&&my<=y+barRight:mx>=x+barLeft&&mx<=x+barRight&&my>=Math.min(b,y)&&my<=Math.max(b,y))item=[i,j/ps]}}}if(item){i=item[0];j=item[1];ps=series[i].datapoints.pointsize;return{datapoint:series[i].datapoints.points.slice(j*ps,(j+1)*ps),dataIndex:j,series:series[i],seriesIndex:i}}return null}function onMouseMove(e){if(options.grid.hoverable)triggerClickHoverEvent("plothover",e,function(s){return s["hoverable"]!=false})}function onMouseLeave(e){if(options.grid.hoverable)triggerClickHoverEvent("plothover",e,function(s){return false})}function onClick(e){triggerClickHoverEvent("plotclick",e,function(s){return s["clickable"]!=false})}function triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top,pos=canvasToAxisCoords({left:canvasX,top:canvasY});pos.pageX=event.pageX;pos.pageY=event.pageY;var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item){item.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left,10);item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top,10)}if(options.grid.autoHighlight){for(var i=0;iaxisx.max||yaxisy.max)return;var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius;octx.strokeStyle=highlightColor;var radius=1.5*pointRadius;x=axisx.p2c(x);y=axisy.p2c(y);octx.beginPath();if(series.points.symbol=="circle")octx.arc(x,y,radius,0,2*Math.PI,false);else series.points.symbol(octx,x,y,radius,false);octx.closePath();octx.stroke()}function drawBarHighlight(series,point){var highlightColor=typeof series.highlightColor==="string"?series.highlightColor:$.color.parse(series.color).scale("a",.5).toString(),fillStyle=highlightColor,barLeft;switch(series.bars.align){case"left":barLeft=0;break;case"right":barLeft=-series.bars.barWidth;break;default:barLeft=-series.bars.barWidth/2}octx.lineWidth=series.bars.lineWidth;octx.strokeStyle=highlightColor;drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,function(){return fillStyle},series.xaxis,series.yaxis,octx,series.bars.horizontal,series.bars.lineWidth)}function getColorOrGradient(spec,bottom,top,defaultColor){if(typeof spec=="string")return spec;else{var gradient=ctx.createLinearGradient(0,top,0,bottom);for(var i=0,l=spec.colors.length;i=0;n--){var o=$(r[n]);if(o[0]==t||o.is(":visible")){var h=o.width(),d=o.height(),v=o.data(a);!v||h===v.w&&d===v.h?i[f]=i[l]:(i[f]=i[c],o.trigger(u,[v.w=h,v.h=d]))}else v=o.data(a),v.w=0,v.h=0}s!==null&&(s=t.requestAnimationFrame(p))}var r=[],i=$.resize=$.extend($.resize,{}),s,o="setTimeout",u="resize",a=u+"-special-event",f="delay",l="pendingDelay",c="activeDelay",h="throttleWindow";i[l]=250,i[c]=20,i[f]=i[l],i[h]=!0,$.event.special[u]={setup:function(){if(!i[h]&&this[o])return!1;var t=$(this);r.push(this),t.data(a,{w:t.width(),h:t.height()}),r.length===1&&(s=n,p())},teardown:function(){if(!i[h]&&this[o])return!1;var t=$(this);for(var n=r.length-1;n>=0;n--)if(r[n]==this){r.splice(n,1);break}t.removeData(a),r.length||(cancelAnimationFrame(s),s=null)},add:function(t){function s(t,i,s){var o=$(this),u=o.data(a);u.w=i!==n?i:o.width(),u.h=s!==n?s:o.height(),r.apply(this,arguments)}if(!i[h]&&this[o])return!1;var r;if($.isFunction(t))return r=t,s;r=t.handler,t.handler=s}},t.requestAnimationFrame||(t.requestAnimationFrame=function(){return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e,n){return t.setTimeout(e,i[f])}}()),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(){return t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout}())})(jQuery,this);(function($){var options={};function init(plot){function onResize(){var placeholder=plot.getPlaceholder();if(placeholder.width()==0||placeholder.height()==0)return;plot.resize();plot.setupGrid();plot.draw()}function bindEvents(plot,eventHolder){plot.getPlaceholder().resize(onResize)}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}plot.hooks.bindEvents.push(bindEvents);plot.hooks.shutdown.push(shutdown)}$.plot.plugins.push({init:init,options:options,name:"resize",version:"1.0"})})(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit-item.js b/js/sam-admin-edit-item.js new file mode 100644 index 0000000..dac6aaf --- /dev/null +++ b/js/sam-admin-edit-item.js @@ -0,0 +1,872 @@ +/** + * Created by minimus on 17.11.13. + */ +var sam = sam || {}; +(function ($) { + var media, mediaTexts = samEditorOptions.media; + + sam.media = media = { + buttonId: '#banner-media', + adUrl: '#ad_img', + adImgId: '#ad_img_id', + adName: '#title', + adDesc: '#item_description', + adAlt: '#ad_alt', + + init: function() { + $(this.buttonId).on( 'click', this.openMediaDialog ); + }, + + openMediaDialog: function( e ) { + e.preventDefault(); + + if ( this._frame ) { + this._frame.open(); + return; + } + + var Attachment = wp.media.model.Attachment; + + this._frame = media.frame = wp.media({ + title: mediaTexts.title, + button: { + text: mediaTexts.button + }, + multiple: false, + library: { + type: 'image' + }/*, + selection: [ Attachment.get( $(this.adImgId).val() ) ]*/ + }); + + this._frame.on('ready', function() { + // + }); + + this._frame.state( 'library' ).on('select', function() { + var attachment = this.get( 'selection' ).single(); + media.handleMediaAttachment( attachment ); + }); + + this._frame.open(); + }, + + handleMediaAttachment: function(a) { + var attechment = a.toJSON(); + $(this.adUrl).val(attechment.url); + $(this.adImgId).val(attechment.id); + if('' == $(this.adName).val() && '' != attechment.title) $(this.adName).val(attechment.title); + if('' == $(this.adDesc).val() && '' != attechment.caption) $(this.adDesc).val(attechment.caption); + if('' == $(this.adAlt).val() && '' != attechment.alt) $(this.adAlt).val(attechment.alt); + } + }; + + $(document).ready(function () { + var em = $('#editor_mode').val(), options, fu, title = $('#title'); + + var + rcvt0 = $('#rc-vt0'), rcvt2 = $('#rc-vt2'), xId = $('#x_id'), rcxid = $('#rc-xid'), + adCats = $('#ad_cats'), rcac = $('#rc-ac'), acw = $('#acw'), xCats = $('#x_cats'), rcxc = $('#rc-xc'), + actt = $('#ad_custom_tax_terms'), rcctt = $('#rc-ctt'), cttw = $('#cttw'), xacct = $('#x_ad_custom_tax_terms'), rcxct = $('#rc-xct'), + adAuth = $('#ad_authors'), rcau = $('#rc-au'), aaw = $('#aaw'), xAuth = $('#x_authors'), rcxa = $('#rc-xa'), + adTags = $('#ad_tags'), rcat = $('#rc-at'), atw = $('#atw'), xTags = $('#x_tags'), rcxt = $('#rc-xt'), + adCust = $('#ad_custom'), rccu = $('#rc-cu'), cuw = $('#cuw'), xCust = $('#x_custom'), rcxu = $('#rc-xu'), + xViewUsers = $('#x-view-users'), custUsers = $('#custom-users'), rccmf = $("#rc-cmf"), rccmt = $("#rc-cmt"), + + adUsersReg = $("#ad_users_reg"), xRegUsers = $('#x-reg-users'), xAdUsers = $('#x_ad_users'), + + btnUpload = $("#upload-file-button"), status = $("#uploading"), srcHelp = $("#uploading-help"), + loadImg = $('#load_img'), sPointer, + + cttGrid = $('#ctt-grid'), cttIn = $('#view_custom_tax_terms'), + xcttGrid = $('#x-ctt-grid'), xcttIn = $('#x_view_custom_tax_terms'), + postsGrid = $('#posts-grid'), postsIn = $('#view_id'), + usersGrid = $('#users-grid'), usersIn = $('#x_view_users'), + xpostsGrid = $('#x-posts-grid'), xpostsIn = $('#x_view_id'), + catsGrid = $('#cats-grid'), catsIn = $('#view_cats'), + xcatsGrid = $('#x-cats-grid'), xcatsIn = $('#x_view_cats'), + authGrid = $('#auth-grid'), authIn = $('#view_authors'), + xauthGrid = $('#x-auth-grid'), xauthIn = $('#x_view_authors'), + tagsGrid = $('#tags-grid'), tagsIn = $('#view_tags'), + xtagsGrid = $('#x-tags-grid'), xtagsIn = $('#x_view_tags'), + custGrid = $('#cust-grid'), custIn = $('#view_custom'), + xcustGrid = $('#x-cust-grid'), xcustIn = $('#x_view_custom'); + + var + //samUploader, mediaTexts = samEditorOptions.media, + samAjaxUrl = samEditorOptions.samAjaxUrl, + samStatsUrl = samEditorOptions.samStatsUrl, + models = samEditorOptions.models, + gData = samEditorOptions.data, + samStrs = samEditorOptions.strings, + sPost = encodeURI(samStrs.posts), sPage = encodeURI(samStrs.page); + + var stats, statsData, itemId = $('#item_id').val(), sMonth = 0; + + function buildLGrid(name, grid, vi, field, gc, url) { + var iVal = vi.val(); + grid.w2grid({ + name: name, + show: {selectColumn: true}, + multiSelect: true, + columns: gc, + url: url, + onSelect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + }, + onUnselect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + }, + onLoad: function(event) { + event.onComplete = function() { + if(null != iVal && '' != iVal) { + var arr = iVal.split(','); + + $.each(arr, function(i, val) { + $.each(w2ui[name].records, function(index, value) { + var iData = (field == 'id') ? value.id : value.slug; + if(iData == val) { + w2ui[name].select(value.recid); + return false; + } + else return true; + }); + }); + } + } + } + }); + } + + function buildGrid(name, grid, vi, field, gc, gr) { + //grid = $('#' + name); + //vi = $('#' + vn); + var iVal = vi.val(); + grid.w2grid({ + name: name, + show: {selectColumn: true}, + multiSelect: true, + columns: gc, + records: gr, + onSelect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + }, + onUnselect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + } + }); + + if(null != iVal && '' != iVal) { + var arr = iVal.split(','); + + $.each(arr, function(i, val) { + $.each(gr, function(index, value) { + var iData = (field == 'id') ? value.id : value.slug; + if(iData == val) { + w2ui[name].select(value.recid); + return false; + } + else return true; + }); + }); + } + } + + title.tooltip({ + track: true + }); + $('#image_tools').tabs(); + + media.init(); + + stats = $.post(samStatsUrl, { + action: 'load_item_stats', + id: itemId, + sm: sMonth + }).done(function(data) { + var + hits = {label: samStrs.labels.hits, data: data.hits}, + clicks = {label: samStrs.labels.clicks, data: data.clicks}; + statsData = [hits, clicks]; + $('#total_hits').text(data.total.hits); + $('#total_clicks').text(data.total.clicks); + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + }); + + fu = new AjaxUpload(btnUpload, { + action:ajaxurl, + name:'uploadfile', + data:{ + action:'upload_ad_image' + }, + onSubmit:function (file, ext) { + if (!(ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext))) { + status.text(samStrs.status); + return false; + } + loadImg.show(); + status.text(samStrs.uploading); + return false; + }, + onComplete:function (file, response) { + status.text(''); + loadImg.hide(); + $('
').appendTo(srcHelp); + if (response == "success") { + $("#files").text(samStrs.file + ' ' + file + ' ' + samStrs.uploaded) + .addClass('updated') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + if (em == 'item') $("#ad_img").val(samStrs.url + file); + else if (em == 'place') $("#patch_img").val(samStrs.url + file); + } + else { + $('#files').text(file + ' ' + response) + .addClass('error') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + } + } + }); + + // Advertiser ComboGrid + $('#adv_nick').combogrid({ + url: samAjaxUrl + '?action=load_combo_data', + datatype: "json", + munit: 'px', + alternate: true, + colModel: models.comboGrid, + select: function(event, ui) { + $('#adv_nick').val(ui.item.slug); + $('#adv_name').val(ui.item.title); + $('#adv_mail').val(ui.item.email); + return false; + } + }); + + $("#add-file-button").click(function () { + var curFile = samStrs.url + $("select#files_list option:selected").val(); + $("#ad_img").val(curFile); + return false; + }); + + buildGrid('ctt-grid', cttGrid, cttIn, 'slug', models.customTaxes, gData.cTax); + buildGrid('x-ctt-grid', xcttGrid, xcttIn, 'slug', models.customTaxes, gData.cTax); + buildGrid('cust-grid', custGrid, custIn, 'slug', models.customs, gData.customs); + buildGrid('x-cust-grid', xcustGrid, xcustIn, 'slug', models.customs, gData.customs); + + var + postAjax = + samAjaxUrl + + '?action=load_posts&cstr=' + samEditorOptions.data.custList + + '&sp=' + sPost + '&spg=' + sPage; + buildLGrid('posts-grid', postsGrid, postsIn, 'id', models.posts, postAjax); + buildLGrid('x-posts-grid', xpostsGrid, xpostsIn, 'id', models.posts, postAjax); + + $('#tabs').tabs({ + activate: function( event, ui ) { + var el = ui.newPanel[0].id; + if(el == 'tabs-1') { + if(w2ui['posts-grid']) postsGrid.w2render('posts-grid'); + } + if(el == 'tabs-2') { + if(rcctt.is(':visible') && w2ui['ctt-grid']) cttGrid.w2render('ctt-grid'); + if(rcxct.is(':visible') && w2ui['x-ctt-grid']) xcttGrid.w2render('x-ctt-grid'); + if(rcxid.is(':visible') && w2ui['x-posts-grid']) xpostsGrid.w2render('x-posts-grid'); + if(rcac.is(':visible') && w2ui['cats-grid']) catsGrid.w2render('cats-grid'); + if(rcxc.is(':visible') && w2ui['x-cats-grid']) xcatsGrid.w2render('x-cats-grid'); + if(rcau.is(':visible') && w2ui['auth-grid']) authGrid.w2render('auth-grid'); + if(rcxa.is(':visible') && w2ui['x-auth-grid']) xauthGrid.w2render('x-auth-grid'); + if(rcat.is(':visible') && w2ui['tags-grid']) tagsGrid.w2render('tags-grid'); + if(rcxt.is(':visible') && w2ui['x-tags-grid']) xtagsGrid.w2render('x-tags-grid'); + if(rccu.is(':visible') && w2ui['cust-grid']) custGrid.w2render('cust-grid'); + if(rcxu.is(':visible') && w2ui['xcust-grid']) xcustGrid.w2render('x-cust-grid'); + } + if(el == 'tabs-3') + if(xViewUsers.is(':visible') && w2ui['users-grid']) usersGrid.w2render('users-grid'); + if(el == 'tabs-5') + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + } + }); + + $('#code_mode_false').click(function () { + rccmf.show('blind', {direction:'vertical'}, 500); + rccmt.hide('blind', {direction:'vertical'}, 500); + }); + + $('#code_mode_true').click(function () { + rccmf.hide('blind', {direction:'vertical'}, 500); + rccmt.show('blind', {direction:'vertical'}, 500); + }); + + if(2 == $('input:radio[name=view_type]:checked').val()) { + if(xId.is(':checked')) { + xId.attr('checked', false); + rcxid.hide('blind', {direction:'vertical'}, 500); + } + xId.attr('disabled', true); + } + + $("input:radio[name=view_type]").click(function () { + var cval = $('input:radio[name=view_type]:checked').val(); + switch (cval) { + case '0': + if (rcvt0.is(':hidden')) rcvt0.show('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':visible')) rcvt2.hide('blind', {direction:'vertical'}, 500); + xId.attr('disabled', false); + break; + case '1': + if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':visible')) rcvt2.hide('blind', {direction:'vertical'}, 500); + xId.attr('disabled', false); + break; + case '2': + if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':hidden')) { + rcvt2.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['posts-grid']) postsGrid.w2render('posts-grid'); + }); + if(xId.is(':checked')) { + xId.attr('checked', false); + rcxid.hide('blind', {direction:'vertical'}, 500); + } + } + xId.attr('disabled', true); + break; + } + }); + + var authRequest = $.ajax({ + url:samAjaxUrl, + data: { + action: 'load_authors', + level: 3 + }, + type: 'POST' + }), authData; + + authRequest.done(function(data) { + authData = data; + buildGrid('auth-grid', authGrid, authIn, 'slug', models.authors, authData); + buildGrid('x-auth-grid', xauthGrid, xauthIn, 'slug', models.authors, authData); + }); + + var usersRequest = $.ajax({ + url: samAjaxUrl, + data: { + action: 'load_users', + subscriber: encodeURI(samStrs.subscriber), + contributor: encodeURI(samStrs.contributor), + author: encodeURI(samStrs.author), + editor: encodeURI(samStrs.editor), + admin: encodeURI(samStrs.admin), + sadmin: encodeURI(samStrs.superAdmin) + }, + type: 'POST' + }), usersData; + + usersRequest.done(function(data) { + usersData = data; + buildGrid('users-grid', usersGrid, usersIn, 'slug', models.users, usersData); + }); + + var catsRequest = $.ajax({ + url: samAjaxUrl, + data: { + action: 'load_cats', + level: 3 + }, + type: 'POST' + }), catsData; + + catsRequest.done(function(data) { + catsData = data; + buildGrid('cats-grid', catsGrid, catsIn, 'slug', models.cats, catsData); + buildGrid('x-cats-grid', xcatsGrid, xcatsIn, 'slug', models.cats, catsData); + }); + + var tagsRequest = $.ajax({ + url: samAjaxUrl, + data: { + action: 'load_tags', + level: 3 + }, + type: 'POST' + }), tagsData; + + tagsRequest.done(function(data) { + tagsData = data; + buildGrid('tags-grid', tagsGrid, tagsIn, 'slug', models.tags, tagsData); + buildGrid('x-tags-grid', xtagsGrid, xtagsIn, 'slug', models.tags, tagsData); + }); + + xId.click(function () { + if (xId.is(':checked')) { + if(2 == $('input:radio[name=view_type]:checked').val()) { + xId.attr('checked', false); + } + else + rcxid.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['x-posts-grid']) xpostsGrid.w2render('x-posts-grid'); + }); + } + else rcxid.hide('blind', {direction:'vertical'}, 500); + }); + + $("input:radio[name=ad_users]").click(function() { + var uval = $('input:radio[name=ad_users]:checked').val(); + if(uval == '0') { + if(custUsers.is(':visible')) custUsers.hide('blind', {direction:'vertical'}, 500); + } + else { + if(custUsers.is(':hidden')) + custUsers.show('blind', {direction:'vertical'}, 500, function() { + if(xViewUsers.is(':visible') && w2ui['users-grid']) usersGrid.w2render('users-grid'); + }); + } + }); + + adUsersReg.click(function() { + if(adUsersReg.is(':checked')) + xRegUsers.show('blind', {direction:'vertical'}, 500, function() { + if(xViewUsers.is(':visible') && w2ui['users-grid']) usersGrid.w2render('users-grid'); + }); + else xRegUsers.hide('blind', {direction:'vertical'}, 500); + }); + + xAdUsers.click(function() { + if(xAdUsers.is(':checked')) + xViewUsers.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['users-grid']) usersGrid.w2render('users-grid'); + }); + else xViewUsers.hide('blind', {direction:'vertical'}, 500); + }); + + $('#ad_swf').click(function() { + if($('#ad_swf').is(':checked')) $('#swf-params').show('blind', {direction:'vertical'}, 500); + else $('#swf-params').hide('blind', {direction:'vertical'}, 500); + }); + + if(adCats.is(':checked') && xCats.is(':checked')) { + xCats.attr('checked', false); + rcxc.hide('blind', {direction:'vertical'}, 500); + } + + adCats.click(function () { + if (adCats.is(':checked')) { + rcac.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['cats-grid']) catsGrid.w2render('cats-grid'); + }); + acw.show('blind', {direction:'vertical'}, 500); + if(xCats.is(':checked')) { + xCats.attr('checked', false); + rcxc.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcac.hide('blind', {direction:'vertical'}, 500); + acw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xCats.click(function () { + if (xCats.is(':checked')) { + rcxc.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['x-cats-grid']) xcatsGrid.w2render('x-cats-grid'); + }); + if(adCats.is(':checked')) { + adCats.attr('checked', false); + rcac.hide('blind', {direction:'vertical'}, 500); + acw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxc.hide('blind', {direction:'vertical'}, 500); + }); + + if(actt.is(':checked') && xacct.is(':checked')) { + xacct.attr('checked', false); + rcxct.hide('blind', {direction:'vertical'}, 500); + } + + actt.click(function() { + if(actt.is(':checked')) { + rcctt.show('blind', {direction: 'vertical'}, 500, function() { + if(w2ui['ctt-grid']) cttGrid.w2render('ctt-grid'); + }); + cttw.show('blind', {direction:'vertical'}, 500); + if(xacct.is(':checked')) { + xacct.attr('checked', false); + rcxct.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcctt.hide('blind', {direction:'vertical'}, 500); + cttw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xacct.click(function() { + if(xacct.is(':checked')) { + rcxct.show('blind', {direction: 'vertical'}, 500, function() { + if(w2ui['x-ctt-grid']) xcttGrid.w2render('x-ctt-grid'); + }); + if(actt.is(':checked')) { + actt.attr('checked', false); + rcctt.hide('blind', {direction:'vertical'}, 500); + cttw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxct.hide('blind', {direction: 'vertical'}, 500); + }); + + if(adAuth.is(':checked') && xAuth.is(':checked')) { + xAuth.attr('checked', false); + rcxa.hide('blind', {direction:'vertical'}, 500); + } + + adAuth.click(function () { + if (adAuth.is(':checked')) { + rcau.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['auth-grid']) authGrid.w2render('auth-grid'); + }); + aaw.show('blind', {direction:'vertical'}, 500); + if(xAuth.is(':checked')) { + xAuth.attr('checked', false); + rcxa.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcau.hide('blind', {direction:'vertical'}, 500); + aaw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xAuth.click(function () { + if (xAuth.is(':checked')) { + rcxa.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['x-auth-grid']) xauthGrid.w2render('x-auth-grid'); + }); + if(adAuth.is(':checked')) { + adAuth.attr('checked', false); + rcau.hide('blind', {direction:'vertical'}, 500); + aaw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxa.hide('blind', {direction:'vertical'}, 500); + }); + + if(adTags.is(':checked') && xTags.is(':checked')) { + xTags.attr('checked', false); + rcxt.hide('blind', {direction:'vertical'}, 500); + } + + adTags.click(function () { + if (adTags.is(':checked')) { + rcat.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['tags-grid']) tagsGrid.w2render('tags-grid'); + }); + atw.show('blind', {direction:'vertical'}, 500); + if(xTags.is(':checked')) { + xTags.attr('checked', false); + rcxt.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcat.hide('blind', {direction:'vertical'}, 500); + atw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xTags.click(function () { + if (xTags.is(':checked')) { + rcxt.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['x-tags-grid']) xtagsGrid.w2render('x-tags-grid'); + }); + if(adTags.is(':checked')) { + adTags.attr('checked', false); + rcat.hide('blind', {direction:'vertical'}, 500); + atw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxt.hide('blind', {direction:'vertical'}, 500); + }); + + if(adCust.is(':checked') && xCust.is(':checked')) { + xCust.attr('checked', false); + rcxu.hide('blind', {direction:'vertical'}, 500); + } + + adCust.click(function () { + if (adCust.is(':checked')) { + rccu.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['cust-grid']) custGrid.w2render('cust-grid'); + }); + cuw.show('blind', {direction:'vertical'}, 500); + if(xCust.is(':checked')) { + xCust.attr('checked', false); + rcxu.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rccu.hide('blind', {direction:'vertical'}, 500); + cuw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xCust.click(function () { + if (xCust.is(':checked')) { + rcxu.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['x-cust-grid']) xcustGrid.w2render('x-cust-grid'); + }); + if(adCust.is(':checked')) { + adCust.attr('checked', false); + rccu.hide('blind', {direction:'vertical'}, 500); + cuw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxu.hide('blind', {direction:'vertical'}, 500); + }); + + $("#ad_start_date, #ad_end_date").datepicker({ + dateFormat:'yy-mm-dd', + showButtonPanel:true + }); + + /*var + samAttachment = wp.media.model.Attachment, + adImgId = $('#ad_img_id'); + + $('#banner-media').click(function(e) { + e.preventDefault(); + + if(samUploader) { + samUploader.open(); + return; + } + + samUploader = wp.media.frames.samBanner = wp.media({ + title: mediaTexts.title, + button: {text: mediaTexts.button}, + library: {type: 'image'}, + multiple: false, + selection: [samAttachment.get( adImgId.val() )] + }); + + samUploader.on('select', function() { + var + adImg = $('#ad_img'), + adName = $('#title'), + adDesc = $('#item_description'), + adAlt = $('#ad_alt'); + + var attachment = samUploader.state().get('selection').first().toJSON(); + adImg.val(attachment.url); // alt, caption, title, description + adImgId.val(attachment.id); + if('' == adName.val() && '' != attachment.caption) adName.val(attachment.caption); + if('' == adDesc.val() && '' != attachment.description) adDesc.val(attachment.description); + if('' == adAlt.val() && '' != attachment.alt) adAlt.val(attachment.alt); + }); + + samUploader.open(); + });*/ + + $('#ad_schedule').click(function () { + if ($('#ad_schedule').is(':checked')) $('#rc-sc').show('blind', {direction:'vertical'}, 500); + else $('#rc-sc').hide('blind', {direction:'vertical'}, 500); + }); + + $('#limit_hits').click(function () { + if ($('#limit_hits').is(':checked')) $('#rc-hl').show('blind', {direction:'vertical'}, 500); + else $('#rc-hl').hide('blind', {direction:'vertical'}, 500); + }); + + $('#limit_clicks').click(function () { + if ($('#limit_clicks').is(':checked')) $('#rc-cl').show('blind', {direction:'vertical'}, 500); + else $('#rc-cl').hide('blind', {direction:'vertical'}, 500); + }); + + sPointer = samEditorOptions.ads; + sPointer.pointer = 'ads'; + + if(sPointer.enabled || '' == title.val()) { + title.pointer({ + content: '

' + sPointer.title + '

' + sPointer.content + '

', + position: 'top', + close: function() { + $.ajax({ + url: ajaxurl, + data: { + action: 'close_pointer', + pointer: sPointer.pointer + }, + async: true + }); + } + }).pointer('open'); + } + + var + isSing = $('#is_singular'), isSingle = $('#is_single'), isPage = $('#is_page'), isAttach = $('#is_attachment'), isPostType = $('#is_posttype'); + + isSing.click(function () { + if (isSing.is(':checked')) + $('#is_single, #is_page, #is_attachment, #is_posttype').attr('checked', true); + }); + + $('#is_single, #is_page, #is_attachment, #is_posttype').click(function () { + if (isSing.is(':checked') && + (!isSingle.is(':checked') || + !isPage.is(':checked') || + !isAttach.is(':checked') || + !isPostType.is(':checked') )) { + isSing.attr('checked', false); + } + else { + if (!isSing.is(':checked') && + isSingle.is(':checked') && + isPostType.is(':checked') && + isPage.is(':checked') && + isAttach.is(':checked')) + isSing.attr('checked', true); + } + }); + + var + isArc = $('#is_archive'), isTax = $('#is_tax'), isCat = $('#is_category'), isTag = $('#is_tag'), + isAuthor = $('#is_author'), isDate = $('#is_date'), isPostTypeArc = $('#is_posttype_archive'), + archives = $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive'); + + isArc.click(function () { + if (isArc.is(':checked')) archives.attr('checked', true); + }); + + archives.click(function () { + if (isArc.is(':checked') && + (!isTax.is(':checked') || + !isCat.is(':checked') || + !isPostTypeArc.is(':checked') || + !isTag.is(':checked') || + !isAuthor.is(':checked') || + !isDate.is(':checked'))) { + isArc.attr('checked', false); + } + else { + if (!isArc.is(':checked') && + isTax.is(':checked') && + isCat.is(':checked') && + isPostTypeArc.is(':checked') && + isTag.is(':checked') && + isAuthor.is(':checked') && + isDate.is(':checked')) { + isArc.attr('checked', true); + } + } + }); + + $('#stats_month').change(function() { + sMonth = $(this).val(); + $.post(samStatsUrl, { + action: 'load_item_stats', + id: itemId, + sm: sMonth + }).done(function(data) { + var + hits = {label: samStrs.labels.hits, data: data.hits}, + clicks = {label: samStrs.labels.clicks, data: data.clicks}; + statsData = [hits, clicks]; + $('#total_hits').text(data.total.hits); + $('#total_clicks').text(data.total.clicks); + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + }); + }); + + return false; + }); +})(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit-item.min.js b/js/sam-admin-edit-item.min.js new file mode 100644 index 0000000..2fef696 --- /dev/null +++ b/js/sam-admin-edit-item.min.js @@ -0,0 +1 @@ +var sam=sam||{};(function(n){var t,i=samEditorOptions.media;sam.media=t={buttonId:"#banner-media",adUrl:"#ad_img",adImgId:"#ad_img_id",adName:"#title",adDesc:"#item_description",adAlt:"#ad_alt",init:function(){n(this.buttonId).on("click",this.openMediaDialog)},openMediaDialog:function(n){if(n.preventDefault(),this._frame){this._frame.open();return}var r=wp.media.model.Attachment;this._frame=t.frame=wp.media({title:i.title,button:{text:i.button},multiple:!1,library:{type:"image"}});this._frame.on("ready",function(){});this._frame.state("library").on("select",function(){var n=this.get("selection").single();t.handleMediaAttachment(n)});this._frame.open()},handleMediaAttachment:function(t){var i=t.toJSON();n(this.adUrl).val(i.url);n(this.adImgId).val(i.id);""==n(this.adName).val()&&""!=i.title&&n(this.adName).val(i.title);""==n(this.adDesc).val()&&""!=i.caption&&n(this.adDesc).val(i.caption);""==n(this.adAlt).val()&&""!=i.alt&&n(this.adAlt).val(i.alt)}};n(document).ready(function(){function sr(t,i,r,u,f,e){var o=r.val();i.w2grid({name:t,show:{selectColumn:!0},multiSelect:!0,columns:f,url:e,onSelect:function(n){n.onComplete=function(){for(var f,e="",t=this.getSelection(),i,n=0;n<\/div>').appendTo(eu);r=="success"?(n("#files").text(i.file+" "+t+" "+i.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),gi=="item"?n("#ad_img").val(i.url+t):gi=="place"&&n("#patch_img").val(i.url+t)):n("#files").text(t+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}});n("#adv_nick").combogrid({url:y+"?action=load_combo_data",datatype:"json",munit:"px",alternate:!0,colModel:r.comboGrid,select:function(t,i){return n("#adv_nick").val(i.item.slug),n("#adv_name").val(i.item.title),n("#adv_mail").val(i.item.email),!1}});n("#add-file-button").click(function(){var t=i.url+n("select#files_list option:selected").val();return n("#ad_img").val(t),!1});f("ctt-grid",ri,ou,"slug",r.customTaxes,wt.cTax);f("x-ctt-grid",ui,su,"slug",r.customTaxes,wt.cTax);f("cust-grid",vi,ku,"slug",r.customs,wt.customs);f("x-cust-grid",yi,du,"slug",r.customs,wt.customs);wi=y+"?action=load_posts&cstr="+samEditorOptions.data.custList+"&sp="+gu+"&spg="+nf;sr("posts-grid",fi,hu,"id",r.posts,wi);sr("x-posts-grid",ei,lu,"id",r.posts,wi);n("#tabs").tabs({activate:function(t,i){var r=i.newPanel[0].id;r=="tabs-1"&&w2ui["posts-grid"]&&fi.w2render("posts-grid");r=="tabs-2"&&(lt.is(":visible")&&w2ui["ctt-grid"]&&ri.w2render("ctt-grid"),nt.is(":visible")&&w2ui["x-ctt-grid"]&&ui.w2render("x-ctt-grid"),b.is(":visible")&&w2ui["x-posts-grid"]&&ei.w2render("x-posts-grid"),ct.is(":visible")&&w2ui["cats-grid"]&&oi.w2render("cats-grid"),d.is(":visible")&&w2ui["x-cats-grid"]&&si.w2render("x-cats-grid"),at.is(":visible")&&w2ui["auth-grid"]&&hi.w2render("auth-grid"),it.is(":visible")&&w2ui["x-auth-grid"]&&ci.w2render("x-auth-grid"),vt.is(":visible")&&w2ui["tags-grid"]&&li.w2render("tags-grid"),ut.is(":visible")&&w2ui["x-tags-grid"]&&ai.w2render("x-tags-grid"),yt.is(":visible")&&w2ui["cust-grid"]&&vi.w2render("cust-grid"),et.is(":visible")&&w2ui["xcust-grid"]&&yi.w2render("x-cust-grid"));r=="tabs-3"&&ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid");r=="tabs-5"&&n.plot("#graph",ht,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})}});n("#code_mode_false").click(function(){nr.show("blind",{direction:"vertical"},500);tr.hide("blind",{direction:"vertical"},500)});n("#code_mode_true").click(function(){nr.hide("blind",{direction:"vertical"},500);tr.show("blind",{direction:"vertical"},500)});2==n("input:radio[name=view_type]:checked").val()&&(u.is(":checked")&&(u.attr("checked",!1),b.hide("blind",{direction:"vertical"},500)),u.attr("disabled",!0));n("input:radio[name=view_type]").click(function(){var t=n("input:radio[name=view_type]:checked").val();switch(t){case"0":e.is(":hidden")&&e.show("blind",{direction:"vertical"},500);o.is(":visible")&&o.hide("blind",{direction:"vertical"},500);u.attr("disabled",!1);break;case"1":e.is(":visible")&&e.hide("blind",{direction:"vertical"},500);o.is(":visible")&&o.hide("blind",{direction:"vertical"},500);u.attr("disabled",!1);break;case"2":e.is(":visible")&&e.hide("blind",{direction:"vertical"},500);o.is(":hidden")&&(o.show("blind",{direction:"vertical"},500,function(){w2ui["posts-grid"]&&fi.w2render("posts-grid")}),u.is(":checked")&&(u.attr("checked",!1),b.hide("blind",{direction:"vertical"},500)));u.attr("disabled",!0)}});hr=n.ajax({url:y,data:{action:"load_authors",level:3},type:"POST"});hr.done(function(n){bi=n;f("auth-grid",hi,yu,"slug",r.authors,bi);f("x-auth-grid",ci,pu,"slug",r.authors,bi)});cr=n.ajax({url:y,data:{action:"load_users",subscriber:encodeURI(i.subscriber),contributor:encodeURI(i.contributor),author:encodeURI(i.author),editor:encodeURI(i.editor),admin:encodeURI(i.admin),sadmin:encodeURI(i.superAdmin)},type:"POST"});cr.done(function(n){lr=n;f("users-grid",st,cu,"slug",r.users,lr)});ar=n.ajax({url:y,data:{action:"load_cats",level:3},type:"POST"});ar.done(function(n){ki=n;f("cats-grid",oi,au,"slug",r.cats,ki);f("x-cats-grid",si,vu,"slug",r.cats,ki)});vr=n.ajax({url:y,data:{action:"load_tags",level:3},type:"POST"});vr.done(function(n){di=n;f("tags-grid",li,wu,"slug",r.tags,di);f("x-tags-grid",ai,bu,"slug",r.tags,di)});u.click(function(){u.is(":checked")?2==n("input:radio[name=view_type]:checked").val()?u.attr("checked",!1):b.show("blind",{direction:"vertical"},500,function(){w2ui["x-posts-grid"]&&ei.w2render("x-posts-grid")}):b.hide("blind",{direction:"vertical"},500)});n("input:radio[name=ad_users]").click(function(){var t=n("input:radio[name=ad_users]:checked").val();t=="0"?pt.is(":visible")&&pt.hide("blind",{direction:"vertical"},500):pt.is(":hidden")&&pt.show("blind",{direction:"vertical"},500,function(){ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid")})});ir.click(function(){ir.is(":checked")?rr.show("blind",{direction:"vertical"},500,function(){ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid")}):rr.hide("blind",{direction:"vertical"},500)});ur.click(function(){ur.is(":checked")?ot.show("blind",{direction:"vertical"},500,function(){w2ui["users-grid"]&&st.w2render("users-grid")}):ot.hide("blind",{direction:"vertical"},500)});n("#ad_swf").click(function(){n("#ad_swf").is(":checked")?n("#swf-params").show("blind",{direction:"vertical"},500):n("#swf-params").hide("blind",{direction:"vertical"},500)});k.is(":checked")&&s.is(":checked")&&(s.attr("checked",!1),d.hide("blind",{direction:"vertical"},500));k.click(function(){k.is(":checked")?(ct.show("blind",{direction:"vertical"},500,function(){w2ui["cats-grid"]&&oi.w2render("cats-grid")}),kt.show("blind",{direction:"vertical"},500),s.is(":checked")&&(s.attr("checked",!1),d.hide("blind",{direction:"vertical"},500))):(ct.hide("blind",{direction:"vertical"},500),kt.hide("blind",{direction:"vertical"},500))});s.click(function(){s.is(":checked")?(d.show("blind",{direction:"vertical"},500,function(){w2ui["x-cats-grid"]&&si.w2render("x-cats-grid")}),k.is(":checked")&&(k.attr("checked",!1),ct.hide("blind",{direction:"vertical"},500),kt.hide("blind",{direction:"vertical"},500))):d.hide("blind",{direction:"vertical"},500)});g.is(":checked")&&h.is(":checked")&&(h.attr("checked",!1),nt.hide("blind",{direction:"vertical"},500));g.click(function(){g.is(":checked")?(lt.show("blind",{direction:"vertical"},500,function(){w2ui["ctt-grid"]&&ri.w2render("ctt-grid")}),dt.show("blind",{direction:"vertical"},500),h.is(":checked")&&(h.attr("checked",!1),nt.hide("blind",{direction:"vertical"},500))):(lt.hide("blind",{direction:"vertical"},500),dt.hide("blind",{direction:"vertical"},500))});h.click(function(){h.is(":checked")?(nt.show("blind",{direction:"vertical"},500,function(){w2ui["x-ctt-grid"]&&ui.w2render("x-ctt-grid")}),g.is(":checked")&&(g.attr("checked",!1),lt.hide("blind",{direction:"vertical"},500),dt.hide("blind",{direction:"vertical"},500))):nt.hide("blind",{direction:"vertical"},500)});tt.is(":checked")&&c.is(":checked")&&(c.attr("checked",!1),it.hide("blind",{direction:"vertical"},500));tt.click(function(){tt.is(":checked")?(at.show("blind",{direction:"vertical"},500,function(){w2ui["auth-grid"]&&hi.w2render("auth-grid")}),gt.show("blind",{direction:"vertical"},500),c.is(":checked")&&(c.attr("checked",!1),it.hide("blind",{direction:"vertical"},500))):(at.hide("blind",{direction:"vertical"},500),gt.hide("blind",{direction:"vertical"},500))});c.click(function(){c.is(":checked")?(it.show("blind",{direction:"vertical"},500,function(){w2ui["x-auth-grid"]&&ci.w2render("x-auth-grid")}),tt.is(":checked")&&(tt.attr("checked",!1),at.hide("blind",{direction:"vertical"},500),gt.hide("blind",{direction:"vertical"},500))):it.hide("blind",{direction:"vertical"},500)});rt.is(":checked")&&l.is(":checked")&&(l.attr("checked",!1),ut.hide("blind",{direction:"vertical"},500));rt.click(function(){rt.is(":checked")?(vt.show("blind",{direction:"vertical"},500,function(){w2ui["tags-grid"]&&li.w2render("tags-grid")}),ni.show("blind",{direction:"vertical"},500),l.is(":checked")&&(l.attr("checked",!1),ut.hide("blind",{direction:"vertical"},500))):(vt.hide("blind",{direction:"vertical"},500),ni.hide("blind",{direction:"vertical"},500))});l.click(function(){l.is(":checked")?(ut.show("blind",{direction:"vertical"},500,function(){w2ui["x-tags-grid"]&&ai.w2render("x-tags-grid")}),rt.is(":checked")&&(rt.attr("checked",!1),vt.hide("blind",{direction:"vertical"},500),ni.hide("blind",{direction:"vertical"},500))):ut.hide("blind",{direction:"vertical"},500)});ft.is(":checked")&&a.is(":checked")&&(a.attr("checked",!1),et.hide("blind",{direction:"vertical"},500));ft.click(function(){ft.is(":checked")?(yt.show("blind",{direction:"vertical"},500,function(){w2ui["cust-grid"]&&vi.w2render("cust-grid")}),ti.show("blind",{direction:"vertical"},500),a.is(":checked")&&(a.attr("checked",!1),et.hide("blind",{direction:"vertical"},500))):(yt.hide("blind",{direction:"vertical"},500),ti.hide("blind",{direction:"vertical"},500))});a.click(function(){a.is(":checked")?(et.show("blind",{direction:"vertical"},500,function(){w2ui["x-cust-grid"]&&yi.w2render("x-cust-grid")}),ft.is(":checked")&&(ft.attr("checked",!1),yt.hide("blind",{direction:"vertical"},500),ti.hide("blind",{direction:"vertical"},500))):et.hide("blind",{direction:"vertical"},500)});n("#ad_start_date, #ad_end_date").datepicker({dateFormat:"yy-mm-dd",showButtonPanel:!0});n("#ad_schedule").click(function(){n("#ad_schedule").is(":checked")?n("#rc-sc").show("blind",{direction:"vertical"},500):n("#rc-sc").hide("blind",{direction:"vertical"},500)});n("#limit_hits").click(function(){n("#limit_hits").is(":checked")?n("#rc-hl").show("blind",{direction:"vertical"},500):n("#rc-hl").hide("blind",{direction:"vertical"},500)});n("#limit_clicks").click(function(){n("#limit_clicks").is(":checked")?n("#rc-cl").show("blind",{direction:"vertical"},500):n("#rc-cl").hide("blind",{direction:"vertical"},500)});v=samEditorOptions.ads;v.pointer="ads";(v.enabled||""==bt.val())&&bt.pointer({content:"

"+v.title+"<\/h3>

"+v.content+"<\/p>",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:v.pointer},async:!0})}}).pointer("open");var p=n("#is_singular"),yr=n("#is_single"),pr=n("#is_page"),wr=n("#is_attachment"),br=n("#is_posttype");p.click(function(){p.is(":checked")&&n("#is_single, #is_page, #is_attachment, #is_posttype").attr("checked",!0)});n("#is_single, #is_page, #is_attachment, #is_posttype").click(function(){!p.is(":checked")||yr.is(":checked")&&pr.is(":checked")&&wr.is(":checked")&&br.is(":checked")?!p.is(":checked")&&yr.is(":checked")&&br.is(":checked")&&pr.is(":checked")&&wr.is(":checked")&&p.attr("checked",!0):p.attr("checked",!1)});var w=n("#is_archive"),kr=n("#is_tax"),dr=n("#is_category"),gr=n("#is_tag"),nu=n("#is_author"),tu=n("#is_date"),iu=n("#is_posttype_archive"),ru=n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive");return w.click(function(){w.is(":checked")&&ru.attr("checked",!0)}),ru.click(function(){!w.is(":checked")||kr.is(":checked")&&dr.is(":checked")&&iu.is(":checked")&&gr.is(":checked")&&nu.is(":checked")&&tu.is(":checked")?!w.is(":checked")&&kr.is(":checked")&&dr.is(":checked")&&iu.is(":checked")&&gr.is(":checked")&&nu.is(":checked")&&tu.is(":checked")&&w.attr("checked",!0):w.attr("checked",!1)}),n("#stats_month").change(function(){pi=n(this).val();n.post(er,{action:"load_item_stats",id:or,sm:pi}).done(function(t){var r={label:i.labels.hits,data:t.hits},u={label:i.labels.clicks,data:t.clicks};ht=[r,u];n("#total_hits").text(t.total.hits);n("#total_clicks").text(t.total.clicks);n.plot("#graph",ht,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})})}),!1})})(jQuery) \ No newline at end of file diff --git a/js/sam-admin-edit-place.js b/js/sam-admin-edit-place.js new file mode 100644 index 0000000..3768e76 --- /dev/null +++ b/js/sam-admin-edit-place.js @@ -0,0 +1,286 @@ +/** + * Created by minimus on 17.11.13. + */ +var sam = sam || {}; +(function ($) { + var media, mediaTexts = samEditorOptions.media; + + sam.media = media = { + buttonId: '#banner-media', + adUrl: '#patch_img', + adImgId: '#patch_img_id', + adName: '#title', + adDesc: '#description', + //adAlt: '#ad_alt', + + init: function() { + $(this.buttonId).on( 'click', this.openMediaDialog ); + }, + + openMediaDialog: function( e ) { + e.preventDefault(); + + if ( this._frame ) { + this._frame.open(); + return; + } + + var Attachment = wp.media.model.Attachment; + + this._frame = media.frame = wp.media({ + title: mediaTexts.title, + button: { + text: mediaTexts.button + }, + multiple: false, + library: { + type: 'image' + }/*, + selection: [ Attachment.get( $(this.adImgId).val() ) ]*/ + }); + + this._frame.on('ready', function() { + // + }); + + this._frame.state( 'library' ).on('select', function() { + var attachment = this.get( 'selection' ).single(); + media.handleMediaAttachment( attachment ); + }); + + this._frame.open(); + }, + + handleMediaAttachment: function(a) { + var attechment = a.toJSON(); + $(this.adUrl).val(attechment.url); + $(this.adImgId).val(attechment.id); + if('' == $(this.adName).val() && '' != attechment.title) $(this.adName).val(attechment.title); + if('' == $(this.adDesc).val() && '' != attechment.caption) $(this.adDesc).val(attechment.caption); + if('' == $(this.adAlt).val() && '' != attechment.alt) $(this.adAlt).val(attechment.alt); + } + }; + + $(document).ready(function () { + var em = $('#editor_mode').val(), fu; + + var + rcpsi = $('#rc-psi'), rcpsc = $('#rc-psc'), rcpsd = $('#rc-psd'), title = $("#title"); + + var + itemId = $('#place_id').val(), + btnUpload = $("#upload-file-button"), + status = $("#uploading"), + srcHelp = $("#uploading-help"), + loadImg = $('#load_img'), + sPointer, statsData, sMonth = 0, + grid = $('#ads-grid'), + samStatsUrl = samEditorOptions.samStatsUrl, + labels = samEditorOptions.labels, + fileExt = ''; + + sPointer = samEditorOptions.places; + sPointer.pointer = 'places'; + + /*var samUploader, mediaTexts = samEditorOptions.media;*/ + + media.init(); + + title.tooltip({ + track: true + }); + + var options = samEditorOptions.options; + + fu = new AjaxUpload(btnUpload, { + action:ajaxurl, + name:'uploadfile', + data:{ + action:'upload_ad_image' + }, + onSubmit: function (file, ext) { + if (!(ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext))) { + status.text(options.status); + return false; + } + loadImg.show(); + status.text(options.uploading); + }, + onComplete:function (file, response) { + status.text(''); + loadImg.hide(); + $('

').appendTo(srcHelp); + if (response == "success") { + $("#files").text(options.file + ' ' + file + ' ' + options.uploaded) + .addClass('updated') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + if (em == 'item') $("#ad_img").val(options.url + file); + else if (em == 'place') $("#patch_img").val(options.url + file); + } + else { + $('#files').text(file + ' ' + response) + .addClass('error') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + } + } + }); + + $.post(samStatsUrl, { + action: 'load_stats', + id: itemId, + sm: sMonth + }).done(function(data) { + var + hits = {label: labels.hits, data: data.hits}, + clicks = {label: labels.clicks, data: data.clicks}; + statsData = [hits, clicks]; + $('#total_hits').text(data.total.hits); + $('#total_clicks').text(data.total.clicks); + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + }); + + $('#tabs').tabs({ + activate: function(ev, ui) { + var el = ui.newPanel[0].id; + if(el == 'tabs-3') { + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + } + } + }); + $('#image_tools').tabs(); + + $.post(samStatsUrl, { + action: 'load_ads', + id: itemId, + sm: 0 + }).done(function(data) { + var records = data.records; + grid.w2grid({ + name: 'ads', + show: {selectColumn: false}, + multiSelect: false, + columns: samEditorOptions.columns, + records: records + }); + }); + /*var url = samStatsUrl + '?action=load_ads&id=' + itemId + '&sm=0'; + grid.w2render('ads-grid');*/ + + $("#add-file-button").click(function () { + var curFile = options.url + $("select#files_list option:selected").val(); + $("#patch_img").val(curFile); + return false; + }); + + $('#patch_source_image').click(function () { + if (rcpsi.is(':hidden')) rcpsi.show('blind', {direction:'vertical'}, 500); + if (rcpsc.is(':visible')) rcpsc.hide('blind', {direction:'vertical'}, 500); + if (rcpsd.is(':visible')) rcpsd.hide('blind', {direction:'vertical'}, 500); + }); + + $('#patch_source_code').click(function () { + if (rcpsi.is(':visible')) rcpsi.hide('blind', {direction:'vertical'}, 500); + if (rcpsc.is(':hidden')) rcpsc.show('blind', {direction:'vertical'}, 500); + if (rcpsd.is(':visible')) rcpsd.hide('blind', {direction:'vertical'}, 500); + }); + + $('#patch_source_dfp').click(function () { + if (rcpsi.is(':visible')) rcpsi.hide('blind', {direction:'vertical'}, 500); + if (rcpsc.is(':visible')) rcpsc.hide('blind', {direction:'vertical'}, 500); + if (rcpsd.is(':hidden')) rcpsd.show('blind', {direction:'vertical'}, 500); + }); + + if(sPointer.enabled || '' == title.val()) { + $('#title').pointer({ + content: '

' + sPointer.title + '

' + sPointer.content + '

', + position: 'top', + close: function() { + $.ajax({ + url: ajaxurl, + data: { + action: 'close_pointer', + pointer: sPointer.pointer + }, + async: true + }); + } + }).pointer('open'); + } + + $('#stats_month').change(function() { + sMonth = $(this).val(); + $.post(samStatsUrl, { + action: 'load_stats', + id: itemId, + sm: sMonth + }).done(function(data) { + var + hits = {label: labels.hits, data: data.hits}, + clicks = {label: labels.clicks, data: data.clicks}; + statsData = [hits, clicks]; + $('#total_hits').text(data.total.hits); + $('#total_clicks').text(data.total.clicks); + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + }); + }); + + return false; + }); +})(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit-place.min.js b/js/sam-admin-edit-place.min.js new file mode 100644 index 0000000..fb2bc06 --- /dev/null +++ b/js/sam-admin-edit-place.min.js @@ -0,0 +1 @@ +var sam=sam||{};(function(n){var t,i=samEditorOptions.media;sam.media=t={buttonId:"#banner-media",adUrl:"#patch_img",adImgId:"#patch_img_id",adName:"#title",adDesc:"#description",init:function(){n(this.buttonId).on("click",this.openMediaDialog)},openMediaDialog:function(n){if(n.preventDefault(),this._frame){this._frame.open();return}var r=wp.media.model.Attachment;this._frame=t.frame=wp.media({title:i.title,button:{text:i.button},multiple:!1,library:{type:"image"}});this._frame.on("ready",function(){});this._frame.state("library").on("select",function(){var n=this.get("selection").single();t.handleMediaAttachment(n)});this._frame.open()},handleMediaAttachment:function(t){var i=t.toJSON();n(this.adUrl).val(i.url);n(this.adImgId).val(i.id);""==n(this.adName).val()&&""!=i.title&&n(this.adName).val(i.title);""==n(this.adDesc).val()&&""!=i.caption&&n(this.adDesc).val(i.caption);""==n(this.adAlt).val()&&""!=i.alt&&n(this.adAlt).val(i.alt)}};n(document).ready(function(){var v=n("#editor_mode").val(),w,r=n("#rc-psi"),u=n("#rc-psc"),f=n("#rc-psd"),y=n("#title"),h=n("#place_id").val(),b=n("#upload-file-button"),c=n("#uploading"),k=n("#uploading-help"),p=n("#load_img"),e,o,l=0,d=n("#ads-grid"),a=samEditorOptions.samStatsUrl,s=samEditorOptions.labels,i;return e=samEditorOptions.places,e.pointer="places",t.init(),y.tooltip({track:!0}),i=samEditorOptions.options,w=new AjaxUpload(b,{action:ajaxurl,name:"uploadfile",data:{action:"upload_ad_image"},onSubmit:function(n,t){if(!(t&&/^(jpg|png|jpeg|gif|swf)$/.test(t)))return c.text(i.status),!1;p.show();c.text(i.uploading)},onComplete:function(t,r){c.text("");p.hide();n('
<\/div>').appendTo(k);r=="success"?(n("#files").text(i.file+" "+t+" "+i.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),v=="item"?n("#ad_img").val(i.url+t):v=="place"&&n("#patch_img").val(i.url+t)):n("#files").text(t+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}}),n.post(a,{action:"load_stats",id:h,sm:l}).done(function(t){var i={label:s.hits,data:t.hits},r={label:s.clicks,data:t.clicks};o=[i,r];n("#total_hits").text(t.total.hits);n("#total_clicks").text(t.total.clicks);n.plot("#graph",o,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})}),n("#tabs").tabs({activate:function(t,i){var r=i.newPanel[0].id;r=="tabs-3"&&n.plot("#graph",o,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})}}),n("#image_tools").tabs(),n.post(a,{action:"load_ads",id:h,sm:0}).done(function(n){var t=n.records;d.w2grid({name:"ads",show:{selectColumn:!1},multiSelect:!1,columns:samEditorOptions.columns,records:t})}),n("#add-file-button").click(function(){var t=i.url+n("select#files_list option:selected").val();return n("#patch_img").val(t),!1}),n("#patch_source_image").click(function(){r.is(":hidden")&&r.show("blind",{direction:"vertical"},500);u.is(":visible")&&u.hide("blind",{direction:"vertical"},500);f.is(":visible")&&f.hide("blind",{direction:"vertical"},500)}),n("#patch_source_code").click(function(){r.is(":visible")&&r.hide("blind",{direction:"vertical"},500);u.is(":hidden")&&u.show("blind",{direction:"vertical"},500);f.is(":visible")&&f.hide("blind",{direction:"vertical"},500)}),n("#patch_source_dfp").click(function(){r.is(":visible")&&r.hide("blind",{direction:"vertical"},500);u.is(":visible")&&u.hide("blind",{direction:"vertical"},500);f.is(":hidden")&&f.show("blind",{direction:"vertical"},500)}),(e.enabled||""==y.val())&&n("#title").pointer({content:"

"+e.title+"<\/h3>

"+e.content+"<\/p>",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:e.pointer},async:!0})}}).pointer("open"),n("#stats_month").change(function(){l=n(this).val();n.post(a,{action:"load_stats",id:h,sm:l}).done(function(t){var i={label:s.hits,data:t.hits},r={label:s.clicks,data:t.clicks};o=[i,r];n("#total_hits").text(t.total.hits);n("#total_clicks").text(t.total.clicks);n.plot("#graph",o,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})})}),!1})})(jQuery) \ No newline at end of file diff --git a/js/sam-admin-edit.js b/js/sam-admin-edit.js deleted file mode 100644 index 0ac1a8d..0000000 --- a/js/sam-admin-edit.js +++ /dev/null @@ -1,757 +0,0 @@ -/** - * @author minimus - * @copyright 2010 - */ -(function ($) { - - - $(document).ready(function () { - $("#title").tooltip({ - track: true - }); - - var options = $.parseJSON($.ajax({ - url:ajaxurl, - data:{action:'get_strings'}, - async:false, - dataType:'jsonp' - }).responseText); - - var - btnUpload = $("#upload-file-button"), - status = $("#uploading"), - srcHelp = $("#uploading-help"), - loadImg = $('#load_img'), - sPointer, - fileExt = ''; - - var fu = new AjaxUpload(btnUpload, { - action:ajaxurl, - name:'uploadfile', - data:{ - action:'upload_ad_image' - }, - onSubmit:function (file, ext) { - if (!(ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext))) { - status.text(options.status); - return false; - } - loadImg.show(); - status.text(options.uploading); - }, - onComplete:function (file, response) { - status.text(''); - loadImg.hide(); - $('

').appendTo(srcHelp); - if (response == "success") { - $("#files").text(options.file + ' ' + file + ' ' + options.uploaded) - .addClass('updated') - .delay(3000) - .fadeOut(1000, function () { - $(this).remove(); - }); - if ($('#editor_mode').val() == 'item') $("#ad_img").val(options.url + file); - if ($('#editor_mode').val() == 'place') $("#patch_img").val(options.url + file); - } - else { - $('#files').text(file + ' ' + response) - .addClass('error') - .delay(3000) - .fadeOut(1000, function () { - $(this).remove(); - }); - } - } - }); - - if ($('#editor_mode').val() == 'item') { - sPointer = samPointer.ads; - sPointer.pointer = 'ads'; - - $("#ad_start_date, #ad_end_date").datepicker({ - dateFormat:'yy-mm-dd', - showButtonPanel:true - }); - - /*var availableCats = options.cats; - var availableAuthors = options.authors; - var availableTags = options.tags; - var availableCustoms = options.customs;*/ - - // Advertiser ComboGrid - $('#adv_nick').combogrid({ - url: ajaxurl+'?action=get_combo_data', - datatype: "json", - munit: 'px', - alternate: true, - colModel: options.users.colModel, - select: function(event, ui) { - $('#adv_nick').val(ui.item.slug); - $('#adv_name').val(ui.item.title); - $('#adv_mail').val(ui.item.email); - return false; - } - }); - - // Posts Grid - var - postsGrid, - pgData = options.posts.posts, - pgOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - pgColumns = [], - pgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - pgColumns.push(pgCheckboxSelector.getColumnDefinition()); - for (var i = 0; i < options.posts.columns.length; i++) { - options.posts.columns[i].editor = Slick.Editors.Text; - pgColumns.push(options.posts.columns[i]); - } - - postsGrid = new Slick.Grid("#posts-grid", pgData, pgColumns, pgOptions); - postsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - postsGrid.registerPlugin(pgCheckboxSelector); - - var postsSelectedItems = $('#view_id').val(); - if (postsSelectedItems != '') { - var psi = postsSelectedItems.split(','), pgSI = []; - $.each(pgData, function (i, pd) { - $.each(psi, function (j, ed) { - if (ed == pd.id) pgSI.push(i); - }); - }); - postsGrid.setSelectedRows(pgSI); - } - - postsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = postsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(pgData[row].id); - }); - $('#view_id').val(items.join(',')); - }); - - // Users Grid - var - usersGrid, - ugData = options.users.users, - ugOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - ugColumns = [], - ugCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - ugColumns.push(ugCheckboxSelector.getColumnDefinition()); - for(i = 0; i < options.users.columns.length; i++) ugColumns.push(options.users.columns[i]); - - usersGrid = new Slick.Grid('#users-grid', ugData, ugColumns, ugOptions); - usersGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - usersGrid.registerPlugin(ugCheckboxSelector); - - var usersSelectedItems = $('#x_view_users').val(); - if(usersSelectedItems != '') { - var usi = usersSelectedItems.split(','), ugSI = []; - $.each(ugData, function(i, ud) { - $.each(usi, function(j, ed) { - if(ed == ud.slug) ugSI.push(i); - }); - }); - usersGrid.setSelectedRows(ugSI); - } - - usersGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = usersGrid.getSelectedRows(); - $.each(sr, function(i, row) { - items.push(ugData[row].slug); - }); - $('#x_view_users').val(items.join(',')); - return false; - }); - - // xPosts Grid - var - xpostsGrid, - xpgColumns = [], - xpgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xpgColumns.push(xpgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.posts.columns.length; i++) xpgColumns.push(options.posts.columns[i]); - - xpostsGrid = new Slick.Grid("#x-posts-grid", pgData, xpgColumns, pgOptions); - xpostsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xpostsGrid.registerPlugin(xpgCheckboxSelector); - - var xpostsSelectedItems = $('#x_view_id').val(); - if (xpostsSelectedItems != '') { - var xpsi = xpostsSelectedItems.split(','), xpgSI = []; - $.each(pgData, function (i, pd) { - $.each(xpsi, function (j, ed) { - if (ed == pd.id) xpgSI.push(i); - }); - }); - xpostsGrid.setSelectedRows(xpgSI); - } - - xpostsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xpostsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(pgData[row].id); - }); - $('#x_view_id').val(items.join(',')); - }); - - // Categories Grid - var - catsGrid, - cgData = options.cats.cats, - cgOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - cgColumns = [], - cgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - cgColumns.push(cgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.cats.columns.length; i++) { - options.cats.columns[i].editor = Slick.Editors.Text; - cgColumns.push(options.cats.columns[i]); - } - - catsGrid = new Slick.Grid("#cats-grid", cgData, cgColumns, cgOptions); - catsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - catsGrid.registerPlugin(cgCheckboxSelector); - - var catsSelectedItems = $('#view_cats').val(); - if (catsSelectedItems != '') { - var csi = catsSelectedItems.split(','), cgSI = []; - $.each(cgData, function (i, cd) { - $.each(csi, function (j, ed) { - if (ed == cd.slug) cgSI.push(i); - }); - }); - catsGrid.setSelectedRows(cgSI); - } - - catsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = catsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(cgData[row].slug); - }); - $('#view_cats').val(items.join(',')); - }); - - // xCats Grid - var - xcatsGrid, - xcgColumns = [], - xcgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xcgColumns.push(xcgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.cats.columns.length; i++) xcgColumns.push(options.cats.columns[i]); - - xcatsGrid = new Slick.Grid("#x-cats-grid", cgData, xcgColumns, cgOptions); - xcatsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xcatsGrid.registerPlugin(xcgCheckboxSelector); - - var xcatsSelectedItems = $('#x_view_cats').val(); - if (xcatsSelectedItems != '') { - var xcsi = xcatsSelectedItems.split(','), xcgSI = []; - $.each(cgData, function (i, cd) { - $.each(xcsi, function (j, ed) { - if (ed == cd.slug) xcgSI.push(i); - }); - }); - xcatsGrid.setSelectedRows(xcgSI); - } - - xcatsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xcatsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(cgData[row].slug); - }); - $('#x_view_cats').val(items.join(',')); - }); - - // Auth Grid - var - authGrid, - agData = options.authors.authors, - agOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - agColumns = [], - agCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - agColumns.push(agCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.authors.columns.length; i++) { - options.authors.columns[i].editor = Slick.Editors.Text; - agColumns.push(options.authors.columns[i]); - } - - authGrid = new Slick.Grid("#auth-grid", agData, agColumns, agOptions); - authGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - authGrid.registerPlugin(agCheckboxSelector); - - var authSelectedItems = $('#view_authors').val(); - if (authSelectedItems != '') { - var asi = authSelectedItems.split(','), agSI = []; - $.each(agData, function (i, cd) { - $.each(asi, function (j, ed) { - if (ed == cd.slug) agSI.push(i); - }); - }); - authGrid.setSelectedRows(agSI); - } - - authGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = authGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(agData[row].slug); - }); - $('#view_authors').val(items.join(',')); - }); - - // xauth Grid - var - xauthGrid, - xagColumns = [], - xagCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xagColumns.push(xagCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.authors.columns.length; i++) xagColumns.push(options.authors.columns[i]); - - xauthGrid = new Slick.Grid("#x-auth-grid", agData, xagColumns, agOptions); - xauthGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xauthGrid.registerPlugin(xagCheckboxSelector); - - var xauthSelectedItems = $('#x_view_authors').val(); - if (xauthSelectedItems != '') { - var xasi = xauthSelectedItems.split(','), xagSI = []; - $.each(agData, function (i, cd) { - $.each(xasi, function (j, ed) { - if (ed == cd.slug) xagSI.push(i); - }); - }); - xauthGrid.setSelectedRows(xagSI); - } - - xauthGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xauthGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(agData[row].slug); - }); - $('#x_view_authors').val(items.join(',')); - }); - - // Tags Grid - var - tagsGrid, - tgData = options.tags.tags, - tgOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - tgColumns = [], - tgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - tgColumns.push(tgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.tags.columns.length; i++) { - options.tags.columns[i].editor = Slick.Editors.Text; - tgColumns.push(options.tags.columns[i]); - } - - tagsGrid = new Slick.Grid("#tags-grid", tgData, tgColumns, tgOptions); - tagsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - tagsGrid.registerPlugin(tgCheckboxSelector); - - var tagsSelectedItems = $('#view_tags').val(); - if (tagsSelectedItems != '') { - var tsi = tagsSelectedItems.split(','), tgSI = []; - $.each(tgData, function (i, cd) { - $.each(tsi, function (j, ed) { - if (ed == cd.slug) tgSI.push(i); - }); - }); - tagsGrid.setSelectedRows(tgSI); - } - - tagsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = tagsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(tgData[row].slug); - }); - $('#view_tags').val(items.join(',')); - }); - - // xTags Grid - var - xtagsGrid, - xtgColumns = [], - xtgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xtgColumns.push(xtgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.tags.columns.length; i++) xtgColumns.push(options.tags.columns[i]); - - xtagsGrid = new Slick.Grid("#x-tags-grid", tgData, xtgColumns, tgOptions); - xtagsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xtagsGrid.registerPlugin(xtgCheckboxSelector); - - var xtagsSelectedItems = $('#x_view_tags').val(); - if (xtagsSelectedItems != '') { - var xtsi = xtagsSelectedItems.split(','), xtgSI = []; - $.each(tgData, function (i, cd) { - $.each(xtsi, function (j, ed) { - if (ed == cd.slug) xtgSI.push(i); - }); - }); - xtagsGrid.setSelectedRows(xtgSI); - } - - xtagsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xtagsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(tgData[row].slug); - }); - $('#x_view_tags').val(items.join(',')); - }); - - // Customs Grid - var - custGrid, - cugData = options.customs.customs, - cugOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - cugColumns = [], - cugCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - cugColumns.push(cugCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.customs.columns.length; i++) { - options.customs.columns[i].editor = Slick.Editors.Text; - cugColumns.push(options.customs.columns[i]); - } - - custGrid = new Slick.Grid("#cust-grid", cugData, cugColumns, cugOptions); - custGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - custGrid.registerPlugin(cugCheckboxSelector); - - var custSelectedItems = $('#view_custom').val(); - if (custSelectedItems != '') { - var cusi = custSelectedItems.split(','), cugSI = []; - $.each(cugData, function (i, cd) { - $.each(cusi, function (j, ed) { - if (ed == cd.slug) cugSI.push(i); - }); - }); - custGrid.setSelectedRows(cugSI); - } - - custGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = custGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(cugData[row].slug); - }); - $('#view_custom').val(items.join(',')); - }); - - // xCustoms Grid - var - xcustGrid, - xcugColumns = [], - xcugCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xcugColumns.push(xcugCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.customs.columns.length; i++) xcugColumns.push(options.customs.columns[i]); - - xcustGrid = new Slick.Grid("#x-cust-grid", cugData, xcugColumns, cugOptions); - xcustGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xcustGrid.registerPlugin(xcugCheckboxSelector); - - var xcustSelectedItems = $('#x_view_custom').val(); - if (xcustSelectedItems != '') { - var xcusi = xcustSelectedItems.split(','), xcugSI = []; - $.each(cugData, function (i, cd) { - $.each(xcusi, function (j, ed) { - if (ed == cd.slug) xcugSI.push(i); - }); - }); - xcustGrid.setSelectedRows(xcugSI); - } - - xcustGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xcustGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(cugData[row].slug); - }); - $('#x_view_custom').val(items.join(',')); - }); - - - $('#tabs').tabs(); - - $("#add-file-button").click(function () { - var curFile = options.url + $("select#files_list option:selected").val(); - $("#ad_img").val(curFile); - return false; - }); - - $('#code_mode_false').click(function () { - $("#rc-cmf").show('blind', {direction:'vertical'}, 500); - $("#rc-cmt").hide('blind', {direction:'vertical'}, 500); - }); - - $('#code_mode_true').click(function () { - $("#rc-cmf").hide('blind', {direction:'vertical'}, 500); - $("#rc-cmt").show('blind', {direction:'vertical'}, 500); - }); - - $("input:radio[name=view_type]").click(function () { - var cval = $('input:radio[name=view_type]:checked').val(); - switch (cval) { - case '0': - if ($('#rc-vt0').is(':hidden')) $("#rc-vt0").show('blind', {direction:'vertical'}, 500); - if ($('#rc-vt2').is(':visible')) $("#rc-vt2").hide('blind', {direction:'vertical'}, 500); - break; - case '1': - if ($('#rc-vt0').is(':visible')) $("#rc-vt0").hide('blind', {direction:'vertical'}, 500); - if ($('#rc-vt2').is(':visible')) $("#rc-vt2").hide('blind', {direction:'vertical'}, 500); - break; - case '2': - if ($('#rc-vt0').is(':visible')) $("#rc-vt0").hide('blind', {direction:'vertical'}, 500); - if ($('#rc-vt2').is(':hidden')) { - $("#rc-vt2").show('blind', {direction:'vertical'}, 500); - postsGrid.invalidate(); - } - } - }); - - $("input:radio[name=ad_users]").click(function() { - var uval = $('input:radio[name=ad_users]:checked').val(); - if(uval == '0') { - if($('#custom-users').is(':visible')) $('#custom-users').hide('blind', {direction:'vertical'}, 500); - } - else { - if($('#custom-users').is(':hidden')) $('#custom-users').show('blind', {direction:'vertical'}, 500); - } - }); - - $("#ad_users_reg").click(function() { - if($('#ad_users_reg').is(':checked')) $('#x-reg-users').show('blind', {direction:'vertical'}, 500); - else $('#x-reg-users').hide('blind', {direction:'vertical'}, 500); - }); - - $('#x_ad_users').click(function() { - if($('#x_ad_users').is(':checked')) $('#x-view-users').show('blind', {direction:'vertical'}, 500); - else $('#x-view-users').hide('blind', {direction:'vertical'}, 500); - }); - - $('#ad_swf').click(function() { - if($('#ad_swf').is(':checked')) $('#swf-params').show('blind', {direction:'vertical'}, 500); - else $('#swf-params').hide('blind', {direction:'vertical'}, 500); - }); - - $('#x_id').click(function () { - if ($('#x_id').is(':checked')) { - $('#rc-xid').show('blind', {direction:'vertical'}, 500); - xpostsGrid.invalidate(); - } - else $('#rc-xid').hide('blind', {direction:'vertical'}, 500); - }); - - $('#ad_cats').click(function () { - if ($('#ad_cats').is(':checked')) { - $('#rc-ac').show('blind', {direction:'vertical'}, 500); - $('#acw').show('blind', {direction:'vertical'}, 500); - } - else { - $('#rc-ac').hide('blind', {direction:'vertical'}, 500); - $('#acw').hide('blind', {direction:'vertical'}, 500); - } - }); - - $('#x_cats').click(function () { - if ($('#x_cats').is(':checked')) $('#rc-xc').show('blind', {direction:'vertical'}, 500); - else $('#rc-xc').hide('blind', {direction:'vertical'}, 500); - }); - - $('#ad_authors').click(function () { - if ($('#ad_authors').is(':checked')) { - $('#rc-au').show('blind', {direction:'vertical'}, 500); - $('#aaw').show('blind', {direction:'vertical'}, 500); - } - else { - $('#rc-au').hide('blind', {direction:'vertical'}, 500); - $('#aaw').hide('blind', {direction:'vertical'}, 500); - } - }); - - $('#x_authors').click(function () { - if ($('#x_authors').is(':checked')) $('#rc-xa').show('blind', {direction:'vertical'}, 500); - else $('#rc-xa').hide('blind', {direction:'vertical'}, 500); - }); - - $('#ad_tags').click(function () { - if ($('#ad_tags').is(':checked')) { - $('#rc-at').show('blind', {direction:'vertical'}, 500); - $('#atw').show('blind', {direction:'vertical'}, 500); - } - else { - $('#rc-at').hide('blind', {direction:'vertical'}, 500); - $('#atw').hide('blind', {direction:'vertical'}, 500); - } - }); - - $('#x_tags').click(function () { - if ($('#x_tags').is(':checked')) $('#rc-xt').show('blind', {direction:'vertical'}, 500); - else $('#rc-xt').hide('blind', {direction:'vertical'}, 500); - }); - - $('#ad_custom').click(function () { - if ($('#ad_custom').is(':checked')) { - $('#rc-cu').show('blind', {direction:'vertical'}, 500); - $('#cuw').show('blind', {direction:'vertical'}, 500); - } - else { - $('#rc-cu').hide('blind', {direction:'vertical'}, 500); - $('#cuw').hide('blind', {direction:'vertical'}, 500); - } - }); - - $('#x_custom').click(function () { - if ($('#x_custom').is(':checked')) $('#rc-xu').show('blind', {direction:'vertical'}, 500); - else $('#rc-xu').hide('blind', {direction:'vertical'}, 500); - }); - - $('#ad_schedule').click(function () { - if ($('#ad_schedule').is(':checked')) $('#rc-sc').show('blind', {direction:'vertical'}, 500); - else $('#rc-sc').hide('blind', {direction:'vertical'}, 500); - }); - - $('#limit_hits').click(function () { - if ($('#limit_hits').is(':checked')) $('#rc-hl').show('blind', {direction:'vertical'}, 500); - else $('#rc-hl').hide('blind', {direction:'vertical'}, 500); - }); - - $('#limit_clicks').click(function () { - if ($('#limit_clicks').is(':checked')) $('#rc-cl').show('blind', {direction:'vertical'}, 500); - else $('#rc-cl').hide('blind', {direction:'vertical'}, 500); - }); - } - - if ($('#editor_mode').val() == 'place') { - sPointer = samPointer.places; - sPointer.pointer = 'places'; - - $("#add-file-button").click(function () { - var curFile = options.url + $("select#files_list option:selected").val(); - $("#patch_img").val(curFile); - return false; - }); - - $('#patch_source_image').click(function () { - if ($('#rc-psi').is(':hidden')) $('#rc-psi').show('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':visible')) $('#rc-psc').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':visible')) $('#rc-psd').hide('blind', {direction:'vertical'}, 500); - }); - - $('#patch_source_code').click(function () { - if ($('#rc-psi').is(':visible')) $('#rc-psi').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':hidden')) $('#rc-psc').show('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':visible')) $('#rc-psd').hide('blind', {direction:'vertical'}, 500); - }); - - $('#patch_source_dfp').click(function () { - if ($('#rc-psi').is(':visible')) $('#rc-psi').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':visible')) $('#rc-psc').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':hidden')) $('#rc-psd').show('blind', {direction:'vertical'}, 500); - }); - } - - if(sPointer.enabled || '' == $('#title').val()) { - $('#title').pointer({ - content: '

' + sPointer.title + '

' + sPointer.content + '

', - position: 'top', - close: function() { - $.ajax({ - url: ajaxurl, - data: { - action: 'close_pointer', - pointer: sPointer.pointer - }, - async: true - }); - } - }).pointer('open'); - } - - $('#is_singular').click(function () { - if ($('#is_singular').is(':checked')) - $('#is_single, #is_page, #is_attachment, #is_posttype').attr('checked', true); - }); - - $('#is_single, #is_page, #is_attachment, #is_posttype').click(function () { - if ($('#is_singular').is(':checked') && - (!$('#is_single').is(':checked') || - !$('#is_page').is(':checked') || - !$('#is_attachment').is(':checked') || - !$('#is_posttype').is(':checked') )) { - $('#is_singular').attr('checked', false); - } - else { - if (!$('#is_singular').is(':checked') && - $('#is_single').is(':checked') && - $('#is_posttype').is(':checked') && - $('#is_page').is(':checked') && - $('#is_attachment').is(':checked')) - $('#is_singular').attr('checked', true); - } - }); - - $('#is_archive').click(function () { - if ($('#is_archive').is(':checked')) - $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive').attr('checked', true); - }); - - $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive').click(function () { - if ($('#is_archive').is(':checked') && - (!$('#is_tax').is(':checked') || - !$('#is_category').is(':checked') || - !$('#is_posttype_archive').is(':checked') || - !$('#is_tag').is(':checked') || - !$('#is_author').is(':checked') || - !$('#is_date').is(':checked'))) { - $('#is_archive').attr('checked', false); - } - else { - if (!$('#is_archive').is(':checked') && - $('#is_tax').is(':checked') && - $('#is_category').is(':checked') && - $('#is_posttype_archive').is(':checked') && - $('#is_tag').is(':checked') && - $('#is_author').is(':checked') && - $('#is_date').is(':checked')) { - $('#is_archive').attr('checked', true); - } - } - }); - - return false; - }); -})(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit.min.js b/js/sam-admin-edit.min.js deleted file mode 100644 index 8107b88..0000000 --- a/js/sam-admin-edit.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @author minimus - * @copyright 2010 - 2012 - */ -(function($){$(document).ready(function(){var options=$.parseJSON($.ajax({url:ajaxurl,data:{action:'get_strings'},async:false,dataType:'jsonp'}).responseText);var btnUpload=$("#upload-file-button");var status=$("#uploading");var srcHelp=$("#uploading-help");var loadImg=$('#load_img');var fileExt='';var fu=new AjaxUpload(btnUpload,{action:ajaxurl,name:'uploadfile',data:{action:'upload_ad_image'},onSubmit:function(file,ext){if(!(ext&&/^(jpg|png|jpeg|gif|swf)$/.test(ext))){status.text(options.status);return false}loadImg.show();status.text(options.uploading)},onComplete:function(file,response){status.text('');loadImg.hide();$('
').appendTo(srcHelp);if(response=="success"){$("#files").text(options.file+' '+file+' '+options.uploaded).addClass('updated').delay(3000).fadeOut(1000,function(){$(this).remove()});if($('#editor_mode').val()=='item')$("#ad_img").val(options.url+file);if($('#editor_mode').val()=='place')$("#patch_img").val(options.url+file)}else{$('#files').text(file+' '+response).addClass('error').delay(3000).fadeOut(1000,function(){$(this).remove()})}}});if($('#editor_mode').val()=='item'){$("#ad_start_date, #ad_end_date").datepicker({dateFormat:'yy-mm-dd',showButtonPanel:true});$('#adv_nick').combogrid({url:ajaxurl+'?action=get_combo_data',datatype:"json",munit:'px',alternate:true,colModel:options.users.colModel,select:function(event,ui){$('#adv_nick').val(ui.item.slug);$('#adv_name').val(ui.item.title);$('#adv_mail').val(ui.item.email);return false}});var postsGrid,pgData=options.posts.posts,pgOptions={editable:true,enableCellNavigation:true,asyncEditorLoading:false,autoEdit:false},pgColumns=[],pgCheckboxSelector=new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"});pgColumns.push(pgCheckboxSelector.getColumnDefinition());for(var i=0;i' + @@ -36,10 +47,10 @@ '

'+options.etype+':
'+eType+'

' + '

'+options.msg+':
'+eMsg+'

' + '

'+options.sql+':

' + - ' '; + ' '; - $('#dialog').html(dHTML); - $('#dialog').dialog('open'); + dlg.html(dHTML); + dlg.dialog('open'); }); }); })(jQuery); \ No newline at end of file diff --git a/js/sam-layout.js b/js/sam-layout.js index 3005c0a..91bb43e 100644 --- a/js/sam-layout.js +++ b/js/sam-layout.js @@ -1,26 +1,88 @@ (function($) { $(document).ready(function() { - $(".sam_ad").click(function(e) { - var - adId = $(this).attr('id'), - url = this.href, - target = $(this).attr('target'); - $.ajax({ - type: "POST", - url: samAjax.ajaxurl, - data: { - action: "sam_click", - sam_ad_id: adId, + if(samAjax.load) { + $('div.sam-place').each(function(i, el) { + var codes = $(el).data('sam'); + if('undefined' == typeof codes) codes = 0; + var + ids = this.id.split('_'), + id = ids[1], + pid = ids[2]; + $.ajax({ + url: samAjax.loadurl, + data: { + action: 'load_place', + id: id, + pid: pid, + codes: codes, + wc: samAjax.clauses, + level: samAjax.level + }, + type: 'POST', + crossDomain: true + //dataType: 'jsonp' + }).done(function(data) { + $(el).replaceWith(data.ad); + $.post(samAjax.ajaxurl, { + action: 'sam_hit', + id: data.id, + pid: data.pid, + level: samAjax.level + }); + $('#' + data.cid).find('a').bind('click', function(e) { + $.post(samAjax.ajaxurl, { + action: 'sam_click', + id: data.id, + pid: data.pid, + level: samAjax.level + }); + }); + }); + }); + + $('div.sam-ad').each(function(i, el) { + var + ids = this.id.split('_'), + id = ids[1], + pid = ids[2]; + $.post(samAjax.ajaxurl, { + action: 'sam_hit', + id: id, + pid: pid, level: samAjax.level - }, - async: true + }); + $(el).find('a').bind('click', function(e) { + $.post(samAjax.ajaxurl, { + action: 'sam_click', + id: id, + pid: pid, + level: samAjax.level + }); + }); }); - setTimeout(function() { - if(target == '_blank') window.open(url); - else window.location = url; - }, 100); + } + else { + $('div.sam-container').each(function(i, el) { + var + ids = this.id.split('_'), + id = ids[1], + pid = ids[2]; + $.post(samAjax.ajaxurl, { + action: 'sam_hit', + id: id, + pid: pid, + level: samAjax.level + }); - e.preventDefault(); - }); + $(el).find('a').bind('click', function(e) { + $.post(samAjax.ajaxurl, { + action: 'sam_click', + id: id, + pid: pid, + level: samAjax.level + }); + }); + }); + } }); })(jQuery); \ No newline at end of file diff --git a/js/sam-layout.min.js b/js/sam-layout.min.js new file mode 100644 index 0000000..305e120 --- /dev/null +++ b/js/sam-layout.min.js @@ -0,0 +1 @@ +(function(n){n(document).ready(function(){samAjax.load?(n("div.sam-place").each(function(t,i){var r=n(i).data("sam");"undefined"==typeof r&&(r=0);var u=this.id.split("_"),f=u[1],e=u[2];n.ajax({url:samAjax.loadurl,data:{action:"load_place",id:f,pid:e,codes:r,wc:samAjax.clauses,level:samAjax.level},type:"POST",crossDomain:!0}).done(function(t){n(i).replaceWith(t.ad);n.post(samAjax.ajaxurl,{action:"sam_hit",id:t.id,pid:t.pid,level:samAjax.level});n("#"+t.cid).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:t.id,pid:t.pid,level:samAjax.level})})})}),n("div.sam-ad").each(function(t,i){var r=this.id.split("_"),u=r[1],f=r[2];n.post(samAjax.ajaxurl,{action:"sam_hit",id:u,pid:f,level:samAjax.level});n(i).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:u,pid:f,level:samAjax.level})})})):n("div.sam-container").each(function(t,i){var r=this.id.split("_"),u=r[1],f=r[2];n.post(samAjax.ajaxurl,{action:"sam_hit",id:u,pid:f,level:samAjax.level});n(i).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:u,pid:f,level:samAjax.level})})})})})(jQuery) \ No newline at end of file diff --git a/js/sam-settings.js b/js/sam-settings.js index fe42699..bb2b413 100644 --- a/js/sam-settings.js +++ b/js/sam-settings.js @@ -16,8 +16,17 @@ $('#access').val(options.values[values[1]]); } }); - - var el = $('#errorlog'), elfs = $('#errorlogFS'); + + $('#tabs').tabs(); + + var + hvOpts = {direction: 'vertical'}, + el = $('#errorlog'), elfs = $('#errorlogFS'), + bbp = $('#bbpEnabled'), + bbpBeforePost = $('label[for=bbpBeforePost],#bbpBeforePost'), + bbpList = $('label[for=bbpList],#bbpList'), + bbpMiddlePost = $('label[for=bbpMiddlePost],#bbpMiddlePost'), + bbpAfterPost = $('label[for=bbpAfterPost],#bbpAfterPost'); el.click(function() { if(el.is(':checked')) elfs.attr('checked', true); @@ -27,5 +36,20 @@ elfs.click(function() { if(!elfs.is(':checked')) el.attr('checked', true); }); + + bbp.click(function() { + if(bbp.is(':checked')) { + if(bbpBeforePost.is(':hidden')) bbpBeforePost.show('blind', hvOpts, 500); + if(bbpList.is(':hidden')) bbpList.show('blind', hvOpts, 500); + if(bbpMiddlePost.is(':hidden')) bbpMiddlePost.show('blind', hvOpts, 500); + if(bbpAfterPost.is(':hidden')) bbpAfterPost.show('blind', hvOpts, 500); + } + else { + if(bbpBeforePost.is(':visible')) bbpBeforePost.hide('blind', hvOpts, 500); + if(bbpList.is(':visible')) bbpList.hide('blind', hvOpts, 500); + if(bbpMiddlePost.is(':visible')) bbpMiddlePost.hide('blind', hvOpts, 500); + if(bbpAfterPost.is(':visible')) bbpAfterPost.hide('blind', hvOpts, 500); + } + }); }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/js/sam-settings.min.js b/js/sam-settings.min.js new file mode 100644 index 0000000..8c8d1b3 --- /dev/null +++ b/js/sam-settings.min.js @@ -0,0 +1 @@ +(function(n){n(document).ready(function(){n("#role-slider").slider({from:0,to:4,step:1,limits:!1,dimension:"",scale:options.roles,skin:"round_plastic",calculate:function(n){return options.roles[n]},onstatechange:function(t){var i=t.split(";");n("#access").val(options.values[i[1]])}});n("#tabs").tabs();var t={direction:"vertical"},i=n("#errorlog"),r=n("#errorlogFS"),s=n("#bbpEnabled"),u=n("label[for=bbpBeforePost],#bbpBeforePost"),f=n("label[for=bbpList],#bbpList"),e=n("label[for=bbpMiddlePost],#bbpMiddlePost"),o=n("label[for=bbpAfterPost],#bbpAfterPost");i.click(function(){i.is(":checked")&&r.attr("checked",!0);i.is(":checked")||r.attr("checked",!1)});r.click(function(){r.is(":checked")||i.attr("checked",!0)});s.click(function(){s.is(":checked")?(u.is(":hidden")&&u.show("blind",t,500),f.is(":hidden")&&f.show("blind",t,500),e.is(":hidden")&&e.show("blind",t,500),o.is(":hidden")&&o.show("blind",t,500)):(u.is(":visible")&&u.hide("blind",t,500),f.is(":visible")&&f.hide("blind",t,500),e.is(":visible")&&e.hide("blind",t,500),o.is(":visible")&&o.hide("blind",t,500))})})})(jQuery) \ No newline at end of file diff --git a/js/slick/jquery.event.drag-2.0.min.js b/js/slick/jquery.event.drag-2.0.min.js deleted file mode 100644 index 2cb7fee..0000000 --- a/js/slick/jquery.event.drag-2.0.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * jquery.event.drag - v 2.0.0 - * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com - * Open Source MIT License - http://threedubmedia.com/code/license - */ -;(function(f){f.fn.drag=function(b,a,d){var e=typeof b=="string"?b:"",k=f.isFunction(b)?b:f.isFunction(a)?a:null;if(e.indexOf("drag")!==0)e="drag"+e;d=(b==k?a:d)||{};return k?this.bind(e,d,k):this.trigger(e)};var i=f.event,h=i.special,c=h.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",livekey:"livedrag",add:function(b){var a=f.data(this,c.datakey),d=b.data||{};a.related+=1;if(!a.live&&b.selector){a.live=true;i.add(this,"draginit."+ c.livekey,c.delegate)}f.each(c.defaults,function(e){if(d[e]!==undefined)a[e]=d[e]})},remove:function(){f.data(this,c.datakey).related-=1},setup:function(){if(!f.data(this,c.datakey)){var b=f.extend({related:0},c.defaults);f.data(this,c.datakey,b);i.add(this,"mousedown",c.init,b);this.attachEvent&&this.attachEvent("ondragstart",c.dontstart)}},teardown:function(){if(!f.data(this,c.datakey).related){f.removeData(this,c.datakey);i.remove(this,"mousedown",c.init);i.remove(this,"draginit",c.delegate);c.textselect(true); this.detachEvent&&this.detachEvent("ondragstart",c.dontstart)}},init:function(b){var a=b.data,d;if(!(a.which>0&&b.which!=a.which))if(!f(b.target).is(a.not))if(!(a.handle&&!f(b.target).closest(a.handle,b.currentTarget).length)){a.propagates=1;a.interactions=[c.interaction(this,a)];a.target=b.target;a.pageX=b.pageX;a.pageY=b.pageY;a.dragging=null;d=c.hijack(b,"draginit",a);if(a.propagates){if((d=c.flatten(d))&&d.length){a.interactions=[];f.each(d,function(){a.interactions.push(c.interaction(this,a))})}a.propagates= a.interactions.length;a.drop!==false&&h.drop&&h.drop.handler(b,a);c.textselect(false);i.add(document,"mousemove mouseup",c.handler,a);return false}}},interaction:function(b,a){return{drag:b,callback:new c.callback,droppable:[],offset:f(b)[a.relative?"position":"offset"]()||{top:0,left:0}}},handler:function(b){var a=b.data;switch(b.type){case !a.dragging&&"mousemove":if(Math.pow(b.pageX-a.pageX,2)+Math.pow(b.pageY-a.pageY,2) options.maxToolTipLength) { - text = text.substr(0, options.maxToolTipLength - 3) + "..."; - } - $(node).attr("title", text); - } else { - $(node).attr("title", ""); - } - } - } - - $.extend(this, { - "init": init, - "destroy": destroy - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.autotooltips.min.js b/js/slick/slick.autotooltips.min.js deleted file mode 100644 index 4734869..0000000 --- a/js/slick/slick.autotooltips.min.js +++ /dev/null @@ -1 +0,0 @@ -(function($){$.extend(true,window,{"Slick":{"AutoTooltips":AutoTooltips}});function AutoTooltips(options){var _grid;var _self=this;var _defaults={maxToolTipLength:null};function init(grid){options=$.extend(true,{},_defaults,options);_grid=grid;_grid.onMouseEnter.subscribe(handleMouseEnter)}function destroy(){_grid.onMouseEnter.unsubscribe(handleMouseEnter)}function handleMouseEnter(e,args){var cell=_grid.getCellFromEvent(e);if(cell){var node=_grid.getCellNode(cell.row,cell.cell);if($(node).innerWidth()options.maxToolTipLength){text=text.substr(0,options.maxToolTipLength-3)+"..."}$(node).attr("title",text)}else{$(node).attr("title","")}}}$.extend(this,{"init":init,"destroy":destroy})}})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.cellcopymanager.js b/js/slick/slick.cellcopymanager.js deleted file mode 100644 index c74018d..0000000 --- a/js/slick/slick.cellcopymanager.js +++ /dev/null @@ -1,86 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellCopyManager": CellCopyManager - } - }); - - - function CellCopyManager() { - var _grid; - var _self = this; - var _copiedRanges; - - function init(grid) { - _grid = grid; - _grid.onKeyDown.subscribe(handleKeyDown); - } - - function destroy() { - _grid.onKeyDown.unsubscribe(handleKeyDown); - } - - function handleKeyDown(e, args) { - var ranges; - if (!_grid.getEditorLock().isActive()) { - if (e.which == $.ui.keyCode.ESCAPE) { - if (_copiedRanges) { - e.preventDefault(); - clearCopySelection(); - _self.onCopyCancelled.notify({ranges: _copiedRanges}); - _copiedRanges = null; - } - } - - if (e.which == 67 && (e.ctrlKey || e.metaKey)) { - ranges = _grid.getSelectionModel().getSelectedRanges(); - if (ranges.length != 0) { - e.preventDefault(); - _copiedRanges = ranges; - markCopySelection(ranges); - _self.onCopyCells.notify({ranges: ranges}); - } - } - - if (e.which == 86 && (e.ctrlKey || e.metaKey)) { - if (_copiedRanges) { - e.preventDefault(); - clearCopySelection(); - ranges = _grid.getSelectionModel().getSelectedRanges(); - _self.onPasteCells.notify({from: _copiedRanges, to: ranges}); - _copiedRanges = null; - } - } - } - } - - function markCopySelection(ranges) { - var columns = _grid.getColumns(); - var hash = {}; - for (var i = 0; i < ranges.length; i++) { - for (var j = ranges[i].fromRow; j <= ranges[i].toRow; j++) { - hash[j] = {}; - for (var k = ranges[i].fromCell; k <= ranges[i].toCell; k++) { - hash[j][columns[k].id] = "copied"; - } - } - } - _grid.setCellCssStyles("copy-manager", hash); - } - - function clearCopySelection() { - _grid.removeCellCssStyles("copy-manager"); - } - - $.extend(this, { - "init": init, - "destroy": destroy, - "clearCopySelection": clearCopySelection, - - "onCopyCells": new Slick.Event(), - "onCopyCancelled": new Slick.Event(), - "onPasteCells": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.cellcopymanager.min.js b/js/slick/slick.cellcopymanager.min.js deleted file mode 100644 index b3fa3f9..0000000 --- a/js/slick/slick.cellcopymanager.min.js +++ /dev/null @@ -1 +0,0 @@ -(function($){$.extend(true,window,{"Slick":{"CellCopyManager":CellCopyManager}});function CellCopyManager(){var _grid;var _self=this;var _copiedRanges;function init(grid){_grid=grid;_grid.onKeyDown.subscribe(handleKeyDown)}function destroy(){_grid.onKeyDown.unsubscribe(handleKeyDown)}function handleKeyDown(e,args){var ranges;if(!_grid.getEditorLock().isActive()){if(e.which==$.ui.keyCode.ESCAPE){if(_copiedRanges){e.preventDefault();clearCopySelection();_self.onCopyCancelled.notify({ranges:_copiedRanges});_copiedRanges=null}}if(e.which==67&&(e.ctrlKey||e.metaKey)){ranges=_grid.getSelectionModel().getSelectedRanges();if(ranges.length!=0){e.preventDefault();_copiedRanges=ranges;markCopySelection(ranges);_self.onCopyCells.notify({ranges:ranges})}}if(e.which==86&&(e.ctrlKey||e.metaKey)){if(_copiedRanges){e.preventDefault();clearCopySelection();ranges=_grid.getSelectionModel().getSelectedRanges();_self.onPasteCells.notify({from:_copiedRanges,to:ranges});_copiedRanges=null}}}}function markCopySelection(ranges){var columns=_grid.getColumns();var hash={};for(var i=0;i
", {css: options.selectionCss}) - .css("position", "absolute") - .appendTo(grid.getCanvasNode()); - } - - var from = grid.getCellNodeBox(range.fromRow, range.fromCell); - var to = grid.getCellNodeBox(range.toRow, range.toCell); - - _elem.css({ - top: from.top - 1, - left: from.left - 1, - height: to.bottom - from.top - 2, - width: to.right - from.left - 2 - }); - - return _elem; - } - - function hide() { - if (_elem) { - _elem.remove(); - _elem = null; - } - } - - $.extend(this, { - "show": show, - "hide": hide - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.cellrangeselector.js b/js/slick/slick.cellrangeselector.js deleted file mode 100644 index c2dee9a..0000000 --- a/js/slick/slick.cellrangeselector.js +++ /dev/null @@ -1,112 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellRangeSelector": CellRangeSelector - } - }); - - - function CellRangeSelector(options) { - var _grid; - var _canvas; - var _dragging; - var _decorator; - var _self = this; - var _defaults = { - selectionCss: { - "border": "2px dashed blue" - } - }; - - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _decorator = new Slick.CellRangeDecorator(grid, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _grid.onDragInit.subscribe(handleDragInit); - _grid.onDragStart.subscribe(handleDragStart); - _grid.onDrag.subscribe(handleDrag); - _grid.onDragEnd.subscribe(handleDragEnd); - } - - function destroy() { - _grid.onDragInit.unsubscribe(handleDragInit); - _grid.onDragStart.unsubscribe(handleDragStart); - _grid.onDrag.unsubscribe(handleDrag); - _grid.onDragEnd.unsubscribe(handleDragEnd); - } - - function handleDragInit(e, dd) { - // prevent the grid from cancelling drag'n'drop by default - e.stopImmediatePropagation(); - } - - function handleDragStart(e, dd) { - var cell = _grid.getCellFromEvent(e); - if (_self.onBeforeCellRangeSelected.notify(cell) !== false) { - if (_grid.canCellBeSelected(cell.row, cell.cell)) { - _dragging = true; - e.stopImmediatePropagation(); - } - } - if (!_dragging) { - return; - } - - var start = _grid.getCellFromPoint( - dd.startX - $(_canvas).offset().left, - dd.startY - $(_canvas).offset().top); - - dd.range = {start: start, end: {}}; - - return _decorator.show(new Slick.Range(start.row, start.cell)); - } - - function handleDrag(e, dd) { - if (!_dragging) { - return; - } - e.stopImmediatePropagation(); - - var end = _grid.getCellFromPoint( - e.pageX - $(_canvas).offset().left, - e.pageY - $(_canvas).offset().top); - - if (!_grid.canCellBeSelected(end.row, end.cell)) { - return; - } - - dd.range.end = end; - _decorator.show(new Slick.Range(dd.range.start.row, dd.range.start.cell, end.row, end.cell)); - } - - function handleDragEnd(e, dd) { - if (!_dragging) { - return; - } - - _dragging = false; - e.stopImmediatePropagation(); - - _decorator.hide(); - _self.onCellRangeSelected.notify({ - range: new Slick.Range( - dd.range.start.row, - dd.range.start.cell, - dd.range.end.row, - dd.range.end.cell - ) - }); - } - - $.extend(this, { - "init": init, - "destroy": destroy, - - "onBeforeCellRangeSelected": new Slick.Event(), - "onCellRangeSelected": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.cellselectionmodel.js b/js/slick/slick.cellselectionmodel.js deleted file mode 100644 index fa91d3c..0000000 --- a/js/slick/slick.cellselectionmodel.js +++ /dev/null @@ -1,92 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellSelectionModel": CellSelectionModel - } - }); - - - function CellSelectionModel(options) { - var _grid; - var _canvas; - var _ranges = []; - var _self = this; - var _selector = new Slick.CellRangeSelector({ - "selectionCss": { - "border": "2px solid black" - } - }); - var _options; - var _defaults = { - selectActiveCell: true - }; - - - function init(grid) { - _options = $.extend(true, {}, _defaults, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _grid.onActiveCellChanged.subscribe(handleActiveCellChange); - grid.registerPlugin(_selector); - _selector.onCellRangeSelected.subscribe(handleCellRangeSelected); - _selector.onBeforeCellRangeSelected.subscribe(handleBeforeCellRangeSelected); - } - - function destroy() { - _grid.onActiveCellChanged.unsubscribe(handleActiveCellChange); - _selector.onCellRangeSelected.unsubscribe(handleCellRangeSelected); - _selector.onBeforeCellRangeSelected.unsubscribe(handleBeforeCellRangeSelected); - _grid.unregisterPlugin(_selector); - } - - function removeInvalidRanges(ranges) { - var result = []; - - for (var i = 0; i < ranges.length; i++) { - var r = ranges[i]; - if (_grid.canCellBeSelected(r.fromRow, r.fromCell) && _grid.canCellBeSelected(r.toRow, r.toCell)) { - result.push(r); - } - } - - return result; - } - - function setSelectedRanges(ranges) { - _ranges = removeInvalidRanges(ranges); - _self.onSelectedRangesChanged.notify(_ranges); - } - - function getSelectedRanges() { - return _ranges; - } - - function handleBeforeCellRangeSelected(e, args) { - if (_grid.getEditorLock().isActive()) { - e.stopPropagation(); - return false; - } - } - - function handleCellRangeSelected(e, args) { - setSelectedRanges([args.range]); - } - - function handleActiveCellChange(e, args) { - if (_options.selectActiveCell) { - setSelectedRanges([new Slick.Range(args.row, args.cell)]); - } - } - - $.extend(this, { - "getSelectedRanges": getSelectedRanges, - "setSelectedRanges": setSelectedRanges, - - "init": init, - "destroy": destroy, - - "onSelectedRangesChanged": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.checkboxselectcolumn.js b/js/slick/slick.checkboxselectcolumn.js deleted file mode 100644 index 4dd918f..0000000 --- a/js/slick/slick.checkboxselectcolumn.js +++ /dev/null @@ -1,154 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CheckboxSelectColumn": CheckboxSelectColumn - } - }); - - - function CheckboxSelectColumn(options) { - var _grid; - var _self = this; - var _selectedRowsLookup = {}; - var _defaults = { - columnId: "_checkbox_selector", - cssClass: null, - toolTip: "Select/Deselect All", - width: 30 - }; - - var _options = $.extend(true, {}, _defaults, options); - - function init(grid) { - _grid = grid; - _grid.onSelectedRowsChanged.subscribe(handleSelectedRowsChanged); - _grid.onClick.subscribe(handleClick); - _grid.onHeaderClick.subscribe(handleHeaderClick); - _grid.onKeyDown.subscribe(handleKeyDown); - } - - function destroy() { - _grid.onSelectedRowsChanged.unsubscribe(handleSelectedRowsChanged); - _grid.onClick.unsubscribe(handleClick); - _grid.onHeaderClick.unsubscribe(handleHeaderClick); - _grid.onKeyDown.unsubscribe(handleKeyDown); - } - - function handleSelectedRowsChanged(e, args) { - var selectedRows = _grid.getSelectedRows(); - var lookup = {}, row, i; - for (i = 0; i < selectedRows.length; i++) { - row = selectedRows[i]; - lookup[row] = true; - if (lookup[row] !== _selectedRowsLookup[row]) { - _grid.invalidateRow(row); - delete _selectedRowsLookup[row]; - } - } - for (i in _selectedRowsLookup) { - _grid.invalidateRow(i); - } - _selectedRowsLookup = lookup; - _grid.render(); - - if (selectedRows.length == _grid.getDataLength()) { - _grid.updateColumnHeader(_options.columnId, "", _options.toolTip); - } else { - _grid.updateColumnHeader(_options.columnId, "", _options.toolTip); - } - } - - function handleKeyDown(e, args) { - if (e.which == 32) { - if (_grid.getColumns()[args.cell].id === _options.columnId) { - // if editing, try to commit - if (!_grid.getEditorLock().isActive() || _grid.getEditorLock().commitCurrentEdit()) { - toggleRowSelection(args.row); - } - e.preventDefault(); - e.stopImmediatePropagation(); - } - } - } - - function handleClick(e, args) { - // clicking on a row select checkbox - if (_grid.getColumns()[args.cell].id === _options.columnId && $(e.target).is(":checkbox")) { - // if editing, try to commit - if (_grid.getEditorLock().isActive() && !_grid.getEditorLock().commitCurrentEdit()) { - e.preventDefault(); - e.stopImmediatePropagation(); - return; - } - - toggleRowSelection(args.row); - e.stopPropagation(); - e.stopImmediatePropagation(); - } - } - - function toggleRowSelection(row) { - if (_selectedRowsLookup[row]) { - _grid.setSelectedRows($.grep(_grid.getSelectedRows(), function (n) { - return n != row - })); - } else { - _grid.setSelectedRows(_grid.getSelectedRows().concat(row)); - } - } - - function handleHeaderClick(e, args) { - if (args.column.id == _options.columnId && $(e.target).is(":checkbox")) { - // if editing, try to commit - if (_grid.getEditorLock().isActive() && !_grid.getEditorLock().commitCurrentEdit()) { - e.preventDefault(); - e.stopImmediatePropagation(); - return; - } - - if ($(e.target).is(":checked")) { - var rows = []; - for (var i = 0; i < _grid.getDataLength(); i++) { - rows.push(i); - } - _grid.setSelectedRows(rows); - } else { - _grid.setSelectedRows([]); - } - e.stopPropagation(); - e.stopImmediatePropagation(); - } - } - - function getColumnDefinition() { - return { - id: _options.columnId, - name: "", - toolTip: _options.toolTip, - field: "sel", - width: _options.width, - resizable: false, - sortable: false, - cssClass: _options.cssClass, - formatter: checkboxSelectionFormatter - }; - } - - function checkboxSelectionFormatter(row, cell, value, columnDef, dataContext) { - if (dataContext) { - return _selectedRowsLookup[row] - ? "" - : ""; - } - return null; - } - - $.extend(this, { - "init": init, - "destroy": destroy, - - "getColumnDefinition": getColumnDefinition - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.core.js b/js/slick/slick.core.js deleted file mode 100644 index efb6a97..0000000 --- a/js/slick/slick.core.js +++ /dev/null @@ -1,424 +0,0 @@ -/*** - * Contains core SlickGrid classes. - * @module Core - * @namespace Slick - */ - -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Event": Event, - "EventData": EventData, - "EventHandler": EventHandler, - "Range": Range, - "NonDataRow": NonDataItem, - "Group": Group, - "GroupTotals": GroupTotals, - "EditorLock": EditorLock, - - /*** - * A global singleton editor lock. - * @class GlobalEditorLock - * @static - * @constructor - */ - "GlobalEditorLock": new EditorLock() - } - }); - - /*** - * An event object for passing data to event handlers and letting them control propagation. - *

This is pretty much identical to how W3C and jQuery implement events.

- * @class EventData - * @constructor - */ - function EventData() { - var isPropagationStopped = false; - var isImmediatePropagationStopped = false; - - /*** - * Stops event from propagating up the DOM tree. - * @method stopPropagation - */ - this.stopPropagation = function () { - isPropagationStopped = true; - }; - - /*** - * Returns whether stopPropagation was called on this event object. - * @method isPropagationStopped - * @return {Boolean} - */ - this.isPropagationStopped = function () { - return isPropagationStopped; - }; - - /*** - * Prevents the rest of the handlers from being executed. - * @method stopImmediatePropagation - */ - this.stopImmediatePropagation = function () { - isImmediatePropagationStopped = true; - }; - - /*** - * Returns whether stopImmediatePropagation was called on this event object.\ - * @method isImmediatePropagationStopped - * @return {Boolean} - */ - this.isImmediatePropagationStopped = function () { - return isImmediatePropagationStopped; - } - } - - /*** - * A simple publisher-subscriber implementation. - * @class Event - * @constructor - */ - function Event() { - var handlers = []; - - /*** - * Adds an event handler to be called when the event is fired. - *

Event handler will receive two arguments - an EventData and the data - * object the event was fired with.

- * @method subscribe - * @param fn {Function} Event handler. - */ - this.subscribe = function (fn) { - handlers.push(fn); - }; - - /*** - * Removes an event handler added with subscribe(fn). - * @method unsubscribe - * @param fn {Function} Event handler to be removed. - */ - this.unsubscribe = function (fn) { - for (var i = handlers.length - 1; i >= 0; i--) { - if (handlers[i] === fn) { - handlers.splice(i, 1); - } - } - }; - - /*** - * Fires an event notifying all subscribers. - * @method notify - * @param args {Object} Additional data object to be passed to all handlers. - * @param e {EventData} - * Optional. - * An EventData object to be passed to all handlers. - * For DOM events, an existing W3C/jQuery event object can be passed in. - * @param scope {Object} - * Optional. - * The scope ("this") within which the handler will be executed. - * If not specified, the scope will be set to the Event instance. - */ - this.notify = function (args, e, scope) { - e = e || new EventData(); - scope = scope || this; - - var returnValue; - for (var i = 0; i < handlers.length && !(e.isPropagationStopped() || e.isImmediatePropagationStopped()); i++) { - returnValue = handlers[i].call(scope, e, args); - } - - return returnValue; - }; - } - - function EventHandler() { - var handlers = []; - - this.subscribe = function (event, handler) { - handlers.push({ - event: event, - handler: handler - }); - event.subscribe(handler); - }; - - this.unsubscribe = function (event, handler) { - var i = handlers.length; - while (i--) { - if (handlers[i].event === event && - handlers[i].handler === handler) { - handlers.splice(i, 1); - event.unsubscribe(handler); - return; - } - } - }; - - this.unsubscribeAll = function () { - var i = handlers.length; - while (i--) { - handlers[i].event.unsubscribe(handlers[i].handler); - } - handlers = []; - } - } - - /*** - * A structure containing a range of cells. - * @class Range - * @constructor - * @param fromRow {Integer} Starting row. - * @param fromCell {Integer} Starting cell. - * @param toRow {Integer} Optional. Ending row. Defaults to fromRow. - * @param toCell {Integer} Optional. Ending cell. Defaults to fromCell. - */ - function Range(fromRow, fromCell, toRow, toCell) { - if (toRow === undefined && toCell === undefined) { - toRow = fromRow; - toCell = fromCell; - } - - /*** - * @property fromRow - * @type {Integer} - */ - this.fromRow = Math.min(fromRow, toRow); - - /*** - * @property fromCell - * @type {Integer} - */ - this.fromCell = Math.min(fromCell, toCell); - - /*** - * @property toRow - * @type {Integer} - */ - this.toRow = Math.max(fromRow, toRow); - - /*** - * @property toCell - * @type {Integer} - */ - this.toCell = Math.max(fromCell, toCell); - - /*** - * Returns whether a range represents a single row. - * @method isSingleRow - * @return {Boolean} - */ - this.isSingleRow = function () { - return this.fromRow == this.toRow; - }; - - /*** - * Returns whether a range represents a single cell. - * @method isSingleCell - * @return {Boolean} - */ - this.isSingleCell = function () { - return this.fromRow == this.toRow && this.fromCell == this.toCell; - }; - - /*** - * Returns whether a range contains a given cell. - * @method contains - * @param row {Integer} - * @param cell {Integer} - * @return {Boolean} - */ - this.contains = function (row, cell) { - return row >= this.fromRow && row <= this.toRow && - cell >= this.fromCell && cell <= this.toCell; - }; - - /*** - * Returns a readable representation of a range. - * @method toString - * @return {String} - */ - this.toString = function () { - if (this.isSingleCell()) { - return "(" + this.fromRow + ":" + this.fromCell + ")"; - } - else { - return "(" + this.fromRow + ":" + this.fromCell + " - " + this.toRow + ":" + this.toCell + ")"; - } - } - } - - - /*** - * A base class that all special / non-data rows (like Group and GroupTotals) derive from. - * @class NonDataItem - * @constructor - */ - function NonDataItem() { - this.__nonDataRow = true; - } - - - /*** - * Information about a group of rows. - * @class Group - * @extends Slick.NonDataItem - * @constructor - */ - function Group() { - this.__group = true; - this.__updated = false; - - /*** - * Number of rows in the group. - * @property count - * @type {Integer} - */ - this.count = 0; - - /*** - * Grouping value. - * @property value - * @type {Object} - */ - this.value = null; - - /*** - * Formatted display value of the group. - * @property title - * @type {String} - */ - this.title = null; - - /*** - * Whether a group is collapsed. - * @property collapsed - * @type {Boolean} - */ - this.collapsed = false; - - /*** - * GroupTotals, if any. - * @property totals - * @type {GroupTotals} - */ - this.totals = null; - } - - Group.prototype = new NonDataItem(); - - /*** - * Compares two Group instances. - * @method equals - * @return {Boolean} - * @param group {Group} Group instance to compare to. - */ - Group.prototype.equals = function (group) { - return this.value === group.value && - this.count === group.count && - this.collapsed === group.collapsed; - }; - - /*** - * Information about group totals. - * An instance of GroupTotals will be created for each totals row and passed to the aggregators - * so that they can store arbitrary data in it. That data can later be accessed by group totals - * formatters during the display. - * @class GroupTotals - * @extends Slick.NonDataItem - * @constructor - */ - function GroupTotals() { - this.__groupTotals = true; - - /*** - * Parent Group. - * @param group - * @type {Group} - */ - this.group = null; - } - - GroupTotals.prototype = new NonDataItem(); - - /*** - * A locking helper to track the active edit controller and ensure that only a single controller - * can be active at a time. This prevents a whole class of state and validation synchronization - * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress - * and attempt a commit or cancel before proceeding. - * @class EditorLock - * @constructor - */ - function EditorLock() { - var activeEditController = null; - - /*** - * Returns true if a specified edit controller is active (has the edit lock). - * If the parameter is not specified, returns true if any edit controller is active. - * @method isActive - * @param editController {EditController} - * @return {Boolean} - */ - this.isActive = function (editController) { - return (editController ? activeEditController === editController : activeEditController !== null); - }; - - /*** - * Sets the specified edit controller as the active edit controller (acquire edit lock). - * If another edit controller is already active, and exception will be thrown. - * @method activate - * @param editController {EditController} edit controller acquiring the lock - */ - this.activate = function (editController) { - if (editController === activeEditController) { // already activated? - return; - } - if (activeEditController !== null) { - throw "SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController"; - } - if (!editController.commitCurrentEdit) { - throw "SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()"; - } - if (!editController.cancelCurrentEdit) { - throw "SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()"; - } - activeEditController = editController; - }; - - /*** - * Unsets the specified edit controller as the active edit controller (release edit lock). - * If the specified edit controller is not the active one, an exception will be thrown. - * @method deactivate - * @param editController {EditController} edit controller releasing the lock - */ - this.deactivate = function (editController) { - if (activeEditController !== editController) { - throw "SlickGrid.EditorLock.deactivate: specified editController is not the currently active one"; - } - activeEditController = null; - }; - - /*** - * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit - * controller and returns whether the commit attempt was successful (commit may fail due to validation - * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded - * and false otherwise. If no edit controller is active, returns true. - * @method commitCurrentEdit - * @return {Boolean} - */ - this.commitCurrentEdit = function () { - return (activeEditController ? activeEditController.commitCurrentEdit() : true); - }; - - /*** - * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit - * controller and returns whether the edit was successfully cancelled. If no edit controller is - * active, returns true. - * @method cancelCurrentEdit - * @return {Boolean} - */ - this.cancelCurrentEdit = function cancelCurrentEdit() { - return (activeEditController ? activeEditController.cancelCurrentEdit() : true); - }; - } -})(jQuery); - - diff --git a/js/slick/slick.editors.js b/js/slick/slick.editors.js deleted file mode 100644 index a3666c2..0000000 --- a/js/slick/slick.editors.js +++ /dev/null @@ -1,512 +0,0 @@ -/*** - * Contains basic SlickGrid editors. - * @module Editors - * @namespace Slick - */ - -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Editors": { - "Text": TextEditor, - "Integer": IntegerEditor, - "Date": DateEditor, - "YesNoSelect": YesNoSelectEditor, - "Checkbox": CheckboxEditor, - "PercentComplete": PercentCompleteEditor, - "LongText": LongTextEditor - } - } - }); - - function TextEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $("") - .appendTo(args.container) - .bind("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }) - .focus() - .select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.getValue = function () { - return $input.val(); - }; - - this.setValue = function (val) { - $input.val(val); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field] || ""; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return $input.val(); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (args.column.validator) { - var validationResults = args.column.validator($input.val()); - if (!validationResults.valid) { - return validationResults; - } - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function IntegerEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - - $input.bind("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }); - - $input.appendTo(args.container); - $input.focus().select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return parseInt($input.val(), 10) || 0; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (isNaN($input.val())) { - return { - valid: false, - msg: "Please enter a valid integer" - }; - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function DateEditor(args) { - var $input; - var defaultValue; - var scope = this; - var calendarOpen = false; - - this.init = function () { - $input = $(""); - $input.appendTo(args.container); - $input.focus().select(); - $input.datepicker({ - showOn: "button", - buttonImageOnly: true, - buttonImage: "../images/calendar.gif", - beforeShow: function () { - calendarOpen = true - }, - onClose: function () { - calendarOpen = false - } - }); - $input.width($input.width() - 18); - }; - - this.destroy = function () { - $.datepicker.dpDiv.stop(true, true); - $input.datepicker("hide"); - $input.datepicker("destroy"); - $input.remove(); - }; - - this.show = function () { - if (calendarOpen) { - $.datepicker.dpDiv.stop(true, true).show(); - } - }; - - this.hide = function () { - if (calendarOpen) { - $.datepicker.dpDiv.stop(true, true).hide(); - } - }; - - this.position = function (position) { - if (!calendarOpen) { - return; - } - $.datepicker.dpDiv - .css("top", position.top + 30) - .css("left", position.left); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return $input.val(); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function YesNoSelectEditor(args) { - var $select; - var defaultValue; - var scope = this; - - this.init = function () { - $select = $(""); - $select.appendTo(args.container); - $select.focus(); - }; - - this.destroy = function () { - $select.remove(); - }; - - this.focus = function () { - $select.focus(); - }; - - this.loadValue = function (item) { - $select.val((defaultValue = item[args.column.field]) ? "yes" : "no"); - $select.select(); - }; - - this.serializeValue = function () { - return ($select.val() == "yes"); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return ($select.val() != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function CheckboxEditor(args) { - var $select; - var defaultValue; - var scope = this; - - this.init = function () { - $select = $(""); - $select.appendTo(args.container); - $select.focus(); - }; - - this.destroy = function () { - $select.remove(); - }; - - this.focus = function () { - $select.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - if (defaultValue) { - $select.attr("checked", "checked"); - } else { - $select.removeAttr("checked"); - } - }; - - this.serializeValue = function () { - return $select.attr("checked"); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return ($select.attr("checked") != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function PercentCompleteEditor(args) { - var $input, $picker; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - $input.width($(args.container).innerWidth() - 25); - $input.appendTo(args.container); - - $picker = $("

").appendTo(args.container); - $picker.append("
"); - - $picker.find(".editor-percentcomplete-buttons").append("

"); - - $input.focus().select(); - - $picker.find(".editor-percentcomplete-slider").slider({ - orientation: "vertical", - range: "min", - value: defaultValue, - slide: function (event, ui) { - $input.val(ui.value) - } - }); - - $picker.find(".editor-percentcomplete-buttons button").bind("click", function (e) { - $input.val($(this).attr("val")); - $picker.find(".editor-percentcomplete-slider").slider("value", $(this).attr("val")); - }) - }; - - this.destroy = function () { - $input.remove(); - $picker.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - $input.val(defaultValue = item[args.column.field]); - $input.select(); - }; - - this.serializeValue = function () { - return parseInt($input.val(), 10) || 0; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ((parseInt($input.val(), 10) || 0) != defaultValue); - }; - - this.validate = function () { - if (isNaN(parseInt($input.val(), 10))) { - return { - valid: false, - msg: "Please enter a valid positive number" - }; - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - /* - * An example of a "detached" editor. - * The UI is added onto document BODY and .position(), .show() and .hide() are implemented. - * KeyDown events are also handled to provide handling for Tab, Shift-Tab, Esc and Ctrl-Enter. - */ - function LongTextEditor(args) { - var $input, $wrapper; - var defaultValue; - var scope = this; - - this.init = function () { - var $container = $("body"); - - $wrapper = $("
") - .appendTo($container); - - $input = $("'); + $('#_tmp_copy_data').focus(); + setTimeout(function () { + obj.paste($('#_tmp_copy_data').val()); + $('#_tmp_copy_data').remove(); + }, 50); // need timer to allow paste + } + break; + + case 88: // x - cut + if (event.ctrlKey || event.metaKey) { + setTimeout(function () { obj.delete(true); }, 100); + } + case 67: // c - copy + if (event.ctrlKey || event.metaKey) { + var text = obj.copy(); + $('body').append(''); + $('#_tmp_copy_data').focus().select(); + setTimeout(function () { $('#_tmp_copy_data').remove(); }, 50); + } + break; + } + var tmp = [187, 189]; // =- + for (var i=48; i<=90; i++) tmp.push(i); // 0-9,a-z,A-Z + if (tmp.indexOf(event.keyCode) != -1 && !event.ctrlKey && !event.metaKey && !cancel) { + if (columns.length == 0) columns.push(0); + var tmp = String.fromCharCode(event.keyCode); + if (event.keyCode == 187) tmp = '='; + if (event.keyCode == 189) tmp = '-'; + if (!event.shiftKey) tmp = tmp.toLowerCase(); + obj.editField(recid, columns[0], tmp, event); + cancel = true; + } + if (cancel) { // cancel default behaviour + if (event.preventDefault) event.preventDefault(); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + + function nextRow (ind) { + if ((ind + 1 < obj.records.length && obj.last.searchIds.length == 0) // if there are more records + || (obj.last.searchIds.length > 0 && ind < obj.last.searchIds[obj.last.searchIds.length-1])) { + ind++; + if (obj.last.searchIds.length > 0) { + while (true) { + if ($.inArray(ind, obj.last.searchIds) != -1 || ind > obj.records.length) break; + ind++; + } + } + return ind; + } else { + return null; + } + } + + function prevRow (ind) { + if ((ind > 0 && obj.last.searchIds.length == 0) // if there are more records + || (obj.last.searchIds.length > 0 && ind > obj.last.searchIds[0])) { + ind--; + if (obj.last.searchIds.length > 0) { + while (true) { + if ($.inArray(ind, obj.last.searchIds) != -1 || ind < 0) break; + ind--; + } + } + return ind; + } else { + return null; + } + } + + function nextCell (check) { + var newCheck = check + 1; + if (obj.columns.length == newCheck) return check; + if (obj.columns[newCheck].hidden) return findNext(newCheck); + return newCheck; + } + + function prevCell (check) { + var newCheck = check - 1; + if (newCheck < 0) return check; + if (obj.columns[newCheck].hidden) return findPrev(newCheck); + return newCheck; + } + + function tmpUnselect () { + if (obj.last.sel_type != 'click') return false; + if (obj.selectType != 'row') { + obj.last.sel_type = 'key'; + if (sel.length > 1) { + for (var s in sel) { + if (sel[s].recid == obj.last.sel_recid && sel[s].column == obj.last.sel_col) { + sel.splice(s, 1); + break; + } + } + obj.unselect.apply(obj, sel); + return true; + } + return false; + } else { + obj.last.sel_type = 'key'; + if (sel.length > 1) { + sel.splice(sel.indexOf(obj.records[obj.last.sel_ind].recid), 1); + obj.unselect.apply(obj, sel); + return true; + } + return false; + } + } + }, + + scrollIntoView: function (ind) { + if (typeof ind == 'undefined') { + var sel = this.getSelection(); + if (sel.length == 0) return; + ind = this.get(sel[0], true); + } + var records = $('#grid_'+ this.name +'_records'); + if (records.length == 0) return; + // if all records in view + var len = this.last.searchIds.length; + if (records.height() > this.recordHeight * (len > 0 ? len : this.records.length)) return; + if (len > 0) ind = this.last.searchIds.indexOf(ind); // if seach is applied + // scroll to correct one + var t1 = Math.floor(records[0].scrollTop / this.recordHeight); + var t2 = t1 + Math.floor(records.height() / this.recordHeight); + if (ind == t1) records.animate({ 'scrollTop': records.scrollTop() - records.height() / 1.3 }); + if (ind == t2) records.animate({ 'scrollTop': records.scrollTop() + records.height() / 1.3 }); + if (ind < t1 || ind > t2) records.animate({ 'scrollTop': (ind - 1) * this.recordHeight }); + }, + + dblClick: function (recid, event) { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // find columns + var column = null; + if (typeof recid == 'object') { + column = recid.column; + recid = recid.recid; + } + if (typeof event == 'undefined') event = {}; + // column user clicked on + if (column == null && event.target) { + var tmp = event.target; + if (tmp.tagName != 'TD') tmp = $(tmp).parents('td')[0]; + column = parseInt($(tmp).attr('col')); + } + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'dblClick', recid: recid, column: column, originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default action + this.selectNone(); + var col = this.columns[column]; + if (col && $.isPlainObject(col.editable)) { + this.editField(recid, column, null, event); + } else { + this.select({ recid: recid, column: column }); + this.last.selected = this.getSelection(); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + toggle: function (recid) { + var rec = this.get(recid); + if (rec.expanded === true) return this.collapse(recid); else return this.expand(recid); + }, + + expand: function (recid) { + var rec = this.get(recid); + var obj = this; + var id = w2utils.escapeId(recid); + if ($('#grid_'+ this.name +'_rec_'+ id +'_expanded_row').length > 0) return false; + if (rec.expanded == 'none') return false; + // insert expand row + var tmp = 1 + (this.show.selectColumn ? 1 : 0); + var addClass = ''; // ($('#grid_'+this.name +'_rec_'+ w2utils.escapeId(recid)).hasClass('w2ui-odd') ? 'w2ui-odd' : 'w2ui-even'); + $('#grid_'+ this.name +'_rec_'+ id).after( + ''+ + (this.show.lineNumbers ? '' : '') + + '
'+ + ' '+ + '
'+ + ' '+ + ''); + // event before + var eventData = this.trigger({ phase: 'before', type: 'expand', target: this.name, recid: recid, + box_id: 'grid_'+ this.name +'_rec_'+ id +'_expanded', ready: ready }); + if (eventData.isCancelled === true) { + $('#grid_'+ this.name +'_rec_'+ id +'_expanded_row').remove(); + return false; + } + // default action + $('#grid_'+ this.name +'_rec_'+ id).attr('expanded', 'yes').addClass('w2ui-expanded'); + $('#grid_'+ this.name +'_rec_'+ id +'_expanded_row').show(); + $('#grid_'+ this.name +'_cell_'+ this.get(recid, true) +'_expand div').html('
'); + rec.expanded = true; + // check if height of expaned row > 5 then remove spinner + setTimeout(ready, 300); + function ready() { + var div1 = $('#grid_'+ obj.name +'_rec_'+ id +'_expanded'); + var div2 = $('#grid_'+ obj.name +'_rec_'+ id +'_expanded_row .w2ui-expanded1 > div'); + if (div1.height() < 5) return; + div1.css('opacity', 1); + div2.show().css('opacity', 1); + $('#grid_'+ obj.name +'_cell_'+ obj.get(recid, true) +'_expand div').html('-'); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.resizeRecords(); + return true; + }, + + collapse: function (recid) { + var rec = this.get(recid); + var obj = this; + var id = w2utils.escapeId(recid); + if ($('#grid_'+ this.name +'_rec_'+ id +'_expanded_row').length == 0) return false; + // event before + var eventData = this.trigger({ phase: 'before', type: 'collapse', target: this.name, recid: recid, + box_id: 'grid_'+ this.name +'_rec_'+ id +'_expanded' }); + if (eventData.isCancelled === true) return false; + // default action + $('#grid_'+ this.name +'_rec_'+ id).removeAttr('expanded').removeClass('w2ui-expanded'); + $('#grid_'+ this.name +'_rec_'+ id +'_expanded').css('opacity', 0); + $('#grid_'+ this.name +'_cell_'+ this.get(recid, true) +'_expand div').html('+'); + setTimeout(function () { + $('#grid_'+ obj.name +'_rec_'+ id +'_expanded').height('0px'); + setTimeout(function () { + $('#grid_'+ obj.name +'_rec_'+ id +'_expanded_row').remove(); + delete rec.expanded; + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resizeRecords(); + }, 300); + }, 200); + return true; + }, + + sort: function (field, direction, multiField) { // if no params - clears sort + // event before + var eventData = this.trigger({ phase: 'before', type: 'sort', target: this.name, field: field, direction: direction, multiField: multiField }); + if (eventData.isCancelled === true) return false; + // check if needed to quit + if (typeof field != 'undefined') { + // default action + var sortIndex = this.sortData.length; + for (var s in this.sortData) { + if (this.sortData[s].field == field) { sortIndex = s; break; } + } + if (typeof direction == 'undefined' || direction == null) { + if (typeof this.sortData[sortIndex] == 'undefined') { + direction = 'asc'; + } else { + switch (String(this.sortData[sortIndex].direction)) { + case 'asc' : direction = 'desc'; break; + case 'desc' : direction = 'asc'; break; + default : direction = 'asc'; break; + } + } + } + if (this.multiSort === false) { this.sortData = []; sortIndex = 0; } + if (multiField != true) { this.sortData = []; sortIndex = 0; } + // set new sort + if (typeof this.sortData[sortIndex] == 'undefined') this.sortData[sortIndex] = {}; + this.sortData[sortIndex].field = field; + this.sortData[sortIndex].direction = direction; + } else { + this.sortData = []; + } + // if local + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (!url) { + this.localSort(); + if (this.searchData.length > 0) this.localSearch(true); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.refresh(); + } else { + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.last.xhr_offset = 0; + this.reload(); + } + }, + + copy: function () { + var sel = this.getSelection(); + if (sel.length == 0) return ''; + var text = ''; + if (typeof sel[0] == 'object') { // cell copy + // find min/max column + var minCol = sel[0].column; + var maxCol = sel[0].column; + var recs = []; + for (var s in sel) { + if (sel[s].column < minCol) minCol = sel[s].column; + if (sel[s].column > maxCol) maxCol = sel[s].column; + if (recs.indexOf(sel[s].index) == -1) recs.push(sel[s].index); + } + recs.sort(); + for (var r in recs) { + var ind = recs[r]; + for (var c = minCol; c <= maxCol; c++) { + var col = this.columns[c]; + if (col.hidden === true) continue; + text += w2utils.stripTags(this.getCellHTML(ind, c)) + '\t'; + } + text = text.substr(0, text.length-1); // remove last \t + text += '\n'; + } + } else { // row copy + for (var s in sel) { + var ind = this.get(sel[s], true); + for (var c in this.columns) { + var col = this.columns[c]; + if (col.hidden === true) continue; + text += w2utils.stripTags(this.getCellHTML(ind, c)) + '\t'; + } + text = text.substr(0, text.length-1); // remove last \t + text += '\n'; + } + } + text = text.substr(0, text.length - 1); + // before event + var eventData = this.trigger({ phase: 'before', type: 'copy', target: this.name, text: text }); + if (eventData.isCancelled === true) return ''; + text = eventData.text; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return text; + }, + + paste: function (text) { + var sel = this.getSelection(); + var ind = this.get(sel[0].recid, true); + var col = sel[0].column; + // before event + var eventData = this.trigger({ phase: 'before', type: 'paste', target: this.name, text: text, index: ind, column: col }); + if (eventData.isCancelled === true) return; + text = eventData.text; + // default action + if (this.selectType == 'row' || sel.length == 0) { + console.log('ERROR: You can paste only if grid.selectType = \'cell\' and when at least one cell selected.'); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return; + } + var newSel = []; + var text = text.split('\n'); + for (var t in text) { + var tmp = text[t].split('\t'); + var cnt = 0; + var rec = this.records[ind]; + var cols = []; + for (var dt in tmp) { + if (!this.columns[col + cnt]) continue; + var field = this.columns[col + cnt].field; + rec.changed = true; + rec.changes = rec.changes || {}; + rec.changes[field] = tmp[dt]; + cols.push(col + cnt); + cnt++; + } + for (var c in cols) newSel.push({ recid: rec.recid, column: cols[c] }); + ind++; + } + this.selectNone(); + this.select.apply(this, newSel); + this.refresh(); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + // ================================================== + // --- Common functions + + resize: function () { + var obj = this; + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // make sure the box is right + if (!this.box || $(this.box).attr('name') != this.name) return; + // determine new width and height + $(this.box).find('> div') + .css('width', $(this.box).width()) + .css('height', $(this.box).height()); + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name }); + if (eventData.isCancelled === true) return false; + // resize + obj.resizeBoxes(); + obj.resizeRecords(); + // init editable + // $('#grid_'+ obj.name + '_records .w2ui-editable input').each(function (index, el) { + // var column = obj.columns[$(el).attr('column')]; + // if (column && column.editable) $(el).w2field(column.editable); + // }); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + refresh: function () { + var obj = this; + var time = (new Date()).getTime(); + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (this.total <= 0 && !url && this.searchData.length == 0) { + this.total = this.records.length; + this.buffered = this.total; + } + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + this.toolbar.disable('edit', 'delete'); + if (!this.box) return; + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'refresh' }); + if (eventData.isCancelled === true) return false; + // -- header + if (this.show.header) { + $('#grid_'+ this.name +'_header').html(this.header +' ').show(); + } else { + $('#grid_'+ this.name +'_header').hide(); + } + // -- toolbar + if (this.show.toolbar) { + // if select-collumn is checked - no toolbar refresh + if (this.toolbar && this.toolbar.get('column-on-off') && this.toolbar.get('column-on-off').checked) { + // no action + } else { + $('#grid_'+ this.name +'_toolbar').show(); + // refresh toolbar only once + if (typeof this.toolbar == 'object') { + this.toolbar.refresh(); + var tmp = $('#grid_'+ obj.name +'_search_all'); + tmp.val(this.last.search); + } + } + } else { + $('#grid_'+ this.name +'_toolbar').hide(); + } + // -- make sure search is closed + this.searchClose(); + // search placeholder + var searchEl = $('#grid_'+ obj.name +'_search_all'); + if (this.searches.length == 0) { + this.last.field = 'all'; + } + if (!this.multiSearch && this.last.field == 'all' && this.searches.length > 0) { + this.last.field = this.searches[0].field; + this.last.caption = this.searches[0].caption; + } + for (var s in this.searches) { + if (this.searches[s].field == this.last.field) this.last.caption = this.searches[s].caption; + } + if (this.last.multi) { + searchEl.attr('placeholder', '[' + w2utils.lang('Multiple Fields') + ']'); + } else { + searchEl.attr('placeholder', this.last.caption); + } + + // focus search if last searched + if (this._focus_when_refreshed === true) { + clearTimeout(obj._focus_timer); + obj._focus_timer = setTimeout(function () { + if (searchEl.length > 0) { searchEl[0].focus(); } + delete obj._focus_when_refreshed; + delete obj._focus_timer; + }, 600); // need time to render + } + + // -- separate summary + var tmp = this.find({ summary: true }, true); + if (tmp.length > 0) { + for (var t in tmp) this.summary.push(this.records[tmp[t]]); + for (var t=tmp.length-1; t>=0; t--) this.records.splice(tmp[t], 1); + this.total = this.total - tmp.length; + this.buffered = this.buffered - tmp.length; + } + + // -- body + var bodyHTML = ''; + bodyHTML += '
'+ + this.getRecordsHTML() + + '
'+ + '
'+ + ' '+ this.getColumnsHTML() +'
'+ + '
'; // Columns need to be after to be able to overlap + $('#grid_'+ this.name +'_body').html(bodyHTML); + // show summary records + if (this.summary.length > 0) { + $('#grid_'+ this.name +'_summary').html(this.getSummaryHTML()).show(); + } else { + $('#grid_'+ this.name +'_summary').hide(); + } + // -- footer + if (this.show.footer) { + $('#grid_'+ this.name +'_footer').html(this.getFooterHTML()).show(); + } else { + $('#grid_'+ this.name +'_footer').hide(); + } + // select last selected record + if (this.last.selected.length > 0) for (var s in this.last.selected) { + if (this.get(this.last.selected[s]) != null) { + this.select(this.get(this.last.selected[s]).recid); + } + } + // show/hide clear search link + if (this.searchData.length > 0) { + $('#grid_'+ this.name +'_searchClear').show(); + } else { + $('#grid_'+ this.name +'_searchClear').hide(); + } + // all selected? + $('#grid_'+ this.name +'_check_all').prop('checked', true); + if ($('#grid_'+ this.name +'_records').find('.grid_select_check[type=checkbox]').length != 0 && + $('#grid_'+ this.name +'_records').find('.grid_select_check[type=checkbox]').length == $('#grid_'+ this.name +'_records').find('.grid_select_check[type=checkbox]:checked').length) { + $('#grid_'+ this.name +'_check_all').prop('checked', true); + } else { + $('#grid_'+ this.name +'_check_all').prop("checked", false); + } + // show number of selected + this.status(); + // collapse all records + var rows = obj.find({ expanded: true }, true); + for (var r in rows) obj.records[rows[r]].expanded = false; + // mark selection + setTimeout(function () { + var str = $.trim($('#grid_'+ obj.name +'_search_all').val()); + if (str != '') $(obj.box).find('.w2ui-grid-data > div').w2marker(str); + }, 50); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + obj.addRange('selection'); + setTimeout(function () { obj.resize(); obj.scroll(); }, 1); // allow to render first + return (new Date()).getTime() - time; + }, + + render: function (box) { + var obj = this; + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (typeof box != 'undefined' && box != null) { + if ($(this.box).find('#grid_'+ this.name +'_body').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-grid') + .html(''); + } + this.box = box; + } + if (!this.box) return; + if (this.last.sortData == null) this.last.sortData = this.sortData; + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'render', box: box }); + if (eventData.isCancelled === true) return false; + // insert Elements + $(this.box) + .attr('name', this.name) + .addClass('w2ui-reset w2ui-grid') + .html('
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ' '+ + '
'); + if (this.selectType != 'row') $(this.box).addClass('w2ui-ss'); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + // init toolbar + this.initToolbar(); + if (this.toolbar != null) this.toolbar.render($('#grid_'+ this.name +'_toolbar')[0]); + // init footer + $('#grid_'+ this.name +'_footer').html(this.getFooterHTML()); + // refresh + this.refresh(); // show empty grid (need it) + this.reload(); + + // init mouse events for mouse selection + $(this.box).on('mousedown', mouseStart); + $(this.box).on('selectstart', function () { return false; }); // fixes chrome cursror bug + + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + // attach to resize event + if ($('.w2ui-layout').length == 0) { // if there is layout, it will send a resize event + this.tmp_resize = function (event) { w2ui[obj.name].resize(); } + $(window).off('resize', this.tmp_resize).on('resize', this.tmp_resize); + } + return (new Date()).getTime() - time; + + function mouseStart (event) { + if (obj.last.move && obj.last.move.type == 'expand') return; + obj.last.move = { + x : event.screenX, + y : event.screenY, + divX : 0, + divY : 0, + recid : $(event.target).parents('tr').attr('recid'), + column : (event.target.tagName == 'TD' ? $(event.target).attr('col') : $(event.target).parents('td').attr('col')), + type : 'select', + start : true + }; + $(document).on('mousemove', mouseMove); + $(document).on('mouseup', mouseStop); + } + + function mouseMove (event) { + if (!obj.last.move || obj.last.move.type != 'select') return; + obj.last.move.divX = (event.screenX - obj.last.move.x); + obj.last.move.divY = (event.screenY - obj.last.move.y); + if (Math.abs(obj.last.move.divX) <= 1 && Math.abs(obj.last.move.divY) <= 1) return; // only if moved more then 1px + if (obj.last.move.start && obj.last.move.recid) { + obj.selectNone(); + obj.last.move.start = false; + } + var newSel= []; + var recid = (event.target.tagName == 'TR' ? $(event.target).attr('recid') : $(event.target).parents('tr').attr('recid')); + if (typeof recid == 'undefined') return; + var ind1 = obj.get(obj.last.move.recid, true); + var ind2 = obj.get(recid, true); + var col1 = parseInt(obj.last.move.column); + var col2 = parseInt(event.target.tagName == 'TD' ? $(event.target).attr('col') : $(event.target).parents('td').attr('col')); + if (ind1 > ind2) { var tmp = ind1; ind1 = ind2; ind2 = tmp; } + // check if need to refresh + var tmp = 'ind1:'+ ind1 +',ind2;'+ ind2 +',col1:'+ col1 +',col2:'+ col2; + if (obj.last.move.range == tmp) return; + obj.last.move.range = tmp; + for (var i = ind1; i <= ind2; i++) { + if (obj.last.searchIds.length > 0 && obj.last.searchIds.indexOf(i) == -1) continue; + if (obj.selectType != 'row') { + if (col1 > col2) { var tmp = col1; col1 = col2; col2 = tmp; } + var tmp = []; + for (var c = col1; c <= col2; c++) { + if (obj.columns[c].hidden) continue; + newSel.push({ recid: obj.records[i].recid, column: parseInt(c) }); + } + } else { + newSel.push(obj.records[i].recid); + } + } + if (obj.selectType != 'row') { + var sel = obj.getSelection(); + // add more items + var tmp = []; + for (var ns in newSel) { + var flag = false; + for (var s in sel) if (newSel[ns].recid == sel[s].recid && newSel[ns].column == sel[s].column) flag = true; + if (!flag) tmp.push({ recid: newSel[ns].recid, column: newSel[ns].column }); + } + obj.select.apply(obj, tmp); + // remove items + var tmp = []; + for (var s in sel) { + var flag = false; + for (var ns in newSel) if (newSel[ns].recid == sel[s].recid && newSel[ns].column == sel[s].column) flag = true; + if (!flag) tmp.push({ recid: sel[s].recid, column: sel[s].column }); + } + obj.unselect.apply(obj, tmp); + } else { + if (obj.multiSelect) { + var sel = obj.getSelection(); + for (var ns in newSel) if (sel.indexOf(newSel[ns]) == -1) obj.select(newSel[ns]); // add more items + for (var s in sel) if (newSel.indexOf(sel[s]) == -1) obj.unselect(sel[s]); // remove items + } + } + } + + function mouseStop (event) { + if (!obj.last.move || obj.last.move.type != 'select') return; + delete obj.last.move; + $(document).off('mousemove', mouseMove); + $(document).off('mouseup', mouseStop); + } + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'destroy' }); + if (eventData.isCancelled === true) return false; + // remove events + $(window).off('resize', this.tmp_resize); + // clean up + if (typeof this.toolbar == 'object' && this.toolbar.destroy) this.toolbar.destroy(); + if ($(this.box).find('#grid_'+ this.name +'_body').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-grid') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + // =========================================== + // --- Internal Functions + + initColumnOnOff: function () { + if (!this.show.toolbarColumns) return; + var obj = this; + var col_html = '
'+ + ''; + for (var c in this.columns) { + var col = this.columns[c]; + col_html += ''+ + ''+ + ''+ + ''; + } + col_html += ''; + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (url) { + col_html += + ''; + } + col_html += ''+ + ''; + col_html += "
'+ + ' '+ + ''+ + ' '+ + '
'+ + '
'+ + ' '+ w2utils.lang('Skip') +' '+ w2utils.lang('Records')+ + '
'+ + '
'+ + '
'+ w2utils.lang('Toggle Line Numbers') +'
'+ + '
'+ + '
'+ w2utils.lang('Reset Column Size') + '
'+ + '
"; + this.toolbar.get('column-on-off').html = col_html; + }, + + columnOnOff: function (el, event, field, value) { + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'columnOnOff', checkbox: el, field: field, originalEvent: event }); + if (eventData.isCancelled === true) return false; + // regular processing + var obj = this; + // collapse expanded rows + for (var r in this.records) { + if (this.records[r].expanded === true) this.records[r].expanded = false + } + // show/hide + var hide = true; + if (field == 'line-numbers') { + this.show.lineNumbers = !this.show.lineNumbers; + this.refresh(); + } else if (field == 'skip') { + if (!w2utils.isInt(value)) value = 0; + obj.skip(value); + } else if (field == 'resize') { + // restore sizes + for (var c in this.columns) { + if (typeof this.columns[c].sizeOriginal != 'undefined') { + this.columns[c].size = this.columns[c].sizeOriginal; + } + } + this.initResize(); + this.resize(); + } else { + var col = this.getColumn(field); + if (col.hidden) { + $(el).prop('checked', true); + this.showColumn(col.field); + } else { + $(el).prop('checked', false); + this.hideColumn(col.field); + } + hide = false; + } + this.initColumnOnOff(); + if (hide) { + setTimeout(function () { + $().w2overlay(); + obj.toolbar.uncheck('column-on-off'); + }, 100); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + initToolbar: function () { + // -- if toolbar is true + if (typeof this.toolbar['render'] == 'undefined') { + var tmp_items = this.toolbar.items; + this.toolbar.items = []; + this.toolbar = $().w2toolbar($.extend(true, {}, this.toolbar, { name: this.name +'_toolbar', owner: this })); + + // ============================================= + // ------ Toolbar Generic buttons + + if (this.show.toolbarReload) { + this.toolbar.items.push($.extend(true, {}, this.buttons['reload'])); + } + if (this.show.toolbarColumns) { + this.toolbar.items.push($.extend(true, {}, this.buttons['columns'])); + this.initColumnOnOff(); + } + if (this.show.toolbarReload || this.show.toolbarColumn) { + this.toolbar.items.push({ type: 'break', id: 'break0' }); + } + if (this.show.toolbarSearch) { + var html = + ''; + this.toolbar.items.push({ type: 'html', id: 'search', html: html }); + if (this.multiSearch && this.searches.length > 0) { + this.toolbar.items.push($.extend(true, {}, this.buttons['search-go'])); + } + } + if (this.show.toolbarSearch && (this.show.toolbarAdd || this.show.toolbarEdit || this.show.toolbarDelete || this.show.toolbarSave)) { + this.toolbar.items.push({ type: 'break', id: 'break1' }); + } + if (this.show.toolbarAdd) { + this.toolbar.items.push($.extend(true, {}, this.buttons['add'])); + } + if (this.show.toolbarEdit) { + this.toolbar.items.push($.extend(true, {}, this.buttons['edit'])); + } + if (this.show.toolbarDelete) { + this.toolbar.items.push($.extend(true, {}, this.buttons['delete'])); + } + if (this.show.toolbarSave) { + if (this.show.toolbarAdd || this.show.toolbarDelete || this.show.toolbarEdit) { + this.toolbar.items.push({ type: 'break', id: 'break2' }); + } + this.toolbar.items.push($.extend(true, {}, this.buttons['save'])); + } + // add original buttons + for (var i in tmp_items) this.toolbar.items.push(tmp_items[i]); + + // ============================================= + // ------ Toolbar onClick processing + + var obj = this; + this.toolbar.on('click', function (event) { + var eventData = obj.trigger({ phase: 'before', type: 'toolbar', target: event.target, originalEvent: event }); + if (eventData.isCancelled === true) return false; + var id = event.target; + switch (id) { + case 'reload': + var eventData2 = obj.trigger({ phase: 'before', type: 'reload', target: obj.name }); + if (eventData2.isCancelled === true) return false; + var url = (typeof obj.url != 'object' ? obj.url : obj.url.get); + if (url) { + obj.clear(true); + } else { + obj.last.scrollTop = 0; + obj.last.scrollLeft = 0; + obj.last.range_start= null; + obj.last.range_end = null; + } + obj.reload(); + obj.trigger($.extend(eventData2, { phase: 'after' })); + break; + case 'column-on-off': + for (var c in obj.columns) { + if (obj.columns[c].hidden) { + $("#grid_"+ obj.name +"_column_"+ c + "_check").prop("checked", false); + } else { + $("#grid_"+ obj.name +"_column_"+ c + "_check").prop('checked', true); + } + } + obj.initResize(); + obj.resize(); + break; + case 'search-advanced': + var tb = this; + var it = this.get(id); + if (it.checked) { + obj.searchClose(); + setTimeout(function () { tb.uncheck(id); }, 1); + } else { + obj.searchOpen(); + event.originalEvent.stopPropagation(); + function tmp_close() { tb.uncheck(id); $(document).off('click', 'body', tmp_close); } + $(document).on('click', 'body', tmp_close); + } + break; + case 'add': + // events + var eventData = obj.trigger({ phase: 'before', target: obj.name, type: 'add', recid: null }); + obj.trigger($.extend(eventData, { phase: 'after' })); + break; + case 'edit': + var sel = obj.getSelection(); + var recid = null; + if (sel.length == 1) recid = sel[0]; + // events + var eventData = obj.trigger({ phase: 'before', target: obj.name, type: 'edit', recid: recid }); + obj.trigger($.extend(eventData, { phase: 'after' })); + break; + case 'delete': + obj.delete(); + break; + case 'save': + obj.save(); + break; + } + // no default action + obj.trigger($.extend(eventData, { phase: 'after' })); + }); + } + return; + }, + + initSearches: function () { + var obj = this; + // init searches + for (var s in this.searches) { + var search = this.searches[s]; + var sdata = this.getSearchData(search.field); + // init types + switch (String(search.type).toLowerCase()) { + case 'alphaNumeric': + case 'text': + $('#grid_'+ this.name +'_operator_'+s).val('begins with'); + break; + + case 'int': + case 'float': + case 'hex': + case 'money': + case 'date': + $('#grid_'+ this.name +'_field_'+s).w2field('clear').w2field(search.type); + $('#grid_'+ this.name +'_field2_'+s).w2field('clear').w2field(search.type); + break; + + case 'list': + // build options + var options = ''; + for (var i in search.items) { + if ($.isPlainObject(search.items[i])) { + var val = search.items[i].id; + var txt = search.items[i].text; + if (typeof val == 'undefined' && typeof search.items[i].value != 'undefined') val = search.items[i].value; + if (typeof txt == 'undefined' && typeof search.items[i].caption != 'undefined') txt = search.items[i].caption; + if (val == null) val = ''; + options += ''; + } else { + options += ''; + } + } + $('#grid_'+ this.name +'_field_'+s).html(options); + break; + } + if (sdata != null) { + $('#grid_'+ this.name +'_operator_'+ s).val(sdata.operator).trigger('change'); + if (!$.isArray(sdata.value)) { + if (typeof sdata.value != 'udefined') $('#grid_'+ this.name +'_field_'+ s).val(sdata.value).trigger('change'); + } else { + if (sdata.operator == 'in') { + $('#grid_'+ this.name +'_field_'+ s).val(sdata.value).trigger('change'); + } else { + $('#grid_'+ this.name +'_field_'+ s).val(sdata.value[0]).trigger('change'); + $('#grid_'+ this.name +'_field2_'+ s).val(sdata.value[1]).trigger('change'); + } + } + } + } + // add on change event + $('#w2ui-overlay .w2ui-grid-searches *[rel=search]').on('keypress', function (evnt) { + if (evnt.keyCode == 13) { obj.search(); } + }); + }, + + initResize: function () { + var obj = this; + //if (obj.resizing === true) return; + $(this.box).find('.w2ui-resizer') + .off('click') + .on('click', function (event) { + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + if (event.preventDefault) event.preventDefault(); + }) + .off('mousedown') + .on('mousedown', function (event) { + if (!event) event = window.event; + if (!window.addEventListener) { window.document.attachEvent('onselectstart', function() { return false; } ); } + obj.resizing = true; + obj.last.tmp = { + x : event.screenX, + y : event.screenY, + gx : event.screenX, + gy : event.screenY, + col : parseInt($(this).attr('name')) + }; + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + if (event.preventDefault) event.preventDefault(); + // fix sizes + for (var c in obj.columns) { + if (typeof obj.columns[c].sizeOriginal == 'undefined') obj.columns[c].sizeOriginal = obj.columns[c].size; + obj.columns[c].size = obj.columns[c].sizeCalculated; + } + var eventData = { phase: 'before', type: 'columnResize', target: obj.name, column: obj.last.tmp.col, field: obj.columns[obj.last.tmp.col].field }; + eventData = obj.trigger($.extend(eventData, { resizeBy: 0, originalEvent: event })); + // set move event + var mouseMove = function (event) { + if (obj.resizing != true) return; + if (!event) event = window.event; + // event before + eventData = obj.trigger($.extend(eventData, { resizeBy: (event.screenX - obj.last.tmp.gx), originalEvent: event })); + if (eventData.isCancelled === true) { eventData.isCancelled = false; return; } + // default action + obj.last.tmp.x = (event.screenX - obj.last.tmp.x); + obj.last.tmp.y = (event.screenY - obj.last.tmp.y); + obj.columns[obj.last.tmp.col].size = (parseInt(obj.columns[obj.last.tmp.col].size) + obj.last.tmp.x) + 'px'; + obj.resizeRecords(); + // reset + obj.last.tmp.x = event.screenX; + obj.last.tmp.y = event.screenY; + } + var mouseUp = function (event) { + delete obj.resizing; + $(document).off('mousemove', 'body'); + $(document).off('mouseup', 'body'); + obj.resizeRecords(); + // event before + obj.trigger($.extend(eventData, { phase: 'after', originalEvent: event })); + } + $(document).on('mousemove', 'body', mouseMove); + $(document).on('mouseup', 'body', mouseUp); + }) + .each(function (index, el) { + var td = $(el).parent(); + $(el).css({ + "height" : '25px', + "margin-left" : (td.width() - 3) + 'px' + }) + }); + }, + + resizeBoxes: function () { + // elements + var main = $(this.box).find('> div'); + var header = $('#grid_'+ this.name +'_header'); + var toolbar = $('#grid_'+ this.name +'_toolbar'); + var summary = $('#grid_'+ this.name +'_summary'); + var footer = $('#grid_'+ this.name +'_footer'); + var body = $('#grid_'+ this.name +'_body'); + var columns = $('#grid_'+ this.name +'_columns'); + var records = $('#grid_'+ this.name +'_records'); + + if (this.show.header) { + header.css({ + top: '0px', + left: '0px', + right: '0px' + }); + } + + if (this.show.toolbar) { + toolbar.css({ + top: ( 0 + (this.show.header ? w2utils.getSize(header, 'height') : 0) ) + 'px', + left: '0px', + right: '0px' + }); + } + if (this.show.footer) { + footer.css({ + bottom: '0px', + left: '0px', + right: '0px' + }); + } + if (this.summary.length > 0) { + summary.css({ + bottom: ( 0 + (this.show.footer ? w2utils.getSize(footer, 'height') : 0) ) + 'px', + left: '0px', + right: '0px' + }); + } + body.css({ + top: ( 0 + (this.show.header ? w2utils.getSize(header, 'height') : 0) + (this.show.toolbar ? w2utils.getSize(toolbar, 'height') : 0) ) + 'px', + bottom: ( 0 + (this.show.footer ? w2utils.getSize(footer, 'height') : 0) + (this.summary.length > 0 ? w2utils.getSize(summary, 'height') : 0) ) + 'px', + left: '0px', + right: '0px' + }); + }, + + resizeRecords: function () { + var obj = this; + // remove empty records + $(this.box).find('.w2ui-empty-record').remove(); + // -- Calculate Column size in PX + var box = $(this.box); + var grid = $(this.box).find('> div'); + var header = $('#grid_'+ this.name +'_header'); + var toolbar = $('#grid_'+ this.name +'_toolbar'); + var summary = $('#grid_'+ this.name +'_summary'); + var footer = $('#grid_'+ this.name +'_footer'); + var body = $('#grid_'+ this.name +'_body'); + var columns = $('#grid_'+ this.name +'_columns'); + var records = $('#grid_'+ this.name +'_records'); + + // body might be expanded by data + if (!this.fixedBody) { + // allow it to render records, then resize + setTimeout(function () { + var calculatedHeight = w2utils.getSize(columns, 'height') + + w2utils.getSize($('#grid_'+ obj.name +'_records table'), 'height'); + obj.height = calculatedHeight + + w2utils.getSize(grid, '+height') + + (obj.show.header ? w2utils.getSize(header, 'height') : 0) + + (obj.show.toolbar ? w2utils.getSize(toolbar, 'height') : 0) + + (summary.css('display') != 'none' ? w2utils.getSize(summary, 'height') : 0) + + (obj.show.footer ? w2utils.getSize(footer, 'height') : 0); + grid.css('height', obj.height); + body.css('height', calculatedHeight); + box.css('height', w2utils.getSize(grid, 'height') + w2utils.getSize(box, '+height')); + }, 1); + } else { + // fixed body height + var calculatedHeight = grid.height() + - (this.show.header ? w2utils.getSize(header, 'height') : 0) + - (this.show.toolbar ? w2utils.getSize(toolbar, 'height') : 0) + - (summary.css('display') != 'none' ? w2utils.getSize(summary, 'height') : 0) + - (this.show.footer ? w2utils.getSize(footer, 'height') : 0); + body.css('height', calculatedHeight); + } + + // check overflow + var bodyOverflowX = false; + var bodyOverflowY = false; + if (body.width() < $(records).find('>table').width()) bodyOverflowX = true; + if (body.height() - columns.height() < $(records).find('>table').height() + (bodyOverflowX ? w2utils.scrollBarSize() : 0)) bodyOverflowY = true; + if (!this.fixedBody) { bodyOverflowY = false; bodyOverflowX = false; } + if (bodyOverflowX || bodyOverflowY) { + columns.find('> table > tbody > tr:nth-child(1) td.w2ui-head-last').css('width', w2utils.scrollBarSize()).show(); + records.css({ + top: ((this.columnGroups.length > 0 && this.show.columns ? 1 : 0) + w2utils.getSize(columns, 'height')) +'px', + "-webkit-overflow-scrolling": "touch", + "overflow-x": (bodyOverflowX ? 'auto' : 'hidden'), + "overflow-y": (bodyOverflowY ? 'auto' : 'hidden') }); + } else { + columns.find('> table > tbody > tr:nth-child(1) td.w2ui-head-last').hide(); + records.css({ + top: ((this.columnGroups.length > 0 && this.show.columns ? 1 : 0) + w2utils.getSize(columns, 'height')) +'px', + overflow: 'hidden' + }); + if (records.length > 0) { this.last.scrollTop = 0; this.last.scrollLeft = 0; } // if no scrollbars, always show top + } + if (this.show.emptyRecords && !bodyOverflowY) { + var max = Math.floor(records.height() / this.recordHeight) + 1; + if (this.fixedBody) { + for (var di = this.buffered; di <= max; di++) { + var html = ''; + html += ''; + if (this.show.lineNumbers) html += ''; + if (this.show.selectColumn) html += ''; + if (this.show.expandColumn) html += ''; + var j = 0; + while (true && this.columns.length > 0) { + var col = this.columns[j]; + if (col.hidden) { j++; if (typeof this.columns[j] == 'undefined') break; else continue; } + html += ''; + j++; + if (typeof this.columns[j] == 'undefined') break; + } + html += ''; + html += ''; + $('#grid_'+ this.name +'_records > table').append(html); + } + } + } + if (body.length > 0) { + var width_max = parseInt(body.width()) + - (bodyOverflowY ? w2utils.scrollBarSize() : 0) + - (this.show.lineNumbers ? 34 : 0) + - (this.show.selectColumn ? 26 : 0) + - (this.show.expandColumn ? 26 : 0); + var width_box = width_max; + var percent = 0; + // gridMinWidth processiong + var restart = false; + for (var i=0; i width_box && col.hidden !== true) { + col.hidden = true; + restart = true; + } + if (col.gridMinWidth < width_box && col.hidden === true) { + col.hidden = false; + restart = true; + } + } + } + if (restart === true) { + this.refresh(); + return; + } + // assign PX column s + for (var i=0; i 0) { + for (var i=0; i parseInt(col.max)) col.sizeCalculated = col.max + 'px'; + width_cols += parseInt(col.sizeCalculated); + } + var width_diff = parseInt(width_box) - parseInt(width_cols); + if (width_diff > 0 && percent > 0) { + var i = 0; + while (true) { + var col = this.columns[i]; + if (typeof col == 'undefined') { i = 0; continue; } + if (col.hidden || col.sizeType == 'px') { i++; continue; } + col.sizeCalculated = (parseInt(col.sizeCalculated) + 1) + 'px'; + width_diff--; + if (width_diff == 0) break; + i++; + } + } else if (width_diff > 0) { + columns.find('> table > tbody > tr:nth-child(1) td.w2ui-head-last').css('width', w2utils.scrollBarSize()).show(); + } + // resize columns + columns.find('> table > tbody > tr:nth-child(1) td').each(function (index, el) { + var ind = $(el).attr('col'); + if (typeof ind != 'undefined' && obj.columns[ind]) $(el).css('width', obj.columns[ind].sizeCalculated); + // last column + if ($(el).hasClass('w2ui-head-last')) { + $(el).css('width', w2utils.scrollBarSize() + (width_diff > 0 && percent == 0 ? width_diff : 0) + 'px'); + } + }); + // if there are column groups - hide first row (needed for sizing) + if (columns.find('> table > tbody > tr').length == 3) { + columns.find('> table > tbody > tr:nth-child(1) td').html('').css({ + 'height' : '0px', + 'border' : '0px', + 'padding' : '0px', + 'margin' : '0px' + }); + } + // resize records + records.find('> table > tbody > tr:nth-child(1) td').each(function (index, el) { + var ind = $(el).attr('col'); + if (typeof ind != 'undefined' && obj.columns[ind]) $(el).css('width', obj.columns[ind].sizeCalculated); + // last column + if ($(el).hasClass('w2ui-grid-data-last')) { + $(el).css('width', (width_diff > 0 && percent == 0 ? width_diff : 0) + 'px'); + } + }); + // resize summary + summary.find('> table > tbody > tr:nth-child(1) td').each(function (index, el) { + var ind = $(el).attr('col'); + if (typeof ind != 'undefined' && obj.columns[ind]) $(el).css('width', obj.columns[ind].sizeCalculated); + // last column + if ($(el).hasClass('w2ui-grid-data-last')) { + $(el).css('width', w2utils.scrollBarSize() + (width_diff > 0 && percent == 0 ? width_diff : 0) + 'px'); + } + }); + this.initResize(); + this.refreshRanges(); + // apply last scroll if any + if (this.last.scrollTop != '' && records.length > 0) { + columns.prop('scrollLeft', this.last.scrollLeft); + records.prop('scrollTop', this.last.scrollTop); + records.prop('scrollLeft', this.last.scrollLeft); + } + }, + + getSearchesHTML: function () { + var html = ''; + var showBtn = false; + for (var i = 0; i < this.searches.length; i++) { + var s = this.searches[i]; + if (s.hidden) continue; + var btn = ''; + if (showBtn == false) { + btn = ''; + showBtn = true; + } + if (typeof s.inTag == 'undefined') s.inTag = ''; + if (typeof s.outTag == 'undefined') s.outTag = ''; + if (typeof s.type == 'undefined') s.type = 'text'; + if (s.type == 'text') { + var operator = ''; + } + if (s.type == 'int' || s.type == 'float' || s.type == 'date') { + var operator = ''; + } + if (s.type == 'list') { + var operator = 'is '; + } + html += ''+ + ' ' + + ' ' + + ' '+ + ' ' + + ''; + } + html += ''+ + ' '+ + '
'+ btn +''+ s.caption +''+ operator +''; + + switch (s.type) { + case 'alphaNumeric': + case 'text': + html += ''; + break; + + case 'int': + case 'float': + case 'hex': + case 'money': + case 'date': + html += ''+ + ''; + break; + + case 'list': + html += ''; + break; + + } + html += s.outTag + + '
'+ + '
'+ + ' '+ + ' '+ + '
'+ + '
'; + return html; + }, + + getColumnsHTML: function () { + var obj = this; + var html = ''; + if (this.show.columnHeaders) { + if (this.columnGroups.length > 0) { + html = getColumns(true) + getGroups() + getColumns(false); + } else { + html = getColumns(true); + } + } + return html; + + function getGroups () { + var html = ''; + // add empty group at the end + if (obj.columnGroups[obj.columnGroups.length-1].caption != '') obj.columnGroups.push({ caption: '' }); + + if (obj.show.lineNumbers) { + html += ''+ + '
 
'+ + ''; + } + if (obj.show.selectColumn) { + html += ''+ + '
 
'+ + ''; + } + if (obj.show.expandColumn) { + html += ''+ + '
 
'+ + ''; + } + var ii = 0; + for (var i=0; i
'; + } + html += ''+ + resizer + + '
'+ + (col.caption == '' ? ' ' : col.caption) + + '
'+ + ''; + } else { + html += ''+ + '
'+ + (colg.caption == '' ? ' ' : colg.caption) + + '
'+ + ''; + } + ii += colg.span; + } + html += ''; + return html; + } + + function getColumns (master) { + var html = ''; + if (obj.show.lineNumbers) { + html += ''+ + '
#
'+ + ''; + } + if (obj.show.selectColumn) { + html += ''+ + '
'+ + ' '+ + '
'+ + ''; + } + if (obj.show.expandColumn) { + html += ''+ + '
 
'+ + ''; + } + var ii = 0; + var id = 0; + for (var i=0; i
'; + } + html += ''+ + resizer + + '
'+ + (col.caption == '' ? ' ' : col.caption) + + '
'+ + ''; + } + } + html += '
 
'; + html += ''; + return html; + } + }, + + getRecordsHTML: function () { + // larget number works better with chrome, smaller with FF. + if (this.buffered > 300) this.show_extra = 30; else this.show_extra = 300; + var records = $('#grid_'+ this.name +'_records'); + var limit = Math.floor(records.height() / this.recordHeight) + this.show_extra + 1; + if (!this.fixedBody) limit = this.buffered; + // always need first record for resizing purposes + var html = '' + this.getRecordHTML(-1, 0); + // first empty row with height + html += ''+ + ' '+ + ''; + for (var i = 0; i < limit; i++) { + html += this.getRecordHTML(i, i+1); + } + html += ''+ + ' '+ + ''+ + ''+ + ' '+ + ''+ + '
'; + this.last.range_start = 0; + this.last.range_end = limit; + return html; + }, + + getSummaryHTML: function () { + if (this.summary.length == 0) return; + var html = ''; + for (var i = 0; i < this.summary.length; i++) { + html += this.getRecordHTML(i, i+1, true); + } + html += '
'; + return html; + }, + + scroll: function (event) { + var time = (new Date()).getTime(); + var obj = this; + var records = $('#grid_'+ this.name +'_records'); + if (this.records.length == 0 || records.length == 0 || records.height() == 0) return; + if (this.buffered > 300) this.show_extra = 30; else this.show_extra = 300; + // need this to enable scrolling when this.limit < then a screen can fit + if (records.height() < this.buffered * this.recordHeight && records.css('overflow-y') == 'hidden') { + if (this.total > 0) this.refresh(); + return; + } + // update footer + var t1 = Math.floor(records[0].scrollTop / this.recordHeight + 1); + var t2 = Math.floor(records[0].scrollTop / this.recordHeight + 1) + Math.round(records.height() / this.recordHeight); + if (t1 > this.buffered) t1 = this.buffered; + if (t2 > this.buffered) t2 = this.buffered; + var url = (typeof this.url != 'object' ? this.url : this.url.get); + $('#grid_'+ this.name + '_footer .w2ui-footer-right').html(w2utils.formatNumber(this.offset + t1) + '-' + w2utils.formatNumber(this.offset + t2) + ' ' + w2utils.lang('of') + ' ' + w2utils.formatNumber(this.total) + + (url ? ' ('+ w2utils.lang('buffered') + ' '+ w2utils.formatNumber(this.buffered) + (this.offset > 0 ? ', skip ' + w2utils.formatNumber(this.offset) : '') + ')' : '') + ); + // only for local data source, else no extra records loaded + if (!url && (!this.fixedBody || this.total <= 300)) return; + // regular processing + var start = Math.floor(records[0].scrollTop / this.recordHeight) - this.show_extra; + var end = start + Math.floor(records.height() / this.recordHeight) + this.show_extra * 2 + 1; + // var div = start - this.last.range_start; + if (start < 1) start = 1; + if (end > this.total) end = this.total; + var tr1 = records.find('#grid_'+ this.name +'_rec_top'); + var tr2 = records.find('#grid_'+ this.name +'_rec_bottom'); + // if row is expanded + if (String(tr1.next().prop('id')).indexOf('_expanded_row') != -1) tr1.next().remove(); + if (String(tr2.prev().prop('id')).indexOf('_expanded_row') != -1) tr2.prev().remove(); + var first = parseInt(tr1.next().attr('line')); + var last = parseInt(tr2.prev().attr('line')); + //$('#log').html('buffer: '+ this.buffered +' start-end: ' + start + '-'+ end + ' ===> first-last: ' + first + '-' + last); + if (first < start || first == 1 || this.last.pull_refresh) { // scroll down + //console.log('end', end, 'last', last, 'show_extre', this.show_extra, this.last.pull_refresh); + if (end <= last + this.show_extra - 2 && end != this.total) return; + this.last.pull_refresh = false; + // remove from top + while (true) { + var tmp = records.find('#grid_'+ this.name +'_rec_top').next(); + if (tmp.attr('line') == 'bottom') break; + if (parseInt(tmp.attr('line')) < start) tmp.remove(); else break; + } + // add at bottom + var tmp = records.find('#grid_'+ this.name +'_rec_bottom').prev(); + var rec_start = tmp.attr('line'); + if (rec_start == 'top') rec_start = start; + for (var i = parseInt(rec_start) + 1; i <= end; i++) { + if (!this.records[i-1]) continue; + if (this.records[i-1].expanded === true) this.records[i-1].expanded = false; + tr2.before(this.getRecordHTML(i-1, i)); + } + markSearch(); + setTimeout(function() { obj.refreshRanges(); }, 0); + } else { // scroll up + if (start >= first - this.show_extra + 2 && start > 1) return; + // remove from bottom + while (true) { + var tmp = records.find('#grid_'+ this.name +'_rec_bottom').prev(); + if (tmp.attr('line') == 'top') break; + if (parseInt(tmp.attr('line')) > end) tmp.remove(); else break; + } + // add at top + var tmp = records.find('#grid_'+ this.name +'_rec_top').next(); + var rec_start = tmp.attr('line'); + if (rec_start == 'bottom') rec_start = end; + for (var i = parseInt(rec_start) - 1; i >= start; i--) { + if (!this.records[i-1]) continue; + if (this.records[i-1].expanded === true) this.records[i-1].expanded = false; + tr1.after(this.getRecordHTML(i-1, i)); + } + markSearch(); + setTimeout(function() { obj.refreshRanges(); }, 0); + } + // first/last row size + var h1 = (start - 1) * obj.recordHeight; + var h2 = (this.buffered - end) * obj.recordHeight; + if (h2 < 0) h2 = 0; + tr1.css('height', h1 + 'px'); + tr2.css('height', h2 + 'px'); + obj.last.range_start = start; + obj.last.range_end = end; + // load more if needed + var s = Math.floor(records[0].scrollTop / this.recordHeight); + var e = s + Math.floor(records.height() / this.recordHeight); + if (e + 10 > this.buffered && this.last.pull_more !== true && this.buffered < this.total - this.offset) { + if (this.autoLoad === true) { + this.last.pull_more = true; + this.last.xhr_offset += this.limit; + this.request('get-records'); + } else { + var more = $('#grid_'+ this.name +'_rec_more'); + if (more.css('display') == 'none') { + more.show() + .on('click', function () { + $(this).find('td').html('
'); + obj.last.pull_more = true; + obj.last.xhr_offset += obj.limit; + obj.request('get-records'); + }); + } + if (more.find('td').text().indexOf('Load') == -1) { + more.find('td').html('
Load '+ obj.limit + ' More...
'); + } + } + } + // check for grid end + if (this.buffered >= this.total - this.offset) $('#grid_'+ this.name +'_rec_more').hide(); + return; + + function markSearch() { + // mark search + if(obj.markSearchResults === false) return; + clearTimeout(obj.last.marker_timer); + obj.last.marker_timer = setTimeout(function () { + // mark all search strings + var str = []; + for (var s in obj.searchData) { + var tmp = obj.searchData[s]; + if ($.inArray(tmp.value, str) == -1) str.push(tmp.value); + } + if (str.length > 0) $(obj.box).find('.w2ui-grid-data > div').w2marker(str); + }, 50); + } + }, + + getRecordHTML: function (ind, lineNum, summary) { + var rec_html = ''; + // first record needs for resize purposes + if (ind == -1) { + rec_html += ''; + if (this.show.lineNumbers) rec_html += ''; + if (this.show.selectColumn) rec_html += ''; + if (this.show.expandColumn) rec_html += ''; + for (var i in this.columns) { + if (this.columns[i].hidden) continue; + rec_html += ''; + } + rec_html += ''; + rec_html += ''; + return rec_html; + } + // regular record + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (summary !== true) { + if (this.searchData.length > 0 && !url) { + if (ind >= this.last.searchIds.length) return ''; + ind = this.last.searchIds[ind]; + record = this.records[ind]; + } else { + if (ind >= this.records.length) return ''; + record = this.records[ind]; + } + } else { + if (ind >= this.summary.length) return ''; + record = this.summary[ind]; + } + if (!record) return ''; + var id = w2utils.escapeId(record.recid); + var isRowSelected = false; + if (record.selected && this.selectType == 'row') isRowSelected = true; + // render TR + rec_html += ''; + if (this.show.lineNumbers) { + rec_html += ''+ + (summary !== true ? '
'+ lineNum +'
' : '') + + ''; + } + if (this.show.selectColumn) { + rec_html += + ''+ + (summary !== true ? + '
'+ + ' '+ + '
' + : + '' ) + + ''; + } + if (this.show.expandColumn) { + var tmp_img = ''; + if (record.expanded === true) tmp_img = '-'; else tmp_img = '+'; + if (record.expanded == 'none') tmp_img = ''; + if (record.expanded == 'spinner') tmp_img = '
'; + rec_html += + ''+ + (summary !== true ? + '
'+ + ' '+ tmp_img +'
' + : + '' ) + + ''; + } + var col_ind = 0; + while (true) { + var col = this.columns[col_ind]; + if (col.hidden) { col_ind++; if (typeof this.columns[col_ind] == 'undefined') break; else continue; } + var isChanged = record.changed && record.changes[col.field]; + var rec_cell = this.getCellHTML(ind, col_ind, summary); + var addStyle = ''; + if (typeof col.render == 'string') { + var tmp = col.render.toLowerCase().split(':'); + if ($.inArray(tmp[0], ['number', 'int', 'float', 'money', 'percent']) != -1) addStyle = 'text-align: right'; + if ($.inArray(tmp[0], ['date']) != -1) addStyle = 'text-align: right'; + } + var isCellSelected = false; + if (record.selected && $.inArray(col_ind, record.selectedColumns) != -1) isCellSelected = true; + rec_html += ''+ + rec_cell + + ''; + col_ind++; + if (typeof this.columns[col_ind] == 'undefined') break; + } + rec_html += ''; + rec_html += ''; + // if row is expanded (buggy) + // if (record.expanded === true && $('#grid_'+ this.name +'_rec_'+ record.recid +'_expanded_row').length == 0) { + // var tmp = 1 + (this.show.selectColumn ? 1 : 0); + // rec_html += + // ''+ + // (this.show.lineNumbers ? '' : '') + + // '
'+ + // ' '+ + // '
'+ + // ' '+ + // ''; + // } + return rec_html; + }, + + getCellHTML: function (ind, col_ind, summary) { + var col = this.columns[col_ind]; + var record = (summary !== true ? this.records[ind] : this.summary[ind]); + var data = this.parseField(record, col.field); + var isChanged = record.changed && typeof record.changes[col.field] != 'undefined'; + if (isChanged) data = record.changes[col.field]; + // various renderers + if (data == null || typeof data == 'undefined') data = ''; + if (typeof col.render != 'undefined') { + if (typeof col.render == 'function') { + data = col.render.call(this, record, ind, col_ind); + if (data.length >= 4 && data.substr(0, 4) != ''; + } + if (typeof col.render == 'object') data = '
' + col.render[data] + '
'; + if (typeof col.render == 'string') { + var tmp = col.render.toLowerCase().split(':'); + var prefix = ''; + var suffix = ''; + if ($.inArray(tmp[0], ['number', 'int', 'float', 'money', 'percent']) != -1) { + if (typeof tmp[1] == 'undefined' || !w2utils.isInt(tmp[1])) tmp[1] = 0; + if (tmp[1] > 20) tmp[1] = 20; + if (tmp[1] < 0) tmp[1] = 0; + if (tmp[0] == 'money') { tmp[1] = 2; prefix = w2utils.settings.currencySymbol; } + if (tmp[0] == 'percent') { suffix = '%'; if (tmp[1] !== '0') tmp[1] = 1; } + if (tmp[0] == 'int') { tmp[1] = 0; } + // format + data = '
' + prefix + w2utils.formatNumber(Number(data).toFixed(tmp[1])) + suffix + '
'; + } + if (tmp[0] == 'date') { + if (typeof tmp[1] == 'undefined' || tmp[1] == '') tmp[1] = w2utils.settings.date_display; + data = '
' + prefix + w2utils.formatDate(data, tmp[1]) + suffix + '
'; + } + if (tmp[0] == 'age') { + data = '
' + prefix + w2utils.age(data) + suffix + '
'; + } + } + } else { + if (!this.show.recordTitles) { + var data = '
'+ data +'
'; + } else { + // title overwrite + var title = String(data).replace(/"/g, "''"); + if (typeof col.title != 'undefined') { + if (typeof col.title == 'function') title = col.title.call(this, record, ind, col_ind); + if (typeof col.title == 'string') title = col.title; + } + var data = '
'+ data +'
'; + } + } + if (data == null || typeof data == 'undefined') data = ''; + return data; + }, + + getFooterHTML: function () { + return '
'+ + ' '+ + ' '+ + ' '+ + '
'; + }, + + status: function (msg) { + if (typeof msg != 'undefined') { + $('#grid_'+ this.name +'_footer').find('.w2ui-footer-left').html(msg); + } else { + // show number of selected + var msgLeft = ''; + var sel = this.getSelection(); + if (sel.length > 0) { + msgLeft = String(sel.length).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") + ' ' + w2utils.lang('selected'); + var tmp = sel[0]; + if (typeof tmp == 'object') tmp = tmp.recid + ', '+ w2utils.lang('Column') +': '+ tmp.column; + if (sel.length == 1) msgLeft = w2utils.lang('Record ID') + ': '+ tmp + ' '; + } + $('#grid_'+ this.name +'_footer .w2ui-footer-left').html(msgLeft); + // toolbar + if (sel.length == 1) this.toolbar.enable('edit'); else this.toolbar.disable('edit'); + if (sel.length >= 1) this.toolbar.enable('delete'); else this.toolbar.disable('delete'); + } + }, + + lock: function (msg, showSpinner) { + var box = $(this.box).find('> div:first-child'); + setTimeout(function () { w2utils.lock(box, msg, showSpinner); }, 10); + }, + + unlock: function () { + var box = this.box; + setTimeout(function () { w2utils.unlock(box); }, 25); // needed timer so if server fast, it will not flash + }, + + parseField: function (obj, field) { + var val = ''; + try { // need this to make sure no error in fields + val = obj; + var tmp = String(field).split('.'); + for (var i in tmp) { + val = val[tmp[i]]; + } + } catch (event) { + val = ''; + } + return val; + } + } + + $.extend(w2grid.prototype, w2utils.event); + w2obj.grid = w2grid; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2layout - layout widget + * - $().w2layout - jQuery wrapper + * - Dependencies: jQuery, w2utils, w2toolbar, w2tabs + * + * == NICE TO HAVE == + * - onResize for the panel + * - problem with layout.html (see in 1.3) + * - add panel title + * + ************************************************************************/ + +(function ($) { + var w2layout = function (options) { + this.box = null // DOM Element that holds the element + this.name = null; // unique name for w2ui + this.panels = []; + this.tmp = {}; + + this.padding = 1; // panel padding + this.resizer = 4; // resizer width or height + this.style = ''; + + this.onShow = null; + this.onHide = null; + this.onResizing = null; + this.onRender = null; + this.onRefresh = null; + this.onResize = null; + this.onDestroy = null + + $.extend(true, this, w2obj.layout, options); + }; + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2layout = function(method) { + if (typeof method === 'object' || !method ) { + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2layout().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + var panels = method.panels; + var object = new w2layout(method); + $.extend(object, { handlers: [], panels: [] }); + // add defined panels panels + for (var p in panels) { + object.panels[p] = $.extend(true, {}, w2layout.prototype.panel, panels[p]); + if ($.isPlainObject(object.panels[p].tabs) || $.isArray(object.panels[p].tabs)) initTabs(object, panels[p].type); + if ($.isPlainObject(object.panels[p].toolbar) || $.isArray(object.panels[p].toolbar)) initToolbar(object, panels[p].type); + } + // add all other panels + for (var p in { 'top':'', 'left':'', 'main':'', 'preview':'', 'right':'', 'bottom':'' }) { + if (object.get(p) != null) continue; + object.panels[p] = $.extend(true, {}, w2layout.prototype.panel, { type: p, hidden: true, size: 50 }); + } + + if ($(this).length > 0) { + object.render($(this)[0]); + } + w2ui[object.name] = object; + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2layout' ); + } + + function initTabs(object, panel, tabs) { + var pan = object.get(panel); + if (pan != null && typeof tabs == 'undefined') tabs = pan.tabs; + if (pan == null || tabs == null) return false; + // instanciate tabs + if ($.isArray(tabs)) tabs = { tabs: tabs }; + $().w2destroy(object.name + '_' + panel + '_tabs'); // destroy if existed + pan.tabs = $().w2tabs($.extend({}, tabs, { owner: object, name: object.name + '_' + panel + '_tabs' })); + pan.show.tabs = true; + return true; + } + + function initToolbar(object, panel, toolbar) { + var pan = object.get(panel); + if (pan != null && typeof toolbar == 'undefined') toolbar = pan.toolbar; + if (pan == null || toolbar == null) return false; + // instanciate toolbar + if ($.isArray(toolbar)) toolbar = { items: toolbar }; + $().w2destroy(object.name + '_' + panel + '_toolbar'); // destroy if existed + pan.toolbar = $().w2toolbar($.extend({}, toolbar, { owner: object, name: object.name + '_' + panel + '_toolbar' })); + pan.show.toolbar = true; + return true; + } + }; + + // ==================================================== + // -- Implementation of core functionality + + w2layout.prototype = { + // default setting for a panel + panel: { + type : null, // left, right, top, bottom + size : 100, // width or height depending on panel name + minSize : 20, + hidden : false, + resizable : false, + overflow : 'auto', + style : '', + content : '', // can be String or Object with .render(box) method + tabs : null, + toolbar : null, + width : null, // read only + height : null, // read only + show : { + toolbar : false, + tabs : false + }, + onRefresh : null, + onShow : null, + onHide : null + }, + + // alias for content + html: function (panel, data, transition) { + return this.content(panel, data, transition); + }, + + content: function (panel, data, transition) { + var obj = this; + var p = this.get(panel); + if (panel == 'css') { + $('#layout_'+ obj.name +'_panel_css').html(''); + return true; + } + if (p == null) return false; + if ($('#layout_'+ this.name + '_panel2_'+ p.type).length > 0) return false; + $('#layout_'+ this.name + '_panel_'+ p.type).scrollTop(0); + if (data == null || typeof data == 'undefined') { + return p.content; + } else { + if (data instanceof jQuery) { + console.log('ERROR: You can not pass jQuery object to w2layout.content() method'); + return false; + } + // remove foreign classes and styles + var tmp = $('#'+ 'layout_'+ this.name + '_panel_'+ panel + ' > .w2ui-panel-content'); + var panelTop = $(tmp).position().top; + tmp.attr('class', 'w2ui-panel-content'); + if (tmp.length > 0 && typeof p.style != 'undefined') tmp[0].style.cssText = p.style; + if (p.content == '') { + p.content = data; + if (!p.hidden) this.refresh(panel); + } else { + p.content = data; + if (!p.hidden) { + if (transition != null && transition != '' && typeof transition != 'undefined') { + // apply transition + var nm = 'layout_'+ this.name + '_panel_'+ p.type; + var div1 = $('#'+ nm + ' > .w2ui-panel-content'); + div1.after('
'); + var div2 = $('#'+ nm + ' > .w2ui-panel-content.new-panel'); + div1.css('top', panelTop); + div2.css('top', panelTop); + if (typeof data == 'object') { + data.box = div2[0]; // do not do .render(box); + data.render(); + } else { + div2.html(data); + } + w2utils.transition(div1[0], div2[0], transition, function () { + div1.remove(); + div2.removeClass('new-panel'); + div2.css('overflow', p.overflow); + // IE Hack + if (window.navigator.userAgent.indexOf('MSIE')) setTimeout(function () { obj.resize(); }, 100); + }); + } else { + if (!p.hidden) this.refresh(panel); + } + } + } + } + // IE Hack + if (window.navigator.userAgent.indexOf('MSIE')) setTimeout(function () { obj.resize(); }, 100); + return true; + }, + + load: function (panel, url, transition, onLoad) { + var obj = this; + if (panel == 'css') { + $.get(url, function (data, status, xhr) { + obj.content(panel, xhr.responseText); + if (onLoad) onLoad(); + }); + return true; + } + if (this.get(panel) != null) { + $.get(url, function (data, status, xhr) { + obj.content(panel, xhr.responseText, transition); + if (onLoad) onLoad(); + // IE Hack + if (window.navigator.userAgent.indexOf('MSIE')) setTimeout(function () { obj.resize(); }, 100); + }); + return true; + } + return false; + }, + + sizeTo: function (panel, size) { + var obj = this; + var pan = obj.get(panel); + if (pan == null) return false; + // resize + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '.35s', + '-moz-transition' : '.35s', + '-ms-transition' : '.35s', + '-o-transition' : '.35s' + }); + setTimeout(function () { + obj.set(panel, { size: size }); + }, 1); + // clean + setTimeout(function () { + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '0s', + '-moz-transition' : '0s', + '-ms-transition' : '0s', + '-o-transition' : '0s' + }); + obj.resize(); + }, 500); + return true; + }, + + show: function (panel, immediate) { + var obj = this; + // event before + var eventData = this.trigger({ phase: 'before', type: 'show', target: panel, object: this.get(panel), immediate: immediate }); + if (eventData.isCancelled === true) return false; + + var p = obj.get(panel); + if (p == null) return false; + p.hidden = false; + if (immediate === true) { + $('#layout_'+ obj.name +'_panel_'+panel).css({ 'opacity': '1' }); + if (p.resizabled) $('#layout_'+ obj.name +'_resizer_'+panel).show(); + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + } else { + if (p.resizabled) $('#layout_'+ obj.name +'_resizer_'+panel).show(); + // resize + $('#layout_'+ obj.name +'_panel_'+panel).css({ 'opacity': '0' }); + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '.2s', + '-moz-transition' : '.2s', + '-ms-transition' : '.2s', + '-o-transition' : '.2s' + }); + setTimeout(function () { obj.resize(); }, 1); + // show + setTimeout(function() { + $('#layout_'+ obj.name +'_panel_'+ panel).css({ 'opacity': '1' }); + }, 250); + // clean + setTimeout(function () { + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '0s', + '-moz-transition' : '0s', + '-ms-transition' : '0s', + '-o-transition' : '0s' + }); + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + }, 500); + } + return true; + }, + + hide: function (panel, immediate) { + var obj = this; + // event before + var eventData = this.trigger({ phase: 'before', type: 'hide', target: panel, object: this.get(panel), immediate: immediate }); + if (eventData.isCancelled === true) return false; + + var p = obj.get(panel); + if (p == null) return false; + p.hidden = true; + if (immediate === true) { + $('#layout_'+ obj.name +'_panel_'+panel).css({ 'opacity': '0' }); + $('#layout_'+ obj.name +'_resizer_'+panel).hide(); + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + } else { + $('#layout_'+ obj.name +'_resizer_'+panel).hide(); + // hide + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '.2s', + '-moz-transition' : '.2s', + '-ms-transition' : '.2s', + '-o-transition' : '.2s' + }); + $('#layout_'+ obj.name +'_panel_'+panel).css({ 'opacity': '0' }); + setTimeout(function () { obj.resize(); }, 1); + // clean + setTimeout(function () { + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '0s', + '-moz-transition' : '0s', + '-ms-transition' : '0s', + '-o-transition' : '0s' + }); + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + }, 500); + } + return true; + }, + + toggle: function (panel, immediate) { + var p = this.get(panel); + if (p == null) return false; + if (p.hidden) return this.show(panel, immediate); else return this.hide(panel, immediate); + }, + + set: function (panel, options) { + var obj = this.get(panel, true); + if (obj == null) return false; + $.extend(this.panels[obj], options); + this.refresh(panel); + this.resize(); // resize is needed when panel size is changed + return true; + }, + + get: function (panel, returnIndex) { + var obj = null; + for (var p in this.panels) { + if (this.panels[p].type == panel) { + if (returnIndex === true) return p; else return this.panels[p]; + } + } + return null; + }, + + el: function (panel) { + var el = $('#layout_'+ this.name +'_panel_'+ panel +' .w2ui-panel-content'); + if (el.length != 1) return null; + return el[0]; + }, + + hideToolbar: function (panel) { + var pan = this.get(panel); + if (!pan) return; + pan.show.toolbar = false; + $('#layout_'+ this.name +'_panel_'+ panel +' > .w2ui-panel-toolbar').hide(); + this.resize(); + }, + + showToolbar: function (panel) { + var pan = this.get(panel); + if (!pan) return; + pan.show.toolbar = true; + $('#layout_'+ this.name +'_panel_'+ panel +' > .w2ui-panel-toolbar').show(); + this.resize(); + }, + + toggleToolbar: function (panel) { + var pan = this.get(panel); + if (!pan) return; + if (pan.show.toolbar) this.hideToolbar(panel); else this.showToolbar(panel); + }, + + hideTabs: function (panel) { + var pan = this.get(panel); + if (!pan) return; + pan.show.tabs = false; + $('#layout_'+ this.name +'_panel_'+ panel +' > .w2ui-panel-tabs').hide(); + this.resize(); + }, + + showTabs: function (panel) { + var pan = this.get(panel); + if (!pan) return; + pan.show.tabs = true; + $('#layout_'+ this.name +'_panel_'+ panel +' > .w2ui-panel-tabs').show(); + this.resize(); + }, + + toggleTabs: function (panel) { + var pan = this.get(panel); + if (!pan) return; + if (pan.show.tabs) this.hideTabs(panel); else this.showTabs(panel); + }, + + render: function (box) { + var obj = this; + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + var time = (new Date()).getTime(); + // event before + var eventData = obj.trigger({ phase: 'before', type: 'render', target: obj.name, box: box }); + if (eventData.isCancelled === true) return false; + + if (typeof box != 'undefined' && box != null) { + if ($(obj.box).find('#layout_'+ obj.name +'_panel_main').length > 0) { + $(obj.box) + .removeAttr('name') + .removeClass('w2ui-layout') + .html(''); + } + obj.box = box; + } + if (!obj.box) return false; + $(obj.box) + .attr('name', obj.name) + .addClass('w2ui-layout') + .html('
'); + if ($(obj.box).length > 0) $(obj.box)[0].style.cssText += obj.style; + // create all panels + var tmp = ['top', 'left', 'main', 'preview', 'right', 'bottom']; + for (var t in tmp) { + var pan = obj.get(tmp[t]); + var html = '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'; + $(obj.box).find(' > div').append(html); + // tabs are rendered in refresh() + } + $(obj.box).find(' > div') + .append('
drag + if (obj.tmp.resizing == 'left' && (obj.get('left').minSize - obj.tmp.resize.div_x > obj.get('left').width)) { + obj.tmp.resize.div_x = obj.get('left').minSize - obj.get('left').width; + } + if (obj.tmp.resize.type == 'left' && (obj.get('main').minSize + obj.tmp.resize.div_x > obj.get('main').width)) { + obj.tmp.resize.div_x = obj.get('main').width - obj.get('main').minSize; + } + // right panel -> drag + if (obj.tmp.resize.type == 'right' && (obj.get('right').minSize + obj.tmp.resize.div_x > obj.get('right').width)) { + obj.tmp.resize.div_x = obj.get('right').width - obj.get('right').minSize; + } + if (obj.tmp.resize.type == 'right' && (obj.get('main').minSize - obj.tmp.resize.div_x > obj.get('main').width)) { + obj.tmp.resize.div_x = obj.get('main').minSize - obj.get('main').width; + } + // top panel -> drag + if (obj.tmp.resize.type == 'top' && (obj.get('top').minSize - obj.tmp.resize.div_y > obj.get('top').height)) { + obj.tmp.resize.div_y = obj.get('top').minSize - obj.get('top').height; + } + if (obj.tmp.resize.type == 'top' && (obj.get('main').minSize + obj.tmp.resize.div_y > obj.get('main').height)) { + obj.tmp.resize.div_y = obj.get('main').height - obj.get('main').minSize; + } + // bottom panel -> drag + if (obj.tmp.resize.type == 'bottom' && (obj.get('bottom').minSize + obj.tmp.resize.div_y > obj.get('bottom').height)) { + obj.tmp.resize.div_y = obj.get('bottom').height - obj.get('bottom').minSize; + } + if (obj.tmp.resize.type == 'bottom' && (obj.get('main').minSize - obj.tmp.resize.div_y > obj.get('main').height)) { + obj.tmp.resize.div_y = obj.get('main').minSize - obj.get('main').height; + } + // preview panel -> drag + if (obj.tmp.resize.type == 'preview' && (obj.get('preview').minSize + obj.tmp.resize.div_y > obj.get('preview').height)) { + obj.tmp.resize.div_y = obj.get('preview').height - obj.get('preview').minSize; + } + if (obj.tmp.resize.type == 'preview' && (obj.get('main').minSize - obj.tmp.resize.div_y > obj.get('main').height)) { + obj.tmp.resize.div_y = obj.get('main').minSize - obj.get('main').height; + } + switch(obj.tmp.resize.type) { + case 'top': + case 'preview': + case 'bottom': + obj.tmp.resize.div_x = 0; + if (p.length > 0) p[0].style.top = (obj.tmp.resize.value + obj.tmp.resize.div_y) + 'px'; + break; + case 'left': + case 'right': + obj.tmp.resize.div_y = 0; + if (p.length > 0) p[0].style.left = (obj.tmp.resize.value + obj.tmp.resize.div_x) + 'px'; + break; + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + } + }, + + refresh: function (panel) { + var obj = this; + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (typeof panel == 'undefined') panel = null; + var time = (new Date()).getTime(); + // event before + var eventData = obj.trigger({ phase: 'before', type: 'refresh', target: (typeof panel != 'undefined' ? panel : obj.name), object: obj.get(panel) }); + if (eventData.isCancelled === true) return; + + // obj.unlock(panel); + if (panel != null && typeof panel != 'undefined') { + var p = obj.get(panel); + if (p == null) return; + // apply properties to the panel + var el = $('#layout_'+ obj.name +'_panel_'+ panel).css({ display: p.hidden ? 'none' : 'block' }); + el = el.find('.w2ui-panel-content'); + if (el.length > 0) el.css('overflow', p.overflow)[0].style.cssText += ';' + p.style; + if (p.resizable === true) { + $('#layout_'+ this.name +'_resizer_'+ panel).show(); + } else { + $('#layout_'+ this.name +'_resizer_'+ panel).hide(); + } + // insert content + if (typeof p.content == 'object' && p.content.render) { + p.content.box = $('#layout_'+ obj.name + '_panel_'+ p.type +' > .w2ui-panel-content')[0]; + p.content.render(); // do not do .render(box); + } else { + $('#layout_'+ obj.name + '_panel_'+ p.type +' > .w2ui-panel-content').html(p.content); + } + // if there are tabs and/or toolbar - render it + var tmp = $(obj.box).find('#layout_'+ obj.name + '_panel_'+ p.type +' .w2ui-panel-tabs'); + if (p.show.tabs) { + if (tmp.find('[name='+ p.tabs.name +']').length == 0 && p.tabs != null) tmp.w2render(p.tabs); else p.tabs.refresh(); + } else { + tmp.html('').removeClass('w2ui-tabs').hide(); + } + var tmp = $(obj.box).find('#layout_'+ obj.name + '_panel_'+ p.type +' .w2ui-panel-toolbar'); + if (p.show.toolbar) { + if (tmp.find('[name='+ p.toolbar.name +']').length == 0 && p.toolbar != null) tmp.w2render(p.toolbar); else p.toolbar.refresh(); + } else { + tmp.html('').removeClass('w2ui-toolbar').hide(); + } + } else { + if ($('#layout_' +obj.name +'_panel_main').length <= 0) { + obj.render(); + return; + } + obj.resize(); + // refresh all of them + for (var p in this.panels) { obj.refresh(this.panels[p].type); } + } + obj.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + resize: function () { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (!this.box) return false; + var time = (new Date()).getTime(); + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name, panel: this.tmp.resizing }); + if (eventData.isCancelled === true) return false; + if (this.padding < 0) this.padding = 0; + + // layout itself + var width = parseInt($(this.box).width()); + var height = parseInt($(this.box).height()); + $(this.box).find(' > div').css({ + width : width + 'px', + height : height + 'px' + }); + var obj = this; + // panels + var pmain = this.get('main'); + var pprev = this.get('preview'); + var pleft = this.get('left'); + var pright = this.get('right'); + var ptop = this.get('top'); + var pbottom = this.get('bottom'); + var smain = true; // main always on + var sprev = (pprev != null && pprev.hidden != true ? true : false); + var sleft = (pleft != null && pleft.hidden != true ? true : false); + var sright = (pright != null && pright.hidden != true ? true : false); + var stop = (ptop != null && ptop.hidden != true ? true : false); + var sbottom = (pbottom != null && pbottom.hidden != true ? true : false); + // calculate % + for (var p in { 'top':'', 'left':'', 'right':'', 'bottom':'', 'preview':'' }) { + var tmp = this.get(p); + var str = String(tmp.size); + if (tmp && str.substr(str.length-1) == '%') { + var tmph = height; + if (tmp.type == 'preview') { + tmph = tmph + - (ptop && !ptop.hidden ? ptop.sizeCalculated : 0) + - (pbottom && !pbottom.hidden ? pbottom.sizeCalculated : 0); + } + tmp.sizeCalculated = parseInt((tmp.type == 'left' || tmp.type == 'right' ? width : tmph) * parseFloat(tmp.size) / 100); + } else { + tmp.sizeCalculated = parseInt(tmp.size); + } + if (tmp.sizeCalculated < parseInt(tmp.minSize)) tmp.sizeCalculated = parseInt(tmp.minSize); + } + // top if any + if (ptop != null && ptop.hidden != true) { + var l = 0; + var t = 0; + var w = width; + var h = ptop.sizeCalculated; + $('#layout_'+ this.name +'_panel_top').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + ptop.width = w; + ptop.height = h; + // resizer + if (ptop.resizable) { + t = ptop.sizeCalculated - (this.padding == 0 ? this.resizer : 0); + h = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_top').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ns-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('top', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_top').hide(); + } + // left if any + if (pleft != null && pleft.hidden != true) { + var l = 0; + var t = 0 + (stop ? ptop.sizeCalculated + this.padding : 0); + var w = pleft.sizeCalculated; + var h = height - (stop ? ptop.sizeCalculated + this.padding : 0) - + (sbottom ? pbottom.sizeCalculated + this.padding : 0); + var e = $('#layout_'+ this.name +'_panel_left'); + if (window.navigator.userAgent.indexOf('MSIE') > 0 && e.length > 0 && e[0].clientHeight < e[0].scrollHeight) w += 17; // IE hack + $('#layout_'+ this.name +'_panel_left').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + pleft.width = w; + pleft.height = h; + // resizer + if (pleft.resizable) { + l = pleft.sizeCalculated - (this.padding == 0 ? this.resizer : 0); + w = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_left').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ew-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('left', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_left').hide(); + $('#layout_'+ this.name +'_resizer_left').hide(); + } + // right if any + if (pright != null && pright.hidden != true) { + var l = width - pright.sizeCalculated; + var t = 0 + (stop ? ptop.sizeCalculated + this.padding : 0); + var w = pright.sizeCalculated; + var h = height - (stop ? ptop.sizeCalculated + this.padding : 0) - + (sbottom ? pbottom.sizeCalculated + this.padding : 0); + $('#layout_'+ this.name +'_panel_right').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + pright.width = w; + pright.height = h; + // resizer + if (pright.resizable) { + l = l - this.padding; + w = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_right').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ew-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('right', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_right').hide(); + } + // bottom if any + if (pbottom != null && pbottom.hidden != true) { + var l = 0; + var t = height - pbottom.sizeCalculated; + var w = width; + var h = pbottom.sizeCalculated; + $('#layout_'+ this.name +'_panel_bottom').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + pbottom.width = w; + pbottom.height = h; + // resizer + if (pbottom.resizable) { + t = t - (this.padding == 0 ? 0 : this.padding); + h = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_bottom').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ns-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('bottom', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_bottom').hide(); + } + // main - always there + var l = 0 + (sleft ? pleft.sizeCalculated + this.padding : 0); + var t = 0 + (stop ? ptop.sizeCalculated + this.padding : 0); + var w = width - (sleft ? pleft.sizeCalculated + this.padding : 0) - + (sright ? pright.sizeCalculated + this.padding: 0); + var h = height - (stop ? ptop.sizeCalculated + this.padding : 0) - + (sbottom ? pbottom.sizeCalculated + this.padding : 0) - + (sprev ? pprev.sizeCalculated + this.padding : 0); + var e = $('#layout_'+ this.name +'_panel_main'); + if (window.navigator.userAgent.indexOf('MSIE') > 0 && e.length > 0 && e[0].clientHeight < e[0].scrollHeight) w += 17; // IE hack + $('#layout_'+ this.name +'_panel_main').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }); + pmain.width = w; + pmain.height = h; + + // preview if any + if (pprev != null && pprev.hidden != true) { + var l = 0 + (sleft ? pleft.sizeCalculated + this.padding : 0); + var t = height - (sbottom ? pbottom.sizeCalculated + this.padding : 0) - pprev.sizeCalculated; + var w = width - (sleft ? pleft.sizeCalculated + this.padding : 0) - + (sright ? pright.sizeCalculated + this.padding : 0); + var h = pprev.sizeCalculated; + var e = $('#layout_'+ this.name +'_panel_preview'); + if (window.navigator.userAgent.indexOf('MSIE') > 0 && e.length > 0 && e[0].clientHeight < e[0].scrollHeight) w += 17; // IE hack + $('#layout_'+ this.name +'_panel_preview').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + pprev.width = w; + pprev.height = h; + // resizer + if (pprev.resizable) { + t = t - (this.padding == 0 ? 0 : this.padding); + h = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_preview').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ns-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('preview', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_preview').hide(); + } + + // display tabs and toolbar if needed + for (var p in { 'top':'', 'left':'', 'main':'', 'preview':'', 'right':'', 'bottom':'' }) { + var pan = this.get(p); + var tmp = '#layout_'+ this.name +'_panel_'+ p +' > .w2ui-panel-'; + var height = 0; + if (pan.show.tabs) { + if (pan.tabs != null && w2ui[this.name +'_'+ p +'_tabs']) w2ui[this.name +'_'+ p +'_tabs'].resize(); + height += w2utils.getSize($(tmp + 'tabs').css({ display: 'block' }), 'height'); + } + if (pan.show.toolbar) { + if (pan.toolbar != null && w2ui[this.name +'_'+ p +'_toolbar']) w2ui[this.name +'_'+ p +'_toolbar'].resize(); + height += w2utils.getSize($(tmp + 'toolbar').css({ top: height + 'px', display: 'block' }), 'height'); + } + $(tmp + 'content').css({ display: 'block' }).css({ top: height + 'px' }); + } + // send resize to all objects + var obj = this; + clearTimeout(this._resize_timer); + this._resize_timer = setTimeout(function () { + for (var e in w2ui) { + if (typeof w2ui[e].resize == 'function') { + // sent to all none-layouts + if (w2ui[e].panels == 'undefined') w2ui[e].resize(); + // only send to nested layouts + var parent = $(w2ui[e].box).parents('.w2ui-layout'); + if (parent.length > 0 && parent.attr('name') == obj.name) w2ui[e].resize(); + } + } + }, 100); + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', type: 'destroy', target: this.name }); + if (eventData.isCancelled === true) return false; + if (typeof w2ui[this.name] == 'undefined') return false; + // clean up + if ($(this.box).find('#layout_'+ this.name +'_panel_main').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-layout') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + + if (this.tmp.events && this.tmp.events.resize) $(window).off('resize', this.tmp.events.resize); + if (this.tmp.events && this.tmp.events.mousemove) $(document).off('mousemove', this.tmp.events.mousemove); + if (this.tmp.events && this.tmp.events.mouseup) $(document).off('mouseup', this.tmp.events.mouseup); + + return true; + }, + + lock: function (panel, msg, showSpinner) { + if ($.inArray(String(panel), ['left', 'right', 'top', 'bottom', 'preview', 'main']) == -1) { + console.log('ERROR: First parameter needs to be the a valid panel name.'); + return; + } + var nm = '#layout_'+ this.name + '_panel_' + panel; + w2utils.lock(nm, msg, showSpinner); + }, + + unlock: function (panel) { + if ($.inArray(String(panel), ['left', 'right', 'top', 'bottom', 'preview', 'main']) == -1) { + console.log('ERROR: First parameter needs to be the a valid panel name.'); + return; + } + var nm = '#layout_'+ this.name + '_panel_' + panel; + w2utils.unlock(nm); + } + } + + $.extend(w2layout.prototype, w2utils.event); + w2obj.layout = w2layout; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2popup - popup widget + * - $().w2popup - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - when maximized, align the slide down message + * - bug: after transfer to another content, message does not work + * - transition should include title, body and buttons, not just body + * - add lock method() to lock popup content + * + ************************************************************************/ + +var w2popup = {}; + +(function ($) { + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2popup = function(method, options) { + if (typeof method == 'undefined') { + options = {}; + method = 'open'; + } + if ($.isPlainObject(method)) { + options = method; + method = 'open'; + } + method = method.toLowerCase(); + if (method == 'load' && typeof options == 'string') options = { url: options }; + if (method == 'open' && typeof options.url != 'undefined') method = 'load'; + if (typeof options == 'undefined') options = {}; + // load options from markup + var dlgOptions = {}; + if ($(this).length > 0 ) { + if ($(this).find('div[rel=title], div[rel=body], div[rel=buttons]').length > 0) { + if ($(this).find('div[rel=title]').length > 0) { + dlgOptions['title'] = $(this).find('div[rel=title]').html(); + } + if ($(this).find('div[rel=body]').length > 0) { + dlgOptions['body'] = $(this).find('div[rel=body]').html(); + dlgOptions['style'] = $(this).find('div[rel=body]')[0].style.cssText; + } + if ($(this).find('div[rel=buttons]').length > 0) { + dlgOptions['buttons'] = $(this).find('div[rel=buttons]').html(); + } + } else { + dlgOptions['title'] = ' '; + dlgOptions['body'] = $(this).html(); + } + if (parseInt($(this).css('width')) != 0) dlgOptions['width'] = parseInt($(this).css('width')); + if (parseInt($(this).css('height')) != 0) dlgOptions['height'] = parseInt($(this).css('height')); + } + // show popup + return w2popup[method]($.extend({}, dlgOptions, options)); + }; + + // ==================================================== + // -- Implementation of core functionality (SINGELTON) + + w2popup = { + defaults: { + title : '', + body : '', + buttons : '', + style : '', + color : '#000', + opacity : 0.4, + speed : 0.3, + modal : false, + maximized : false, + keyboard : true, // will close popup on esc if not modal + width : 500, + height : 300, + showClose : true, + showMax : false, + transition : null + }, + handlers : [], + onOpen : null, + onClose : null, + onMax : null, + onMin : null, + onKeydown : null, + + open: function (options) { + var obj = this; + // get old options and merge them + var old_options = $('#w2ui-popup').data('options'); + var options = $.extend({}, this.defaults, { body : '' }, old_options, options); + // if new - reset event handlers + if ($('#w2ui-popup').length == 0) { + w2popup.handlers = []; + w2popup.onMax = null; + w2popup.onMin = null; + w2popup.onOpen = null; + w2popup.onClose = null; + w2popup.onKeydown = null; + } + if (options.onOpen) w2popup.onOpen = options.onOpen; + if (options.onClose) w2popup.onClose = options.onClose; + if (options.onMax) w2popup.onMax = options.onMax; + if (options.onMin) w2popup.onMin = options.onMin; + if (options.onKeydown) w2popup.onKeydown = options.onKeydown; + + if (window.innerHeight == undefined) { + var width = document.documentElement.offsetWidth; + var height = document.documentElement.offsetHeight; + if (w2utils.engine == 'IE7') { width += 21; height += 4; } + } else { + var width = window.innerWidth; + var height = window.innerHeight; + } + if (parseInt(width) - 10 < parseInt(options.width)) options.width = parseInt(width) - 10; + if (parseInt(height) - 10 < parseInt(options.height)) options.height = parseInt(height) - 10; + var top = ((parseInt(height) - parseInt(options.height)) / 2) * 0.6; + var left = (parseInt(width) - parseInt(options.width)) / 2; + // check if message is already displayed + if ($('#w2ui-popup').length == 0) { + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'open', target: 'popup', options: options, present: false }); + if (eventData.isCancelled === true) return; + // output message + w2popup.lockScreen(options); + var msg = '
'; + if (options.title != '') { + msg +='
'+ + (options.showClose ? '
Close
' : '')+ + (options.showMax ? '
Max
' : '') + + options.title + + '
'; + } + msg += '
'; + msg += '
'+ options.body +'
'; + msg += '
'; + msg += '
'; + msg += '
'; + msg += '
'; + if (options.buttons != '') { + msg += '
'+ options.buttons +'
'; + } + msg += '
'; + $('body').append(msg); + // allow element to render + setTimeout(function () { + $('#w2ui-popup .w2ui-box2').hide(); + $('#w2ui-popup').css({ + '-webkit-transition': options.speed +'s opacity, '+ options.speed +'s -webkit-transform', + '-webkit-transform': 'scale(1)', + '-moz-transition': options.speed +'s opacity, '+ options.speed +'s -moz-transform', + '-moz-transform': 'scale(1)', + '-ms-transition': options.speed +'s opacity, '+ options.speed +'s -ms-transform', + '-ms-transform': 'scale(1)', + '-o-transition': options.speed +'s opacity, '+ options.speed +'s -o-transform', + '-o-transform': 'scale(1)', + 'opacity': '1' + }); + }, 1); + // clean transform + setTimeout(function () { + $('#w2ui-popup').css({ + '-webkit-transform': '', + '-moz-transform': '', + '-ms-transform': '', + '-o-transform': '' + }); + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, options.speed * 1000); + } else { + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'open', target: 'popup', options: options, present: true }); + if (eventData.isCancelled === true) return; + // check if size changed + if (typeof old_options == 'undefined' || old_options['width'] != options['width'] || old_options['height'] != options['height']) { + $('#w2ui-panel').remove(); + w2popup.resize(options.width, options.height); + } + // show new items + var body = $('#w2ui-popup .w2ui-box2 > .w2ui-msg-body').html(options.body); + if (body.length > 0) body[0].style.cssText = options.style; + $('#w2ui-popup .w2ui-msg-buttons').html(options.buttons); + $('#w2ui-popup .w2ui-msg-title').html( + (options.showClose ? '
Close
' : '')+ + (options.showMax ? '
Max
' : '') + + options.title); + // transition + var div_old = $('#w2ui-popup .w2ui-box1')[0]; + var div_new = $('#w2ui-popup .w2ui-box2')[0]; + w2utils.transition(div_old, div_new, options.transition); + div_new.className = 'w2ui-box1'; + div_old.className = 'w2ui-box2'; + $(div_new).addClass('w2ui-current-box'); + // remove max state + $('#w2ui-popup').data('prev-size', null); + // call event onChange + setTimeout(function () { + obj.trigger($.extend(eventData, { phase: 'after' })); + }, 1); + } + // save new options + options._last_w2ui_name = w2utils.keyboard.active(); + w2utils.keyboard.active(null); + $('#w2ui-popup').data('options', options); + // keyboard events + if (options.keyboard) $(document).on('keydown', this.keydown); + + // initialize move + var tmp = { resizing: false }; + $('#w2ui-popup .w2ui-msg-title') + .on('mousedown', function (event) { mvStart(event); }) + .on('mousemove', function (event) { mvMove(event); }) + .on('mouseup', function (event) { mvStop(event); }); + $('#w2ui-popup .w2ui-msg-body') + .on('mousemove', function (event) { mvMove(event); }) + .on('mouseup', function (event) { mvStop(event); }); + $('#w2ui-lock') + .on('mousemove', function (event) { mvMove(event); }) + .on('mouseup', function (event) { mvStop(event); }); + + // handlers + function mvStart(event) { + if (!event) event = window.event; + if (!window.addEventListener) { window.document.attachEvent('onselectstart', function() { return false; } ); } + tmp.resizing = true; + tmp.tmp_x = event.screenX; + tmp.tmp_y = event.screenY; + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + if (event.preventDefault) event.preventDefault(); else return false; + } + + function mvMove(evnt) { + if (tmp.resizing != true) return; + if (!evnt) evnt = window.event; + tmp.tmp_div_x = (evnt.screenX - tmp.tmp_x); + tmp.tmp_div_y = (evnt.screenY - tmp.tmp_y); + $('#w2ui-popup').css({ + '-webkit-transition': 'none', + '-webkit-transform': 'translate3d('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px, 0px)', + '-moz-transition': 'none', + '-moz-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)', + '-ms-transition': 'none', + '-ms-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)', + '-o-transition': 'none', + '-o-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)' + }); + $('#w2ui-panel').css({ + '-webkit-transition': 'none', + '-webkit-transform': 'translate3d('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px, 0px)', + '-moz-transition': 'none', + '-moz-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)', + '-ms-transition': 'none', + '-ms-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px', + '-o-transition': 'none', + '-o-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)' + }); + } + + function mvStop(evnt) { + if (tmp.resizing != true) return; + if (!evnt) evnt = window.event; + tmp.tmp_div_x = (evnt.screenX - tmp.tmp_x); + tmp.tmp_div_y = (evnt.screenY - tmp.tmp_y); + $('#w2ui-popup').css({ + '-webkit-transition': 'none', + '-webkit-transform': 'translate3d(0px, 0px, 0px)', + '-moz-transition': 'none', + '-moz-transform': 'translate(0px, 0px)', + '-ms-transition': 'none', + '-ms-transform': 'translate(0px, 0px)', + '-o-transition': 'none', + '-o-transform': 'translate(0px, 0px)', + 'left': (parseInt($('#w2ui-popup').css('left')) + parseInt(tmp.tmp_div_x)) + 'px', + 'top': (parseInt($('#w2ui-popup').css('top')) + parseInt(tmp.tmp_div_y)) + 'px' + }); + $('#w2ui-panel').css({ + '-webkit-transition': 'none', + '-webkit-transform': 'translate3d(0px, 0px, 0px)', + '-moz-transition': 'none', + '-moz-transform': 'translate(0px, 0px)', + '-ms-transition': 'none', + '-ms-transform': 'translate(0px, 0px)', + '-o-transition': 'none', + '-o-transform': 'translate(0px, 0px)', + 'left': (parseInt($('#w2ui-panel').css('left')) + parseInt(tmp.tmp_div_x)) + 'px', + 'top': (parseInt($('#w2ui-panel').css('top')) + parseInt(tmp.tmp_div_y)) + 'px' + }); + tmp.resizing = false; + } + return this; + }, + + keydown: function (event) { + var options = $('#w2ui-popup').data('options'); + if (!options.keyboard) return; + // trigger event + var eventData = w2popup.trigger({ phase: 'before', type: 'keydown', target: 'popup', options: options, object: w2popup, originalEvent: event }); + if (eventData.isCancelled === true) return; + // default behavior + switch (event.keyCode) { + case 27: + event.preventDefault(); + if ($('#w2ui-popup .w2ui-popup-message').length > 0) w2popup.message(); else w2popup.close(); + break; + } + // event after + w2popup.trigger($.extend(eventData, { phase: 'after'})); + }, + + close: function (options) { + var obj = this; + var options = $.extend({}, $('#w2ui-popup').data('options'), options); + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'close', target: 'popup', options: options }); + if (eventData.isCancelled === true) return; + // default behavior + $('#w2ui-popup, #w2ui-panel').css({ + '-webkit-transition': options.speed +'s opacity, '+ options.speed +'s -webkit-transform', + '-webkit-transform': 'scale(0.9)', + '-moz-transition': options.speed +'s opacity, '+ options.speed +'s -moz-transform', + '-moz-transform': 'scale(0.9)', + '-ms-transition': options.speed +'s opacity, '+ options.speed +'s -ms-transform', + '-ms-transform': 'scale(0.9)', + '-o-transition': options.speed +'s opacity, '+ options.speed +'s -o-transform', + '-o-transform': 'scale(0.9)', + 'opacity': '0' + }); + w2popup.unlockScreen(); + setTimeout(function () { + $('#w2ui-popup').remove(); + $('#w2ui-panel').remove(); + // event after + obj.trigger($.extend(eventData, { phase: 'after'})); + }, options.speed * 1000); + // restore active + w2utils.keyboard.active(options._last_w2ui_name); + // remove keyboard events + if (options.keyboard) $(document).off('keydown', this.keydown); + }, + + toggle: function () { + var options = $('#w2ui-popup').data('options'); + if (options.maximized === true) w2popup.min(); else w2popup.max(); + }, + + max: function () { + var obj = this; + var options = $('#w2ui-popup').data('options'); + if (options.maximized === true) return; + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'max', target: 'popup', options: options }); + if (eventData.isCancelled === true) return; + // default behavior + options.maximized = true; + options.prevSize = $('#w2ui-popup').css('width')+':'+$('#w2ui-popup').css('height'); + $('#w2ui-popup').data('options', options); + // do resize + w2popup.resize(10000, 10000, function () { + obj.trigger($.extend(eventData, { phase: 'after'})); + }); + }, + + min: function () { + var obj = this; + var options = $('#w2ui-popup').data('options'); + if (options.maximized !== true) return; + var size = options.prevSize.split(':'); + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'min', target: 'popup', options: options }); + if (eventData.isCancelled === true) return; + // default behavior + options.maximized = false; + options.prevSize = null; + $('#w2ui-popup').data('options', options); + // do resize + w2popup.resize(size[0], size[1], function () { + obj.trigger($.extend(eventData, { phase: 'after'})); + }); + }, + + get: function () { + return $('#w2ui-popup').data('options'); + }, + + set: function (options) { + w2popup.open(options); + }, + + clear: function() { + $('#w2ui-popup .w2ui-msg-title').html(''); + $('#w2ui-popup .w2ui-msg-body').html(''); + $('#w2ui-popup .w2ui-msg-buttons').html(''); + }, + + reset: function () { + w2popup.open(w2popup.defaults); + }, + + load: function (options) { + if (String(options.url) == 'undefined') { + console.log('ERROR: The url parameter is empty.'); + return; + } + var tmp = String(options.url).split('#'); + var url = tmp[0]; + var selector = tmp[1]; + if (String(options) == 'undefined') options = {}; + // load url + var html = $('#w2ui-popup').data(url); + if (typeof html != 'undefined' && html != null) { + popup(html, selector); + } else { + $.get(url, function (data, status, obj) { + popup(obj.responseText, selector); + $('#w2ui-popup').data(url, obj.responseText); // remember for possible future purposes + }); + } + function popup(html, selector) { + delete options.url; + $('body').append(''); + if (typeof selector != 'undefined' && $('#w2ui-tmp #'+selector).length > 0) { + $('#w2ui-tmp #'+ selector).w2popup(options); + } else { + $('#w2ui-tmp > div').w2popup(options); + } + // link styles + if ($('#w2ui-tmp > style').length > 0) { + var style = $('
').append($('#w2ui-tmp > style').clone()).html(); + if ($('#w2ui-popup #div-style').length == 0) { + $('#w2ui-ppopup').append('
'); + } + $('#w2ui-popup #div-style').html(style); + } + $('#w2ui-tmp').remove(); + } + }, + + message: function (options) { + $().w2tag(); // hide all tags + if (!options) options = { width: 200, height: 100 }; + if (parseInt(options.width) < 10) options.width = 10; + if (parseInt(options.height) < 10) options.height = 10; + if (typeof options.hideOnClick == 'undefined') options.hideOnClick = false; + + var head = $('#w2ui-popup .w2ui-msg-title'); + if ($('#w2ui-popup .w2ui-popup-message').length == 0) { + var pwidth = parseInt($('#w2ui-popup').width()); + $('#w2ui-popup .w2ui-box1') + .before(''); + $('#w2ui-popup .w2ui-popup-message').data('options', options); + } else { + if (typeof options.width == 'undefined') options.width = w2utils.getSize($('#w2ui-popup .w2ui-popup-message'), 'width'); + if (typeof options.height == 'undefined') options.height = w2utils.getSize($('#w2ui-popup .w2ui-popup-message'), 'height'); + } + var display = $('#w2ui-popup .w2ui-popup-message').css('display'); + $('#w2ui-popup .w2ui-popup-message').css({ + '-webkit-transform': (display == 'none' ? 'translateY(-'+ options.height + 'px)': 'translateY(0px)'), + '-moz-transform': (display == 'none' ? 'translateY(-'+ options.height + 'px)': 'translateY(0px)'), + '-ms-transform': (display == 'none' ? 'translateY(-'+ options.height + 'px)': 'translateY(0px)'), + '-o-transform': (display == 'none' ? 'translateY(-'+ options.height + 'px)': 'translateY(0px)') + }); + if (display == 'none') { + $('#w2ui-popup .w2ui-popup-message').show().html(options.html); + setTimeout(function() { + $('#w2ui-popup .w2ui-popup-message').css({ + '-webkit-transition': '0s', '-moz-transition': '0s', '-ms-transition': '0s', '-o-transition': '0s', + 'z-Index': 1500 + }); // has to be on top of lock + w2popup.lock(); + if (typeof options.onOpen == 'function') options.onOpen(); + }, 300); + } else { + $('#w2ui-popup .w2ui-popup-message').css('z-Index', 250); + var options = $('#w2ui-popup .w2ui-popup-message').data('options'); + $('#w2ui-popup .w2ui-popup-message').remove(); + w2popup.unlock(); + if (typeof options.onClose == 'function') options.onClose(); + } + // timer needs to animation + setTimeout(function () { + $('#w2ui-popup .w2ui-popup-message').css({ + '-webkit-transform': (display == 'none' ? 'translateY(0px)': 'translateY(-'+ options.height +'px)'), + '-moz-transform': (display == 'none' ? 'translateY(0px)': 'translateY(-'+ options.height +'px)'), + '-ms-transform': (display == 'none' ? 'translateY(0px)': 'translateY(-'+ options.height +'px)'), + '-o-transform': (display == 'none' ? 'translateY(0px)': 'translateY(-'+ options.height +'px)') + }); + }, 1); + }, + + lock: function (msg, showSpinner) { + w2utils.lock($('#w2ui-popup'), msg, showSpinner); + }, + + unlock: function () { + w2utils.unlock($('#w2ui-popup')); + }, + + // --- INTERNAL FUNCTIONS + + lockScreen: function (options) { + if ($('#w2ui-lock').length > 0) return false; + if (typeof options == 'undefined') options = $('#w2ui-popup').data('options'); + if (typeof options == 'undefined') options = {}; + options = $.extend({}, w2popup.defaults, options); + // show element + $('body').append('
'); + // lock screen + setTimeout(function () { + $('#w2ui-lock').css({ + '-webkit-transition': options.speed +'s opacity', + '-moz-transition': options.speed +'s opacity', + '-ms-transition': options.speed +'s opacity', + '-o-transition': options.speed +'s opacity', + 'opacity': options.opacity + }); + }, 1); + // add events + if (options.modal == true) { + $('#w2ui-lock').on('mousedown', function () { + $('#w2ui-lock').css({ + '-webkit-transition': '.1s', + '-moz-transition': '.1s', + '-ms-transition': '.1s', + '-o-transition': '.1s', + 'opacity': '0.6' + }); + if (window.getSelection) window.getSelection().removeAllRanges(); + }); + $('#w2ui-lock').on('mouseup', function () { + setTimeout(function () { + $('#w2ui-lock').css({ + '-webkit-transition': '.1s', + '-moz-transition': '.1s', + '-ms-transition': '.1s', + '-o-transition': '.1s', + 'opacity': options.opacity + }); + }, 100); + if (window.getSelection) window.getSelection().removeAllRanges(); + }); + } else { + $('#w2ui-lock').on('mouseup', function () { w2popup.close(); }); + } + return true; + }, + + unlockScreen: function () { + if ($('#w2ui-lock').length == 0) return false; + var options = $.extend({}, $('#w2ui-popup').data('options'), options); + $('#w2ui-lock').css({ + '-webkit-transition': options.speed +'s opacity', + '-moz-transition': options.speed +'s opacity', + '-ms-transition': options.speed +'s opacity', + '-o-transition': options.speed +'s opacity', + 'opacity': 0 + }); + setTimeout(function () { + $('#w2ui-lock').remove(); + }, options.speed * 1000); + return true; + }, + + resize: function (width, height, callBack) { + var options = $('#w2ui-popup').data('options'); + // calculate new position + if (parseInt($(window).width()) - 10 < parseInt(width)) width = parseInt($(window).width()) - 10; + if (parseInt($(window).height()) - 10 < parseInt(height)) height = parseInt($(window).height()) - 10; + var top = ((parseInt($(window).height()) - parseInt(height)) / 2) * 0.8; + var left = (parseInt($(window).width()) - parseInt(width)) / 2; + // resize there + $('#w2ui-popup').css({ + '-webkit-transition': options.speed + 's width, '+ options.speed + 's height, '+ options.speed + 's left, '+ options.speed + 's top', + '-moz-transition': options.speed + 's width, '+ options.speed + 's height, '+ options.speed + 's left, '+ options.speed + 's top', + '-ms-transition': options.speed + 's width, '+ options.speed + 's height, '+ options.speed + 's left, '+ options.speed + 's top', + '-o-transition': options.speed + 's width, '+ options.speed + 's height, '+ options.speed + 's left, '+ options.speed + 's top', + 'top': top, + 'left': left, + 'width': width, + 'height': height + }); + if (typeof callBack == 'function') { + setTimeout(function () { + callBack(); + }, options.speed * 1000); + } + } + } + + // merge in event handling + $.extend(w2popup, w2utils.event); + +})(jQuery); + +// ============================================ +// --- Common dialogs + +var w2alert = function (msg, title, callBack) { + if (typeof title == 'undefined') title = w2utils.lang('Notification'); + if (jQuery('#w2ui-popup').length > 0) { + w2popup.message({ + width : 400, + height : 150, + html : '
'+ + '
'+ msg +'
'+ + '
'+ + '
'+ + ' '+ + '
', + onClose : function () { + if (typeof callBack == 'function') callBack(); + } + }); + } else { + w2popup.open({ + width : 450, + height : 200, + showMax : false, + title : title, + body : '
' + msg +'
', + buttons : '', + onClose : function () { + if (typeof callBack == 'function') callBack(); + } + }); + } +}; + +var w2confirm = function (msg, title, callBack) { + if (typeof callBack == 'undefined' || typeof title == 'function') { + callBack = title; + title = w2utils.lang('Confirmation'); + } + if (typeof title == 'undefined') { + title = w2utils.lang('Confirmation'); + } + if (jQuery('#w2ui-popup').length > 0) { + w2popup.message({ + width : 400, + height : 150, + html : '
'+ + '
'+ msg +'
'+ + '
'+ + '
'+ + ' '+ + ' '+ + '
', + onOpen: function () { + jQuery('#w2ui-popup .w2ui-popup-message .w2ui-popup-button').on('click', function (event) { + w2popup.message(); + if (typeof callBack == 'function') callBack(event.target.id); + }); + }, + onKeydown: function (event) { + switch (event.originalEvent.keyCode) { + case 13: // enter + if (typeof callBack == 'function') callBack('Yes'); + w2popup.message(); + break + case 27: // esc + if (typeof callBack == 'function') callBack('No'); + w2popup.message(); + break + } + } + }); + } else { + w2popup.open({ + width : 450, + height : 200, + title : title, + modal : true, + showClose : false, + body : '
' + msg +'
', + buttons : ''+ + '', + onOpen: function (event) { + event.onComplete = function () { + jQuery('#w2ui-popup .w2ui-popup-button').on('click', function (event) { + w2popup.close(); + if (typeof callBack == 'function') callBack(event.target.id); + }); + } + }, + onKeydown: function (event) { + switch (event.originalEvent.keyCode) { + case 13: // enter + if (typeof callBack == 'function') callBack('Yes'); + w2popup.close(); + break + case 27: // esc + if (typeof callBack == 'function') callBack('No'); + w2popup.close(); + break + } + } + }); + } +}; + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2tabs - tabs widget + * - $().w2tabs - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - tabs might not work in chromium apps, need bind() + * - on overflow display << >> + * - individual tab onClick (possibly other events) are not working + * + ************************************************************************/ + +(function ($) { + var w2tabs = function (options) { + this.box = null; // DOM Element that holds the element + this.name = null; // unique name for w2ui + this.active = null; + this.tabs = []; + this.right = ''; + this.style = ''; + this.onClick = null; + this.onClose = null; + this.onRender = null; + this.onRefresh = null; + this.onResize = null; + this.onDestroy = null; + + $.extend(true, this, w2obj.tabs, options); + } + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2tabs = function(method) { + if (typeof method === 'object' || !method ) { + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2tabs().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + // extend tabs + var tabs = method.tabs; + var object = new w2tabs(method); + $.extend(object, { tabs: [], handlers: [] }); + for (var i in tabs) { object.tabs[i] = $.extend({}, w2tabs.prototype.tab, tabs[i]); } + if ($(this).length != 0) { + object.render($(this)[0]); + } + // register new object + w2ui[object.name] = object; + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2tabs' ); + } + }; + + // ==================================================== + // -- Implementation of core functionality + + w2tabs.prototype = { + tab : { + id : null, // commnad to be sent to all event handlers + text : '', + hidden : false, + disabled : false, + closable : false, + hint : '', + onClick : null, + onRefresh : null, + onClose : null + }, + + add: function (tab) { + return this.insert(null, tab); + }, + + insert: function (id, tab) { + if (!$.isArray(tab)) tab = [tab]; + // assume it is array + for (var r in tab) { + // checks + if (String(tab[r].id) == 'undefined') { + console.log('ERROR: The parameter "id" is required but not supplied. (obj: '+ this.name +')'); + return; + } + var unique = true; + for (var i in this.tabs) { if (this.tabs[i].id == tab[r].id) { unique = false; break; } } + if (!unique) { + console.log('ERROR: The parameter "id='+ tab[r].id +'" is not unique within the current tabs. (obj: '+ this.name +')'); + return; + } + if (!w2utils.isAlphaNumeric(tab[r].id)) { + console.log('ERROR: The parameter "id='+ tab[r].id +'" must be alpha-numeric + "-_". (obj: '+ this.name +')'); + return; + } + // add tab + var tab = $.extend({}, tab, tab[r]); + if (id == null || typeof id == 'undefined') { + this.tabs.push(tab); + } else { + var middle = this.get(id, true); + this.tabs = this.tabs.slice(0, middle).concat([tab], this.tabs.slice(middle)); + } + this.refresh(tab[r].id); + } + }, + + remove: function (id) { + var removed = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab) return false; + removed++; + // remove from array + this.tabs.splice(this.get(tab.id, true), 1); + // remove from screen + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(tab.id)).remove(); + } + return removed; + }, + + select: function (id) { + if (this.get(id) == null || this.active == id) return false; + this.active = id; + this.refresh(); + return true; + }, + + set: function (id, tab) { + var index = this.get(id, true); + if (index == null) return false; + $.extend(this.tabs[index], tab); + this.refresh(id); + return true; + }, + + get: function (id, returnIndex) { + if (arguments.length == 0) { + var all = []; + for (var i = 0; i < this.tabs.length; i++) if (this.tabs[i].id != null) all.push(this.tabs[i].id); + return all; + } + for (var i in this.tabs) { + if (this.tabs[i].id == id) { + if (returnIndex === true) return i; else return this.tabs[i]; + } + } + return null; + }, + + show: function () { + var shown = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab || tab.hidden === false) continue; + tab.hidden = false; + this.refresh(tab.id); + shown++; + } + return shown; + }, + + hide: function () { + var hidden = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab || tab.hidden === true) continue; + tab.hidden = true; + this.refresh(tab.id); + hidden++; + } + return hidden; + }, + + enable: function (id) { + var enabled = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab || tab.disabled === false) continue; + tab.disabled = false; + this.refresh(tab.id); + enabled++; + } + return enabled; + }, + + disable: function (id) { + var disabled = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab || tab.disabled === true) continue; + tab.disabled = true; + this.refresh(tab.id); + disabled++; + } + return disabled; + }, + + refresh: function (id) { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (String(id) == 'undefined') { + // refresh all + for (var i in this.tabs) this.refresh(this.tabs[i].id); + } + // event before + var eventData = this.trigger({ phase: 'before', type: 'refresh', target: (typeof id != 'undefined' ? id : this.name), object: this.get(id) }); + if (eventData.isCancelled === true) return false; + // create or refresh only one item + var tab = this.get(id); + if (tab == null) return; + if (typeof tab.caption != 'undefined') tab.text = tab.caption; + + var jq_el = $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(tab.id)); + var tabHTML = (tab.closable ? '
' : '') + + '
' + tab.text + '
'; + if (jq_el.length == 0) { + // does not exist - create it + var addStyle = ''; + if (tab.hidden) { addStyle += 'display: none;'; } + if (tab.disabled) { addStyle += 'opacity: 0.2; -moz-opacity: 0.2; -webkit-opacity: 0.2; -o-opacity: 0.2; filter:alpha(opacity=20);'; } + html = ''+ tabHTML + ''; + if (this.get(id, true) != this.tabs.length-1 && $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.tabs[parseInt(this.get(id, true))+1].id)).length > 0) { + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.tabs[parseInt(this.get(id, true))+1].id)).before(html); + } else { + $(this.box).find('#tabs_'+ this.name +'_right').before(html); + } + } else { + // refresh + jq_el.html(tabHTML); + if (tab.hidden) { jq_el.css('display', 'none'); } + else { jq_el.css('display', ''); } + if (tab.disabled) { jq_el.css({ 'opacity': '0.2', '-moz-opacity': '0.2', '-webkit-opacity': '0.2', '-o-opacity': '0.2', 'filter': 'alpha(opacity=20)' }); } + else { jq_el.css({ 'opacity': '1', '-moz-opacity': '1', '-webkit-opacity': '1', '-o-opacity': '1', 'filter': 'alpha(opacity=100)' }); } + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + render: function (box) { + var time = (new Date()).getTime(); + // event before + var eventData = this.trigger({ phase: 'before', type: 'render', target: this.name, box: box }); + if (eventData.isCancelled === true) return false; + // default action + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (String(box) != 'undefined' && box != null) { + if ($(this.box).find('> table #tabs_'+ this.name + '_right').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-tabs') + .html(''); + } + this.box = box; + } + if (!this.box) return; + // render all buttons + var html = ''+ + ' '+ + '
'+ this.right +'
'; + $(this.box) + .attr('name', this.name) + .addClass('w2ui-reset w2ui-tabs') + .html(html); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.refresh(); + return (new Date()).getTime() - time; + }, + + resize: function () { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name }); + if (eventData.isCancelled === true) return false; + // empty function + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', type: 'destroy', target: this.name }); + if (eventData.isCancelled === true) return false; + // clean up + if ($(this.box).find('> table #tabs_'+ this.name + '_right').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-tabs') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + // =================================================== + // -- Internal Event Handlers + + click: function (id, event) { + var tab = this.get(id); + if (tab == null || tab.disabled) return false; + // event before + var eventData = this.trigger({ phase: 'before', type: 'click', target: id, object: this.get(id), originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default action + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.active) +' .w2ui-tab').removeClass('active'); + this.active = tab.id; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.refresh(id); + }, + + animateClose: function(id, event) { + var tab = this.get(id); + if (tab == null || tab.disabled) return false; + // event before + var eventData = this.trigger({ phase: 'before', type: 'close', target: id, object: this.get(id), originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default action + var obj = this; + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(tab.id)).css({ + '-webkit-transition': '.2s', + '-moz-transition': '2s', + '-ms-transition': '.2s', + '-o-transition': '.2s', + opacity: '0' }); + setTimeout(function () { + var width = $(obj.box).find('#tabs_'+ obj.name +'_tab_'+ w2utils.escapeId(tab.id)).width(); + $(obj.box).find('#tabs_'+ obj.name +'_tab_'+ w2utils.escapeId(tab.id)) + .html('
') + setTimeout(function () { + $(obj.box).find('#tabs_'+ obj.name +'_tab_'+ w2utils.escapeId(tab.id)).find(':first-child').css({ 'width': '0px' }); + }, 50); + }, 200); + setTimeout(function () { + obj.remove(id); + }, 450); + // event before + this.trigger($.extend(eventData, { phase: 'after' })); + this.refresh(); + }, + + animateInsert: function(id, tab) { + if (this.get(id) == null) return; + if (!$.isPlainObject(tab)) return; + // check for unique + var unique = true; + for (var i in this.tabs) { if (this.tabs[i].id == tab.id) { unique = false; break; } } + if (!unique) { + console.log('ERROR: The parameter "id='+ tab.id +'" is not unique within the current tabs. (obj: '+ this.name +')'); + return; + } + // insert simple div + var jq_el = $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(tab.id)); + if (jq_el.length != 0) return; // already exists + // measure width + if (typeof tab.caption != 'undefined') tab.text = tab.caption; + var tmp = '
'+ + ''+ + '
'+ + (tab.closable ? '
' : '') + + '
'+ tab.text +'
'+ + '
'+ + '
'; + $('body').append(tmp); + // create dummy element + tabHTML = '
 
'; + var addStyle = ''; + if (tab.hidden) { addStyle += 'display: none;'; } + if (tab.disabled) { addStyle += 'opacity: 0.2; -moz-opacity: 0.2; -webkit-opacity: 0.2; -o-opacity: 0.2; filter:alpha(opacity=20);'; } + html = ''+ tabHTML +''; + if (this.get(id, true) != this.tabs.length && $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.tabs[parseInt(this.get(id, true))].id)).length > 0) { + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.tabs[parseInt(this.get(id, true))].id)).before(html); + } else { + $(this.box).find('#tabs_'+ this.name +'_right').before(html); + } + // -- move + var obj = this; + setTimeout(function () { + var width = $('#_tmp_simple_tab').width(); + $('#_tmp_tabs').remove(); + $('#tabs_'+ obj.name +'_tab_'+ w2utils.escapeId(tab.id) +' > div').css('width', width+'px'); + }, 1); + setTimeout(function () { + // insert for real + obj.insert(id, tab); + }, 200); + } + } + + $.extend(w2tabs.prototype, w2utils.event); + w2obj.tabs = w2tabs; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2toolbar - toolbar widget + * - $().w2toolbar - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - on overflow display << >> + * + ************************************************************************/ + +(function ($) { + var w2toolbar = function (options) { + this.box = null, // DOM Element that holds the element + this.name = null, // unique name for w2ui + this.items = [], + this.right = '', // HTML text on the right of toolbar + this.onClick = null, + this.onRender = null, + this.onRefresh = null, + this.onResize = null, + this.onDestroy = null + + $.extend(true, this, w2obj.toolbar, options); + } + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2toolbar = function(method) { + if (typeof method === 'object' || !method ) { + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2toolbar().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + var items = method.items; + // extend items + var object = new w2toolbar(method); + $.extend(object, { items: [], handlers: [] }); + + for (var i in items) { object.items[i] = $.extend({}, w2toolbar.prototype.item, items[i]); } + if ($(this).length != 0) { + object.render($(this)[0]); + } + // register new object + w2ui[object.name] = object; + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2toolbar' ); + } + }; + + // ==================================================== + // -- Implementation of core functionality + + w2toolbar.prototype = { + item: { + id : null, // commnad to be sent to all event handlers + type : 'button', // button, check, radio, drop, menu, break, html, spacer + text : '', + html : '', + img : null, + icon : null, + hidden : false, + disabled: false, + checked : false, // used for radio buttons + arrow : true, // arrow down for drop/menu types + hint : '', + group : null, // used for radio buttons + items : null, // for type menu it is an array of items in the menu + onClick : null + }, + + add: function (items) { + this.insert(null, items); + }, + + insert: function (id, items) { + if (!$.isArray(items)) items = [items]; + for (var o in items) { + // checks + if (typeof items[o].type == 'undefined') { + console.log('ERROR: The parameter "type" is required but not supplied in w2toolbar.add() method.'); + return; + } + if ($.inArray(String(items[o].type), ['button', 'check', 'radio', 'drop', 'menu', 'break', 'html', 'spacer']) == -1) { + console.log('ERROR: The parameter "type" should be one of the following [button, check, radio, drop, menu, break, html, spacer] '+ + 'in w2toolbar.add() method.'); + return; + } + if (typeof items[o].id == 'undefined') { + console.log('ERROR: The parameter "id" is required but not supplied in w2toolbar.add() method.'); + return; + } + var unique = true; + for (var i = 0; i < this.items.length; i++) { if (this.items[i].id == items[o].id) { unique = false; return; } } + if (!unique) { + console.log('ERROR: The parameter "id" is not unique within the current toolbar.'); + return; + } + if (!w2utils.isAlphaNumeric(items[o].id)) { + console.log('ERROR: The parameter "id" must be alpha-numeric + "-_".'); + return; + } + // add item + var it = $.extend({}, w2toolbar.prototype.item, items[o]); + if (id == null || typeof id == 'undefined') { + this.items.push(it); + } else { + var middle = this.get(id, true); + this.items = this.items.slice(0, middle).concat([it], this.items.slice(middle)); + } + this.refresh(it.id); + } + }, + + remove: function (id) { + var removed = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + removed++; + // remove from screen + $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id)).remove(); + // remove from array + var ind = this.get(it.id, true); + if (ind) this.items.splice(ind, 1); + } + return removed; + }, + + set: function (id, item) { + var index = this.get(id, true); + if (index == null) return false; + $.extend(this.items[index], item); + this.refresh(id); + return true; + }, + + get: function (id, returnIndex) { + if (arguments.length == 0) { + var all = []; + for (var i = 0; i < this.items.length; i++) if (this.items[i].id != null) all.push(this.items[i].id); + return all; + } + for (var i = 0; i < this.items.length; i++) { + if (this.items[i].id == id) { + if (returnIndex === true) return i; else return this.items[i]; + } + } + return null; + }, + + show: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.hidden = false; + this.refresh(it.id); + } + return items; + }, + + hide: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.hidden = true; + this.refresh(it.id); + } + return items; + }, + + enable: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.disabled = false; + this.refresh(it.id); + } + return items; + }, + + disable: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.disabled = true; + this.refresh(it.id); + } + return items; + }, + + check: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.checked = true; + this.refresh(it.id); + } + return items; + }, + + uncheck: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.checked = false; + this.refresh(it.id); + } + return items; + }, + + render: function (box) { + // event before + var eventData = this.trigger({ phase: 'before', type: 'render', target: this.name, box: box }); + if (eventData.isCancelled === true) return false; + + if (typeof box != 'undefined' && box != null) { + if ($(this.box).find('> table #tb_'+ this.name + '_right').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-toolbar') + .html(''); + } + this.box = box; + } + if (!this.box) return; + // render all buttons + var html = ''+ + ''; + for (var i = 0; i < this.items.length; i++) { + var it = this.items[i]; + if (typeof it.id == 'undefined' || it.id == null) it.id = "item_" + i; + if (it == null) continue; + if (it.type == 'spacer') { + html += ''; + } else { + html += ''; + } + } + html += ''; + html += ''+ + '
'+ this.getItemHTML(it) + + ''+ this.right +'
'; + $(this.box) + .attr('name', this.name) + .addClass('w2ui-reset w2ui-toolbar') + .html(html); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + refresh: function (id) { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'refresh', target: (typeof id != 'undefined' ? id : this.name), item: this.get(id) }); + if (eventData.isCancelled === true) return false; + + if (typeof id == 'undefined') { + // refresh all + for (var i = 0; i < this.items.length; i++) { + var it = this.items[i]; + if (typeof it.id == 'undefined' || it.id == null) it.id = "item_" + i; + this.refresh(it.id); + } + } + // create or refresh only one item + var it = this.get(id); + if (it == null) return; + + var el = $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id)); + var html = this.getItemHTML(it); + if (el.length == 0) { + // does not exist - create it + if (it.type == 'spacer') { + html = ''; + } else { + html = ''+ html + + ''; + } + if (this.get(id, true) == this.items.length-1) { + $(this.box).find('#tb_'+ this.name +'_right').before(html); + } else { + $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(this.items[parseInt(this.get(id, true))+1].id)).before(html); + } + } else { + // refresh + el.html(html); + if (it.hidden) { el.css('display', 'none'); } else { el.css('display', ''); } + if (it.disabled) { el.addClass('disabled'); } else { el.removeClass('disabled'); } + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + resize: function () { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name }); + if (eventData.isCancelled === true) return false; + + // empty function + + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', type: 'destroy', target: this.name }); + if (eventData.isCancelled === true) return false; + // clean up + if ($(this.box).find('> table #tb_'+ this.name + '_right').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-toolbar') + .html(''); + } + $(this.box).html(''); + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + // ======================================== + // --- Internal Functions + + getItemHTML: function (item) { + var html = ''; + + if (typeof item.caption != 'undefined') item.text = item.caption; + if (typeof item.hint == 'undefined') item.hint = ''; + if (typeof item.text == 'undefined') item.text = ''; + + switch (item.type) { + case 'menu': + case 'button': + case 'check': + case 'radio': + case 'drop': + var img = ' '; + if (item.img) img = '
'; + if (item.icon) img = '
'; + html += ''+ + '
'+ + ' '+ + ' ' + + img + + (item.text != '' ? '' : '') + + (((item.type == 'drop' || item.type == 'menu') && item.arrow !== false) ? + '' : '') + + '
'+ item.text +'   
'+ + '
'; + break; + + case 'break': + html += ''+ + ' '+ + '
 
'; + break; + + case 'html': + html += ''+ + ' '+ + '
' + item.html + '
'; + break; + } + + var newHTML = ''; + if (typeof item.onRender == 'function') newHTML = item.onRender.call(this, item.id, html); + if (typeof this.onRender == 'function') newHTML = this.onRender(item.id, html); + if (newHTML != '' && typeof newHTML != 'undefined') html = newHTML; + return html; + }, + + menuClick: function (id, menu_index, event) { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + var obj = this; + var it = this.get(id); + if (it && !it.disabled) { + // event before + var eventData = this.trigger({ phase: 'before', type: 'click', target: (typeof id != 'undefined' ? id : this.name), item: this.get(id), + subItem: (typeof menu_index != 'undefined' && this.get(id) ? this.get(id).items[menu_index] : null), originalEvent: event }); + if (eventData.isCancelled === true) return false; + + // normal processing + + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + } + }, + + click: function (id, event) { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + var obj = this; + var it = this.get(id); + if (it && !it.disabled) { + // event before + var eventData = this.trigger({ phase: 'before', type: 'click', target: (typeof id != 'undefined' ? id : this.name), + item: this.get(id), originalEvent: event }); + if (eventData.isCancelled === true) return false; + + $('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').removeClass('down'); + + if (it.type == 'radio') { + for (var i = 0; i < this.items.length; i++) { + var itt = this.items[i]; + if (itt == null || itt.id == it.id || itt.type != 'radio') continue; + if (itt.group == it.group && itt.checked) { + itt.checked = false; + this.refresh(itt.id); + } + } + it.checked = true; + $('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').addClass('checked'); + } + + if (it.type == 'drop' || it.type == 'menu') { + if (it.checked) { + // if it was already checked, second click will hide it + it.checked = false; + } else { + // show overlay + setTimeout(function () { + var el = $('#tb_'+ obj.name +'_item_'+ w2utils.escapeId(it.id)); + if (!$.isPlainObject(it.overlay)) it.overlay = {}; + if (it.type == 'drop') { + el.w2overlay(it.html, $.extend({ left: (el.width() - 50) / 2, top: 3 }, it.overlay)); + } + if (it.type == 'menu') { + el.w2menu(it.items, $.extend({ left: (el.width() - 50) / 2, top: 3 }, it.overlay, { + select: function (item, event, index) { obj.menuClick(it.id, index, event); } + })); + } + // window.click to hide it + $(document).on('click', hideDrop); + function hideDrop() { + it.checked = false; + if (it.checked) { + $('#tb_'+ obj.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').addClass('checked'); + } else { + $('#tb_'+ obj.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').removeClass('checked'); + } + obj.refresh(it.id); + $(document).off('click', hideDrop); + } + }, 1); + } + } + + if (it.type == 'check' || it.type == 'drop' || it.type == 'menu') { + it.checked = !it.checked; + if (it.checked) { + $('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').addClass('checked'); + } else { + $('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').removeClass('checked'); + } + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + } + } + } + + $.extend(w2toolbar.prototype, w2utils.event); + w2obj.toolbar = w2toolbar; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2sidebar - sidebar widget + * - $().w2sidebar - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - return ids of all subitems + * - add find() method to find nodes by a specific criteria (I want all nodes for exampe) + * - dbl click should be like it is in grid (with timer not HTML dbl click event) + * + ************************************************************************/ + +(function ($) { + var w2sidebar = function (options) { + this.name = null; + this.box = null; + this.sidebar = null; + this.parent = null; + this.nodes = []; // Sidebar child nodes + this.menu = []; + this.selected = null; // current selected node (readonly) + this.img = null; + this.icon = null; + this.style = ''; + this.topHTML = ''; + this.bottomHTML = ''; + this.keyboard = true; + this.onClick = null; // Fire when user click on Node Text + this.onDblClick = null; // Fire when user dbl clicks + this.onContextMenu = null; + this.onMenuClick = null; // when context menu item selected + this.onExpand = null; // Fire when node Expands + this.onCollapse = null; // Fire when node Colapses + this.onKeydown = null; + this.onRender = null; + this.onRefresh = null; + this.onResize = null; + this.onDestroy = null; + + $.extend(true, this, w2obj.sidebar, options); + } + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2sidebar = function(method) { + if (typeof method === 'object' || !method ) { + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2sidebar().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + // extend items + var nodes = method.nodes; + var object = new w2sidebar(method); + $.extend(object, { handlers: [], nodes: [] }); + if (typeof nodes != 'undefined') { + object.add(object, nodes); + } + if ($(this).length != 0) { + object.render($(this)[0]); + } + object.sidebar = object; + // register new object + w2ui[object.name] = object; + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2sidebar' ); + } + }; + + // ==================================================== + // -- Implementation of core functionality + + w2sidebar.prototype = { + + node: { + id : null, + text : '', + count : '', + img : null, + icon : null, + nodes : [], + style : '', + selected : false, + expanded : false, + hidden : false, + disabled : false, + group : false, // if true, it will build as a group + plus : false, // if true, plus will be shown even if there is no sub nodes + // events + onClick : null, + onDblClick : null, + onContextMenu : null, + onExpand : null, + onCollapse : null, + // internal + parent : null, // node object + sidebar : null + }, + + add: function (parent, nodes) { + if (arguments.length == 1) { + // need to be in reverse order + nodes = arguments[0]; + parent = this; + } + if (typeof parent == 'string') parent = this.get(parent); + return this.insert(parent, null, nodes); + }, + + insert: function (parent, before, nodes) { + if (arguments.length == 2) { + // need to be in reverse order + nodes = arguments[1]; + before = arguments[0]; + var ind = this.get(before); + if (ind == null) { + var txt = (nodes[o].caption != 'undefined' ? nodes[o].caption : nodes[o].text); + console.log('ERROR: Cannot insert node "'+ txt +'" because cannot find node "'+ before +'" to insert before.'); + return null; + } + parent = this.get(before).parent; + } + if (typeof parent == 'string') parent = this.get(parent); + if (!$.isArray(nodes)) nodes = [nodes]; + for (var o in nodes) { + if (typeof nodes[o].id == 'undefined') { + var txt = (nodes[o].caption != 'undefined' ? nodes[o].caption : nodes[o].text); + console.log('ERROR: Cannot insert node "'+ txt +'" because it has no id.'); + continue; + } + if (this.get(this, nodes[o].id) != null) { + var txt = (nodes[o].caption != 'undefined' ? nodes[o].caption : nodes[o].text); + console.log('ERROR: Cannot insert node with id='+ nodes[o].id +' (text: '+ txt + ') because another node with the same id already exists.'); + continue; + } + var tmp = $.extend({}, w2sidebar.prototype.node, nodes[o]); + tmp.sidebar= this; + tmp.parent = parent; + var nd = tmp.nodes; + tmp.nodes = []; // very important to re-init empty nodes array + if (before == null) { // append to the end + parent.nodes.push(tmp); + } else { + var ind = this.get(parent, before, true); + if (ind == null) { + var txt = (nodes[o].caption != 'undefined' ? nodes[o].caption : nodes[o].text); + console.log('ERROR: Cannot insert node "'+ txt +'" because cannot find node "'+ before +'" to insert before.'); + return null; + } + parent.nodes.splice(ind, 0, tmp); + } + if (typeof nd != 'undefined' && nd.length > 0) { this.insert(tmp, null, nd); } + } + this.refresh(parent.id); + return tmp; + }, + + remove: function () { // multiple arguments + var deleted = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + var ind = this.get(tmp.parent, arguments[a], true); + if (ind == null) continue; + tmp.parent.nodes.splice(ind, 1); + deleted++; + } + if (deleted > 0 && arguments.length == 1) this.refresh(tmp.parent.id); else this.refresh(); + return deleted; + }, + + set: function (parent, id, node) { + if (arguments.length == 2) { + // need to be in reverse order + node = id; + id = parent; + parent = this; + } + // searches all nested nodes + this._tmp = null; + if (typeof parent == 'string') parent = this.get(parent); + if (parent.nodes == null) return null; + for (var i=0; i < parent.nodes.length; i++) { + if (parent.nodes[i].id == id) { + // make sure nodes inserted correctly + var nodes = node.nodes; + $.extend(parent.nodes[i], node, { nodes: [] }); + if (typeof nodes != 'undefined') { + this.add(parent.nodes[i], nodes); + } + this.refresh(id); + return true; + } else { + this._tmp = this.set(parent.nodes[i], id, node); + if (this._tmp) return true; + } + } + return false; + }, + + get: function (parent, id, returnIndex) { // can be just called get(id) or get(id, true) + if (arguments.length == 1 || (arguments.length == 2 && id === true) ) { + // need to be in reverse order + returnIndex = id; + id = parent; + parent = this; + } + // searches all nested nodes + this._tmp = null; + if (typeof parent == 'string') parent = this.get(parent); + if (parent.nodes == null) return null; + for (var i=0; i < parent.nodes.length; i++) { + if (parent.nodes[i].id == id) { + if (returnIndex === true) return i; else return parent.nodes[i]; + } else { + this._tmp = this.get(parent.nodes[i], id, returnIndex); + if (this._tmp || this._tmp === 0) return this._tmp; + } + } + return this._tmp; + }, + + hide: function () { // multiple arguments + var hidden = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + tmp.hidden = true; + hidden++; + } + if (arguments.length == 1) this.refresh(arguments[0]); else this.refresh(); + return hidden; + }, + + show: function () { + var shown = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + tmp.hidden = false; + shown++; + } + if (arguments.length == 1) this.refresh(arguments[0]); else this.refresh(); + return shown; + }, + + disable: function () { // multiple arguments + var disabled = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + tmp.disabled = true; + if (tmp.selected) this.unselect(tmp.id); + disabled++; + } + if (arguments.length == 1) this.refresh(arguments[0]); else this.refresh(); + return disabled; + }, + + enable: function () { // multiple arguments + var enabled = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + tmp.disabled = false; + enabled++; + } + if (arguments.length == 1) this.refresh(arguments[0]); else this.refresh(); + return enabled; + }, + + select: function (id) { + if (this.selected == id) return false; + this.unselect(this.selected); + var new_node = this.get(id); + if (!new_node) return false; + $(this.box).find('#node_'+ w2utils.escapeId(id)) + .addClass('w2ui-selected') + .find('.w2ui-icon').addClass('w2ui-icon-selected'); + new_node.selected = true; + this.selected = id; + }, + + unselect: function (id) { + var current = this.get(id); + if (!current) return false; + current.selected = false; + $(this.box).find('#node_'+ w2utils.escapeId(id)) + .removeClass('w2ui-selected') + .find('.w2ui-icon').removeClass('w2ui-icon-selected'); + if (this.selected == id) this.selected = null; + return true; + }, + + toggle: function(id) { + var nd = this.get(id); + if (nd == null) return; + if (nd.plus) { + this.set(id, { plus: false }); + this.expand(id); + this.refresh(id); + return; + } + if (nd.nodes.length == 0) return; + if (this.get(id).expanded) this.collapse(id); else this.expand(id); + }, + + collapse: function (id) { + var nd = this.get(id); + // event before + var eventData = this.trigger({ phase: 'before', type: 'collapse', target: id, object: nd }); + if (eventData.isCancelled === true) return false; + // default action + $(this.box).find('#node_'+ w2utils.escapeId(id) +'_sub').slideUp('fast'); + $(this.box).find('#node_'+ w2utils.escapeId(id) +' .w2ui-node-dots:first-child').html('
+
'); + nd.expanded = false; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.resize(); + }, + + collapseAll: function (parent) { + if (typeof parent == 'undefined') parent = this; + if (typeof parent == 'string') parent = this.get(parent); + if (parent.nodes == null) return null; + for (var i=0; i < parent.nodes.length; i++) { + if (parent.nodes[i].expanded === true) parent.nodes[i].expanded = false; + if (parent.nodes[i].nodes && parent.nodes[i].nodes.length > 0) this.collapseAll(parent.nodes[i]); + } + this.refresh(parent.id); + }, + + expand: function (id) { + var nd = this.get(id); + // event before + var eventData = this.trigger({ phase: 'before', type: 'expand', target: id, object: nd }); + if (eventData.isCancelled === true) return false; + // default action + $(this.box).find('#node_'+ w2utils.escapeId(id) +'_sub').slideDown('fast'); + $(this.box).find('#node_'+ w2utils.escapeId(id) +' .w2ui-node-dots:first-child').html('
-
'); + nd.expanded = true; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.resize(); + }, + + expandAll: function (parent) { + if (typeof parent == 'undefined') parent = this; + if (typeof parent == 'string') parent = this.get(parent); + if (parent.nodes == null) return null; + for (var i=0; i < parent.nodes.length; i++) { + if (parent.nodes[i].expanded === false) parent.nodes[i].expanded = true; + if (parent.nodes[i].nodes && parent.nodes[i].nodes.length > 0) this.collapseAll(parent.nodes[i]); + } + this.refresh(parent.id); + }, + + expandParents: function (id) { + var node = this.get(id); + if (node == null) return; + if (node.parent) { + node.parent.expanded = true; + this.expandParents(node.parent.id); + } + this.refresh(id); + }, + + click: function (id, event) { + var obj = this; + var nd = this.get(id); + if (nd == null) return; + var old = this.selected; + if (nd.disabled || nd.group) return; // should click event if already selected + // move selected first + $(obj.box).find('#node_'+ w2utils.escapeId(old)).removeClass('w2ui-selected').find('.w2ui-icon').removeClass('w2ui-icon-selected'); + $(obj.box).find('#node_'+ w2utils.escapeId(id)).addClass('w2ui-selected').find('.w2ui-icon').addClass('w2ui-icon-selected'); + // need timeout to allow rendering + setTimeout(function () { + // event before + var eventData = obj.trigger({ phase: 'before', type: 'click', target: id, originalEvent: event, object: nd }); + if (eventData.isCancelled === true) { + // restore selection + $(obj.box).find('#node_'+ w2utils.escapeId(id)).removeClass('w2ui-selected').find('.w2ui-icon').removeClass('w2ui-icon-selected'); + $(obj.box).find('#node_'+ w2utils.escapeId(old)).addClass('w2ui-selected').find('.w2ui-icon').addClass('w2ui-icon-selected'); + return false; + } + // default action + if (old != null) obj.get(old).selected = false; + obj.get(id).selected = true; + obj.selected = id; + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, 1); + }, + + keydown: function (event) { + var obj = this; + var nd = obj.get(obj.selected); + if (!nd || obj.keyboard !== true) return; + // trigger event + var eventData = obj.trigger({ phase: 'before', type: 'keydown', target: obj.name, originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default behaviour + if (event.keyCode == 13 || event.keyCode == 32) { // enter or space + if (nd.nodes.length > 0) obj.toggle(obj.selected); + } + if (event.keyCode == 37) { // left + if (nd.nodes.length > 0) { + obj.collapse(obj.selected); + } else { + // collapse parent + if (nd.parent && !nd.parent.disabled && !nd.parent.group) { + obj.collapse(nd.parent.id); + obj.click(nd.parent.id); + setTimeout(function () { obj.scrollIntoView(); }, 50); + } + } + } + if (event.keyCode == 39) { // right + if (nd.nodes.length > 0) obj.expand(obj.selected); + } + if (event.keyCode == 38) { // up + var tmp = prev(nd); + if (tmp != null) { obj.click(tmp.id, event); setTimeout(function () { obj.scrollIntoView(); }, 50); } + } + if (event.keyCode == 40) { // down + var tmp = next(nd); + if (tmp != null) { obj.click(tmp.id, event); setTimeout(function () { obj.scrollIntoView(); }, 50); } + } + // cancel event if needed + if ($.inArray(event.keyCode, [13, 32, 37, 38, 39, 40]) != -1) { + if (event.preventDefault) event.preventDefault(); + if (event.stopPropagation) event.stopPropagation(); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + return; + + function next (node, noSubs) { + if (node == null) return null; + var parent = node.parent; + var ind = obj.get(node.id, true); + var nextNode = null; + // jump inside + if (node.expanded && node.nodes.length > 0 && noSubs !== true) { + var t = node.nodes[0]; + if (!t.disabled && !t.group) nextNode = t; else nextNode = next(t); + } else { + if (parent && ind + 1 < parent.nodes.length) { + nextNode = parent.nodes[ind + 1]; + } else { + nextNode = next(parent, true); // jump to the parent + } + } + if (nextNode != null && (nextNode.disabled || nextNode.group)) nextNode = next(nextNode); + return nextNode; + } + + function prev (node) { + if (node == null) return null; + var parent = node.parent; + var ind = obj.get(node.id, true); + var prevNode = null; + var noSubs = false; + if (ind > 0) { + prevNode = parent.nodes[ind - 1]; + // jump inside parents last node + if (prevNode.expanded && prevNode.nodes.length > 0) { + var t = prevNode.nodes[prevNode.nodes.length - 1]; + if (!t.disabled && !t.group) prevNode = t; else prevNode = prev(t); + } + } else { + prevNode = parent; // jump to the parent + noSubs = true; + } + if (prevNode != null && (prevNode.disabled || prevNode.group)) prevNode = prev(prevNode); + return prevNode; + } + }, + + scrollIntoView: function (id) { + if (typeof id == 'undefined') id = this.selected; + var nd = this.get(id); + if (nd == null) return; + var body = $(this.box).find('.w2ui-sidebar-div'); + var item = $(this.box).find('#node_'+ w2utils.escapeId(id)); + var offset = item.offset().top - body.offset().top; + if (offset + item.height() > body.height()) { + body.animate({ 'scrollTop': body.scrollTop() + body.height() / 1.3 }); + } + if (offset <= 0) { + body.animate({ 'scrollTop': body.scrollTop() - body.height() / 1.3 }); + } + }, + + dblClick: function (id, event) { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + var nd = this.get(id); + // event before + var eventData = this.trigger({ phase: 'before', type: 'dblClick', target: id, originalEvent: event, object: nd }); + if (eventData.isCancelled === true) return false; + // default action + if (nd.nodes.length > 0) this.toggle(id); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + contextMenu: function (id, event) { + var obj = this; + var nd = obj.get(id); + if (id != obj.selected) obj.click(id); + // need timeout to allow click to finish first + setTimeout(function () { + // event before + var eventData = obj.trigger({ phase: 'before', type: 'contextMenu', target: id, originalEvent: event, object: nd }); + if (eventData.isCancelled === true) return false; + // default action + if (nd.group || nd.disabled) return; + if (obj.menu.length > 0) { + $(obj.box).find('#node_'+ w2utils.escapeId(id)) + .w2menu(obj.menu, { + left: (event ? event.offsetX || event.pageX : 50) - 25, + select: function (item, event, index) { obj.menuClick(id, index, event); } + } + ); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, 1); + }, + + menuClick: function (itemId, index, event) { + var obj = this; + // event before + var eventData = obj.trigger({ phase: 'before', type: 'menuClick', target: itemId, originalEvent: event, menuIndex: index, menuItem: obj.menu[index] }); + if (eventData.isCancelled === true) return false; + // default action + // -- empty + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, + + render: function (box) { + // event before + var eventData = this.trigger({ phase: 'before', type: 'render', target: this.name, box: box }); + if (eventData.isCancelled === true) return false; + // default action + if (typeof box != 'undefined' && box != null) { + if ($(this.box).find('> div > div.w2ui-sidebar-div').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-sidebar') + .html(''); + } + this.box = box; + } + if (!this.box) return; + $(this.box) + .attr('name', this.name) + .addClass('w2ui-reset w2ui-sidebar') + .html('
'+ + '
' + + '
'+ + '
'+ + '
' + ); + $(this.box).find('> div').css({ + width : $(this.box).width() + 'px', + height : $(this.box).height() + 'px' + }); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + // adjust top and bottom + if (this.topHTML != '') { + $(this.box).find('.w2ui-sidebar-top').html(this.topHTML); + $(this.box).find('.w2ui-sidebar-div') + .css('top', $(this.box).find('.w2ui-sidebar-top').height() + 'px'); + } + if (this.bottomHTML != '') { + $(this.box).find('.w2ui-sidebar-bottom').html(this.bottomHTML); + $(this.box).find('.w2ui-sidebar-div') + .css('bottom', $(this.box).find('.w2ui-sidebar-bottom').height() + 'px'); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + // --- + this.refresh(); + }, + + refresh: function (id) { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'refresh', target: (typeof id != 'undefined' ? id : this.name) }); + if (eventData.isCancelled === true) return false; + // adjust top and bottom + if (this.topHTML != '') { + $(this.box).find('.w2ui-sidebar-top').html(this.topHTML); + $(this.box).find('.w2ui-sidebar-div') + .css('top', $(this.box).find('.w2ui-sidebar-top').height() + 'px'); + } + if (this.bottomHTML != '') { + $(this.box).find('.w2ui-sidebar-bottom').html(this.bottomHTML); + $(this.box).find('.w2ui-sidebar-div') + .css('bottom', $(this.box).find('.w2ui-sidebar-bottom').height() + 'px'); + } + // default action + $(this.box).find('> div').css({ + width : $(this.box).width() + 'px', + height : $(this.box).height() + 'px' + }); + var obj = this; + if (typeof id == 'undefined') { + var node = this; + var nm = '.w2ui-sidebar-div'; + } else { + var node = this.get(id); + if (node == null) return; + var nm = '#node_'+ w2utils.escapeId(node.id) + '_sub'; + } + if (node != this) { + var tmp = '#node_'+ w2utils.escapeId(node.id); + var nodeHTML = getNodeHTML(node); + $(this.box).find(tmp).before(''); + $(this.box).find(tmp).remove(); + $(this.box).find(nm).remove(); + $('#sidebar_'+ this.name + '_tmp').before(nodeHTML); + $('#sidebar_'+ this.name + '_tmp').remove(); + } + // refresh sub nodes + $(this.box).find(nm).html(''); + for (var i=0; i < node.nodes.length; i++) { + var nodeHTML = getNodeHTML(node.nodes[i]); + $(this.box).find(nm).append(nodeHTML); + if (node.nodes[i].nodes.length != 0) { this.refresh(node.nodes[i].id); } + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + + function getNodeHTML(nd) { + var html = ''; + var img = nd.img; + if (img == null) img = this.img; + var icon = nd.icon; + if (icon == null) icon = this.icon; + // -- find out level + var tmp = nd.parent; + var level = 0; + while (tmp && tmp.parent != null) { + if (tmp.group) level--; + tmp = tmp.parent; + level++; + } + if (typeof nd.caption != 'undefined') nd.text = nd.caption; + if (nd.group) { + html = + '
'+ + ' '+ (!nd.hidden && nd.expanded ? w2utils.lang('Hide') : w2utils.lang('Show')) +''+ + ' '+ nd.text +''+ + '
'+ + '
'; + } else { + if (nd.selected && !nd.disabled) obj.selected = nd.id; + var tmp = ''; + if (img) tmp = '
'; + if (icon) tmp = '
'; + html = + '
'+ + ''+ + ''+ + ''+ + '
'+ + '
' + (nd.nodes.length > 0 ? (nd.expanded ? '-' : '+') : (nd.plus ? '+' : '')) + '
' + + '
'+ + tmp + + (nd.count !== '' ? '
'+ nd.count +'
' : '') + + '
'+ nd.text +'
'+ + '
'+ + '
'+ + '
'; + } + return html; + } + }, + + resize: function () { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name }); + if (eventData.isCancelled === true) return false; + // default action + $(this.box).css('overflow', 'hidden'); // container should have no overflow + //$(this.box).find('.w2ui-sidebar-div').css('overflow', 'hidden'); + $(this.box).find('> div').css({ + width : $(this.box).width() + 'px', + height : $(this.box).height() + 'px' + }); + //$(this.box).find('.w2ui-sidebar-div').css('overflow', 'auto'); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', type: 'destroy', target: this.name }); + if (eventData.isCancelled === true) return false; + // clean up + if ($(this.box).find('> div > div.w2ui-sidebar-div').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-sidebar') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + lock: function (msg, showSpinner) { + var box = $(this.box).find('> div:first-child'); + w2utils.lock(box, msg, showSpinner); + }, + + unlock: function () { + w2utils.unlock(this.box); + } + } + + $.extend(w2sidebar.prototype, w2utils.event); + w2obj.sidebar = w2sidebar; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2field - various field controls + * - $().w2field - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - select - for select, list - for drop down (needs this in grid) + * - enum add events: onLoad, onRequest, onCompare, onSelect, onDelete, onClick for already selected elements + * - upload (regular files) + * - enum - refresh happens on each key press even if not needed (for speed) + * - BUG with prefix/postfix and arrows (test in different contexts) + * - multiple date selection + * - rewrire everythin in objects (w2ftext, w2fenum, w2fdate) + * - render calendar to the div + * + ************************************************************************/ + +(function ($) { + + /* SINGELTON PATTERN */ + + var w2field = new (function () { + this.customTypes = []; + }); + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2field = function(method) { + // Method calling logic + if (w2field[method]) { + return w2field[method].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object') { + return w2field.init.apply( this, arguments ); + } else if ( typeof method === 'string') { + return w2field.init.apply( this, [{ type: method }] ); + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2field'); + } + }; + + $.extend(w2field, { + // CONTEXT: this - is jQuery object + init: function (options) { + var obj = w2field; + return $(this).each(function (field, index) { + // Check for Custom Types + if (typeof w2field.customTypes[options.type.toLowerCase()] == 'function') { + w2field.customTypes[options.type.toLowerCase()].call(this, options); + return; + } + // Common Types + var tp = options.type.toLowerCase(); + switch (tp) { + + case 'clear': // removes any previous field type + $(this) + .off('focus') + .off('blur') + .off('keypress') + .off('keydown') + .off('change') + .removeData(); // removes all attached data + if ($(this).prev().hasClass('w2ui-list')) { // if enum + $(this).prev().remove(); + $(this).removeAttr('tabindex').css('border-color', '').show(); + } + if ($(this).prev().hasClass('w2ui-upload')) { // if upload + $(this).prev().remove(); + $(this).removeAttr('tabindex').css('border-color', '').show(); + } + if ($(this).prev().hasClass('w2ui-field-helper')) { // helpers + $(this).css('padding-left', $(this).css('padding-top')); + $(this).prev().remove(); + } + if ($(this).next().hasClass('w2ui-field-helper')) { // helpers + $(this).css('padding-right', $(this).css('padding-top')); + $(this).next().remove(); + } + if ($(this).next().hasClass('w2ui-field-helper')) { // helpers + $(this).next().remove(); + } + break; + + case 'text': + case 'int': + case 'float': + case 'money': + case 'alphanumeric': + case 'hex': + var el = this; + var defaults = { + min : null, + max : null, + arrows : false, + keyboard: true, + suffix : '', + prefix : '' + } + options = $.extend({}, defaults, options); + if (['text', 'alphanumeric', 'hex'].indexOf(tp) != -1) { + options.arrows = false; + options.keyboard = false; + } + // init events + $(this) + .data('options', options) + .on('keypress', function (event) { // keyCode & charCode differ in FireFox + if (event.metaKey || event.ctrlKey || event.altKey || (event.charCode != event.keyCode && event.keyCode > 0)) return; + if (event.keyCode == 13) $(this).change(); + var ch = String.fromCharCode(event.charCode); + if (!checkType(ch, true)) { + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + return false; + } + }) + .on('keydown', function (event, extra) { + if (!options.keyboard) return; + var cancel = false; + var v = $(el).val(); + if (!checkType(v)) v = options.min || 0; else v = parseFloat(v); + var key = event.keyCode || extra.keyCode; + var inc = 1; + if (event.ctrlKey || event.metaKey) inc = 10; + switch (key) { + case 38: // up + $(el).val((v + inc <= options.max || options.max == null ? v + inc : options.max)).change(); + if (tp == 'money') $(el).val( Number($(el).val()).toFixed(2) ); + cancel = true; + break; + case 40: // down + $(el).val((v - inc >= options.min || options.min == null ? v - inc : options.min)).change(); + if (tp == 'money') $(el).val( Number($(el).val()).toFixed(2) ); + cancel = true; + break; + } + if (cancel) { + event.preventDefault(); + // set cursor to the end + setTimeout(function () { el.setSelectionRange(el.value.length, el.value.length); }, 0); + } + }) + .on('change', function (event) { + // check max/min + var v = $(el).val(); + var cancel = false; + if (options.min != null && v != '' && v < options.min) { $(el).val(options.min).change(); cancel = true; } + if (options.max != null && v != '' && v > options.max) { $(el).val(options.max).change(); cancel = true; } + if (cancel) { + event.stopPropagation(); + event.preventDefault(); + return false; + } + // check validity + if (this.value != '' && !checkType(this.value)) $(this).val(options.min != null ? options.min : ''); + }); + if ($(this).val() == '' && options.min != null) $(this).val(options.min); + if (options.prefix != '') { + $(this).before( + '
'+ + options.prefix + + '
'); + var helper = $(this).prev(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'padding-top' : $(this).css('padding-top'), + 'padding-bottom': $(this).css('padding-bottom'), + 'padding-left' : $(this).css('padding-left'), + 'padding-right' : 0, + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : (parseInt($(this).css('margin-bottom')) + 1) + 'px', + 'margin-left' : 0, + 'margin-right' : 0 + }) + .on('click', function () { + $(this).next().focus(); + }); + $(this).css('padding-left', (helper.width() + parseInt($(this).css('padding-left')) + 5) + 'px'); + } + var pr = parseInt($(this).css('padding-right')); + if (options.arrows != '') { + $(this).after( + '
 '+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'); + var height = w2utils.getSize(this, 'height'); + var helper = $(this).next(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'height' : ($(this).height() + parseInt($(this).css('padding-top')) + parseInt($(this).css('padding-bottom')) ) + 'px', + 'padding' : '0px', + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : '0px', + 'border-left' : '1px solid silver' + }) + .css('margin-left', '-'+ (helper.width() + parseInt($(this).css('margin-right')) + 12) + 'px') + .on('mousedown', function (event) { + var btn = this; + var evt = event; + $('body').on('mouseup', tmp); + $('body').data('_field_update_timer', setTimeout(update, 700)); + update(false); + // timer function + function tmp() { + clearTimeout($('body').data('_field_update_timer')); + $('body').off('mouseup', tmp); + } + // update function + function update(notimer) { + $(el).focus().trigger($.Event("keydown"), { + keyCode : ($(evt.target).attr('type') == 'up' ? 38 : 40) + }); + if (notimer !== false) $('body').data('_field_update_timer', setTimeout(update, 60)); + }; + }); + pr += helper.width() + 12; + $(this).css('padding-right', pr + 'px'); + } + if (options.suffix != '') { + $(this).after( + '
'+ + options.suffix + + '
'); + var helper = $(this).next(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'padding-top' : $(this).css('padding-top'), + 'padding-bottom': $(this).css('padding-bottom'), + 'padding-left' : '3px', + 'padding-right' : $(this).css('padding-right'), + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : (parseInt($(this).css('margin-bottom')) + 1) + 'px' + }) + .on('click', function () { + $(this).prev().focus(); + }); + helper.css('margin-left', '-'+ (helper.width() + parseInt($(this).css('padding-right')) + 5) + 'px'); + pr += helper.width() + 3; + $(this).css('padding-right', pr + 'px'); + } + + function checkType(ch, loose) { + switch (tp) { + case 'int': + if (loose && ['-'].indexOf(ch) != -1) return true; + return w2utils.isInt(ch); + break; + case 'float': + if (loose && ['-','.'].indexOf(ch) != -1) return true; + return w2utils.isFloat(ch); + break; + case 'money': + if (loose && ['-','.','$','€','£','¥'].indexOf(ch) != -1) return true; + return w2utils.isMoney(ch); + break; + case 'hex': + return w2utils.isHex(ch); + break; + case 'alphanumeric': + return w2utils.isAlphaNumeric(ch); + break; + } + return true; + } + break; + + case 'date': + var obj = this; + var defaults = { + format : w2utils.settings.date_format, // date format + start : '', // start of selectable range + end : '', // end of selectable range + blocked : {}, // {'4/11/2011': 'yes'} + colored : {} // {'4/11/2011': 'red:white'} + } + options = $.extend({}, defaults, options); + // -- insert div for calendar + $(this) // remove transtion needed for functionality + .css( { 'transition': 'none', '-webkit-transition': 'none', '-moz-transition': 'none', '-ms-transition': 'none', '-o-transition': 'none' }) + .data("options", options) + .on('focus', function () { + var top = parseFloat($(obj).offset().top) + parseFloat(obj.offsetHeight); + var left = parseFloat($(obj).offset().left); + clearInterval($(obj).data('mtimer')); + $('#global_calendar_div').remove(); + $('body').append('
'+ + '
'); + $('#global_calendar_div') + .html($().w2field('calendar_get', obj.value, options)) + .css({ + left: left + 'px', + top: top + 'px' + }) + .data('el', obj) + .show(); + var max = $(window).width() + $(document).scrollLeft() - 1; + if (left + $('#global_calendar_div').width() > max) { + $('#global_calendar_div').css('left', (max - $('#global_calendar_div').width()) + 'px'); + } + // monitors + var mtimer = setInterval(function () { + var max = $(window).width() + $(document).scrollLeft() - 1; + var left = $(obj).offset().left; + if (left + $('#global_calendar_div').width() > max) left = max - $('#global_calendar_div').width(); + // monitor if moved + if ($('#global_calendar_div').data('position') != ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)) { + $('#global_calendar_div').css({ + '-webkit-transition': '.2s', + left: left + 'px', + top : ($(obj).offset().top + obj.offsetHeight) + 'px' + }).data('position', ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)); + } + // monitor if destroyed + if ($(obj).length == 0 || ($(obj).offset().left == 0 && $(obj).offset().top == 0)) { + clearInterval(mtimer); + $('#global_calendar_div').remove(); + return; + } + }, 100); + $(obj).data('mtimer', mtimer); + }) + .on('blur', function (event) { + // trim empty spaces + $(obj).val($.trim($(obj).val())); + // check if date is valid + if ($.trim($(obj).val()) != '' && !w2utils.isDate($(obj).val(), options.format)) { + $(this).w2tag(w2utils.lang('Not a valid date') + ': '+ options.format); + } + clearInterval($(obj).data('mtimer')); + $('#global_calendar_div').remove(); + }) + .on('keypress', function (event) { + var obj = this; + setTimeout(function () { + $('#global_calendar_div').html( $().w2field('calendar_get', obj.value, options) ); + }, 10); + }); + setTimeout(function () { + // if it is unix time - convert to readable date + if (w2utils.isInt(obj.value)) obj.value = w2utils.formatDate(obj.value, options.format); + }, 1); + break; + + case 'time': + break; + + case 'datetime': + break; + + case 'color': + var obj = this; + var defaults = { + prefix : '#', + suffix : '
' + } + options = $.extend({}, defaults, options); + // -- insert div for color + $(this) + .attr('maxlength', 6) + .on('focus', function () { + var top = parseFloat($(obj).offset().top) + parseFloat(obj.offsetHeight); + var left = parseFloat($(obj).offset().left); + clearInterval($(obj).data('mtimer')); + $('#global_color_div').remove(); + $('body').append('
'+ + '
'); + $('#global_color_div') + .html($().w2field('getColorHTML', obj.value)) + .css({ + left: left + 'px', + top: top + 'px' + }) + .data('el', obj) + .show(); + var max = $(window).width() + $(document).scrollLeft() - 1; + if (left + $('#global_color_div').width() > max) { + $('#global_color_div').css('left', (max - $('#global_color_div').width()) + 'px'); + } + // monitors + var mtimer = setInterval(function () { + var max = $(window).width() + $(document).scrollLeft() - 1; + var left = $(obj).offset().left; + if (left + $('#global_color_div').width() > max) left = max - $('#global_color_div').width(); + // monitor if moved + if ($('#global_color_div').data('position') != ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)) { + $('#global_color_div').css({ + '-webkit-transition': '.2s', + left: left + 'px', + top : ($(obj).offset().top + obj.offsetHeight) + 'px' + }).data('position', ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)); + } + // monitor if destroyed + if ($(obj).length == 0 || ($(obj).offset().left == 0 && $(obj).offset().top == 0)) { + clearInterval(mtimer); + $('#global_color_div').remove(); + return; + } + }, 100); + $(obj).data('mtimer', mtimer); + }) + .on('click', function () { + $(this).trigger('focus'); + }) + .on('blur', function (event) { + // trim empty spaces + $(obj).val($.trim($(obj).val())); + clearInterval($(obj).data('mtimer')); + $('#global_color_div').remove(); + }) + .on('keydown', function (event) { // need this for cut/paster + if (event.keyCode == 86 && (event.ctrlKey || event.metaKey)) { + var obj = this; + $(this).prop('maxlength', 7); + setTimeout(function () { + var val = $(obj).val(); + if (val.substr(0, 1) == '#') val = val.substr(1); + if (!w2utils.isHex(val)) val = ''; + $(obj).val(val).prop('maxlength', 6).change(); + }, 20); + } + }) + .on('keyup', function (event) { + if (event.keyCode == 86 && (event.ctrlKey || event.metaKey)) $(this).prop('maxlength', 6); + }) + .on('keypress', function (event) { // keyCode & charCode differ in FireFox + if (event.keyCode == 13) $(this).change(); + //if (event.ct) + var ch = String.fromCharCode(event.charCode); + if (!w2utils.isHex(ch, true)) { + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + return false; + } + }) + .on('change', function (event) { + var color = '#' + $(this).val(); + if ($(this).val().length != 6 && $(this).val().length != 3) color = ''; + $(this).next().find('div').css('background-color', color); + }); + if (options.prefix != '') { + $(this).before( + '
'+ + options.prefix + + '
'); + var helper = $(this).prev(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'padding-top' : $(this).css('padding-top'), + 'padding-bottom': $(this).css('padding-bottom'), + 'padding-left' : $(this).css('padding-left'), + 'padding-right' : 0, + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : (parseInt($(this).css('margin-bottom')) + 1) + 'px', + 'margin-left' : 0, + 'margin-right' : 0 + }) + .on('click', function () { + $(this).next().focus(); + }); + $(this).css('padding-left', (helper.width() + parseInt($(this).css('padding-left')) + 2) + 'px'); + } + if (options.suffix != '') { + $(this).after( + '
'+ + options.suffix + + '
'); + var helper = $(this).next(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'padding-top' : $(this).css('padding-top'), + 'padding-bottom': $(this).css('padding-bottom'), + 'padding-left' : '3px', + 'padding-right' : $(this).css('padding-right'), + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : (parseInt($(this).css('margin-bottom')) + 1) + 'px' + }) + .on('click', function () { + $(this).prev().focus(); + }); + helper.css('margin-left', '-'+ (helper.width() + parseInt($(this).css('padding-right')) + 4) + 'px'); + var pr = helper.width() + parseInt($(this).css('padding-right')) + 4; + $(this).css('padding-right', pr + 'px'); + // set color to current + helper.find('div').css('background-color', '#' + $(obj).val()); + } + break; + + case 'select': + case 'list': + if (this.tagName != 'SELECT') { + console.log('ERROR: You can only apply $().w2field(\'list\') to a SELECT element'); + return; + } + var defaults = { + url : '', + items : [], + value : null, + showNone : true + }; + var obj = this; + var settings = $.extend({}, defaults, options); + $(obj).data('settings', settings); + // define refresh method + obj.refresh = function () { + var settings = $(obj).data('settings'); + var html = ''; + var items = w2field.cleanItems(settings.items); + // build options + if (settings.showNone) html = ''; + for (var i in items) { + if (!settings.showNone && settings.value == null) settings.value = items[i].id; + html += ''; + } + $(obj).html(html); + $(obj).val(settings.value); + if ($(obj).val() != settings.value) $(obj).change(); + } + // pull from server + if (settings.url != '' ) { + $.ajax({ + type : 'GET', + dataType : 'text', + url : settings.url, + complete: function (xhr, status) { + if (status == 'success') { + var data = $.parseJSON(xhr.responseText); + var settings = $(obj).data('settings'); + settings.items = w2field.cleanItems(data.items); + $(obj).data('settings', settings); + obj.refresh(); + } + } + }); + } else { // refresh local + obj.refresh(); + } + break; + + case 'enum': + if (this.tagName != 'INPUT') { + console.log('ERROR: You can only apply $().w2field(\'enum\') to an INPUT element'); + return; + } + var defaults = { + url : '', + items : [], + selected : [], // preselected items + max : 0, // maximum number of items that can be selected 0 for unlim + maxHeight : 172, // max height for input control to grow + showAll : false, // if true then show selected item in drop down + match : 'begins with', // ['begins with', 'contains'] + render : null, // render(item, selected) + maxCache : 500, // number items to cache + onShow : null, // when overlay is shown onShow(settings) + onHide : null, // when overlay is hidden onHide(settings) + onAdd : null, // onAdd(item, settings) + onRemove : null, // onRemove(index, settings) + onItemOver : null, + onItemOut : null, + onItemClick : null + } + var obj = this; + var settings = $.extend({}, defaults, options); + + // normalize items and selected + settings.items = w2field.cleanItems(settings.items); + settings.selected = w2field.cleanItems(settings.selected); + + $(this).data('selected', settings.selected); + $(this).css({ + 'padding' : '0px', + 'border-color' : 'transparent', + 'background-color' : 'transparent', + 'outline' : 'none' + }); + + // add item to selected + this.add = function (item) { + if ($(this).attr('readonly')) return; + var selected = $(this).data('selected'); + var settings = $(this).data('settings'); + if (typeof settings.onAdd == 'function') { + var cancel = settings.onAdd(item, settings); + if (cancel === false) return; + } + if (!$.isArray(selected)) selected = []; + if (settings.max != 0 && settings.max <= selected.length) { + // if max reached, replace last + selected.splice(selected.length - 1, 1); + } + selected.push(item); + $(this).data('last_del', null); + $(this).trigger('change'); + } + + this.remove = function (index) { + var settings = $(this).data('settings'); + if (typeof settings.onRemove == 'function') { + var cancel = settings.onRemove(index, settings); + if (cancel === false) return; + } + if ($(this).attr('readonly')) return; + $(this).data('selected').splice(index, 1); + $(this).parent().find('[title=Remove][index='+ index +']').remove(); + this.refresh(); + w2field.list_render.call(this); + $(this).trigger('change'); + } + + this.show = function () { + if ($(this).attr('readonly')) return; + var settings = $(this).data('settings'); + // insert global div + if ($('#w2ui-global-items').length == 0) { + $('body').append('
'); + } else { + // ignore second click + return; + } + var div = $('#w2ui-global-items'); + div.css({ + display : 'block', + left : ($(obj).offset().left) + 'px', + top : ($(obj).offset().top + obj.offsetHeight + 3) + 'px' + }) + .width(w2utils.getSize(obj, 'width')) + .data('position', ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)); + + // show drop content + w2field.list_render.call(obj); + + // monitors + var monitor = function () { + var div = $('#w2ui-global-items'); + // monitor if destroyed + if ($(obj).length == 0 || ($(obj).offset().left == 0 && $(obj).offset().top == 0)) { + clearInterval($(obj).data('mtimer')); + hide(); + return; + } + // monitor if moved + if (div.data('position') != ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)) { + div.css({ + '-webkit-transition': '.2s', + left: ($(obj).offset().left) + 'px', + top : ($(obj).offset().top + obj.offsetHeight + 3) + 'px' + }) + .data('position', ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)); + // if moved then resize + setTimeout(function () { + w2field.list_render.call(obj, $(obj).data('last_search')); + }, 200); + } + if (div.length > 0) $(obj).data('mtimer', setTimeout(monitor, 100)); + }; + $(obj).data('mtimer', setTimeout(monitor, 100)); + // onShow + if (typeof settings.onShow == 'function') settings.onShow.call(this, settings); + } + + this.hide = function () { + var settings = $(this).data('settings'); + clearTimeout($(obj).data('mtimer')); + $('#w2ui-global-items').remove(); + // onShow + if (typeof settings.onHide == 'function') settings.onHide.call(this, settings); + } + + // render controls with all items in it + this.refresh = function () { + var obj = this; + // remove all items + $($(this).data('div')).remove(); + // rebuild it + var margin = 'margin-top: ' + $(this).css('margin-top') + '; ' + + 'margin-bottom: ' + $(this).css('margin-bottom') + '; ' + + 'margin-left: ' + $(this).css('margin-left') + '; ' + + 'margin-right: ' + $(this).css('margin-right') + '; '+ + 'width: ' + (w2utils.getSize(this, 'width') + - parseInt($(this).css('margin-left')) + - parseInt($(this).css('margin-right'))) + 'px; '; + var html = '
'+ + '
    '; + var selected = $(this).data('selected'); + for (var s in selected) { + html += '
  • '+ + '
      
    '+ + selected[s].text + + '
  • '; + } + html += '
  • '+ + ' '+ + '
  • '+ + '
'+ + '
'; + $(this).before(html); + + var div = $(this).prev()[0]; + $(this).data('div', div); + // click on item + $(div).find('li') + .data('mouse', 'out') + .on('click', function (event) { + if ($(event.target).hasClass('nomouse')) return; + if (event.target.title == w2utils.lang('Remove')) { + obj.remove($(event.target).attr('index')); + return; + } + event.stopPropagation(); + if (typeof settings.onItemClick == 'function') settings.onItemClick.call(this, settings); + }) + .on('mouseover', function (event) { + var tmp = event.target; + if (tmp.tagName != 'LI') tmp = tmp.parentNode; + if ($(tmp).hasClass('nomouse')) return; + if ($(tmp).data('mouse') == 'out') { + if (typeof settings.onItemOver == 'function') settings.onItemOver.call(this, settings); + } + $(tmp).data('mouse', 'over'); + }) + .on('mouseout', function (event) { + var tmp = event.target; + if (tmp.tagName != 'LI') tmp = tmp.parentNode; + if ($(tmp).hasClass('nomouse')) return; + $(tmp).data('mouse', 'leaving'); + setTimeout(function () { + if ($(tmp).data('mouse') == 'leaving') { + $(tmp).data('mouse', 'out'); + if (typeof settings.onItemOut == 'function') settings.onItemOut.call(this, settings); + } + }, 0); + }); + $(div) // click on item + .on('click', function (event) { + $(this).find('input').focus(); + }) + .find('input') + .on('focus', function (event) { + $(div).css({ 'outline': 'auto 5px -webkit-focus-ring-color', 'outline-offset': '-2px' }); + obj.show(); + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + }) + .on('blur', function (event) { + $(div).css('outline', 'none'); + obj.hide(); + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + }); + // adjust height + obj.resize(); + } + this.resize = function () { + var settings = $(this).data('settings'); + var div = $(this).prev(); + var cntHeight = $(div).find('>div').height(); //w2utils.getSize(div, 'height'); + if (cntHeight < 23) cntHeight = 23; + if (cntHeight > settings.maxHeight) cntHeight = settings.maxHeight; + $(div).height(cntHeight + (cntHeight % 23 == 0 ? 0 : 23 - cntHeight % 23) ); + if (div.length > 0) div[0].scrollTop = 1000; + $(this).height(cntHeight); + } + // init control + $(this).data('settings', settings).attr('tabindex', -1); + obj.refresh(); + break; + + case 'upload': + if (this.tagName != 'INPUT') { + console.log('ERROR: You can only apply $().w2field(\'upload\') to an INPUT element'); + return; + } + // init defaults + var defaults = { + url : '', // not yet implemented + base64 : true, // if true max file size is 20mb (only tru for now) + hint : w2utils.lang('Attach files by dragging and dropping or Click to Select'), + max : 0, // max number of files, 0 - unlim + maxSize : 0, // max size of all files, 0 - unlim + maxFileSize : 0, // max size of a single file, 0 -unlim + onAdd : null, + onRemove : null, + onItemClick : null, + onItemDblClick : null, + onItemOver : null, + onItemOut : null, + onProgress : null, // not yet implemented + onComplete : null // not yet implemented + } + var obj = this; + var settings = $.extend({}, defaults, options); + if (settings.base64 === true) { + if (settings.maxSize == 0) settings.maxSize = 20 * 1024 * 1024; // 20mb + if (settings.maxFileSize == 0) settings.maxFileSize = 20 * 1024 * 1024; // 20mb + } + var selected = settings.selected; + delete settings.selected; + if (!$.isArray(selected)) selected = []; + $(this).data('selected', selected).data('settings', settings).attr('tabindex', -1); + w2field.upload_init.call(this); + + this.refresh = function () { + var obj = this; + var div = $(this).data('div'); + var settings = $(this).data('settings'); + var selected = $(this).data('selected'); + $(div).find('li').remove(); + $(div).find('> span:first-child').css('line-height', ($(div).height() - w2utils.getSize(div, '+height') - 8) + 'px'); + for (var s in selected) { + var file = selected[s]; + // add li element + var cnt = $(div).find('.file-list li').length; + $(div).find('> span:first-child').remove(); + $(div).find('.file-list').append('
  • ' + + '
      
    ' + + ' ' + file.name + '' + + ' - ' + w2utils.size(file.size) + ''+ + '
  • '); + var li = $(div).find('.file-list #file-' + cnt); + var previewHTML = ""; + if ((/image/i).test(file.type)) { // image + previewHTML = '
    '+ + ' '+ + '
    '; + } + var td1 = 'style="padding: 3px; text-align: right; color: #777;"'; + var td2 = 'style="padding: 3px"'; + previewHTML += '
    '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + '
    Name:'+ file.name +'
    Size:'+ w2utils.size(file.size) +'
    Type:' + + ' '+ file.type +''+ + '
    Modified:'+ w2utils.date(file.modified) +'
    '+ + '
    '; + li.data('file', file) + .on('click', function (event) { + if (typeof settings.onItemClick == 'function') { + var ret = settings.onItemClick.call(obj, $(this).data('file')); + if (ret === false) return; + } + if (!$(event.target).hasClass('file-delete')) event.stopPropagation(); + }) + .on('dblclick', function (event) { + if (typeof settings.onItemDblClick == 'function') { + var ret = settings.onItemDblClick.call(obj, $(this).data('file')); + if (ret === false) return; + } + event.stopPropagation(); + if (document.selection) document.selection.empty(); else document.defaultView.getSelection().removeAllRanges(); + }) + .on('mouseover', function (event) { + if (typeof settings.onItemOver == 'function') { + var ret = settings.onItemOver.call(obj, $(this).data('file')); + if (ret === false) return; + } + var file = $(this).data('file'); + $(this).w2overlay( + previewHTML.replace('##FILE##', (file.content ? 'data:'+ file.type +';base64,'+ file.content : '')), + { top: -4 } + ); + }) + .on('mouseout', function () { + if (typeof settings.onItemOut == 'function') { + var ret = settings.onItemOut.call(obj, $(this).data('file')); + if (ret === false) return; + } + $(this).w2overlay(); + }); + } + } + this.refresh(); + break; + + case 'slider': + // for future reference + break; + + default: + console.log('ERROR: w2field does not recognize "'+ options.type + '" field type.'); + break; + } + }); + }, + + // ****************************************************** + // -- Implementation + + addType: function (type, handler) { + w2field.customTypes[String(type).toLowerCase()] = handler; + }, + + cleanItems: function (items) { + var newItems = []; + for (var i in items) { + var id = ''; + var text = ''; + var opt = items[i]; + if (opt == null) continue; + if ($.isPlainObject(items)) { + id = i; + text = opt; + } else { + if (typeof opt == 'object') { + if (typeof opt.id != 'undefined') id = opt.id; + if (typeof opt.value != 'undefined') id = opt.value; + if (typeof opt.txt != 'undefined') text = opt.txt; + if (typeof opt.text != 'undefined') text = opt.text; + } + if (typeof opt == 'string') { + if (String(opt) == '') continue; + id = opt; + text = opt; + opt = {}; + } + } + if (w2utils.isInt(id)) id = parseInt(id); + if (w2utils.isFloat(id)) id = parseFloat(id); + newItems.push($.extend({}, opt, { id: id, text: text })); + } + return newItems; + }, + + // ****************************************************** + // -- Upload + + upload_init: function () { + var obj = this; // this -> input element + var settings = $(this).data('settings'); + // create drop area if needed + var el = $(obj).prev(); + if (el.length > 0 && el[0].tagName == 'DIV' && el.hasClass('w2ui-upload')) el.remove(); + // rebuild it + var margin = 'margin-top: ' + $(obj).css('margin-top') + '; ' + + 'margin-bottom: ' + $(obj).css('margin-bottom') + '; ' + + 'margin-left: ' + $(obj).css('margin-left') + '; ' + + 'margin-right: ' + $(obj).css('margin-right') + '; '+ + 'width: ' + (w2utils.getSize(obj, 'width') + - parseInt($(obj).css('margin-left')) + - parseInt($(obj).css('margin-right'))) + 'px; '+ + 'height: ' + (w2utils.getSize(obj, 'height') + - parseInt($(obj).css('margin-top')) + - parseInt($(obj).css('margin-bottom'))) + 'px; '; + var html = + '
    '+ + ' '+ settings.hint +''+ + '
      '+ + ' '+ + '
      '; + $(obj) + .css({ + 'display1' : 'none', + 'border-color' : 'transparent' + }) + .before(html); + $(obj).data('div', $(obj).prev()[0]); + var div = $(obj).data('div'); + // if user selects files through input control + $(div).find('.file-input') + .off('change') + .on('change', function () { + if (typeof this.files !== "undefined") { + for (var i = 0, l = this.files.length; i < l; i++) { + w2field.upload_add.call(obj, this.files[i]); + } + } + }); + + // if user clicks drop zone + $(div) + .off('click') + .on('click', function (event) { + $(div).w2tag(); + if (event.target.tagName == 'LI' || $(event.target).hasClass('file-size')) { + return; + } + if ($(event.target).hasClass('file-delete')) { + w2field.upload_remove.call(obj, event.target.parentNode); + return; + } + if (event.target.tagName != 'INPUT') { + var settings = $(obj).data('settings'); + var selected = $(obj).data('selected'); + var cnt = 0; + for (var s in selected) { cnt++; } + if (cnt < settings.max || settings.max == 0) $(div).find('.file-input').click(); + } + }) + .off('dragenter') + .on('dragenter', function (event) { + $(div).addClass('dragover'); + }) + .off('dragleave') + .on('dragleave', function (event) { + $(div).removeClass('dragover'); + }) + .off('drop') + .on('drop', function (event) { + $(div).removeClass('dragover'); + var files = event.originalEvent.dataTransfer.files; + for (var i=0, l=files.length; i input element + var div = $(obj).data('div'); + var settings = $(obj).data('settings'); + var selected = $(obj).data('selected'); + var newItem = { + name : file.name, + type : file.type, + modified : file.lastModifiedDate, + size : file.size, + content : null + }; + var size = 0; + var cnt = 0; + for (var s in selected) { size += selected[s].size; cnt++; } + // check params + if (settings.maxFileSize != 0 && newItem.size > settings.maxFileSize) { + var err = 'Maximum file size is '+ w2utils.size(settings.maxFileSize); + $(div).w2tag(err); + console.log('ERROR: '+ err); + return; + } + if (settings.maxSize != 0 && size + newItem.size > settings.maxSize) { + var err = 'Maximum total size is '+ w2utils.size(settings.maxFileSize); + $(div).w2tag(err); + console.log('ERROR: '+ err); + return; + } + if (settings.max != 0 && cnt >= settings.max) { + var err = 'Maximum number of files is '+ settings.max; + $(div).w2tag(err); + console.log('ERROR: '+ err); + return; + } + if (typeof settings.onAdd == 'function') { + var ret = settings.onAdd.call(obj, newItem); + if (ret === false) return; + } + selected.push(newItem); + // read file as base64 + if (typeof FileReader !== "undefined" && settings.base64 === true) { + var reader = new FileReader(); + // need a closure + reader.onload = (function () { + return function (event) { + var fl = event.target.result; + var ind = fl.indexOf(','); + newItem.content = fl.substr(ind+1); + obj.refresh(); + $(obj).trigger('change'); + }; + })(); + reader.readAsDataURL(file); + } else { + obj.refresh(); + $(obj).trigger('change'); + } + }, + + upload_remove: function (li) { + var obj = this; // this -> input element + var div = $(obj).data('div'); + var settings = $(obj).data('settings'); + var selected = $(obj).data('selected'); + var file = $(li).data('file'); + // run event + if (typeof settings.onRemove == 'function') { + var ret = settings.onRemove.call(obj, file); + if (ret === false) return false; + } + // remove from selected + for (var i = selected.length - 1; i >= 0; i--) { + if (selected[i].name == file.name && selected[i].size == file.size) { + selected.splice(i, 1); + } + } + $(li).fadeOut('fast'); + setTimeout(function () { + $(li).remove(); + // if all files remoted + if (selected.length == 0) { + $(div).prepend(''+ settings.hint +''); + } + obj.refresh(); + $(obj).trigger('change'); + }, 300); + }, + + // ****************************************************** + // -- Enum + + list_render: function (search) { + var obj = this; + var div = $('#w2ui-global-items'); + var settings = $(this).data('settings'); + var items = settings.items; + var selected = $(this).data('selected'); + if (div.length == 0) return; // if it is hidden + + // build overall html + if (typeof search == 'undefined') { + var html = ''; + html += '
      '; + div.html(html); + search = ''; + } + $(this).data('last_search', search); + if (typeof $(obj).data('last_index') == 'undefined' || $(obj).data('last_index') == null) $(obj).data('last_index', 0); + + // pull items from url + if (typeof settings.last_total == 'undefined') settings.last_total = -1; + if (typeof settings.last_search_len == 'undefined') settings.last_search_len = 0; + if (typeof settings.last_search_match == 'undefined') settings.last_search_match = -1; + if (settings.url != '' && ( + (items.length == 0 && settings.last_total != 0) + || (search.length > settings.last_search_len && settings.last_total > settings.maxCache) + || (search.length < settings.last_search_match && search.length != settings.last_search_len) + ) + ) { + var match = false; + if (settings.last_total < settings.maxCache) match = true; + $.ajax({ + type : 'GET', + dataType : 'text', + url : settings.url, + data : { + search : search, + max : settings.maxCache + }, + complete: function (xhr, status) { + settings.last_total = 0; + if (status == 'success') { + var data = $.parseJSON(xhr.responseText); + if (match == false && data.total < settings.maxCache) { settings.last_search_match = search.length; } + settings.last_search_len = search.length; + settings.last_total = data.total + settings.items = data.items; + w2field.list_render.call(obj, search); + } + } + }); + } + + // build items + var i = 0; + var ihtml = '
        '; + // get ids of all selected items + var ids = []; + for (var a in selected) ids.push(w2utils.isInt(selected[a].id) ? parseInt(selected[a].id) : String(selected[a].id)) + // build list + var group = ''; + for (var a in items) { + var id = items[a].id; + var txt = items[a].text; + // if already selected + if ($.inArray(w2utils.isInt(id) ? parseInt(id) : String(id), ids) != -1 && settings.showAll !== true) continue; + // check match with search + var txt1 = String(search).toLowerCase(); + var txt2 = txt.toLowerCase(); + var match = (txt1.length <= txt2.length && txt2.substr(0, txt1.length) == txt1); + if (settings.match.toLowerCase() == 'contains' && txt2.indexOf(txt1) != -1) match = true; + if (match) { + if (typeof settings['render'] == 'function') { + txt = settings['render'](items[a], selected); + } + if (txt !== false) { + // render group if needed + if (typeof items[a].group != 'undefined' && items[a].group != group) { + group = items[a].group; + ihtml += '
      • '+ group +'
      • '; + } + // render item + ihtml += '\n
      • '+ + txt +'
      • '; + if (i == $(obj).data('last_index')) $(obj).data('last_item', items[a]); + i++; + } + } + } + ihtml += '
      '; + if (i == 0) { + ihtml = '
      '+ w2utils.lang('No items found') +'
      '; + var noItems = true; + } + div.find('.w2ui-items-list').html(ihtml); + $(this).data('last_max', i-1); + + // scroll selected into view + if (div.find('li.selected').length > 0) div.find('li.selected')[0].scrollIntoView(false); + + // if menu goes off screen - add scrollbar + div.css({ '-webkit-transition': '0s', height : 'auto' }); + var max_height = parseInt($(document).height()) - parseInt(div.offset().top) - 8; + if (parseInt(div.height()) > max_height) { + div.css({ + height : (max_height - 5) + 'px', + overflow: 'show' + }); + $(div).find('.w2ui-items-list').css({ + height : (max_height - 15) + 'px', + overflow: 'auto' + }); + } + + // add events + $(div) + .off('mousedown') + .on('mousedown', function (event) { + var target = event.target; + if (target.tagName != "LI") target = $(target).parents('li'); + var id = $(target).attr('index'); + if (!id) return; + var item = settings.items[id]; + if (typeof id == 'undefined') { if (event.preventDefault) event.preventDefault(); else return false; } + obj.add(item); + $(obj).data('last_index', 0); + obj.refresh(); + w2field.list_render.call(obj, ''); + } + ); + $(obj).prev().find('li > input') + .val(search) + .css('max-width', ($(div).width() - 25) + 'px') + .width(((search.length + 2) * 6) + 'px') + .focus() + .on('click', function (event) { + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + }) + .off('keyup') + .on('keyup', function (event) { + var inp = this; + setTimeout(function () { + var curr = $(obj).data('last_index'); + switch (event.keyCode) { + case 38: // up + curr--; + if (curr < 0) curr = 0; + $(obj).data('last_index', curr); + if (event.preventDefault) event.preventDefault(); + break; + case 40: // down + curr++; + if (curr > $(obj).data('last_max')) curr = $(obj).data('last_max'); + $(obj).data('last_index', curr); + if (event.preventDefault) event.preventDefault(); + break; + case 13: // enter + if (typeof $(obj).data('last_item') == 'undefined' || $(obj).data('last_item') == null || noItems === true) break; + var selected = $(obj).data('selected'); + obj.add($(obj).data('last_item')); + // select next + if (curr > $(obj).data('last_max') - 1) curr = $(obj).data('last_max')-1; + $(obj).data('last_index', curr); + $(obj).data('last_item', null); + // refrech + $(inp).val(''); + obj.refresh(); + if (event.preventDefault) event.preventDefault(); + break; + case 8: // backspace + if (String(inp.value) == '') { + if (typeof $(obj).data('last_del') == 'undefined' || $(obj).data('last_del') == null) { + // mark for deletion + var selected = $(obj).data('selected'); + if (!$.isArray(selected)) selected = []; + $(obj).data('last_del', selected.length-1); + // refrech + obj.refresh(); + } else { + // delete marked one + var selected = $(obj).data('selected'); + obj.remove(selected.length - 1); + } + } + break; + default: + $(obj).data('last_index', 0); + $(obj).data('last_del', null); + break; + } + // adjust height + obj.resize(); + + // refresh menu + if (!(event.keyCode == 8 && String(inp.value) == '')) { + $(obj).prev().find('li').css('opacity', '1'); + $(obj).data('last_del', null); + } + if ($.inArray(event.keyCode, [16,91,37,39]) == -1) { // command and shift keys and arrows + w2field.list_render.call(obj, inp.value); + } + }, 10); + }) + }, + + // ****************************************************** + // -- Calendar + + calendar_get: function (date, options) { + var td = new Date(); + var today = (Number(td.getMonth())+1) + '/' + td.getDate() + '/' + (String(td.getYear()).length > 3 ? td.getYear() : td.getYear() + 1900); + if (String(date) == '' || String(date) == 'undefined') date = w2utils.formatDate(today, options.format); + if (!w2utils.isDate(date, options.format)) date = w2utils.formatDate(today, options.format); + // format date + var tmp = date.replace(/-/g, '/').replace(/\./g, '/').toLowerCase().split('/'); + var tmp2 = options.format.replace(/-/g, '/').replace(/\./g, '/').toLowerCase(); + var dt = new Date(); + if (tmp2 == 'mm/dd/yyyy') dt = new Date(tmp[0] + '/' + tmp[1] + '/' + tmp[2]); + if (tmp2 == 'm/d/yyyy') dt = new Date(tmp[0] + '/' + tmp[1] + '/' + tmp[2]); + if (tmp2 == 'dd/mm/yyyy') dt = new Date(tmp[1] + '/' + tmp[0] + '/' + tmp[2]); + if (tmp2 == 'd/m/yyyy') dt = new Date(tmp[1] + '/' + tmp[0] + '/' + tmp[2]); + if (tmp2 == 'yyyy/dd/mm') dt = new Date(tmp[2] + '/' + tmp[1] + '/' + tmp[0]); + if (tmp2 == 'yyyy/d/m') dt = new Date(tmp[2] + '/' + tmp[1] + '/' + tmp[0]); + if (tmp2 == 'yyyy/mm/dd') dt = new Date(tmp[1] + '/' + tmp[2] + '/' + tmp[0]); + if (tmp2 == 'yyyy/m/d') dt = new Date(tmp[1] + '/' + tmp[2] + '/' + tmp[0]); + var html = '' + + ''+ + // ''+ + '
      '+ $().w2field('calendar_month', (dt.getMonth() + 1), dt.getFullYear(), options) +'
      '; + return html; + }, + + calendar_next: function(month_year) { + var tmp = String(month_year).split('/'); + var month = tmp[0]; + var year = tmp[1]; + if (parseInt(month) < 12) { + month = parseInt(month) + 1; + } else { + month = 1; + year = parseInt(year) + 1; + } + var options = $($('#global_calendar_div.w2ui-calendar').data('el')).data('options'); + $('#global_calendar_div.w2ui-calendar').html( $().w2field('calendar_get', w2utils.formatDate(month+'/1/'+year, options.format), options) ); + }, + + calendar_previous: function(month_year) { + var tmp = String(month_year).split('/'); + var month = tmp[0]; + var year = tmp[1]; + if (parseInt(month) > 1) { + month = parseInt(month) - 1; + } else { + month = 12; + year = parseInt(year) - 1; + } + var options = $($('#global_calendar_div.w2ui-calendar').data('el')).data('options'); + $('#global_calendar_div.w2ui-calendar').html( $().w2field('calendar_get', w2utils.formatDate(month+'/1/'+year, options.format), options) ); + }, + + calendar_month: function(month, year, options) { + var td = new Date(); + var months = w2utils.settings.fullmonths; + var days = w2utils.settings.fulldays; + var daysCount = ['31', '28', '31', '30', '31', '30', '31', '31', '30', '31', '30', '31']; + var today = (Number(td.getMonth())+1) + '/' + td.getDate() + '/' + (String(td.getYear()).length > 3 ? td.getYear() : td.getYear() + 1900); + + year = Number(year); + month = Number(month); + if (year === null || year === '') year = String(td.getYear()).length > 3 ? td.getYear() : td.getYear() + 1900; + if (month === null || month === '') month = Number(td.getMonth())+1; + if (month > 12) { month = month - 12; year++; } + if (month < 1 || month == 0) { month = month + 12; year--; } + if (year/4 == Math.floor(year/4)) { daysCount[1] = '29'; } else { daysCount[1] = '28'; } + if (year == null) { year = td.getYear(); } + if (month == null) { month = td.getMonth()-1; } + + // start with the required date + var td = new Date(); + td.setDate(1); + td.setMonth(month-1); + td.setYear(year); + var weekDay = td.getDay(); + var tabDays = w2utils.settings.shortdays; + var dayTitle = ''; + for ( var i = 0, len = tabDays.length; i < len; i++) { + dayTitle += '' + tabDays[i] + ''; + } + var html = + '
      '+ + '
      <-
      '+ + '
      ->
      '+ + months[month-1] +', '+ year + + '
      '+ + ''+ + ' ' + dayTitle + ''+ + ' '; + + var day = 1; + for (var ci=1; ci<43; ci++) { + if (weekDay == 0 && ci == 1) { + for (var ti=0; ti<6; ti++) html += ''; + ci += 6; + } else { + if (ci < weekDay || day > daysCount[month-1]) { + html += ''; + if ((ci)%7 == 0) html += ''; + continue; + } + } + var dt = month + '/' + day + '/' + year; + + var className = ''; + if (ci % 7 == 6) className = 'w2ui-saturday'; + if (ci % 7 == 0) className = 'w2ui-sunday'; + if (dt == today) className += ' w2ui-today'; + + var dspDay = day; + var col = ''; + var bgcol = ''; + var blocked = ''; + if (options.colored) if (options.colored[dt] != undefined) { // if there is predefined colors for dates + tmp = options.colored[dt].split(':'); + bgcol = 'background-color: ' + tmp[0] + ';'; + col = 'color: ' + tmp[1] + ';'; + } + var noSelect = false; + // enable range + if (options.start || options.end) { + var start = new Date(options.start); + var end = new Date(options.end); + var current = new Date(dt); + if (current < start || current > end) { + blocked = ' w2ui-blocked-date'; + noSelect = true; + } + } + // block predefined dates + if (options.blocked && $.inArray(dt, options.blocked) != -1) { + blocked = ' w2ui-blocked-date'; + noSelect = true; + } + html += ''; + day++; + } + html += '
        
      '; + if (ci % 7 == 0 || (weekDay == 0 && ci == 1)) html += '
      '; + return html; + }, + + getColorHTML: function (color) { + var html = '
      '+ + ''; + var colors = [ + ['000000', '444444', '666666', '999999', 'CCCCCC', 'EEEEEE', 'F3F3F3', 'FFFFFF'], + ['FF011B', 'FF9838', 'FFFD59', '01FD55', '00FFFE', '0424F3', '9B24F4', 'FF21F5'], + ['F4CCCC', 'FCE5CD', 'FFF2CC', 'D9EAD3', 'D0E0E3', 'CFE2F3', 'D9D1E9', 'EAD1DC'], + ['EA9899', 'F9CB9C', 'FEE599', 'B6D7A8', 'A2C4C9', '9FC5E8', 'B4A7D6', 'D5A6BD'], + ['E06666', 'F6B26B', 'FED966', '93C47D', '76A5AF', '6FA8DC', '8E7CC3', 'C27BA0'], + ['CC0814', 'E69138', 'F1C232', '6AA84F', '45818E', '3D85C6', '674EA7', 'A54D79'], + ['99050C', 'B45F17', 'BF901F', '37761D', '124F5C', '0A5394', '351C75', '741B47'], + ['660205', '783F0B', '7F6011', '274E12', '0C343D', '063762', '20124D', '4C1030'] + ]; + for (var i=0; i<8; i++) { + html += ''; + for (var j=0; j<8; j++) { + html += ''; + } + html += ''; + if (i < 2) html += ''; + } + html += '
      '+ + '
      '+ + ' '+ (color == colors[i][j] ? '•' : ' ')+ + '
      '+ + '
      '; + return html; + } + }); + + w2obj.field = w2field; + +}) (jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2form - form widget + * - $().w2form - jQuery wrapper + * - Dependencies: jQuery, w2utils, w2fields, w2tabs, w2toolbar, w2alert + * + * == NICE TO HAVE == + * - refresh(field) - would refresh only one field + * - include delta on save + * + ************************************************************************/ + + +(function ($) { + var w2form = function(options) { + // public properties + this.name = null; + this.header = ''; + this.box = null; // HTML element that hold this element + this.url = ''; + this.formURL = ''; // url where to get form HTML + this.formHTML = ''; // form HTML (might be loaded from the url) + this.page = 0; // current page + this.recid = 0; // can be null or 0 + this.fields = []; + this.actions = {}; + this.record = {}; + this.original = {}; + this.postData = {}; + this.toolbar = {}; // if not empty, then it is toolbar + this.tabs = {}; // if not empty, then it is tabs object + + this.style = ''; + this.focus = 0; // focus first or other element + this.msgNotJSON = w2utils.lang('Return data is not in JSON format.'); + this.msgRefresh = w2utils.lang('Refreshing...'); + this.msgSaving = w2utils.lang('Saving...'); + + // events + this.onRequest = null; + this.onLoad = null; + this.onValidate = null; + this.onSubmit = null; + this.onSave = null; + this.onChange = null; + this.onRender = null; + this.onRefresh = null; + this.onResize = null; + this.onDestroy = null; + this.onAction = null; + this.onToolbar = null; + this.onError = null; + + // internal + this.isGenerated = false; + this.last = { + xhr : null // jquery xhr requests + } + + $.extend(true, this, w2obj.form, options); + }; + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2form = function(method) { + if (typeof method === 'object' || !method ) { + var obj = this; + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2form().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + // remember items + var record = method.record; + var original = method.original; + var fields = method.fields; + var toolbar = method.toolbar; + var tabs = method.tabs; + // extend items + var object = new w2form(method); + $.extend(object, { record: {}, original: {}, fields: [], tabs: {}, toolbar: {}, handlers: [] }); + if ($.isArray(tabs)) { + $.extend(true, object.tabs, { tabs: [] }); + for (var t in tabs) { + var tmp = tabs[t]; + if (typeof tmp == 'object') object.tabs.tabs.push(tmp); else object.tabs.tabs.push({ id: tmp, caption: tmp }); + } + } else { + $.extend(true, object.tabs, tabs); + } + $.extend(true, object.toolbar, toolbar); + // reassign variables + for (var p in fields) object.fields[p] = $.extend(true, {}, fields[p]); + for (var p in record) { + if ($.isPlainObject(record[p])) { + object.record[p] = $.extend(true, {}, record[p]); + } else { + object.record[p] = record[p]; + } + } + for (var p in original) { + if ($.isPlainObject(original[p])) { + object.original[p] = $.extend(true, {}, original[p]); + } else { + object.original[p] = original[p]; + } + } + if (obj.length > 0) object.box = obj[0]; + // render if necessary + if (object.formURL != '') { + $.get(object.formURL, function (data) { + object.formHTML = data; + object.isGenerated = true; + if ($(object.box).length != 0 || data.length != 0) { + $(object.box).html(data); + object.render(object.box); + } + }); + } else if (object.formHTML != '') { + // it is already loaded into formHTML + } else if ($(this).length != 0 && $.trim($(this).html()) != '') { + object.formHTML = $(this).html(); + } else { // try to generate it + object.formHTML = object.generateHTML(); + } + // register new object + w2ui[object.name] = object; + // render if not loaded from url + if (object.formURL == '') { + if (String(object.formHTML).indexOf('w2ui-page') == -1) { + object.formHTML = '
      '+ object.formHTML +'
      '; + } + $(object.box).html(object.formHTML); + object.isGenerated = true; + object.render(object.box); + } + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2form'); + } + } + + // ==================================================== + // -- Implementation of core functionality + + w2form.prototype = { + + get: function (field, returnIndex) { + for (var f in this.fields) { + if (this.fields[f].name == field) { + if (returnIndex === true) return f; else return this.fields[f]; + } + } + return null; + }, + + set: function (field, obj) { + for (var f in this.fields) { + if (this.fields[f].name == field) { + $.extend(this.fields[f] , obj); + this.refresh(); + return true; + } + } + return false; + }, + + reload: function (callBack) { + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (url && this.recid != 0) { + //this.clear(); + this.request(callBack); + } else { + this.refresh(); + if (typeof callBack == 'function') callBack(); + } + }, + + clear: function () { + this.recid = 0; + this.record = {}; + // clear all enum fields + for (var f in this.fields) { + var field = this.fields[f]; + } + $().w2tag(); + this.refresh(); + }, + + error: function (msg) { + var obj = this; + // let the management of the error outside of the grid + var eventData = this.trigger({ target: this.name, type: 'error', message: msg , xhr: this.last.xhr }); + if (eventData.isCancelled === true) { + if (typeof callBack == 'function') callBack(); + return false; + } + // need a time out because message might be already up) + setTimeout(function () { w2alert(msg, 'Error'); }, 1); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + validate: function (showErrors) { + if (typeof showErrors == 'undefined') showErrors = true; + // validate before saving + var errors = []; + for (var f in this.fields) { + var field = this.fields[f]; + if (this.record[field.name] == null) this.record[field.name] = ''; + switch (field.type) { + case 'int': + if (this.record[field.name] && !w2utils.isInt(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not an integer') }); + } + break; + case 'float': + if (this.record[field.name] && !w2utils.isFloat(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not a float') }); + } + break; + case 'money': + if (this.record[field.name] && !w2utils.isMoney(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not in money format') }); + } + break; + case 'hex': + if (this.record[field.name] && !w2utils.isHex(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not a hex number') }); + } + break; + case 'email': + if (this.record[field.name] && !w2utils.isEmail(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not a valid email') }); + } + break; + case 'checkbox': + // convert true/false + if (this.record[field.name] == true) this.record[field.name] = 1; else this.record[field.name] = 0; + break; + case 'date': + // format date before submit + if (this.record[field.name] && !w2utils.isDate(this.record[field.name], field.options.format)) { + errors.push({ field: field, error: w2utils.lang('Not a valid date') + ': ' + field.options.format }); + } else { + // convert to universal timestamp with time zone + //var d = new Date(this.record[field.name]); + //var tz = (d.getTimezoneOffset() > 0 ? '+' : '-') + Math.floor(d.getTimezoneOffset()/60) + ':' + (d.getTimezoneOffset() % 60); + //this.record[field.name] = d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate() + ' ' + // + d.getHours() + ':' + d.getSeconds() + ':' + d.getMilliseconds() + tz; + //this.record[field.name + '_unix'] = Math.round(d.getTime() / 1000); + //this.record[field.name] = w2utils.formatDate(this.record[field.name], 'mm/dd/yyyy'); + } + break; + case 'select': + case 'list': + break; + case 'enum': + break; + } + // === check required - if field is '0' it should be considered not empty + var val = this.record[field.name]; + if ( field.required && (val === '' || ($.isArray(val) && val.length == 0)) ) { + errors.push({ field: field, error: w2utils.lang('Required field') }); + } + if ( field.equalto && this.record[field.name]!=this.record[field.equalto] ) { + errors.push({ field: field, error: w2utils.lang('Field should be equal to ')+field.equalto }); + } + } + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'validate', errors: errors }); + if (eventData.isCancelled === true) return errors; + // show error + if (showErrors) for (var e in eventData.errors) { + var err = eventData.errors[e]; + $(err.field.el).w2tag(err.error, { "class": 'w2ui-error' }); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return errors; + }, + + request: function (postData, callBack) { // if (1) param then it is call back if (2) then postData and callBack + var obj = this; + // check for multiple params + if (typeof postData == 'function') { + callBack = postData; + postData = null; + } + if (typeof postData == 'undefined' || postData == null) postData = {}; + if (!this.url || (typeof this.url == 'object' && !this.url.get)) return; + if (this.recid == null || typeof this.recid == 'undefined') this.recid = 0; + // build parameters list + var params = {}; + // add list params + params['cmd'] = 'get-record'; + params['name'] = this.name; + params['recid'] = this.recid; + // append other params + $.extend(params, this.postData); + $.extend(params, postData); + // event before + var eventData = this.trigger({ phase: 'before', type: 'request', target: this.name, url: this.url, postData: params }); + if (eventData.isCancelled === true) { if (typeof callBack == 'function') callBack({ status: 'error', message: 'Request aborted.' }); return false; } + // default action + this.record = {}; + this.original = {}; + // call server to get data + this.lock(this.msgRefresh); + var url = eventData.url; + if (typeof eventData.url == 'object' && eventData.url.get) url = eventData.url.get; + if (this.last.xhr) try { this.last.xhr.abort(); } catch (e) {}; + this.last.xhr = $.ajax({ + type : 'GET', + url : url, + data : String($.param(eventData.postData, false)).replace(/%5B/g, '[').replace(/%5D/g, ']'), + dataType : 'text', + complete : function (xhr, status) { + obj.unlock(); + // event before + var eventData = obj.trigger({ phase: 'before', target: obj.name, type: 'load', xhr: xhr, status: status }); + if (eventData.isCancelled === true) { + if (typeof callBack == 'function') callBack({ status: 'error', message: 'Request aborted.' }); + return false; + } + // parse server response + var responseText = obj.last.xhr.responseText; + if (status != 'error') { + // default action + if (typeof responseText != 'undefined' && responseText != '') { + var data; + // check if the onLoad handler has not already parsed the data + if (typeof responseText == "object") { + data = responseText; + } else { + // $.parseJSON or $.getJSON did not work because it expect perfect JSON data - where everything is in double quotes + try { eval('data = '+ responseText); } catch (e) { } + } + if (typeof data == 'undefined') { + data = { + status : 'error', + message : obj.msgNotJSON, + responseText : responseText + } + } + if (data['status'] == 'error') { + obj.error(data['message']); + } else { + obj.record = $.extend({}, data.record); + obj.original = $.extend({}, data.record); + } + } + } else { + obj.error('AJAX Error ' + xhr.status + ': '+ xhr.statusText); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.refresh(); + // call back + if (typeof callBack == 'function') callBack(data); + } + }); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + submit: function (postData, callBack) { + return this.save(postData, callBack); + }, + + save: function (postData, callBack) { + var obj = this; + // check for multiple params + if (typeof postData == 'function') { + callBack = postData; + postData = null; + } + // validation + var errors = obj.validate(true); + if (errors.length !== 0) { + obj.goto(errors[0].field.page); + return; + } + // submit save + if (typeof postData == 'undefined' || postData == null) postData = {}; + if (!obj.url || (typeof obj.url == 'object' && !obj.url.save)) { + console.log("ERROR: Form cannot be saved because no url is defined."); + return; + } + obj.lock(obj.msgSaving + ' '); + // need timer to allow to lock + setTimeout(function () { + // build parameters list + var params = {}; + // add list params + params['cmd'] = 'save-record'; + params['name'] = obj.name; + params['recid'] = obj.recid; + // append other params + $.extend(params, obj.postData); + $.extend(params, postData); + params.record = $.extend(true, {}, obj.record); + // convert before submitting + for (var f in obj.fields) { + var field = obj.fields[f]; + switch (String(field.type).toLowerCase()) { + case 'date': // to yyyy-mm-dd format + var dt = params.record[field.name]; + if (field.options.format.toLowerCase() == 'dd/mm/yyyy' || field.options.format.toLowerCase() == 'dd-mm-yyyy' + || field.options.format.toLowerCase() == 'dd.mm.yyyy') { + var tmp = dt.replace(/-/g, '/').replace(/\./g, '/').split('/'); + var dt = new Date(tmp[2] + '-' + tmp[1] + '-' + tmp[0]); + } + params.record[field.name] = w2utils.formatDate(dt, 'yyyy-mm-dd'); + break; + } + } + // event before + var eventData = obj.trigger({ phase: 'before', type: 'submit', target: obj.name, url: obj.url, postData: params }); + if (eventData.isCancelled === true) { + if (typeof callBack == 'function') callBack({ status: 'error', message: 'Saving aborted.' }); + return false; + } + // default action + var url = eventData.url; + if (typeof eventData.url == 'object' && eventData.url.save) url = eventData.url.save; + if (obj.last.xhr) try { obj.last.xhr.abort(); } catch (e) {}; + obj.last.xhr = $.ajax({ + type : (w2utils.settings.RESTfull ? (obj.recid == 0 ? 'POST' : 'PUT') : 'POST'), + url : url, + data : String($.param(eventData.postData, false)).replace(/%5B/g, '[').replace(/%5D/g, ']'), + dataType : 'text', + xhr : function() { + var xhr = new window.XMLHttpRequest(); + // upload + xhr.upload.addEventListener("progress", function(evt) { + if (evt.lengthComputable) { + var percent = Math.round(evt.loaded / evt.total * 100); + $('#'+ obj.name + '_progress').text(''+ percent + '%'); + } + }, false); + return xhr; + }, + complete : function (xhr, status) { + obj.unlock(); + + // event before + var eventData = obj.trigger({ phase: 'before', target: obj.name, type: 'save', xhr: xhr, status: status }); + if (eventData.isCancelled === true) { + if (typeof callBack == 'function') callBack({ status: 'error', message: 'Saving aborted.' }); + return false; + } + // parse server response + var responseText = xhr.responseText; + if (status != 'error') { + // default action + if (typeof responseText != 'undefined' && responseText != '') { + var data; + // check if the onLoad handler has not already parsed the data + if (typeof responseText == "object") { + data = responseText; + } else { + // $.parseJSON or $.getJSON did not work because it expect perfect JSON data - where everything is in double quotes + try { eval('data = '+ responseText); } catch (e) { } + } + if (typeof data == 'undefined') { + data = { + status : 'error', + message : obj.msgNotJSON, + responseText : responseText + } + } + if (data['status'] == 'error') { + obj.error(data['message']); + } else { + obj.original = $.extend({}, obj.record); + } + } + } else { + obj.error('AJAX Error ' + xhr.status + ': '+ xhr.statusText); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.refresh(); + // call back + if (typeof callBack == 'function') callBack(data); + } + }); + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, 50); + }, + + lock: function (msg, showSpinner) { + var box = $(this.box).find('> div:first-child'); + w2utils.lock(box, msg, showSpinner); + }, + + unlock: function () { + var obj = this; + setTimeout(function () { w2utils.unlock(obj.box); }, 25); // needed timer so if server fast, it will not flash + }, + + goto: function (page) { + if (typeof page != 'undefined') this.page = page; + // if it was auto size, resize it + if ($(this.box).data('auto-size') === true) $(this.box).height(0); + this.refresh(); + }, + + generateHTML: function () { + var pages = []; // array for each page + for (var f in this.fields) { + var html = ''; + var field = this.fields[f]; + if (typeof field.html == 'undefined') field.html = {}; + field.html = $.extend(true, { caption: '', span: 6, attr: '', text: '', page: 0 }, field.html); + if (field.html.caption == '') field.html.caption = field.name; + var input = ''; + if (field.type == 'list') input = ''; + if (field.type == 'checkbox') input = ''; + if (field.type == 'textarea') input = ''; + html += '\n
      '+ field.html.caption +':
      '+ + '\n
      '+ + input + field.html.text + + '
      '; + if (typeof pages[field.html.page] == 'undefined') pages[field.html.page] = '
      '; + pages[field.html.page] += html; + } + for (var p in pages) pages[p] += '\n
      '; + // buttons if any + var buttons = ''; + if (!$.isEmptyObject(this.actions)) { + buttons += '\n
      '; + for (var a in this.actions) { + buttons += '\n '; + } + buttons += '\n
      '; + } + return pages.join('') + buttons; + }, + + action: function (action, event) { + // event before + var eventData = this.trigger({ phase: 'before', target: action, type: 'action', originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default actions + if (typeof (this.actions[action]) == 'function') { + this.actions[action].call(this, event); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + resize: function () { + var obj = this; + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'resize' }); + if (eventData.isCancelled === true) return false; + // default behaviour + var main = $(this.box).find('> div'); + var header = $(this.box).find('> div .w2ui-form-header'); + var toolbar = $(this.box).find('> div .w2ui-form-toolbar'); + var tabs = $(this.box).find('> div .w2ui-form-tabs'); + var page = $(this.box).find('> div .w2ui-page'); + var cpage = $(this.box).find('> div .w2ui-page.page-'+ this.page); + var dpage = $(this.box).find('> div .w2ui-page.page-'+ this.page + ' > div'); + var buttons = $(this.box).find('> div .w2ui-buttons'); + // if no height, calculate it + resizeElements(); + if (parseInt($(this.box).height()) == 0 || $(this.box).data('auto-size') === true) { + $(this.box).height( + (header.length > 0 ? w2utils.getSize(header, 'height') : 0) + + (this.tabs.tabs.length > 0 ? w2utils.getSize(tabs, 'height') : 0) + + (this.toolbar.items.length > 0 ? w2utils.getSize(toolbar, 'height') : 0) + + (page.length > 0 ? w2utils.getSize(dpage, 'height') + w2utils.getSize(cpage, '+height') + 12 : 0) + // why 12 ??? + (buttons.length > 0 ? w2utils.getSize(buttons, 'height') : 0) + ); + $(this.box).data('auto-size', true); + } + resizeElements(); + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + + function resizeElements() { + // resize elements + main.width($(obj.box).width()).height($(obj.box).height()); + toolbar.css('top', (obj.header != '' ? w2utils.getSize(header, 'height') : 0)); + tabs.css('top', (obj.header != '' ? w2utils.getSize(header, 'height') : 0) + + (obj.toolbar.items.length > 0 ? w2utils.getSize(toolbar, 'height') : 0)); + page.css('top', (obj.header != '' ? w2utils.getSize(header, 'height') : 0) + + (obj.toolbar.items.length > 0 ? w2utils.getSize(toolbar, 'height') + 5 : 0) + + (obj.tabs.tabs.length > 0 ? w2utils.getSize(tabs, 'height') + 5 : 0)); + page.css('bottom', (buttons.length > 0 ? w2utils.getSize(buttons, 'height') : 0)); + } + }, + + refresh: function () { + var obj = this; + if (!this.box) return; + if (!this.isGenerated || typeof $(this.box).html() == 'undefined') return; + // update what page field belongs + $(this.box).find('input, textarea, select').each(function (index, el) { + var name = (typeof $(el).attr('name') != 'undefined' ? $(el).attr('name') : $(el).attr('id')); + var field = obj.get(name); + if (field) { + // find page + var div = $(el).parents('.w2ui-page'); + if (div.length > 0) { + for (var i = 0; i < 100; i++) { + if (div.hasClass('page-'+i)) { field.page = i; break; } + } + } + } + }); + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'refresh', page: this.page }) + if (eventData.isCancelled === true) return false; + // default action + $(this.box).find('.w2ui-page').hide(); + $(this.box).find('.w2ui-page.page-' + this.page).show(); + $(this.box).find('.w2ui-form-header').html(this.header); + // refresh tabs if needed + if (typeof this.tabs == 'object' && this.tabs.tabs.length > 0) { + $('#form_'+ this.name +'_tabs').show(); + this.tabs.active = this.tabs.tabs[this.page].id; + this.tabs.refresh(); + } else { + $('#form_'+ this.name +'_tabs').hide(); + } + // refresh tabs if needed + if (typeof this.toolbar == 'object' && this.toolbar.items.length > 0) { + $('#form_'+ this.name +'_toolbar').show(); + this.toolbar.refresh(); + } else { + $('#form_'+ this.name +'_toolbar').hide(); + } + // refresh values of all fields + for (var f in this.fields) { + var field = this.fields[f]; + field.el = $(this.box).find('[name="'+ String(field.name).replace(/\\/g, '\\\\') +'"]')[0]; + if (typeof field.el == 'undefined') { + console.log('ERROR: Cannot associate field "'+ field.name + '" with html control. Make sure html control exists with the same name.'); + //return; + } + if (field.el) field.el.id = field.name; + $(field.el).off('change').on('change', function () { + var value_new = this.value; + var value_previous = obj.record[this.name] ? obj.record[this.name] : ''; + var field = obj.get(this.name); + if ((field.type == 'enum' || field.type == 'upload') && $(this).data('selected')) { + var new_arr = $(this).data('selected'); + var cur_arr = obj.record[this.name]; + var value_new = []; + var value_previous = []; + if ($.isArray(new_arr)) for (var i in new_arr) value_new[i] = $.extend(true, {}, new_arr[i]); // clone array + if ($.isArray(cur_arr)) for (var i in cur_arr) value_previous[i] = $.extend(true, {}, cur_arr[i]); // clone array + } + // event before + var eventData = obj.trigger({ phase: 'before', target: this.name, type: 'change', value_new: value_new, value_previous: value_previous }); + if (eventData.isCancelled === true) { + $(this).val(obj.record[this.name]); // return previous value + return false; + } + // default action + var val = this.value; + if (this.type == 'checkbox') val = this.checked ? true : false; + if (this.type == 'radio') val = this.checked ? true : false; + if (field.type == 'enum') val = value_new; + if (field.type == 'upload') val = value_new; + obj.record[this.name] = val; + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }); + if (field.required) { + $(field.el).parent().addClass('w2ui-required'); + } else { + $(field.el).parent().removeClass('w2ui-required'); + } + } + // attach actions on buttons + $(this.box).find('button, input[type=button]').each(function (index, el) { + $(el).off('click').on('click', function (event) { + var action = this.value; + if (this.name) action = this.name; + if (this.id) action = this.id; + obj.action(action, event); + }); + }); + // init controls with record + for (var f in this.fields) { + var field = this.fields[f]; + var value = (typeof this.record[field.name] != 'undefined' ? this.record[field.name] : ''); + if (!field.el) continue; + switch (String(field.type).toLowerCase()) { + case 'email': + case 'text': + case 'textarea': + field.el.value = value; + break; + case 'date': + if (!field.options) field.options = {}; + if (!field.options.format) field.options.format = w2utils.settings.date_format; + field.el.value = value; + this.record[field.name] = value; + $(field.el).w2field($.extend({}, field.options, { type: 'date' })); + break; + case 'int': + field.el.value = value; + $(field.el).w2field('int'); + break; + case 'float': + field.el.value = value; + $(field.el).w2field('float'); + break; + case 'money': + field.el.value = value; + $(field.el).w2field('money'); + break; + case 'hex': + field.el.value = value; + $(field.el).w2field('hex'); + break; + case 'alphanumeric': + field.el.value = value; + $(field.el).w2field('alphaNumeric'); + break; + case 'checkbox': + if (this.record[field.name] == true || this.record[field.name] == 1 || this.record[field.name] == 't') { + $(field.el).prop('checked', true); + } else { + $(field.el).prop('checked', false); + } + break; + case 'password': + // hide passwords + field.el.value = value; + break; + case 'select': + case 'list': + $(field.el).w2field($.extend({}, field.options, { type: 'list', value: value })); + break; + case 'enum': + if (typeof field.options == 'undefined' || (typeof field.options.url == 'undefined' && typeof field.options.items == 'undefined')) { + console.log("ERROR: (w2form."+ obj.name +") the field "+ field.name +" defined as enum but not field.options.url or field.options.items provided."); + break; + } + // normalize value + this.record[field.name] = w2obj.field.cleanItems(value); + value = this.record[field.name]; + $(field.el).w2field( $.extend({}, field.options, { type: 'enum', selected: value }) ); + break; + case 'upload': + $(field.el).w2field($.extend({}, field.options, { type: 'upload', selected: value })); + break; + default: + console.log('ERROR: field type "'+ field.type +'" is not recognized.'); + break; + } + } + // wrap pages in div + var tmp = $(this.box).find('.w2ui-page'); + for (var i = 0; i < tmp.length; i++) { + if ($(tmp[i]).find('> *').length > 1) $(tmp[i]).wrapInner('
      '); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.resize(); + }, + + render: function (box) { + var obj = this; + if (typeof box == 'object') { + // remove from previous box + if ($(this.box).find('#form_'+ this.name +'_tabs').length > 0) { + $(this.box).removeAttr('name') + .removeClass('w2ui-reset w2ui-form') + .html(''); + } + this.box = box; + } + if (!this.isGenerated) return; + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'render', box: (typeof box != 'undefined' ? box : this.box) }); + if (eventData.isCancelled === true) return false; + // default actions + var html = '
      ' + + (this.header != '' ? '
      ' + this.header + '
      ' : '') + + '
      ' + + '
      ' + + this.formHTML + + '
      '; + $(this.box).attr('name', this.name) + .addClass('w2ui-reset w2ui-form') + .html(html); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + + // init toolbar regardless it is defined or not + if (typeof this.toolbar['render'] == 'undefined') { + this.toolbar = $().w2toolbar($.extend({}, this.toolbar, { name: this.name +'_toolbar', owner: this })); + this.toolbar.on('click', function (event) { + var eventData = obj.trigger({ phase: 'before', type: 'toolbar', target: event.target, originalEvent: event }); + if (eventData.isCancelled === true) return false; + // no default action + obj.trigger($.extend(eventData, { phase: 'after' })); + }); + } + if (typeof this.toolbar == 'object' && typeof this.toolbar.render == 'function') { + this.toolbar.render($('#form_'+ this.name +'_toolbar')[0]); + } + // init tabs regardless it is defined or not + if (typeof this.tabs['render'] == 'undefined') { + this.tabs = $().w2tabs($.extend({}, this.tabs, { name: this.name +'_tabs', owner: this })); + this.tabs.on('click', function (event) { + obj.goto(this.get(event.target, true)); + }); + } + if (typeof this.tabs == 'object' && typeof this.tabs.render == 'function') { + this.tabs.render($('#form_'+ this.name +'_tabs')[0]); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + // after render actions + this.resize(); + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (url && this.recid != 0) { + this.request(); + } else { + this.refresh(); + } + // attach to resize event + if ($('.w2ui-layout').length == 0) { // if there is layout, it will send a resize event + this.tmp_resize = function (event) { w2ui[obj.name].resize(); } + $(window).off('resize', 'body').on('resize', 'body', this.tmp_resize); + } + setTimeout(function () { obj.resize(); obj.refresh(); }, 150); // need timer because resize is on timer + // focus on load + function focusEl() { + var inputs = $(obj.box).find('input, select, textarea'); + if (inputs.length > obj.focus) inputs[obj.focus].focus(); + } + if (this.focus >= 0) setTimeout(focusEl, 500); // need timeout to allow form to render + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'destroy' }); + if (eventData.isCancelled === true) return false; + // clean up + if (typeof this.toolbar == 'object' && this.toolbar.destroy) this.toolbar.destroy(); + if (typeof this.tabs == 'object' && this.tabs.destroy) this.tabs.destroy(); + if ($(this.box).find('#form_'+ this.name +'_tabs').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-form') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + $(window).off('resize', 'body') + } + } + + $.extend(w2form.prototype, w2utils.event); + w2obj.form = w2form; +})(jQuery); diff --git a/js/w2ui.min.js b/js/w2ui.min.js new file mode 100644 index 0000000..2135cb1 --- /dev/null +++ b/js/w2ui.min.js @@ -0,0 +1 @@ +var w2ui=w2ui||{},w2obj=w2obj||{},w2utils=function(n){function nt(n){var t=/^[-]?[0-9]+$/;return t.test(n)}function tt(n){var t=new RegExp(w2utils.settings.float);return t.test(n)}function d(n){var t=new RegExp(w2utils.settings.currency);return t.test(n)}function w(n){var t=/^[a-fA-F0-9]+$/;return t.test(n)}function b(n){var t=/^[a-zA-Z0-9_-]+$/;return t.test(n)}function k(n){var t=/^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;return t.test(n)}function et(n,t,i){if(!n)return!1;t||(t=w2utils.settings.date_format);var r=n.replace(/-/g,"/").replace(/\./g,"/").toLowerCase().split("/"),o=t.replace(/-/g,"/").replace(/\./g,"/").toLowerCase(),s="Invalid Date",u,f,e;return(o=="mm/dd/yyyy"&&(u=r[0],f=r[1],e=r[2]),o=="m/d/yyyy"&&(u=r[0],f=r[1],e=r[2]),o=="dd/mm/yyyy"&&(u=r[1],f=r[0],e=r[2]),o=="d/m/yyyy"&&(u=r[1],f=r[0],e=r[2]),o=="yyyy/dd/mm"&&(u=r[2],f=r[1],e=r[0]),o=="yyyy/d/m"&&(u=r[2],f=r[1],e=r[0]),o=="yyyy/mm/dd"&&(u=r[1],f=r[2],e=r[0]),o=="yyyy/m/d"&&(u=r[1],f=r[2],e=r[0]),s=new Date(u+"/"+f+"/"+e),typeof u=="undefined")?!1:s=="Invalid Date"?!1:s.getMonth()+1!=u||s.getDate()!=f||s.getFullYear()!=e?!1:i===!0?s:!0}function ot(t){var r,i;return String(t)=="undefined"?!1:(t=t.toUpperCase(),r=t.indexOf("PM")>=0||t.indexOf("AM")>=0?12:23,t=n.trim(t.replace("AM","")),t=n.trim(t.replace("PM","")),i=t.split(":"),i.length!=2)?!1:i[0]==""||parseInt(i[0])<0||parseInt(i[0])>r||!this.isInt(i[0])?!1:i[1]==""||parseInt(i[1])<0||parseInt(i[1])>59||!this.isInt(i[1])?!1:!0}function st(n){var f,i;if(n==""||typeof n=="undefined"||n==null||(w2utils.isInt(n)&&(n=Number(n)),f=new Date(n),w2utils.isInt(n)&&(f=new Date(Number(n))),i=String(n).split("-"),i.length==3&&(f=new Date(i[0],Number(i[1])-1,i[2])),i=String(n).split("/"),i.length==3&&(f=new Date(i[2],Number(i[0])-1,i[1])),f=="Invalid Time"))return"";var e=new Date,t=(e.getTime()-f.getTime())/1e3,r="",u="";return t<60?(r=Math.floor(t),u="sec",t<0&&(r=0,u="sec")):t<3600?(r=Math.floor(t/60),u="min"):t<86400?(r=Math.floor(t/3600),u="hour"):t<2592e3?(r=Math.floor(t/86400),u="day"):t<31104e3?(r=Math.floor(t/259200)/10,u="month"):t>=31104e3&&(r=Math.floor(t/3110400)/10,u="year"),r+" "+u+(r>1?"s":"")}function ft(n){var o=w2utils.settings.shortmonths,t,i,f,r;if(n==""||typeof n=="undefined"||n==null||(w2utils.isInt(n)&&(n=Number(n)),t=new Date(n),w2utils.isInt(n)&&(t=new Date(Number(n))),i=String(n).split("-"),i.length==3&&(t=new Date(i[0],Number(i[1])-1,i[2])),i=String(n).split("/"),i.length==3&&(t=new Date(i[2],Number(i[0])-1,i[1])),t=="Invalid Date"))return"";f=new Date,r=new Date,r.setTime(r.getTime()-864e5);var u=o[t.getMonth()]+" "+t.getDate()+", "+t.getFullYear(),h=o[f.getMonth()]+" "+f.getDate()+", "+f.getFullYear(),c=o[r.getMonth()]+" "+r.getDate()+", "+r.getFullYear(),l=t.getHours()-(t.getHours()>12?12:0)+":"+(t.getMinutes()<10?"0":"")+t.getMinutes()+" "+(t.getHours()>=12?"pm":"am"),s=t.getHours()-(t.getHours()>12?12:0)+":"+(t.getMinutes()<10?"0":"")+t.getMinutes()+":"+(t.getSeconds()<10?"0":"")+t.getSeconds()+" "+(t.getHours()>=12?"pm":"am"),e=u;return u==h&&(e=l),u==c&&(e=w2utils.lang("Yesterday")),''+e+""}function it(n){if(!w2utils.isFloat(n)||n=="")return"";if(n=parseFloat(n),n==0)return 0;var i=["Bt","KB","MB","GB","TB"],t=parseInt(Math.floor(Math.log(n)/Math.log(1024)));return(Math.floor(n/Math.pow(1024,t)*10)/10).toFixed(t==0?0:1)+" "+i[t]}function rt(n){var t="";return(w2utils.isFloat(n)||w2utils.isInt(n)||w2utils.isMoney(n))&&(t=String(n).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")),t}function ut(n,t){var s=w2utils.settings.shortmonths,o=w2utils.settings.fullmonths,r,i;if((typeof t=="undefined"&&(t=this.settings.date_format),typeof n=="undefined"||n==""||n==null)||(r=new Date(n),w2utils.isInt(n)&&(r=new Date(Number(n))),i=String(n).split("-"),i.length==3&&(r=new Date(i[0],Number(i[1])-1,i[2])),i=String(n).split("/"),i.length==3&&(r=new Date(i[2],Number(i[0])-1,i[1])),r=="Invalid Date"))return"";var f=r.getFullYear(),u=r.getMonth(),e=r.getDate();return t.toLowerCase().replace("month",w2utils.settings.fullmonths[u]).replace("mon",w2utils.settings.shortmonths[u]).replace(/yyyy/g,f).replace(/yyy/g,f).replace(/yy/g,String(f).substr(2)).replace(/(^|[^a-z$])y/g,"$1"+f).replace(/mm/g,(u+1<10?"0":"")+(u+1)).replace(/dd/g,(e<10?"0":"")+e).replace(/(^|[^a-z$])m/g,"$1"+(u+1)).replace(/(^|[^a-z$])d/g,"$1"+e)}function e(n,t){var h=w2utils.settings.shortmonths,s=w2utils.settings.fullmonths,i;if((typeof t=="undefined"&&(t=this.settings.time_format),typeof n=="undefined"||n==""||n==null)||(i=new Date(n),w2utils.isInt(n)&&(i=new Date(Number(n))),i=="Invalid Date"))return"";var e="am",u=i.getHours(),o=i.getHours(),r=i.getMinutes(),f=i.getSeconds();return r<10&&(r="0"+r),f<10&&(f="0"+f),(t.indexOf("am")!=-1||t.indexOf("pm")!=-1)&&(u>=12&&(e="pm"),u>12&&(u=u-12)),t.toLowerCase().replace("am",e).replace("pm",e).replace("hh",u).replace("h24",o).replace("mm",r).replace("mi",r).replace("ss",f).replace(/(^|[^a-z$])h/g,"$1"+u).replace(/(^|[^a-z$])m/g,"$1"+r).replace(/(^|[^a-z$])s/g,"$1"+f)}function o(n,t){var i;return i=typeof t!="string"?[this.settings.date_format,this.settings.time_format]:t.split("|"),this.formatDate(n,i[0])+" "+this.formatTime(n,i[1])}function s(t){if(t==null)return t;switch(typeof t){case"string":t=n.trim(String(t).replace(/(<([^>]+)>)/ig,""));break;case"object":for(var i in t)t[i]=this.stripTags(t[i])}return t}function f(n){if(n==null)return n;switch(typeof n){case"string":n=String(n).replace(/&/g,"&").replace(/>/g,">").replace(/\|\/? {}\\])/g,"\\$1")}function r(n){function l(n){for(var n=String(n).replace(/\r\n/g,"\n"),i="",t,r=0;r127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128));return i}var e="",s,f,u,h,c,o,r,i=0,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=l(n);i>2,c=(s&3)<<4|f>>4,o=(f&15)<<2|u>>6,r=u&63,isNaN(f)?o=r=64:isNaN(u)&&(r=64),e=e+t.charAt(h)+t.charAt(c)+t.charAt(o)+t.charAt(r);return e}function u(n){function l(n){for(var u="",t=0,i=0,f=0,r=0;t191&&i<224?(r=n.charCodeAt(t+1),u+=String.fromCharCode((i&31)<<6|r&63),t+=2):(r=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),u+=String.fromCharCode((i&15)<<12|(r&63)<<6|c3&63),t+=3);return u}var t="",s,o,c,h,f,r,e,i=0,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i>4,o=(f&15)<<4|r>>2,c=(r&3)<<6|e,t=t+String.fromCharCode(s),r!=64&&(t=t+String.fromCharCode(o)),e!=64&&(t=t+String.fromCharCode(c));return t=l(t)}function v(t,i,r,u){function f(n,t,i){var r=!!window.webkitURL;return r||typeof i=="undefined"||(t=i),";"+n+": "+t+"; -webkit-"+n+": "+t+"; -moz-"+n+": "+t+"; -ms-"+n+": "+t+"; -o-"+n+": "+t+";"}var o=n(t).width(),s=n(t).height(),e=.5;if(!t||!i){console.log("ERROR: Cannot do transition when one of the divs is null");return}t.parentNode.style.cssText+=f("perspective","700px")+"; overflow: hidden;",t.style.cssText+="; position: absolute; z-index: 1019; "+f("backface-visibility","hidden"),i.style.cssText+="; position: absolute; z-index: 1020; "+f("backface-visibility","hidden");switch(r){case"slide-left":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d("+o+"px, 0, 0)","translate("+o+"px, 0)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+";"+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),t.style.cssText+=f("transition",e+"s")+";"+f("transform","translate3d(-"+o+"px, 0, 0)","translate(-"+o+"px, 0)")},1);break;case"slide-right":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d(-"+o+"px, 0, 0)","translate(-"+o+"px, 0)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0px, 0, 0)","translate(0px, 0)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d("+o+"px, 0, 0)","translate("+o+"px, 0)")},1);break;case"slide-down":t.style.cssText+="overflow: hidden; z-index: 1; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; z-index: 0; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0, "+s+"px, 0)","translate(0, "+s+"px)")},1);break;case"slide-up":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, "+s+"px, 0)","translate(0, "+s+"px)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")},1);break;case"flip-left":t.style.cssText+="overflow: hidden; "+f("-transform","rotateY(0deg)"),i.style.cssText+="overflow: hidden; "+f("transform","rotateY(-180deg)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateY(0deg)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateY(180deg)")},1);break;case"flip-right":t.style.cssText+="overflow: hidden; "+f("transform","rotateY(0deg)"),i.style.cssText+="overflow: hidden; "+f("transform","rotateY(180deg)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateY(0deg)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateY(-180deg)")},1);break;case"flip-down":t.style.cssText+="overflow: hidden; "+f("transform","rotateX(0deg)"),i.style.cssText+="overflow: hidden; "+f("transform","rotateX(180deg)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateX(0deg)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateX(-180deg)")},1);break;case"flip-up":t.style.cssText+="overflow: hidden; "+f("transform","rotateX(0deg)"),i.style.cssText+="overflow: hidden; "+f("transform","rotateX(-180deg)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateX(0deg)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateX(180deg)")},1);break;case"pop-in":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")+"; "+f("transform","scale(.8)")+"; opacity: 0;",n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","scale(1)")+"; opacity: 1;",t.style.cssText+=f("transition",e+"s")+";"},1);break;case"pop-out":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")+"; "+f("transform","scale(1)")+"; opacity: 1;",i.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")+"; opacity: 0;",n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; opacity: 1;",t.style.cssText+=f("transition",e+"s")+"; "+f("transform","scale(1.7)")+"; opacity: 0;"},1);break;default:t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")+"; opacity: 0;",n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; opacity: 1;",t.style.cssText+=f("transition",e+"s")},1)}setTimeout(function(){r=="slide-down"&&(n(t).css("z-index","1019"),n(i).css("z-index","1020")),i&&n(i).css({opacity:"1","-webkit-transition":"","-moz-transition":"","-ms-transition":"","-o-transition":"","-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":"","-webkit-backface-visibility":"","-moz-backface-visibility":"","-ms-backface-visibility":"","-o-backface-visibility":""}),t&&(n(t).css({opacity:"1","-webkit-transition":"","-moz-transition":"","-ms-transition":"","-o-transition":"","-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":"","-webkit-backface-visibility":"","-moz-backface-visibility":"","-ms-backface-visibility":"","-o-backface-visibility":""}),t.parentNode&&n(t.parentNode).css({"-webkit-perspective":"","-moz-perspective":"","-ms-perspective":"","-o-perspective":""})),typeof u=="function"&&u()},e*1e3)}function y(t,i,r){i||i==0||(i=""),w2utils.unlock(t),n(t).find(">:first-child").before('
      '),setTimeout(function(){var f=n(t).find(".w2ui-lock"),u=n(t).find(".w2ui-lock-msg");f.data("old_opacity",f.css("opacity")).css("opacity","0").show(),u.data("old_opacity",u.css("opacity")).css("opacity","0").show(),setTimeout(function(){var f=n(t).find(".w2ui-lock"),u=n(t).find(".w2ui-lock-msg"),o=(n(t).width()-w2utils.getSize(u,"width"))/2,e=(n(t).height()*.9-w2utils.getSize(u,"height"))/2;f.css({opacity:f.data("old_opacity"),left:"0px",top:"0px",width:"100%",height:"100%"}),i||u.css({"background-color":"transparent",border:"0px"}),r===!0&&(i='
      "+i),u.html(i).css({opacity:u.data("old_opacity"),left:o+"px",top:e+"px"})},10)},10),n().w2tag()}function p(t){n(t).find(".w2ui-lock").remove(),n(t).find(".w2ui-lock-msg").remove()}function a(t,i){var f={left:parseInt(n(t).css("border-left-width"))||0,right:parseInt(n(t).css("border-right-width"))||0,top:parseInt(n(t).css("border-top-width"))||0,bottom:parseInt(n(t).css("border-bottom-width"))||0},u={left:parseInt(n(t).css("margin-left"))||0,right:parseInt(n(t).css("margin-right"))||0,top:parseInt(n(t).css("margin-top"))||0,bottom:parseInt(n(t).css("margin-bottom"))||0},r={left:parseInt(n(t).css("padding-left"))||0,right:parseInt(n(t).css("padding-right"))||0,top:parseInt(n(t).css("padding-top"))||0,bottom:parseInt(n(t).css("padding-bottom"))||0};switch(i){case"top":return f.top+u.top+r.top;case"bottom":return f.bottom+u.bottom+r.bottom;case"left":return f.left+u.left+r.left;case"right":return f.right+u.right+r.right;case"width":return f.left+f.right+u.left+u.right+r.left+r.right+parseInt(n(t).width());case"height":return f.top+f.bottom+u.top+u.bottom+r.top+r.bottom+parseInt(n(t).height());case"+width":return f.left+f.right+u.left+u.right+r.left+r.right;case"+height":return f.top+f.bottom+u.top+u.bottom+r.top+r.bottom}return 0}function h(n){var t=this.settings.phrases[n];return typeof t=="undefined"?n:t}function c(t){t||(t="en-us"),t.length==5&&(t="locale/"+t+".json"),n.ajax({url:t,type:"GET",dataType:"JSON",async:!1,cache:!1,success:function(t){w2utils.settings=n.extend(!0,w2utils.settings,t)},error:function(){console.log("ERROR: Cannot load locale "+t)}})}function l(){if(t.scrollBarSize)return t.scrollBarSize;var i='
      \t
      1
      ';return n("body").append(i),t.scrollBarSize=100-n("#_scrollbar_width > div").width(),n("#_scrollbar_width").remove(),String(navigator.userAgent).indexOf("MSIE")>=0&&(t.scrollBarSize=t.scrollBarSize/2),t.scrollBarSize}var t={};return{settings:{locale:"en-us",date_format:"m/d/yyyy",date_display:"Mon d, yyyy",time_format:"hh:mi pm",currency:"^[$€£¥]?[-]?[0-9]*[.]?[0-9]+$",currencySymbol:"$",float:"^[-]?[0-9]*[.]?[0-9]+$",shortmonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullmonths:["January","February","March","April","May","June","July","August","September","October","November","December"],shortdays:["M","T","W","T","F","S","S"],fulldays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],RESTfull:!1,phrases:{}},isInt:nt,isFloat:tt,isMoney:d,isHex:w,isAlphaNumeric:b,isEmail:k,isDate:et,isTime:ot,age:st,date:ft,size:it,formatNumber:rt,formatDate:ut,formatTime:e,formatDateTime:o,stripTags:s,encodeTags:f,escapeId:i,base64encode:r,base64decode:u,transition:v,lock:y,unlock:p,lang:h,locale:c,getSize:a,scrollBarSize:l}}(jQuery),w2popup,w2alert,w2confirm;w2utils.event={on:function(n,t){if(jQuery.isPlainObject(n)||(n={type:n}),n=jQuery.extend({type:null,execute:"before",target:null,onComplete:null},n),typeof n.type=="undefined"){console.log("ERROR: You must specify event type when calling .on() method of "+this.name);return}if(typeof t=="undefined"){console.log("ERROR: You must specify event handler function when calling .on() method of "+this.name);return}this.handlers.push({event:n,handler:t})},off:function(n,t){var r,u,i;if(jQuery.isPlainObject(n)||(n={type:n}),n=jQuery.extend({},{type:null,execute:"before",target:null,onComplete:null},n),typeof n.type=="undefined"){console.log("ERROR: You must specify event type when calling .off() method of "+this.name);return}typeof t=="undefined"&&(t=null),r=[];for(u in this.handlers)i=this.handlers[u],(i.event.type==n.type||n.type=="*")&&(i.event.target==n.target||n.target==null)&&(i.handler==t||t==null)||r.push(i);this.handlers=r},trigger:function(n){var n=jQuery.extend({type:null,phase:"before",target:null,isStopped:!1,isCancelled:!1},n,{preventDefault:function(){this.isCancelled=!0},stopPropagation:function(){this.isStopped=!0}}),e,t,r,i,f;for(typeof n.target=="undefined"&&(n.target=null),e=this.handlers.length-1;e>=0;e--)if(t=this.handlers[e],(t.event.type==n.type||t.event.type=="*")&&(t.event.target==n.target||t.event.target==null)&&(t.event.execute==n.phase||t.event.execute=="*"||t.event.phase=="*")&&(n=jQuery.extend({},t.event,n),r=[],i=RegExp(/\((.*?)\)/).exec(t.handler),i&&(r=i[1].split(/\s*,\s*/)),r.length==2?t.handler.call(this,n.target,n):t.handler.call(this,n),n.isStopped===!0||n.stop===!0))return n;if(f="on"+n.type.substr(0,1).toUpperCase()+n.type.substr(1),n.phase=="before"&&typeof this[f]=="function"){var u=this[f],r=[],i=RegExp(/\((.*?)\)/).exec(u);if(i&&(r=i[1].split(/\s*,\s*/)),r.length==2?u.call(this,n.target,n):u.call(this,n),n.isStopped===!0||n.stop===!0)return n}if(typeof n.object!="undefined"&&n.object!=null&&n.phase=="before"&&typeof n.object[f]=="function"){var u=n.object[f],r=[],i=RegExp(/\((.*?)\)/).exec(u);if(i&&(r=i[1].split(/\s*,\s*/)),r.length==2?u.call(this,n.target,n):u.call(this,n),n.isStopped===!0||n.stop===!0)return n}return n.phase=="after"&&n.onComplete!=null&&n.onComplete.call(this,n),n}},w2utils.keyboard=function(n){function f(){jQuery(document).on("keydown",e);jQuery(document).on("mousedown",o)}function e(n){var i=n.target.tagName;jQuery.inArray(i,["INPUT","SELECT","TEXTAREA"])==-1&&jQuery(n.target).prop("contenteditable")!="true"&&t&&w2ui[t]&&typeof w2ui[t].keydown=="function"&&w2ui[t].keydown.call(w2ui[t],n)}function o(n){var r=n.target.tagName,i=jQuery(n.target).parents(".w2ui-reset");i.length>0&&(t=i.attr("name"))}function i(n){if(typeof n=="undefined")return t;t=n}function r(){t=null}function u(){}var t=null;return n.active=i,n.clear=r,n.register=u,f(),n}({}),function(n){n.fn.w2render=function(t){n(this).length>0&&(typeof t=="string"&&w2ui[t]&&w2ui[t].render(n(this)[0]),typeof t=="object"&&t.render(n(this)[0]))},n.fn.w2destroy=function(n){!n&&this.length>0&&(n=this.attr("name")),typeof n=="string"&&w2ui[n]&&w2ui[n].destroy(),typeof n=="object"&&n.destroy()},n.fn.w2marker=function(t){return t==""||typeof t=="undefined"?n(this).each(function(n,t){t.innerHTML=t.innerHTML.replace(/\(.*)\<\/span\>/ig,"$1")}):n(this).each(function(n,i){var f,r,u;typeof t=="string"&&(t=[t]),i.innerHTML=i.innerHTML.replace(/\(.*)\<\/span\>/ig,"$1");for(f in t)r=t[f],typeof r!="string"&&(r=String(r)),r=r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&").replace(/&/g,"&").replace(//g,"<"),u=new RegExp(r+"(?!([^<]+)?>)","gi"),i.innerHTML=i.innerHTML.replace(u,function(n){return''+n+""})})},n.fn.w2tag=function(t,i){if(n.isPlainObject(i)||(i={}),n.isPlainObject(i.css)||(i.css={}),typeof i["class"]=="undefined"&&(i["class"]=""),n(this).length==0){n(".w2ui-tag").each(function(t,i){var r=n(i).data("options");typeof r=="undefined"&&(r={}),n(n(i).data("taged-el")).removeClass(r["class"]),clearInterval(n(i).data("timer")),n(i).remove()});return}return n(this).each(function(r,u){var h=u.id,f=w2utils.escapeId(u.id),s,o;if(t==""||t==null||typeof t=="undefined")n("#w2ui-tag-"+f).css("opacity",0),setTimeout(function(){clearInterval(n("#w2ui-tag-"+f).data("timer")),n("#w2ui-tag-"+f).remove()},300);else{clearInterval(n("#w2ui-tag-"+f).data("timer")),n("#w2ui-tag-"+f).remove(),n("body").append('
      0?"w2ui-tag-popup":"")+'" \tstyle="">
      '),s=setInterval(function(){if(n(u).length==0||n(u).offset().left==0&&n(u).offset().top==0){clearInterval(n("#w2ui-tag-"+f).data("timer")),e();return}n("#w2ui-tag-"+f).data("position")!=n(u).offset().left+u.offsetWidth+"x"+n(u).offset().top&&n("#w2ui-tag-"+f).css({"-webkit-transition":".2s","-moz-transition":".2s","-ms-transition":".2s","-o-transition":".2s",left:n(u).offset().left+u.offsetWidth+"px",top:n(u).offset().top+"px"}).data("position",n(u).offset().left+u.offsetWidth+"x"+n(u).offset().top)},100),setTimeout(function(){n(u).offset()&&(n("#w2ui-tag-"+f).css({opacity:"1",left:n(u).offset().left+u.offsetWidth+"px",top:n(u).offset().top+"px"}).html('
      '+t+"
      ").data("text",t).data("taged-el",u).data("options",i).data("position",n(u).offset().left+u.offsetWidth+"x"+n(u).offset().top).data("timer",s),n(u).off("keypress",e).on("keypress",e).off("change",e).on("change",e).css(i.css).addClass(i["class"]),typeof i.onShow=="function"&&i.onShow())},1),o="",n(u).length>0&&(o=n(u)[0].style.cssText);function e(){n("#w2ui-tag-"+f).length<=0||(clearInterval(n("#w2ui-tag-"+f).data("timer")),n("#w2ui-tag-"+f).remove(),n(u).off("keypress",e).removeClass(i["class"]),n(u).length>0&&(n(u)[0].style.cssText=o),typeof i.onHide=="function"&&i.onHide())}}})},n.fn.w2overlay=function(t,i){function e(){var t;(typeof i.onHide=="function"&&(t=i.onHide()),t!==!1)&&(n("#w2ui-overlay").remove(),n(document).off("click",e))}function o(){n(document).on("click",e);if(n("#w2ui-overlay > div").length>0){var u=n("#w2ui-overlay > div").height(),r=n("#w2ui-overlay> div").width(),t=window.innerHeight-n("#w2ui-overlay > div").offset().top-7;u>t&&n("#w2ui-overlay> div").height(t).width(r+w2utils.scrollBarSize()).css({"overflow-y":"auto"}),r=n("#w2ui-overlay> div").width(),t=window.innerWidth-n("#w2ui-overlay > div").offset().left-7,r>t&&n("#w2ui-overlay> div").width(t).css({"overflow-x":"auto"}),typeof i.onShow=="function"&&i.onShow()}}var u,f,r;if(n.isPlainObject(i)||(i={}),n.isPlainObject(i.css)||(i.css={}),this.length==0||t==""||typeof t=="undefined")return e(),n(this);n("#w2ui-overlay").length>0&&n(document).click(),n("body").append('
      0?"w2ui-overlay-popup":"")+'">\t
      '),u=this,r=n("#w2ui-overlay div"),r.css(i.css).html(t),typeof i["class"]!="undefined"&&r.addClass(i["class"]),typeof i.top=="undefined"&&(i.top=0),typeof i.left=="undefined"&&(i.left=0),typeof i.width=="undefined"&&(i.width=100),typeof i.height=="undefined"&&(i.height=0),f=r.css("background-color"),r=n("#w2ui-overlay"),typeof f!="undefined"&&f!="rgba(0, 0, 0, 0)"&&f!="transparent"&&r.css("background-color",f);r.css({display:"none",left:n(u).offset().left+i.left+"px",top:n(u).offset().top+w2utils.getSize(n(u),"height")+3+i.top+"px","min-width":i.width?i.width:"auto","min-height":i.height?i.height:"auto"}).fadeIn("fast").data("position",n(u).offset().left+"x"+(n(u).offset().top+u.offsetHeight)).on("click",function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0});return setTimeout(o,0),n(this)},n.fn.w2menu=function(t,i){function r(){for(var f='',n,i,u,r=0;r ",n.img&&(u=''),n.icon&&(u=''),f+=""+u+"\t";return f+="
      "+n.text+"
      "}return(typeof i.select=="undefined"&&typeof i.onSelect=="function"&&(i.select=i.onSelect),typeof i.select!="function")?(console.log("ERROR: options.select is required to be a function, not "+typeof i.select+" in $().w2menu(menu, options)"),n(this)):n.isArray(t)?(n.fn.w2menuHandler=function(n,r){i.select(t[r],n,r)},n(this).w2overlay(r(),i)):(console.log("ERROR: first parameter should be an array of objects or strings in $().w2menu(menu, options)"),n(this))}}(jQuery),function($){var w2grid=function(n){this.name=null,this.box=null,this.header="",this.url="",this.columns=[],this.columnGroups=[],this.records=[],this.summary=[],this.searches=[],this.searchData=[],this.sortData=[],this.postData={},this.toolbar={},this.show={header:!1,toolbar:!1,footer:!1,columnHeaders:!0,lineNumbers:!1,expandColumn:!1,selectColumn:!1,emptyRecords:!0,toolbarReload:!0,toolbarColumns:!0,toolbarSearch:!0,toolbarAdd:!1,toolbarEdit:!1,toolbarDelete:!1,toolbarSave:!1,selectionBorder:!0,recordTitles:!0},this.autoLoad=!0,this.fixedBody=!0,this.recordHeight=24,this.keyboard=!0,this.selectType="row",this.multiSearch=!0,this.multiSelect=!0,this.multiSort=!0,this.markSearchResults=!0,this.total=0,this.buffered=0,this.limit=100,this.offset=0,this.style="",this.ranges=[],this.onAdd=null,this.onEdit=null,this.onRequest=null,this.onLoad=null,this.onDelete=null,this.onDeleted=null,this.onSave=null,this.onSaved=null,this.onSelect=null,this.onUnselect=null,this.onClick=null,this.onDblClick=null,this.onColumnClick=null,this.onColumnResize=null,this.onSort=null,this.onSearch=null,this.onChange=null,this.onExpand=null,this.onCollapse=null,this.onError=null,this.onKeydown=null,this.onToolbar=null,this.onColumnOnOff=null,this.onCopy=null,this.onPaste=null,this.onSelectionExtend=null,this.onEditField=null,this.onRender=null,this.onRefresh=null,this.onReload=null,this.onResize=null,this.onDestroy=null,this.last={field:"all",caption:w2utils.lang("All Fields"),logic:"OR",search:"",searchIds:[],multi:!1,scrollTop:0,scrollLeft:0,selected:[],sortData:null,sortCount:0,xhr:null,range_start:null,range_end:null,sel_ind:null,sel_col:null,sel_type:null},this.isIOS=navigator.userAgent.toLowerCase().indexOf("iphone")!=-1||navigator.userAgent.toLowerCase().indexOf("ipod")!=-1||navigator.userAgent.toLowerCase().indexOf("ipad")!=-1?!0:!1,$.extend(!0,this,w2obj.grid,n)};$.fn.w2grid=function(n){var i,u,a,r,e,o,s;if(typeof n!="object"&&n){if(w2ui[$(this).attr("name")])return s=w2ui[$(this).attr("name")],s[n].apply(s,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+n+" does not exist on jQuery.w2grid")}else{if(!n||typeof n.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2grid().');return}if(typeof w2ui[n.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+n.name+").");return}if(!w2utils.isAlphaNumeric(n.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}var h=n.columns,l=n.columnGroups,f=n.records,c=n.searches,y=n.searchData,v=n.sortData,w=n.postData,p=n.toolbar,t=new w2grid(n);$.extend(t,{postData:{},records:[],columns:[],searches:[],toolbar:{},sortData:[],searchData:[],handlers:[]}),t.onExpand!=null&&(t.show.expandColumn=!0),$.extend(!0,t.toolbar,p);for(i in h)t.columns[i]=$.extend(!0,{},h[i]);for(i in l)t.columnGroups[i]=$.extend(!0,{},l[i]);for(i in c)t.searches[i]=$.extend(!0,{},c[i]);for(i in y)t.searchData[i]=$.extend(!0,{},y[i]);for(i in v)t.sortData[i]=$.extend(!0,{},v[i]);t.postData=$.extend(!0,{},w);for(u in f){if(f[u].recid==null||typeof f[u].recid=="undefined"){console.log("ERROR: Cannot add records without recid. (obj: "+t.name+")");return}t.records[u]=$.extend(!0,{},f[u])}t.records.length>0&&(t.buffered=t.records.length);for(a in t.columns)(r=t.columns[a],typeof r.searchable!="undefined"&&t.getSearch(r.field)==null)&&(e=r.searchable,o="",r.searchable===!0&&(e="text",o='size="20"'),t.addSearch({field:r.field,caption:r.caption,type:e,attr:o}));return t.initToolbar(),$(this).length!=0&&t.render($(this)[0]),w2ui[t.name]=t,t}},w2grid.prototype={msgDelete:w2utils.lang("Are you sure you want to delete selected records?"),msgNotJSON:w2utils.lang("Returned data is not in valid JSON format."),msgRefresh:w2utils.lang("Refreshing..."),buttons:{reload:{type:"button",id:"reload",img:"icon-reload",hint:w2utils.lang("Reload data in the list")},columns:{type:"drop",id:"column-on-off",img:"icon-columns",hint:w2utils.lang("Show/hide columns"),arrow:!1,html:""},search:{type:"html",id:"search",html:'
      "},"search-go":{type:"check",id:"search-advanced",caption:w2utils.lang("Search..."),hint:w2utils.lang("Open Search Fields")},add:{type:"button",id:"add",caption:w2utils.lang("Add New"),hint:w2utils.lang("Add new record"),img:"icon-add"},edit:{type:"button",id:"edit",caption:w2utils.lang("Edit"),hint:w2utils.lang("Edit selected record"),img:"icon-edit",disabled:!0},"delete":{type:"button",id:"delete",caption:w2utils.lang("Delete"),hint:w2utils.lang("Delete selected records"),img:"icon-delete",disabled:!0},save:{type:"button",id:"save",caption:w2utils.lang("Save"),hint:w2utils.lang("Save changed records"),img:"icon-save"}},add:function(n){var i,t,r;$.isArray(n)||(n=[n]),i=0;for(t in n){if(n[t].recid==null||typeof n[t].recid=="undefined"){console.log("ERROR: Cannot add record without recid. (obj: "+this.name+")");continue}this.records.push(n[t]),i++}return this.buffered=this.records.length,r=typeof this.url!="object"?this.url:this.url.get,r||(this.localSort(),this.localSearch()),this.refresh(),i},find:function(n,t){var f,i,u,r,e;for((typeof n=="undefined"||n==null)&&(n={}),f=[],i=0;i0&&!o)for(f in this.last.searchIds)this.last.searchIds[f]==r&&(r=f);$(u).replaceWith(this.getRecordHTML(r,s))}}return!0},get:function(n,t){for(var i=0;i=0;n--)this.records[n].recid==arguments[t]&&(this.records.splice(n,1),r++);return i=typeof this.url!="object"?this.url:this.url.get,i||(this.buffered=this.records.length,this.localSort(),this.localSearch()),this.refresh(),r},addColumn:function(n,t){var r=0,i;arguments.length==1?(t=n,n=this.columns.length):(typeof n=="string"&&(n=this.getColumn(n,!0)),n===null&&(n=this.columns.length)),$.isArray(t)||(t=[t]);for(i in t)this.columns.splice(n,0,t[i]),n++,r++;return this.initColumnOnOff(),this.refresh(),r},removeColumn:function(){for(var i=0,n,t=0;t=0;n--)this.columns[n].field==arguments[t]&&(this.columns.splice(n,1),i++);return this.initColumnOnOff(),this.refresh(),i},getColumn:function(n,t){for(var i=0;i=0;n--)this.columns[n].field==arguments[t]&&(this.columns[n].hidden=!this.columns[n].hidden,i++);return this.refresh(),i},showColumn:function(){for(var i=0,n,t=0;t=0;n--)this.columns[n].field==arguments[t]&&this.columns[n].hidden!==!1&&(this.columns[n].hidden=!1,i++);return this.refresh(),i},hideColumn:function(){for(var i=0,n,t=0;t=0;n--)this.columns[n].field==arguments[t]&&this.columns[n].hidden!==!0&&(this.columns[n].hidden=!0,i++);return this.refresh(),i},addSearch:function(n,t){var r=0,i;arguments.length==1?(t=n,n=this.searches.length):(typeof n=="string"&&(n=this.getSearch(n,!0)),n===null&&(n=this.searches.length)),$.isArray(t)||(t=[t]);for(i in t)this.searches.splice(n,0,t[i]),n++,r++;return this.searchClose(),r},removeSearch:function(){for(var i=0,n,t=0;t=0;n--)this.searches[n].field==arguments[t]&&(this.searches.splice(n,1),i++);return this.searchClose(),i},getSearch:function(n,t){for(var i=0;i=0;n--)this.searches[n].field==arguments[t]&&(this.searches[n].hidden=!this.searches[n].hidden,i++);return this.searchClose(),i},showSearch:function(){for(var i=0,n,t=0;t=0;n--)this.searches[n].field==arguments[t]&&this.searches[n].hidden!==!1&&(this.searches[n].hidden=!1,i++);return this.searchClose(),i},hideSearch:function(){for(var i=0,n,t=0;t=0;n--)this.searches[n].field==arguments[t]&&this.searches[n].hidden!==!0&&(this.searches[n].hidden=!0,i++);return this.searchClose(),i},getSearchData:function(n){for(var t in this.searchData)if(this.searchData[t].field==n)return this.searchData[t];return null},localSort:function(n){var r=typeof this.url!="object"?this.url:this.url.get,i,t;if(r){console.log("ERROR: grid.localSort can only be used on local data source, grid.url should be empty.");return}if(!$.isEmptyObject(this.sortData))return i=+new Date,t=this,this.records.sort(function(n,i){var e=0,f,r,u;for(f in t.sortData)if(r=n[t.sortData[f].field],u=i[t.sortData[f].field],String(t.sortData[f].field).indexOf(".")!=-1&&(r=t.parseField(n,t.sortData[f].field),u=t.parseField(i,t.sortData[f].field)),typeof r=="string"&&(r=$.trim(r.toLowerCase())),typeof u=="string"&&(u=$.trim(u.toLowerCase())),r>u&&(e=t.sortData[f].direction=="asc"?1:-1),r0&&!a){this.total=0;for(l in this.records){s=this.records[l],u=0;for(v in this.searchData)if(i=this.searchData[v],t=this.getSearch(i.field),i!=null){t==null&&(t={field:i.field,type:i.type}),f=String(c.parseField(s,t.field)).toLowerCase(),typeof i.value!="undefined"&&($.isArray(i.value)?(r=i.value[0],e=i.value[1]):r=String(i.value).toLowerCase());switch(i.operator){case"is":s[t.field]==i.value&&u++,t.type=="date"&&(o=new Date(Number(f)),f=+new Date(o.getFullYear(),o.getMonth(),o.getDate()),r=Number(r),e=Number(f)+864e5,r>=f&&r<=e&&u++);break;case"between":t.type=="int"&&parseInt(s[t.field])>=parseInt(r)&&parseInt(s[t.field])<=parseInt(e)&&u++,t.type=="float"&&parseFloat(s[t.field])>=parseFloat(r)&&parseFloat(s[t.field])<=parseFloat(e)&&u++,t.type=="date"&&(o=new Date(Number(e)),e=+new Date(o.getFullYear(),o.getMonth(),o.getDate()),e=Number(e)+864e5,f>=r&&f=0&&u++;break;case"ends with":f.indexOf(r)==f.length-r.length&&u++}}(this.last.logic=="OR"&&u!=0||this.last.logic=="AND"&&u==this.searchData.length)&&this.last.searchIds.push(parseInt(l))}this.total=this.last.searchIds.length}return this.buffered=this.total,h=+new Date-h,n!==!0&&setTimeout(function(){c.status("Search took "+h/1e3+" sec")},10),h},getRangeData:function(n,t){var o=this.get(n[0].recid,!0),c=this.get(n[1].recid,!0),s=n[0].column,h=n[1].column,r=[],u,f,i,e;if(s==h)for(u=o;u<=c;u++)f=this.records[u],e=f[this.columns[s].field]||null,t!==!0?r.push(e):r.push({data:e,column:s,index:u,record:f});else if(o==c)for(f=this.records[o],i=s;i<=h;i++)e=f[this.columns[i].field]||null,t!==!0?r.push(e):r.push({data:e,column:i,index:o,record:f});else for(u=o;u<=c;u++)for(f=this.records[u],r.push([]),i=s;i<=h;i++)e=f[this.columns[i].field],t!==!0?r[r.length-1].push(e):r[r.length-1].push({data:e,column:i,index:u,record:f});return r},addRange:function(n){var o=0,t,u,e,f,s;if(this.selectType=="row")return o;$.isArray(n)||(n=[n]);for(t in n){if(typeof n[t]!="object"&&(n[t]={name:"selection"}),n[t].name=="selection"){if(this.show.selectionBorder===!1)continue;if(u=this.getSelection(),u.length==0){this.removeRange(n[t].name);continue}else var i=u[0],r=u[u.length-1],c=$("#grid_"+this.name+"_rec_"+i.recid+" td[col="+i.column+"]"),h=$("#grid_"+this.name+"_rec_"+r.recid+" td[col="+r.column+"]")}else var i=n[t].range[0],r=n[t].range[1],c=$("#grid_"+this.name+"_rec_"+i.recid+" td[col="+i.column+"]"),h=$("#grid_"+this.name+"_rec_"+r.recid+" td[col="+r.column+"]");if(i){e={name:n[t].name,range:[{recid:i.recid,column:i.column},{recid:r.recid,column:r.column}],style:n[t].style||""},f=!1;for(s in this.ranges)if(this.ranges[s].name==n[t].name){f=t;break}f!==!1?this.ranges[f]=e:this.ranges.push(e),o++}}return this.refreshRanges(),o},removeRange:function(){for(var r=0,i,n,t=0;t=0;n--)this.ranges[n].name==i&&(this.ranges.splice(n,1),r++);return r},refreshRanges:function(){function l(t){var i=n.getSelection();n.last.move={type:"expand",x:t.screenX,y:t.screenY,divX:0,divY:0,recid:i[0].recid,column:i[0].column,originalRange:[{recid:i[0].recid,column:i[0].column},{recid:i[i.length-1].recid,column:i[i.length-1].column}],newRange:[{recid:i[0].recid,column:i[0].column},{recid:i[i.length-1].recid,column:i[i.length-1].column}]};$(document).off("mousemove",f).on("mousemove",f);$(document).off("mouseup",e).on("mouseup",e)}function f(t){var r=n.last.move,e,o,u,f;if(r&&r.type=="expand"&&(r.divX=t.screenX-r.x,r.divY=t.screenY-r.y,u=t.originalEvent.target,u.tagName!="TD"&&(u=$(u).parents("td")[0]),typeof $(u).attr("col")!="undefined"&&(o=parseInt($(u).attr("col"))),u=$(u).parents("tr")[0],e=$(u).attr("recid"),r.newRange[1].recid!=e||r.newRange[1].column!=o)){if(f=$.extend({},r.newRange),r.newRange=[{recid:r.recid,column:r.column},{recid:e,column:o}],i=n.trigger($.extend(i,{originalRange:r.originalRange,newRange:r.newRange})),i.isCancelled===!0){r.newRange=f,i.newRange=f;return}n.removeRange("grid-selection-expand"),n.addRange({name:"grid-selection-expand",range:i.newRange,style:"background-color: rgba(100,100,100,0.1); border: 2px dotted rgba(100,100,100,0.5);"})}}function e(){n.removeRange("grid-selection-expand"),delete n.last.move,$(document).off("mousemove",f),$(document).off("mouseup",e),n.trigger($.extend(i,{phase:"after"}))}var n=this,a=+new Date,o=$("#grid_"+this.name+"_records"),c,i;for(c in this.ranges){var t=this.ranges[c],h=t.range[0],s=t.range[1],r=$("#grid_"+this.name+"_rec_"+h.recid+" td[col="+h.column+"]"),u=$("#grid_"+this.name+"_rec_"+s.recid+" td[col="+s.column+"]");$("#grid_"+this.name+"_"+t.name).length==0?o.append('
      '+(t.name=="selection"?'
      ':"")+"
      "):$("#grid_"+this.name+"_"+t.name).attr("style",t.style),r.length>0&&u.length>0&&$("#grid_"+this.name+"_"+t.name).css({left:r.position().left-1+o.scrollLeft()+"px",top:r.position().top-1+o.scrollTop()+"px",width:u.position().left-r.position().left+u.width()+3+"px",height:u.position().top-r.position().top+u.height()+3+"px"})}$(this.box).find("#grid_"+this.name+"_resizer").off("mousedown").on("mousedown",l);return i={phase:"before",type:"selectionExtend",target:n.name,originalRange:null,newRange:null},+new Date-a},select:function(){for(var s=0,r,o,e,f,u,i=0;i td[col="+r+"]").addClass("w2ui-selected"),s++,n.selected&&($("#grid_"+this.name+"_rec_"+w2utils.escapeId(t)).data("selected","yes"),$("#grid_"+this.name+"_cell_"+h+"_select_check").prop("checked",!0))}this.trigger($.extend(u,{phase:"after"}))}}return $("#grid_"+this.name+"_check_all").prop("checked",!0),$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length!=0&&$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length==$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]:checked").length?$("#grid_"+this.name+"_check_all").prop("checked",!0):$("#grid_"+this.name+"_check_all").prop("checked",!1),this.status(),this.addRange("selection"),s},unselect:function(){for(var s=0,f,i,h,o,r,e,t=0;t td[col="+i+"]").removeClass("w2ui-selected"),s++,r.length==0&&(n.selected=!1,$("#grid_"+this.name+"_rec_"+w2utils.escapeId(u)).removeData("selected"),$("#grid_"+this.name+"_cell_"+c+"_select_check").prop("checked",!1))}this.trigger($.extend(e,{phase:"after"}))}}return $("#grid_"+this.name+"_check_all").prop("checked",!0),$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length!=0&&$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length==$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]:checked").length?$("#grid_"+this.name+"_check_all").prop("checked",!0):$("#grid_"+this.name+"_check_all").prop("checked",!1),this.status(),this.addRange("selection"),s},selectAll:function(){var r,n,u,f,t,i;if(this.multiSelect!==!1&&(r=this.trigger({phase:"before",type:"select",target:this.name,all:!0}),r.isCancelled!==!0)){n=[];for(u in this.columns)n.push(parseInt(u));if(f=typeof this.url!="object"?this.url:this.url.get,f)this.selectType=="row"?this.set({selected:!0}):this.set({selected:!0,selectedColumns:n.slice()}),this.refresh();else if(this.searchData.length==0)this.set({selected:!0}),this.selectType=="row"?this.set({selected:!0}):this.set({selected:!0,selectedColumns:n.slice()});else{for(t=0;t=1?this.toolbar.enable("delete"):this.toolbar.disable("delete"),this.addRange("selection"),this.trigger($.extend(r,{phase:"after"}))}},selectNone:function(){var f=this.trigger({phase:"before",type:"unselect",target:this.name,all:!0}),r,n,t,i,u;if(f.isCancelled!==!0){this.last.selected=[];for(r in this.records)if(n=this.records[r],n.selected===!0&&(n.selected=!1,t=$("#grid_"+this.name+"_rec_"+w2utils.escapeId(n.recid)),t.removeClass("w2ui-selected").removeData("selected"),$("#grid_"+this.name+"_cell_"+r+"_select_check").prop("checked",!1),this.selectType!="row")){i=n.selectedColumns;for(u in i)t.find(" > td[col="+i[u]+"]").removeClass("w2ui-selected");n.selectedColumns=[]}this.toolbar.disable("edit","delete"),this.removeRange("selection"),this.trigger($.extend(f,{phase:"after"}))}},getSelection:function(n){var t,i,r,u,f;if(this.selectType=="row"){t=this.find({selected:!0},!0),i=[];for(r in t)n===!0?i.push(t[r]):i.push(this.records[t[r]].recid);return i}t=this.find({selected:!0},!0),i=[];for(r in t){u=this.records[t[r]];for(f in u.selectedColumns)i.push({recid:u.recid,index:parseInt(t[r]),column:u.selectedColumns[f]})}return i},search:function(n,t){var it=this,nt=typeof this.url!="object"?this.url:this.url.get,u=[],v=this.last.multi,a=this.last.logic,g=this.last.field,p=this.last.search,f,d,h,s,c,r,o,k,b,i,y;if(arguments.length==0){p="";for(f in this.searches){var i=this.searches[f],l=$("#grid_"+this.name+"_operator_"+f).val(),e=$("#grid_"+this.name+"_field_"+f).val(),w=$("#grid_"+this.name+"_field2_"+f).val();if(e!=""&&e!=null||typeof w!="undefined"&&w!=""){r={field:i.field,type:i.type,operator:l},l=="between"?$.extend(r,{value:[e,w]}):l=="in"?$.extend(r,{value:e.split(",")}):$.extend(r,{value:e});try{i.type=="date"&&l=="between"&&(r.value[0]=w2utils.isDate(e,w2utils.settings.date_format,!0).getTime(),r.value[1]=w2utils.isDate(w,w2utils.settings.date_format,!0).getTime()),i.type=="date"&&l=="is"&&(r.value=w2utils.isDate(e,w2utils.settings.date_format,!0).getTime())}catch(tt){}u.push(r)}}u.length>0&&!nt?(v=!0,a="AND"):(v=!0,a="AND")}if(typeof n=="string"&&(g=n,p=t,v=!1,a="OR",typeof t!="undefined"))if(n.toLowerCase()=="all")if(this.searches.length>0)for(f in this.searches)i=this.searches[f],(i.type=="text"||i.type=="int"&&w2utils.isInt(t)||i.type=="float"&&w2utils.isFloat(t)||i.type=="money"&&w2utils.isMoney(t)||i.type=="hex"&&w2utils.isHex(t)||i.type=="date"&&w2utils.isDate(t)||i.type=="alphaNumeric"&&w2utils.isAlphaNumeric(t))&&(r={field:i.field,type:i.type,operator:i.type=="text"?"contains":"is",value:t},u.push(r)),i.type=="int"&&String(t).indexOf("-")!=-1&&(c=String(t).split("-"),r={field:i.field,type:i.type,operator:"between",value:[c[0],c[1]]},u.push(r));else for(d in this.columns)r={field:this.columns[d].field,type:"text",operator:"contains",value:t},u.push(r);else if(i=this.getSearch(n),i==null&&(i={field:n,type:"text"}),i.field==n&&(this.last.caption=i.caption),t!=""){if(h="contains",s=t,w2utils.isInt(t)&&(h="is",s=t),i.type=="int"&&t!=""&&(String(t).indexOf("-")!=-1&&(r=t.split("-"),r.length==2&&(h="between",s=[parseInt(r[0]),parseInt(r[1])])),String(t).indexOf(",")!=-1)){r=t.split(","),h="in",s=[];for(c in r)s.push(r[c])}r={field:i.field,type:i.type,operator:h,value:s},u.push(r)}if($.isArray(n)){o="AND",typeof t=="string"&&(o=t.toUpperCase(),o!="OR"&&o!="AND"&&(o="AND")),p="",v=!0,a=o;for(k in n)b=n[k],i=this.getSearch(b.field),i==null&&(i={type:"text",operator:"contains"}),u.push($.extend(!0,{},i,b))}(y=this.trigger({phase:"before",type:"search",target:this.name,searchData:u,searchField:n?n:"multi",searchValue:t?t:"multi"}),y.isCancelled!==!0)&&(this.searchData=y.searchData,this.last.field=g,this.last.search=p,this.last.multi=v,this.last.logic=a,this.last.scrollTop=0,this.last.scrollLeft=0,this.last.selected=[],this.searchClose(),this.set({expanded:!1}),nt?(this.last.xhr_offset=0,this.reload()):(this.localSearch(),this.refresh()),this.trigger($.extend(y,{phase:"after"})))},searchOpen:function(){if(this.box&&this.searches.length!=0){var n=this;$("#tb_"+this.name+"_toolbar_item_search-advanced").w2overlay(this.getSearchesHTML(),{left:-10,"class":"w2ui-grid-searches",onShow:function(){n.last.logic=="OR"&&(n.searchData=[]),n.initSearches(),$("#w2ui-overlay .w2ui-grid-searches").data("grid-name",n.name);var t=$("#w2ui-overlay .w2ui-grid-searches *[rel=search]");t.length>0&&t[0].focus()}})}},searchClose:function(){this.box&&this.searches.length!=0&&(this.toolbar&&this.toolbar.uncheck("search-advanced"),$("#w2ui-overlay .w2ui-grid-searches").length>0&&$().w2overlay())},searchShowFields:function(n){var r,i,t;for(typeof n=="undefined"&&(n=$("#grid_"+this.name+"_search_all")),r='
      ',i=-1;i"}r+="
      "+t.caption+"
      ",$(n).w2overlay(r,{left:-15,top:7})},searchReset:function(n){var t=this.trigger({phase:"before",type:"search",target:this.name,searchData:[]});t.isCancelled!==!0&&(this.searchData=[],this.last.search="",this.last.logic="OR",this.last.multi&&(this.multiSearch?(this.last.field="all",this.last.caption=w2utils.lang("All Fields")):(this.last.field=this.searches[0].field,this.last.caption=this.searches[0].caption)),this.last.multi=!1,this.last.xhr_offset=0,this.last.scrollTop=0,this.last.scrollLeft=0,this.last.selected=[],this.searchClose(),n||this.reload(),this.trigger($.extend(t,{phase:"after"})))},clear:function(n){this.offset=0,this.total=0,this.buffered=0,this.records=[],this.summary=[],this.last.scrollTop=0,this.last.scrollLeft=0,this.last.range_start=null,this.last.range_end=null,this.last.xhr_offset=0,n||this.refresh()},reset:function(n){this.offset=0,this.last.scrollTop=0,this.last.scrollLeft=0,this.last.selected=[],this.last.range_start=null,this.last.range_end=null,this.last.xhr_offset=0,this.searchReset(n),this.last.sortData!=null&&(this.sortData=this.last.sortData),this.set({selected:!1,expanded:!1},!0),n||this.refresh()},skip:function(n){var t=typeof this.url!="object"?this.url:this.url.get;t?(this.offset=parseInt(n),(this.offset<0||!w2utils.isInt(this.offset))&&(this.offset=0),this.offset>this.total&&(this.offset=this.total-this.limit),this.records=[],this.buffered=0,this.last.xhr_offset=0,this.last.pull_more=!0,this.last.scrollTop=0,this.last.scrollLeft=0,$("#grid_"+this.name+"_records").prop("scrollTop",0),this.initColumnOnOff(),this.reload()):console.log("ERROR: grid.skip() can only be called when you have remote data source.")},load:function(n,t){if(typeof n=="undefined"){console.log('ERROR: You need to provide url argument when calling .load() method of "'+this.name+'" object.');return}this.request("get-records",{},n,t)},reload:function(n){var t=typeof this.url!="object"?this.url:this.url.get;t?(this.last.xhr_offset>0&&this.last.xhr_offset div"),o.type=="enum"&&console.log("ERROR: Grid's inline editing does not support enum field type."),(o.type=="list"||o.type=="select")&&console.log("ERROR: Grid's inline editing does not support list/select field type."),typeof o.inTag=="undefined"&&(o.inTag=""),typeof o.outTag=="undefined"&&(o.outTag=""),typeof o.style=="undefined"&&(o.style=""),typeof o.items=="undefined"&&(o.items=[]),h=f.changed&&f.changes[e.field]?w2utils.stripTags(f.changes[e.field]):w2utils.stripTags(f[e.field]),(h==null||typeof h=="undefined")&&(h=""),typeof i!="undefined"&&i!=null&&(h=i),v=typeof e.style!="undefined"?e.style+";":"",$.inArray(e.render,["number","int","float","money","percent"])!=-1&&(v+="text-align: right;"),c.addClass("w2ui-editable").html('"+o.outTag);c.find("input").w2field(o.type).on("blur",function(){if(u.parseField(f,e.field)!=this.value){var r=u.trigger({phase:"before",type:"change",target:u.name,input_id:this.id,recid:n,column:t,value_new:this.value,value_previous:f.changes?f.changes[e.field]:u.parseField(f,e.field),value_original:u.parseField(f,e.field)});r.isCancelled===!0||(f.changed=!0,f.changes=f.changes||{},f.changes[e.field]=r.value_new,u.trigger($.extend(r,{phase:"after"})))}else f.changes&&delete f.changes[e.field],$.isEmptyObject(f.changes)&&delete f.changes;$(a).replaceWith(u.getRecordHTML(s,a.attr("line")))}).on("keydown",function(i){function a(n){var t=n+1;return u.columns.length==t?n:u.columns[t].hidden?a(t):t}function v(n){var t=n-1;return t<0?n:u.columns[t].hidden?v(t):t}function c(n){var t=n+1;return u.records.length==t?n:t}function l(n){var t=n-1;return t<0?n:t}var o=!1,r,h;switch(i.keyCode){case 9:o=!0,r=i.shiftKey?v(t):a(t),r!=t&&(this.blur(),setTimeout(function(){u.selectType!="row"?(u.selectNone(),u.select({recid:n,column:r})):u.editField(n,r,null,i)},1));break;case 13:o=!0,r=i.shiftKey?l(s):c(s),r!=s&&(this.blur(),setTimeout(function(){u.selectType!="row"?(u.selectNone(),u.select({recid:u.records[r].recid,column:t})):u.editField(u.records[r].recid,t,null,i)},1));break;case 38:o=!0,r=l(s),r!=s&&(this.blur(),setTimeout(function(){u.selectType!="row"?(u.selectNone(),u.select({recid:u.records[r].recid,column:t})):u.editField(u.records[r].recid,t,null,i)},1));break;case 40:o=!0,r=c(s),r!=s&&(this.blur(),setTimeout(function(){u.selectType!="row"?(u.selectNone(),u.select({recid:u.records[r].recid,column:t})):u.editField(u.records[r].recid,t,null,i)},1));break;case 27:h=f.changed&&f.changes[e.field]?f.changes[e.field]:u.parseField(f,e.field),this.value=typeof h!="undefined"?h:"",this.blur(),setTimeout(function(){u.select({recid:n,column:t})},1)}o&&i.preventDefault&&i.preventDefault()});typeof i=="undefined"||i==null?c.find("input").focus():c.find("input").val("").focus().val(i),u.trigger($.extend(l,{phase:"after"}))}},"delete":function(n){var o=this,f=this.trigger({phase:"before",target:this.name,type:"delete",force:n}),t,e,u,r,i;if(f.isCancelled===!0)return!1;if(n=f.force,t=this.getSelection(),t.length!=0){if(this.msgDelete!=""&&!n){w2confirm(o.msgDelete,w2utils.lang("Delete Confirmation"),function(n){n=="Yes"&&w2ui[o.name].delete(!0)});return}if(e=typeof this.url!="object"?this.url:this.url.remove,e)this.request("delete-records");else if(typeof t[0]!="object")this.remove.apply(this,t);else{for(u in t)r=this.columns[t[u].column].field,i=this.get(t[u].recid,!0),i!=null&&r!="recid"&&(this.records[i][r]="",this.records[i].changed&&(this.records[i].changes[r]=""));this.refresh()}this.trigger($.extend(f,{phase:"after"}))}},click:function(n,t){var g=+new Date,i=null,b,c,nt,f,r,p,y,a,h,s,v,u,tt,e,k,o;if(typeof n=="object"&&(i=n.column,n=n.recid),w2utils.isInt(n)&&(n=parseInt(n)),typeof t=="undefined"&&(t={}),g-parseInt(this.last.click_time)<250&&t.type=="click"){this.dblClick(n,t);return}if(this.last.click_time=g,i==null&&t.target&&(u=t.target,u.tagName!="TD"&&(u=$(u).parents("td")[0]),typeof $(u).attr("col")!="undefined"&&(i=parseInt($(u).attr("col")))),b=this.trigger({phase:"before",target:this.name,type:"click",recid:n,column:i,originalEvent:t}),b.isCancelled===!0)return!1;c=$("#grid_"+this.name+"_rec_"+w2utils.escapeId(n)).parents("tr"),c.length>0&&String(c.attr("id")).indexOf("expanded_row")!=-1&&(nt=c.parents(".w2ui-grid").attr("name"),w2ui[nt].selectNone(),c.parents(".w2ui-grid").find(".w2ui-expanded-row .w2ui-grid").each(function(n,t){var i=$(t).attr("name");w2ui[i]&&w2ui[i].selectNone()})),$(this.box).find(".w2ui-expanded-row .w2ui-grid").each(function(n,t){var i=$(t).attr("name");w2ui[i]&&w2ui[i].selectNone()}),f=this,r=this.getSelection(),$("#grid_"+this.name+"_check_all").prop("checked",!1);var d=this.get(n,!0),l=this.records[d],w=[];if(f.last.sel_ind=d,f.last.sel_col=i,f.last.sel_recid=n,f.last.sel_type="click",t.shiftKey&&r.length>0){if(r[0].recid)for(h=this.get(r[0].recid,!0),s=this.get(n,!0),i>r[0].column?(p=r[0].column,y=i):(p=i,y=r[0].column),a=p;a<=y;a++)w.push(a);else h=this.get(r[0],!0),s=this.get(n,!0);for(v=[],h>s&&(u=h,h=s,s=u),tt=typeof this.url!="object"?this.url:this.url.get,e=h;e<=s;e++)if(!(this.searchData.length>0)||tt||$.inArray(e,this.last.searchIds)!=-1)if(this.selectType=="row")v.push(this.records[e].recid);else for(k in w)v.push({recid:this.records[e].recid,column:w[k]});this.select.apply(this,v)}else(t.ctrlKey||t.shiftKey||t.metaKey)&&this.multiSelect||this.showSelectColumn?(o=l.selected,this.selectType!="row"&&$.inArray(i,l.selectedColumns)==-1&&(o=!1),o===!0?this.unselect({recid:n,column:i}):this.select({recid:l.recid,column:i}),setTimeout(function(){window.getSelection&&window.getSelection().removeAllRanges()},10)):(o=l.selected,this.selectType!="row"&&$.inArray(i,l.selectedColumns)==-1&&(o=!1),r.length>300?this.selectNone():this.unselect.apply(this,r),o===!0?this.unselect({recid:n,column:i}):this.select({recid:n,column:i}));this.status(),f.last.selected=this.getSelection(),f.initResize(),this.trigger($.extend(b,{phase:"after"}))},columnClick:function(n,t){var i=this.trigger({phase:"before",type:"columnClick",target:this.name,field:n,originalEvent:t});if(i.isCancelled===!0)return!1;this.sort(n,null,t&&(t.ctrlKey||t.metaKey)?!0:!1),this.trigger($.extend(i,{phase:"after"}))},keydown:function(n){function st(n){if(n+10&&n0)for(;;){if($.inArray(n,t.last.searchIds)!=-1||n>t.records.length)break;n++}return n}return null}function ht(n){if(n>0&&t.last.searchIds.length==0||t.last.searchIds.length>0&&n>t.last.searchIds[0]){if(n--,t.last.searchIds.length>0)for(;;){if($.inArray(n,t.last.searchIds)!=-1||n<0)break;n--}return n}return null}function et(n){var i=n+1;return t.columns.length==i?n:t.columns[i].hidden?findNext(i):i}function ot(n){var i=n-1;return i<0?n:t.columns[i].hidden?findPrev(i):i}function g(){if(t.last.sel_type!="click")return!1;if(t.selectType!="row"){if(t.last.sel_type="key",i.length>1){for(var n in i)if(i[n].recid==t.last.sel_recid&&i[n].column==t.last.sel_col){i.splice(n,1);break}return t.unselect.apply(t,i),!0}return!1}return(t.last.sel_type="key",i.length>1)?(i.splice(i.indexOf(t.records[t.last.sel_ind].recid),1),t.unselect.apply(t,i),!0):!1}var t=this,it,b,i,c,y,d,a,v,h,l,f,o,rt,e,u;if(t.keyboard===!0){if(it=t.trigger({phase:"before",type:"keydown",target:t.name,originalEvent:n}),it.isCancelled===!0)return!1;if(i=t.getSelection(),i.length!=0){var ct=$("#grid_"+t.name+"_records"),f=i[0],r=[],ft=i[i.length-1];if(typeof f=="object"){for(f=i[0].recid,r=[],b=0;;){if(!i[b]||i[b].recid!=f)break;r.push(i[b].column),b++}ft=i[i.length-1].recid}var p=t.get(f,!0),w=t.get(ft,!0),ut=t.get(f),k=$("#grid_"+t.name+"_rec_"+w2utils.escapeId(t.records[p].recid)),s=!1;switch(n.keyCode){case 8:case 46:t.delete(),s=!0,n.stopPropagation();break;case 27:i=t.getSelection(),t.selectNone(),i.length>0&&(typeof i[0]=="object"?t.select({recid:i[0].recid,column:i[0].column}):t.select(i[0])),s=!0;break;case 13:case 32:r.length==0&&r.push(0),t.editField(f,r[0],null,n),s=!0;break;case 65:if(!n.metaKey&&!n.ctrlKey)break;t.selectAll(),s=!0;break;case 70:if(!n.metaKey&&!n.ctrlKey)break;$("#grid_"+t.name+"_search_all").focus(),s=!0;break;case 13:if(this.selectType=="row"){if(k.length<=0||t.show.expandColumn!==!0)break;t.toggle(f,n),s=!0}else r.length==0&&r.push(0),t.editField(f,r[0],null,n),s=!0;break;case 37:if(l=$("#grid_"+this.name+"_rec_"+w2utils.escapeId(t.records[p].recid)).parents("tr"),l.length>0&&String(l.attr("id")).indexOf("expanded_row")!=-1){f=l.prev().attr("recid"),o=l.parents(".w2ui-grid").attr("name"),t.selectNone(),w2utils.keyboard.active(o),w2ui[o].set(f,{expanded:!1}),w2ui[o].collapse(f),w2ui[o].click(f),s=!0;break}if(this.selectType=="row"){if(k.length<=0||ut.expanded!==!0)break;t.set(f,{expanded:!1},!0),t.collapse(f,n)}else if(c=ot(r[0]),c!=r[0])if(n.shiftKey){if(g())return;var u=[],tt=[],nt=[];if(r.indexOf(this.last.sel_col)==0&&r.length>1)for(e in i)u.indexOf(i[e].recid)==-1&&u.push(i[e].recid),nt.push({recid:i[e].recid,column:r[r.length-1]});else for(e in i)u.indexOf(i[e].recid)==-1&&u.push(i[e].recid),tt.push({recid:i[e].recid,column:c});t.unselect.apply(t,nt),t.select.apply(t,tt)}else t.click({recid:f,column:c},n);else if(!n.shiftKey)for(h=1;h1)for(e in i)u.indexOf(i[e].recid)==-1&&u.push(i[e].recid),nt.push({recid:i[e].recid,column:r[0]});else for(e in i)u.indexOf(i[e].recid)==-1&&u.push(i[e].recid),tt.push({recid:i[e].recid,column:a});t.unselect.apply(t,nt),t.select.apply(t,tt)}else t.click({recid:f,column:a},n);else if(!n.shiftKey)for(h=0;h0&&w2ui[y.attr("name")])){t.selectNone(),o=y.attr("name"),d=w2ui[o].records,w2utils.keyboard.active(o),w2ui[o].click(d[d.length-1].recid),s=!0;break}if(n.shiftKey){if(g())return;if(t.selectType=="row")t.last.sel_ind>c&&t.last.sel_ind!=w?t.unselect(t.records[w].recid):t.select(t.records[c].recid);else if(t.last.sel_ind>c&&t.last.sel_ind!=w){c=w,u=[];for(v in r)u.push({recid:t.records[c].recid,column:r[v]});t.unselect.apply(t,u)}else{u=[];for(v in r)u.push({recid:t.records[c].recid,column:r[v]});t.select.apply(t,u)}}else t.selectNone(),t.click({recid:t.records[c].recid,column:r[0]},n);t.scrollIntoView(c),n.preventDefault&&n.preventDefault()}else{if(!n.shiftKey)for(h=1;h0&&String(l.attr("id")).indexOf("expanded_row")!=-1){f=l.prev().attr("recid"),o=l.parents(".w2ui-grid").attr("name"),t.selectNone(),w2utils.keyboard.active(o),w2ui[o].click(f),s=!0;break}}break;case 40:if(k.length<=0)break;if(t.records[w].expanded&&(y=$("#grid_"+this.name+"_rec_"+w2utils.escapeId(t.records[w].recid)+"_expanded_row").find(".w2ui-grid"),y.length>0&&w2ui[y.attr("name")])){t.selectNone(),o=y.attr("name"),d=w2ui[o].records,w2utils.keyboard.active(o),w2ui[o].click(d[0].recid),s=!0;break}if(a=st(w),a!=null){if(n.shiftKey){if(g())return;if(t.selectType=="row")this.last.sel_ind0&&String(l.attr("id")).indexOf("expanded_row")!=-1){f=l.next().attr("recid"),o=l.parents(".w2ui-grid").attr("name"),t.selectNone(),w2utils.keyboard.active(o),w2ui[o].click(f),s=!0;break}}break;case 86:(n.ctrlKey||n.metaKey)&&($("body").append(''),$("#_tmp_copy_data").focus(),setTimeout(function(){t.paste($("#_tmp_copy_data").val()),$("#_tmp_copy_data").remove()},50));break;case 88:(n.ctrlKey||n.metaKey)&&setTimeout(function(){t.delete(!0)},100);case 67:(n.ctrlKey||n.metaKey)&&(rt=t.copy(),$("body").append('"),$("#_tmp_copy_data").focus().select(),setTimeout(function(){$("#_tmp_copy_data").remove()},50))}for(u=[187,189],e=48;e<=90;e++)u.push(e);u.indexOf(n.keyCode)==-1||n.ctrlKey||n.metaKey||s||(r.length==0&&r.push(0),u=String.fromCharCode(n.keyCode),n.keyCode==187&&(u="="),n.keyCode==189&&(u="-"),n.shiftKey||(u=u.toLowerCase()),t.editField(f,r[0],u,n),s=!0),s&&n.preventDefault&&n.preventDefault(),t.trigger($.extend(it,{phase:"after"}))}}},scrollIntoView:function(n){var f,t,r,i,u;if(typeof n=="undefined"){if(f=this.getSelection(),f.length==0)return;n=this.get(f[0],!0)}(t=$("#grid_"+this.name+"_records"),t.length!=0)&&((r=this.last.searchIds.length,t.height()>this.recordHeight*(r>0?r:this.records.length))||(r>0&&(n=this.last.searchIds.indexOf(n)),i=Math.floor(t[0].scrollTop/this.recordHeight),u=i+Math.floor(t.height()/this.recordHeight),n==i&&t.animate({scrollTop:t.scrollTop()-t.height()/1.3}),n==u&&t.animate({scrollTop:t.scrollTop()+t.height()/1.3}),(nu)&&t.animate({scrollTop:(n-1)*this.recordHeight})))},dblClick:function(n,t){var i,r,f,u;if(window.getSelection&&window.getSelection().removeAllRanges(),i=null,typeof n=="object"&&(i=n.column,n=n.recid),typeof t=="undefined"&&(t={}),i==null&&t.target&&(r=t.target,r.tagName!="TD"&&(r=$(r).parents("td")[0]),i=parseInt($(r).attr("col"))),f=this.trigger({phase:"before",target:this.name,type:"dblClick",recid:n,column:i,originalEvent:t}),f.isCancelled===!0)return!1;this.selectNone(),u=this.columns[i],u&&$.isPlainObject(u.editable)?this.editField(n,i,null,t):(this.select({recid:n,column:i}),this.last.selected=this.getSelection()),this.trigger($.extend(f,{phase:"after"}))},toggle:function(n){var t=this.get(n);return t.expanded===!0?this.collapse(n):this.expand(n)},expand:function(n){function u(){var r=$("#grid_"+i.name+"_rec_"+t+"_expanded"),u=$("#grid_"+i.name+"_rec_"+t+"_expanded_row .w2ui-expanded1 > div");r.height()<5||(r.css("opacity",1),u.show().css("opacity",1),$("#grid_"+i.name+"_cell_"+i.get(n,!0)+"_expand div").html("-"))}var e=this.get(n),i=this,t=w2utils.escapeId(n),o,f,r;return $("#grid_"+this.name+"_rec_"+t+"_expanded_row").length>0?!1:e.expanded=="none"?!1:(o=1+(this.show.selectColumn?1:0),f="",$("#grid_"+this.name+"_rec_"+t).after(''+(this.show.lineNumbers?'':"")+'\t
      \t\t\t
      \t'),r=this.trigger({phase:"before",type:"expand",target:this.name,recid:n,box_id:"grid_"+this.name+"_rec_"+t+"_expanded",ready:u}),r.isCancelled===!0)?($("#grid_"+this.name+"_rec_"+t+"_expanded_row").remove(),!1):($("#grid_"+this.name+"_rec_"+t).attr("expanded","yes").addClass("w2ui-expanded"),$("#grid_"+this.name+"_rec_"+t+"_expanded_row").show(),$("#grid_"+this.name+"_cell_"+this.get(n,!0)+"_expand div").html('
      '),e.expanded=!0,setTimeout(u,300),this.trigger($.extend(r,{phase:"after"})),this.resizeRecords(),!0)},collapse:function(n){var u=this.get(n),i=this,t=w2utils.escapeId(n),r;return $("#grid_"+this.name+"_rec_"+t+"_expanded_row").length==0?!1:(r=this.trigger({phase:"before",type:"collapse",target:this.name,recid:n,box_id:"grid_"+this.name+"_rec_"+t+"_expanded"}),r.isCancelled===!0)?!1:($("#grid_"+this.name+"_rec_"+t).removeAttr("expanded").removeClass("w2ui-expanded"),$("#grid_"+this.name+"_rec_"+t+"_expanded").css("opacity",0),$("#grid_"+this.name+"_cell_"+this.get(n,!0)+"_expand div").html("+"),setTimeout(function(){$("#grid_"+i.name+"_rec_"+t+"_expanded").height("0px"),setTimeout(function(){$("#grid_"+i.name+"_rec_"+t+"_expanded_row").remove(),delete u.expanded,i.trigger($.extend(r,{phase:"after"})),i.resizeRecords()},300)},200),!0)},sort:function(n,t,i){var f=this.trigger({phase:"before",type:"sort",target:this.name,field:n,direction:t,multiField:i}),r,u,e;if(f.isCancelled===!0)return!1;if(typeof n!="undefined"){r=this.sortData.length;for(u in this.sortData)if(this.sortData[u].field==n){r=u;break}if(typeof t=="undefined"||t==null)if(typeof this.sortData[r]=="undefined")t="asc";else switch(String(this.sortData[r].direction)){case"asc":t="desc";break;case"desc":t="asc";break;default:t="asc"}this.multiSort===!1&&(this.sortData=[],r=0),i!=!0&&(this.sortData=[],r=0),typeof this.sortData[r]=="undefined"&&(this.sortData[r]={}),this.sortData[r].field=n,this.sortData[r].direction=t}else this.sortData=[];e=typeof this.url!="object"?this.url:this.url.get,e?(this.trigger($.extend(f,{phase:"after"})),this.last.xhr_offset=0,this.reload()):(this.localSort(),this.searchData.length>0&&this.localSearch(!0),this.trigger($.extend(f,{phase:"after"})),this.refresh())},copy:function(){var t=this.getSelection(),n,c,i,f,r,o,e;if(t.length==0)return"";if(n="",typeof t[0]=="object"){var s=t[0].column,h=t[0].column,u=[];for(i in t)t[i].columnh&&(h=t[i].column),u.indexOf(t[i].index)==-1&&u.push(t[i].index);u.sort();for(c in u){for(f=u[c],r=s;r<=h;r++)(o=this.columns[r],o.hidden!==!0)&&(n+=w2utils.stripTags(this.getCellHTML(f,r))+"\t");n=n.substr(0,n.length-1),n+="\n"}}else for(i in t){f=this.get(t[i],!0);for(r in this.columns)(o=this.columns[r],o.hidden!==!0)&&(n+=w2utils.stripTags(this.getCellHTML(f,r))+"\t");n=n.substr(0,n.length-1),n+="\n"}return(n=n.substr(0,n.length-1),e=this.trigger({phase:"before",type:"copy",target:this.name,text:n}),e.isCancelled===!0)?"":(n=e.text,this.trigger($.extend(e,{phase:"after"})),n)},paste:function(n){var e=this.getSelection(),o=this.get(e[0].recid,!0),u=e[0].column,i=this.trigger({phase:"before",type:"paste",target:this.name,text:n,index:o,column:u}),s,n,a,l,c,h;if(i.isCancelled!==!0){if(n=i.text,this.selectType=="row"||e.length==0){console.log("ERROR: You can paste only if grid.selectType = 'cell' and when at least one cell selected."),this.trigger($.extend(i,{phase:"after"}));return}s=[],n=n.split("\n");for(a in n){var v=n[a].split("\t"),r=0,t=this.records[o],f=[];for(l in v)this.columns[u+r]&&(c=this.columns[u+r].field,t.changed=!0,t.changes=t.changes||{},t.changes[c]=v[l],f.push(u+r),r++);for(h in f)s.push({recid:t.recid,column:f[h]});o++}this.selectNone(),this.select.apply(this,s),this.refresh(),this.trigger($.extend(i,{phase:"after"}))}},resize:function(){var t=this,i=+new Date,n;if(window.getSelection&&window.getSelection().removeAllRanges(),this.box&&$(this.box).attr("name")==this.name)return($(this.box).find("> div").css("width",$(this.box).width()).css("height",$(this.box).height()),n=this.trigger({phase:"before",type:"resize",target:this.name}),n.isCancelled===!0)?!1:(t.resizeBoxes(),t.resizeRecords(),this.trigger($.extend(n,{phase:"after"})),+new Date-i)},refresh:function(){var n=this,h=+new Date,c=typeof this.url!="object"?this.url:this.url.get,o,u,t,r,f,i,e,s;if(this.total<=0&&!c&&this.searchData.length==0&&(this.total=this.records.length,this.buffered=this.total),window.getSelection&&window.getSelection().removeAllRanges(),this.toolbar.disable("edit","delete"),this.box){if(o=this.trigger({phase:"before",target:this.name,type:"refresh"}),o.isCancelled===!0)return!1;this.show.header?$("#grid_"+this.name+"_header").html(this.header+" ").show():$("#grid_"+this.name+"_header").hide(),this.show.toolbar?this.toolbar&&this.toolbar.get("column-on-off")&&this.toolbar.get("column-on-off").checked||($("#grid_"+this.name+"_toolbar").show(),typeof this.toolbar=="object"&&(this.toolbar.refresh(),t=$("#grid_"+n.name+"_search_all"),t.val(this.last.search))):$("#grid_"+this.name+"_toolbar").hide(),this.searchClose(),u=$("#grid_"+n.name+"_search_all"),this.searches.length==0&&(this.last.field="all"),!this.multiSearch&&this.last.field=="all"&&this.searches.length>0&&(this.last.field=this.searches[0].field,this.last.caption=this.searches[0].caption);for(i in this.searches)this.searches[i].field==this.last.field&&(this.last.caption=this.searches[i].caption);if(this.last.multi?u.attr("placeholder","["+w2utils.lang("Multiple Fields")+"]"):u.attr("placeholder",this.last.caption),this._focus_when_refreshed===!0&&(clearTimeout(n._focus_timer),n._focus_timer=setTimeout(function(){u.length>0&&u[0].focus(),delete n._focus_when_refreshed,delete n._focus_timer},600)),t=this.find({summary:!0},!0),t.length>0){for(r in t)this.summary.push(this.records[t[r]]);for(r=t.length-1;r>=0;r--)this.records.splice(t[r],1);this.total=this.total-t.length,this.buffered=this.buffered-t.length}if(f="",f+='
      "+this.getRecordsHTML()+'
      \t'+this.getColumnsHTML()+"
      ",$("#grid_"+this.name+"_body").html(f),this.summary.length>0?$("#grid_"+this.name+"_summary").html(this.getSummaryHTML()).show():$("#grid_"+this.name+"_summary").hide(),this.show.footer?$("#grid_"+this.name+"_footer").html(this.getFooterHTML()).show():$("#grid_"+this.name+"_footer").hide(),this.last.selected.length>0)for(i in this.last.selected)this.get(this.last.selected[i])!=null&&this.select(this.get(this.last.selected[i]).recid);this.searchData.length>0?$("#grid_"+this.name+"_searchClear").show():$("#grid_"+this.name+"_searchClear").hide(),$("#grid_"+this.name+"_check_all").prop("checked",!0),$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length!=0&&$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length==$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]:checked").length?$("#grid_"+this.name+"_check_all").prop("checked",!0):$("#grid_"+this.name+"_check_all").prop("checked",!1),this.status(),e=n.find({expanded:!0},!0);for(s in e)n.records[e[s]].expanded=!1;return setTimeout(function(){var t=$.trim($("#grid_"+n.name+"_search_all").val());t!=""&&$(n.box).find(".w2ui-grid-data > div").w2marker(t)},50),this.trigger($.extend(o,{phase:"after"})),n.resize(),n.addRange("selection"),setTimeout(function(){n.resize(),n.scroll()},1),+new Date-h}},render:function(n){function e(n){if(!t.last.move||t.last.move.type!="expand"){t.last.move={x:n.screenX,y:n.screenY,divX:0,divY:0,recid:$(n.target).parents("tr").attr("recid"),column:n.target.tagName=="TD"?$(n.target).attr("col"):$(n.target).parents("td").attr("col"),type:"select",start:!0};$(document).on("mousemove",r);$(document).on("mouseup",u)}}function r(n){var i,y,o,v,u,s,r,e,f;if(t.last.move&&t.last.move.type=="select"&&(t.last.move.divX=n.screenX-t.last.move.x,t.last.move.divY=n.screenY-t.last.move.y,!(Math.abs(t.last.move.divX)<=1)||!(Math.abs(t.last.move.divY)<=1))&&(t.last.move.start&&t.last.move.recid&&(t.selectNone(),t.last.move.start=!1),i=[],y=n.target.tagName=="TR"?$(n.target).attr("recid"):$(n.target).parents("tr").attr("recid"),typeof y!="undefined")){var h=t.get(t.last.move.recid,!0),l=t.get(y,!0),a=parseInt(t.last.move.column),c=parseInt(n.target.tagName=="TD"?$(n.target).attr("col"):$(n.target).parents("td").attr("col"));if(h>l&&(u=h,h=l,l=u),u="ind1:"+h+",ind2;"+l+",col1:"+a+",col2:"+c,t.last.move.range!=u){for(t.last.move.range=u,o=h;o<=l;o++)if(!(t.last.searchIds.length>0)||t.last.searchIds.indexOf(o)!=-1)if(t.selectType!="row")for(a>c&&(u=a,a=c,c=u),u=[],v=a;v<=c;v++)t.columns[v].hidden||i.push({recid:t.records[o].recid,column:parseInt(v)});else i.push(t.records[o].recid);if(t.selectType!="row"){r=t.getSelection(),u=[];for(e in i){s=!1;for(f in r)i[e].recid==r[f].recid&&i[e].column==r[f].column&&(s=!0);s||u.push({recid:i[e].recid,column:i[e].column})}t.select.apply(t,u),u=[];for(f in r){s=!1;for(e in i)i[e].recid==r[f].recid&&i[e].column==r[f].column&&(s=!0);s||u.push({recid:r[f].recid,column:r[f].column})}t.unselect.apply(t,u)}else if(t.multiSelect){r=t.getSelection();for(e in i)r.indexOf(i[e])==-1&&t.select(i[e]);for(f in r)i.indexOf(r[f])==-1&&t.unselect(r[f])}}}}function u(){t.last.move&&t.last.move.type=="select"&&(delete t.last.move,$(document).off("mousemove",r),$(document).off("mouseup",u))}var t=this,f=+new Date,i;if(window.getSelection&&window.getSelection().removeAllRanges(),typeof n!="undefined"&&n!=null&&($(this.box).find("#grid_"+this.name+"_body").length>0&&$(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-grid").html(""),this.box=n),this.box){if(this.last.sortData==null&&(this.last.sortData=this.sortData),i=this.trigger({phase:"before",target:this.name,type:"render",box:n}),i.isCancelled===!0)return!1;$(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-grid").html('
      \t
      \t
      \t
      \t
      \t
      '),this.selectType!="row"&&$(this.box).addClass("w2ui-ss"),$(this.box).length>0&&($(this.box)[0].style.cssText+=this.style),this.initToolbar(),this.toolbar!=null&&this.toolbar.render($("#grid_"+this.name+"_toolbar")[0]),$("#grid_"+this.name+"_footer").html(this.getFooterHTML()),this.refresh(),this.reload();$(this.box).on("mousedown",e);$(this.box).on("selectstart",function(){return!1});if(this.trigger($.extend(i,{phase:"after"})),$(".w2ui-layout").length==0){this.tmp_resize=function(){w2ui[t.name].resize()};$(window).off("resize",this.tmp_resize).on("resize",this.tmp_resize)}return+new Date-f}},destroy:function(){var n=this.trigger({phase:"before",target:this.name,type:"destroy"});if(n.isCancelled===!0)return!1;$(window).off("resize",this.tmp_resize),typeof this.toolbar=="object"&&this.toolbar.destroy&&this.toolbar.destroy(),$(this.box).find("#grid_"+this.name+"_body").length>0&&$(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-grid").html(""),delete w2ui[this.name],this.trigger($.extend(n,{phase:"after"}))},initColumnOnOff:function(){var i,n,t,r,u;if(this.show.toolbarColumns){i=this,n='
      ';for(t in this.columns)r=this.columns[t],n+='";n+='',u=typeof this.url!="object"?this.url:this.url.get,u&&(n+='"),n+='",n+="
      \t\t
      \t
      \t\t'+w2utils.lang("Skip")+' "+w2utils.lang("Records")+"\t
      \t
      "+w2utils.lang("Toggle Line Numbers")+'
      \t
      "+w2utils.lang("Reset Column Size")+"
      ",this.toolbar.get("column-on-off").html=n}},columnOnOff:function(n,t,i,r){var h=this.trigger({phase:"before",target:this.name,type:"columnOnOff",checkbox:n,field:i,originalEvent:t}),o,s,e,u,f;if(h.isCancelled===!0)return!1;o=this;for(s in this.records)this.records[s].expanded===!0&&(this.records[s].expanded=!1);if(e=!0,i=="line-numbers")this.show.lineNumbers=!this.show.lineNumbers,this.refresh();else if(i=="skip")w2utils.isInt(r)||(r=0),o.skip(r);else if(i=="resize"){for(u in this.columns)typeof this.columns[u].sizeOriginal!="undefined"&&(this.columns[u].size=this.columns[u].sizeOriginal);this.initResize(),this.resize()}else f=this.getColumn(i),f.hidden?($(n).prop("checked",!0),this.showColumn(f.field)):($(n).prop("checked",!1),this.hideColumn(f.field)),e=!1;this.initColumnOnOff(),e&&setTimeout(function(){$().w2overlay(),o.toolbar.uncheck("column-on-off")},100),this.trigger($.extend(h,{phase:"after"}))},initToolbar:function(){var t,i,r,n;if(typeof this.toolbar.render=="undefined"){t=this.toolbar.items,this.toolbar.items=[],this.toolbar=$().w2toolbar($.extend(!0,{},this.toolbar,{name:this.name+"_toolbar",owner:this})),this.show.toolbarReload&&this.toolbar.items.push($.extend(!0,{},this.buttons.reload)),this.show.toolbarColumns&&(this.toolbar.items.push($.extend(!0,{},this.buttons.columns)),this.initColumnOnOff()),(this.show.toolbarReload||this.show.toolbarColumn)&&this.toolbar.items.push({type:"break",id:"break0"}),this.show.toolbarSearch&&(i='",this.toolbar.items.push({type:"html",id:"search",html:i}),this.multiSearch&&this.searches.length>0&&this.toolbar.items.push($.extend(!0,{},this.buttons["search-go"]))),this.show.toolbarSearch&&(this.show.toolbarAdd||this.show.toolbarEdit||this.show.toolbarDelete||this.show.toolbarSave)&&this.toolbar.items.push({type:"break",id:"break1"}),this.show.toolbarAdd&&this.toolbar.items.push($.extend(!0,{},this.buttons.add)),this.show.toolbarEdit&&this.toolbar.items.push($.extend(!0,{},this.buttons.edit)),this.show.toolbarDelete&&this.toolbar.items.push($.extend(!0,{},this.buttons["delete"])),this.show.toolbarSave&&((this.show.toolbarAdd||this.show.toolbarDelete||this.show.toolbarEdit)&&this.toolbar.items.push({type:"break",id:"break2"}),this.toolbar.items.push($.extend(!0,{},this.buttons.save)));for(r in t)this.toolbar.items.push(t[r]);n=this;this.toolbar.on("click",function(t){var i=n.trigger({phase:"before",type:"toolbar",target:t.target,originalEvent:t}),r,s,h,u,f,c,e,o;if(i.isCancelled===!0)return!1;r=t.target;switch(r){case"reload":if(s=n.trigger({phase:"before",type:"reload",target:n.name}),s.isCancelled===!0)return!1;h=typeof n.url!="object"?n.url:n.url.get,h?n.clear(!0):(n.last.scrollTop=0,n.last.scrollLeft=0,n.last.range_start=null,n.last.range_end=null),n.reload(),n.trigger($.extend(s,{phase:"after"}));break;case"column-on-off":for(u in n.columns)n.columns[u].hidden?$("#grid_"+n.name+"_column_"+u+"_check").prop("checked",!1):$("#grid_"+n.name+"_column_"+u+"_check").prop("checked",!0);n.initResize(),n.resize();break;case"search-advanced":if(f=this,c=this.get(r),c.checked)n.searchClose(),setTimeout(function(){f.uncheck(r)},1);else{n.searchOpen(),t.originalEvent.stopPropagation();function l(){f.uncheck(r),$(document).off("click","body",l)}$(document).on("click","body",l)}break;case"add":i=n.trigger({phase:"before",target:n.name,type:"add",recid:null}),n.trigger($.extend(i,{phase:"after"}));break;case"edit":e=n.getSelection(),o=null,e.length==1&&(o=e[0]),i=n.trigger({phase:"before",target:n.name,type:"edit",recid:o}),n.trigger($.extend(i,{phase:"after"}));break;case"delete":n.delete();break;case"save":n.save()}n.trigger($.extend(i,{phase:"after"}))})}return},initSearches:function(){var o=this,t,n,r,e,i,u,f;for(t in this.searches){n=this.searches[t],r=this.getSearchData(n.field);switch(String(n.type).toLowerCase()){case"alphaNumeric":case"text":$("#grid_"+this.name+"_operator_"+t).val("begins with");break;case"int":case"float":case"hex":case"money":case"date":$("#grid_"+this.name+"_field_"+t).w2field("clear").w2field(n.type),$("#grid_"+this.name+"_field2_"+t).w2field("clear").w2field(n.type);break;case"list":e='';for(i in n.items)$.isPlainObject(n.items[i])?(u=n.items[i].id,f=n.items[i].text,typeof u=="undefined"&&typeof n.items[i].value!="undefined"&&(u=n.items[i].value),typeof f=="undefined"&&typeof n.items[i].caption!="undefined"&&(f=n.items[i].caption),u==null&&(u=""),e+='"):e+='";$("#grid_"+this.name+"_field_"+t).html(e)}r!=null&&($("#grid_"+this.name+"_operator_"+t).val(r.operator).trigger("change"),$.isArray(r.value)?r.operator=="in"?$("#grid_"+this.name+"_field_"+t).val(r.value).trigger("change"):($("#grid_"+this.name+"_field_"+t).val(r.value[0]).trigger("change"),$("#grid_"+this.name+"_field2_"+t).val(r.value[1]).trigger("change")):typeof r.value!="udefined"&&$("#grid_"+this.name+"_field_"+t).val(r.value).trigger("change"))}$("#w2ui-overlay .w2ui-grid-searches *[rel=search]").on("keypress",function(n){n.keyCode==13&&o.search()})},initResize:function(){var n=this;$(this.box).find(".w2ui-resizer").off("click").on("click",function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0,n.preventDefault&&n.preventDefault()}).off("mousedown").on("mousedown",function(t){var r,i,f,u;t||(t=window.event),window.addEventListener||window.document.attachEvent("onselectstart",function(){return!1}),n.resizing=!0,n.last.tmp={x:t.screenX,y:t.screenY,gx:t.screenX,gy:t.screenY,col:parseInt($(this).attr("name"))},t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,t.preventDefault&&t.preventDefault();for(r in n.columns)typeof n.columns[r].sizeOriginal=="undefined"&&(n.columns[r].sizeOriginal=n.columns[r].size),n.columns[r].size=n.columns[r].sizeCalculated;i={phase:"before",type:"columnResize",target:n.name,column:n.last.tmp.col,field:n.columns[n.last.tmp.col].field},i=n.trigger($.extend(i,{resizeBy:0,originalEvent:t})),f=function(t){if(n.resizing==!0){if(t||(t=window.event),i=n.trigger($.extend(i,{resizeBy:t.screenX-n.last.tmp.gx,originalEvent:t})),i.isCancelled===!0){i.isCancelled=!1;return}n.last.tmp.x=t.screenX-n.last.tmp.x,n.last.tmp.y=t.screenY-n.last.tmp.y,n.columns[n.last.tmp.col].size=parseInt(n.columns[n.last.tmp.col].size)+n.last.tmp.x+"px",n.resizeRecords(),n.last.tmp.x=t.screenX,n.last.tmp.y=t.screenY}},u=function(t){delete n.resizing,$(document).off("mousemove","body"),$(document).off("mouseup","body"),n.resizeRecords(),n.trigger($.extend(i,{phase:"after",originalEvent:t}))};$(document).on("mousemove","body",f);$(document).on("mouseup","body",u)}).each(function(n,t){var i=$(t).parent();$(t).css({height:"25px","margin-left":i.width()-3+"px"})})},resizeBoxes:function(){var o=$(this.box).find("> div"),n=$("#grid_"+this.name+"_header"),i=$("#grid_"+this.name+"_toolbar"),r=$("#grid_"+this.name+"_summary"),t=$("#grid_"+this.name+"_footer"),u=$("#grid_"+this.name+"_body"),e=$("#grid_"+this.name+"_columns"),f=$("#grid_"+this.name+"_records");this.show.header&&n.css({top:"0px",left:"0px",right:"0px"}),this.show.toolbar&&i.css({top:0+(this.show.header?w2utils.getSize(n,"height"):0)+"px",left:"0px",right:"0px"}),this.show.footer&&t.css({bottom:"0px",left:"0px",right:"0px"}),this.summary.length>0&&r.css({bottom:0+(this.show.footer?w2utils.getSize(t,"height"):0)+"px",left:"0px",right:"0px"}),u.css({top:0+(this.show.header?w2utils.getSize(n,"height"):0)+(this.show.toolbar?w2utils.getSize(i,"height"):0)+"px",bottom:0+(this.show.footer?w2utils.getSize(t,"height"):0)+(this.summary.length>0?w2utils.getSize(r,"height"):0)+"px",left:"0px",right:"0px"})},resizeRecords:function(){var i=this,rt,c,h,d,y,e,s,b,u,t,n;$(this.box).find(".w2ui-empty-record").remove();var g=$(this.box),v=$(this.box).find("> div"),nt=$("#grid_"+this.name+"_header"),tt=$("#grid_"+this.name+"_toolbar"),a=$("#grid_"+this.name+"_summary"),it=$("#grid_"+this.name+"_footer"),l=$("#grid_"+this.name+"_body"),r=$("#grid_"+this.name+"_columns"),f=$("#grid_"+this.name+"_records");if(this.fixedBody?(rt=v.height()-(this.show.header?w2utils.getSize(nt,"height"):0)-(this.show.toolbar?w2utils.getSize(tt,"height"):0)-(a.css("display")!="none"?w2utils.getSize(a,"height"):0)-(this.show.footer?w2utils.getSize(it,"height"):0),l.css("height",rt)):setTimeout(function(){var n=w2utils.getSize(r,"height")+w2utils.getSize($("#grid_"+i.name+"_records table"),"height");i.height=n+w2utils.getSize(v,"+height")+(i.show.header?w2utils.getSize(nt,"height"):0)+(i.show.toolbar?w2utils.getSize(tt,"height"):0)+(a.css("display")!="none"?w2utils.getSize(a,"height"):0)+(i.show.footer?w2utils.getSize(it,"height"):0),v.css("height",i.height),l.css("height",n),g.css("height",w2utils.getSize(v,"height")+w2utils.getSize(g,"+height"))},1),c=!1,h=!1,l.width()<$(f).find(">table").width()&&(c=!0),l.height()-r.height()<$(f).find(">table").height()+(c?w2utils.scrollBarSize():0)&&(h=!0),this.fixedBody||(h=!1,c=!1),c||h?(r.find("> table > tbody > tr:nth-child(1) td.w2ui-head-last").css("width",w2utils.scrollBarSize()).show(),f.css({top:(this.columnGroups.length>0&&this.show.columns?1:0)+w2utils.getSize(r,"height")+"px","-webkit-overflow-scrolling":"touch","overflow-x":c?"auto":"hidden","overflow-y":h?"auto":"hidden"})):(r.find("> table > tbody > tr:nth-child(1) td.w2ui-head-last").hide(),f.css({top:(this.columnGroups.length>0&&this.show.columns?1:0)+w2utils.getSize(r,"height")+"px",overflow:"hidden"}),f.length>0&&(this.last.scrollTop=0,this.last.scrollLeft=0)),this.show.emptyRecords&&!h&&(d=Math.floor(f.height()/this.recordHeight)+1,this.fixedBody))for(y=this.buffered;y<=d;y++){for(e="",e+='',this.show.lineNumbers&&(e+=''),this.show.selectColumn&&(e+=''),this.show.expandColumn&&(e+=''),s=0;!0&&this.columns.length>0;){if(n=this.columns[s],n.hidden)if(s++,typeof this.columns[s]=="undefined")break;else continue;if(e+='',s++,typeof this.columns[s]=="undefined")break}e+='',e+="",$("#grid_"+this.name+"_records > table").append(e)}if(l.length>0){var p=parseInt(l.width())-(h?w2utils.scrollBarSize():0)-(this.show.lineNumbers?34:0)-(this.show.selectColumn?26:0)-(this.show.expandColumn?26:0),k=p,o=0,w=!1;for(t=0;tk&&n.hidden!==!0&&(n.hidden=!0,w=!0),n.gridMinWidth0)for(t=0;tparseInt(n.max)&&(n.sizeCalculated=n.max+"px"),b+=parseInt(n.sizeCalculated));if(u=parseInt(k)-parseInt(b),u>0&&o>0)for(t=0;;){if(n=this.columns[t],typeof n=="undefined"){t=0;continue}if(n.hidden||n.sizeType=="px"){t++;continue}if(n.sizeCalculated=parseInt(n.sizeCalculated)+1+"px",u--,u==0)break;t++}else u>0&&r.find("> table > tbody > tr:nth-child(1) td.w2ui-head-last").css("width",w2utils.scrollBarSize()).show();r.find("> table > tbody > tr:nth-child(1) td").each(function(n,t){var r=$(t).attr("col");typeof r!="undefined"&&i.columns[r]&&$(t).css("width",i.columns[r].sizeCalculated),$(t).hasClass("w2ui-head-last")&&$(t).css("width",w2utils.scrollBarSize()+(u>0&&o==0?u:0)+"px")}),r.find("> table > tbody > tr").length==3&&r.find("> table > tbody > tr:nth-child(1) td").html("").css({height:"0px",border:"0px",padding:"0px",margin:"0px"}),f.find("> table > tbody > tr:nth-child(1) td").each(function(n,t){var r=$(t).attr("col");typeof r!="undefined"&&i.columns[r]&&$(t).css("width",i.columns[r].sizeCalculated),$(t).hasClass("w2ui-grid-data-last")&&$(t).css("width",(u>0&&o==0?u:0)+"px")}),a.find("> table > tbody > tr:nth-child(1) td").each(function(n,t){var r=$(t).attr("col");typeof r!="undefined"&&i.columns[r]&&$(t).css("width",i.columns[r].sizeCalculated),$(t).hasClass("w2ui-grid-data-last")&&$(t).css("width",w2utils.scrollBarSize()+(u>0&&o==0?u:0)+"px")}),this.initResize(),this.refreshRanges(),this.last.scrollTop!=""&&f.length>0&&(r.prop("scrollLeft",this.last.scrollLeft),f.prop("scrollTop",this.last.scrollTop),f.prop("scrollLeft",this.last.scrollLeft))},getSearchesHTML:function(){for(var i='',f=!1,n,u,r,t=0;t",f=!0),typeof n.inTag=="undefined"&&(n.inTag=""),typeof n.outTag=="undefined"&&(n.outTag=""),typeof n.type=="undefined"&&(n.type="text"),n.type=="text"&&(r='"),(n.type=="int"||n.type=="float"||n.type=="date")&&(r='"),n.type=="list"&&(r='is '),i+='\t\t\t\t"}return i+='\t
      '+u+''+n.caption+''+r+'';switch(n.type){case"alphaNumeric":case"text":i+='";break;case"int":case"float":case"hex":case"money":case"date":i+='";break;case"list":i+='"}i+=n.outTag+"\t
      \t\t
      \t\t\t\t\t\t
      \t
      '},getColumnsHTML:function(){function r(){var i="",u,f,t,r,e,o,s;for(n.columnGroups[n.columnGroups.length-1].caption!=""&&n.columnGroups.push({caption:""}),n.show.lineNumbers&&(i+='\t
       
      '),n.show.selectColumn&&(i+='\t
       
      '),n.show.expandColumn&&(i+='\t
       
      '),u=0,f=0;f
      '),i+='"+s+'\t
      '+(r.caption==""?" ":r.caption)+"\t
      "}else i+='\t
      '+(t.caption==""?" ":t.caption)+"\t
      ";u+=t.span}return i+=""}function t(t){var u="",f,s,r,i,c,e,o,h;for(n.show.lineNumbers&&(u+='\t
      #
      "),n.show.selectColumn&&(u+='\t
      \t\t\t
      "),n.show.expandColumn&&(u+='\t
       
      '),f=0,s=0,r=0;r
      '),u+='"+h+'\t
      '+(i.caption==""?" ":i.caption)+"\t
      ")}return u+='
       
      ',u+=""}var n=this,i="";return this.show.columnHeaders&&(i=this.columnGroups.length>0?t(!0)+r()+t(!1):t(!0)),i},getRecordsHTML:function(){var r,i,n,t;for(this.show_extra=this.buffered>300?30:300,r=$("#grid_"+this.name+"_records"),i=Math.floor(r.height()/this.recordHeight)+this.show_extra+1,this.fixedBody||(i=this.buffered),n=""+this.getRecordHTML(-1,0),n+='\t',t=0;t\t\t
      ',this.last.range_start=0,this.last.range_end=i,n},getSummaryHTML:function(){var t,n;if(this.summary.length!=0){for(t="",n=0;n0&&$(i.box).find(".w2ui-grid-data > div").w2marker(n)},50))}var nt=+new Date,i=this,t=$("#grid_"+this.name+"_records"),l,v,p,f,e,h,s,y,k,u,o,r,g,a,b,w,c;if(this.records.length!=0&&t.length!=0&&t.height()!=0){if(this.show_extra=this.buffered>300?30:300,t.height()0&&this.refresh();return}if(l=Math.floor(t[0].scrollTop/this.recordHeight+1),v=Math.floor(t[0].scrollTop/this.recordHeight+1)+Math.round(t.height()/this.recordHeight),l>this.buffered&&(l=this.buffered),v>this.buffered&&(v=this.buffered),p=typeof this.url!="object"?this.url:this.url.get,$("#grid_"+this.name+"_footer .w2ui-footer-right").html(w2utils.formatNumber(this.offset+l)+"-"+w2utils.formatNumber(this.offset+v)+" "+w2utils.lang("of")+" "+w2utils.formatNumber(this.total)+(p?" ("+w2utils.lang("buffered")+" "+w2utils.formatNumber(this.buffered)+(this.offset>0?", skip "+w2utils.formatNumber(this.offset):"")+")":"")),p||this.fixedBody&&!(this.total<=300)){if(f=Math.floor(t[0].scrollTop/this.recordHeight)-this.show_extra,e=f+Math.floor(t.height()/this.recordHeight)+this.show_extra*2+1,f<1&&(f=1),e>this.total&&(e=this.total),h=t.find("#grid_"+this.name+"_rec_top"),s=t.find("#grid_"+this.name+"_rec_bottom"),String(h.next().prop("id")).indexOf("_expanded_row")!=-1&&h.next().remove(),String(s.prev().prop("id")).indexOf("_expanded_row")!=-1&&s.prev().remove(),y=parseInt(h.next().attr("line")),k=parseInt(s.prev().attr("line")),y=y-this.show_extra+2&&f>1)return;for(;;){if(u=t.find("#grid_"+this.name+"_rec_bottom").prev(),u.attr("line")=="top")break;if(parseInt(u.attr("line"))>e)u.remove();else break}for(u=t.find("#grid_"+this.name+"_rec_top").next(),o=u.attr("line"),o=="bottom"&&(o=e),r=parseInt(o)-1;r>=f;r--)this.records[r-1]&&(this.records[r-1].expanded===!0&&(this.records[r-1].expanded=!1),h.after(this.getRecordHTML(r-1,r)));d(),setTimeout(function(){i.refreshRanges()},0)}if(g=(f-1)*i.recordHeight,a=(this.buffered-e)*i.recordHeight,a<0&&(a=0),h.css("height",g+"px"),s.css("height",a+"px"),i.last.range_start=f,i.last.range_end=e,b=Math.floor(t[0].scrollTop/this.recordHeight),w=b+Math.floor(t.height()/this.recordHeight),w+10>this.buffered&&this.last.pull_more!==!0&&this.buffered
      '),i.last.pull_more=!0,i.last.xhr_offset+=i.limit,i.request("get-records")});c.find("td").text().indexOf("Load")==-1&&c.find("td").html("
      Load "+i.limit+" More...
      ")}this.buffered>=this.total-this.offset&&$("#grid_"+this.name+"_rec_more").hide();return}}},getRecordHTML:function(n,t,i){var r="",c,a,v,o,e,u,f,s,l;if(n==-1){r+='
      ',this.show.lineNumbers&&(r+=''),this.show.selectColumn&&(r+=''),this.show.expandColumn&&(r+='');for(c in this.columns)this.columns[c].hidden||(r+='');return r+='',r+=""}if(a=typeof this.url!="object"?this.url:this.url.get,i!==!0)if(this.searchData.length>0&&!a){if(n>=this.last.searchIds.length)return"";n=this.last.searchIds[n],record=this.records[n]}else{if(n>=this.records.length)return"";record=this.records[n]}else{if(n>=this.summary.length)return"";record=this.summary[n]}if(!record)return"";for(v=w2utils.escapeId(record.recid),o=!1,record.selected&&this.selectType=="row"&&(o=!0),r+='",this.show.lineNumbers&&(r+='"),this.show.selectColumn&&(r+='"),this.show.expandColumn&&(e="",e=record.expanded===!0?"-":"+",record.expanded=="none"&&(e=""),record.expanded=="spinner"&&(e='
      '),r+='"),u=0;;){if(f=this.columns[u],f.hidden)if(u++,typeof this.columns[u]=="undefined")break;else continue;var y=record.changed&&record.changes[f.field],p=this.getCellHTML(n,u,i),h="";if(typeof f.render=="string"&&(s=f.render.toLowerCase().split(":"),$.inArray(s[0],["number","int","float","money","percent"])!=-1&&(h="text-align: right"),$.inArray(s[0],["date"])!=-1&&(h="text-align: right")),l=!1,record.selected&&$.inArray(u,record.selectedColumns)!=-1&&(l=!0),r+='",u++,typeof this.columns[u]=="undefined")break}return r+='',r+=""},getCellHTML:function(n,t,i){var f=this.columns[t],e=i!==!0?this.records[n]:this.summary[n],r=this.parseField(e,f.field),c=e.changed&&typeof e.changes[f.field]!="undefined",s;if(c&&(r=e.changes[f.field]),(r==null||typeof r=="undefined")&&(r=""),typeof f.render!="undefined"){if(typeof f.render=="function"&&(r=f.render.call(this,e,n,t),r.length>=4&&r.substr(0,4)!=""+r+"")),typeof f.render=="object"&&(r="
      "+f.render[r]+"
      "),typeof f.render=="string"){var u=f.render.toLowerCase().split(":"),h="",o="";$.inArray(u[0],["number","int","float","money","percent"])!=-1&&(typeof u[1]!="undefined"&&w2utils.isInt(u[1])||(u[1]=0),u[1]>20&&(u[1]=20),u[1]<0&&(u[1]=0),u[0]=="money"&&(u[1]=2,h=w2utils.settings.currencySymbol),u[0]=="percent"&&(o="%",u[1]!=="0"&&(u[1]=1)),u[0]=="int"&&(u[1]=0),r="
      "+h+w2utils.formatNumber(Number(r).toFixed(u[1]))+o+"
      "),u[0]=="date"&&((typeof u[1]=="undefined"||u[1]=="")&&(u[1]=w2utils.settings.date_display),r="
      "+h+w2utils.formatDate(r,u[1])+o+"
      "),u[0]=="age"&&(r="
      "+h+w2utils.age(r)+o+"
      ")}}else this.show.recordTitles?(s=String(r).replace(/"/g,"''"),typeof f.title!="undefined"&&(typeof f.title=="function"&&(s=f.title.call(this,e,n,t)),typeof f.title=="string"&&(s=f.title)),r='
      '+r+"
      "):r="
      "+r+"
      ";return(r==null||typeof r=="undefined")&&(r=""),r},getFooterHTML:function(){return'
      \t\t\t
      '},status:function(n){var r,t,i;typeof n!="undefined"?$("#grid_"+this.name+"_footer").find(".w2ui-footer-left").html(n):(r="",t=this.getSelection(),t.length>0&&(r=String(t.length).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")+" "+w2utils.lang("selected"),i=t[0],typeof i=="object"&&(i=i.recid+", "+w2utils.lang("Column")+": "+i.column),t.length==1&&(r=w2utils.lang("Record ID")+": "+i+" ")),$("#grid_"+this.name+"_footer .w2ui-footer-left").html(r),t.length==1?this.toolbar.enable("edit"):this.toolbar.disable("edit"),t.length>=1?this.toolbar.enable("delete"):this.toolbar.disable("delete"))},lock:function(n,t){var i=$(this.box).find("> div:first-child");setTimeout(function(){w2utils.lock(i,n,t)},10)},unlock:function(){var n=this.box;setTimeout(function(){w2utils.unlock(n)},25)},parseField:function(n,t){var i="",r,u;try{i=n,r=String(t).split(".");for(u in r)i=i[r[u]]}catch(f){i=""}return i}},$.extend(w2grid.prototype,w2utils.event),w2obj.grid=w2grid}(jQuery),function(n){var t=function(t){this.box=null,this.name=null,this.panels=[],this.tmp={},this.padding=1,this.resizer=4,this.style="",this.onShow=null,this.onHide=null,this.onResizing=null,this.onRender=null,this.onRefresh=null,this.onResize=null,this.onDestroy=null,n.extend(!0,this,w2obj.layout,t)};n.fn.w2layout=function(i){function s(t,i,r){var u=t.get(i);return(u!=null&&typeof r=="undefined"&&(r=u.tabs),u==null||r==null)?!1:(n.isArray(r)&&(r={tabs:r}),n().w2destroy(t.name+"_"+i+"_tabs"),u.tabs=n().w2tabs(n.extend({},r,{owner:t,name:t.name+"_"+i+"_tabs"})),u.show.tabs=!0,!0)}function o(t,i,r){var u=t.get(i);return(u!=null&&typeof r=="undefined"&&(r=u.toolbar),u==null||r==null)?!1:(n.isArray(r)&&(r={items:r}),n().w2destroy(t.name+"_"+i+"_toolbar"),u.toolbar=n().w2toolbar(n.extend({},r,{owner:t,name:t.name+"_"+i+"_toolbar"})),u.show.toolbar=!0,!0)}var f,r,u,e;if(typeof i!="object"&&i){if(w2ui[n(this).attr("name")])return e=w2ui[n(this).attr("name")],e[i].apply(e,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+i+" does not exist on jQuery.w2layout")}else{if(!i||typeof i.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2layout().');return}if(typeof w2ui[i.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+i.name+").");return}if(!w2utils.isAlphaNumeric(i.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}f=i.panels,r=new t(i),n.extend(r,{handlers:[],panels:[]});for(u in f)r.panels[u]=n.extend(!0,{},t.prototype.panel,f[u]),(n.isPlainObject(r.panels[u].tabs)||n.isArray(r.panels[u].tabs))&&s(r,f[u].type),(n.isPlainObject(r.panels[u].toolbar)||n.isArray(r.panels[u].toolbar))&&o(r,f[u].type);for(u in{top:"",left:"",main:"",preview:"",right:"",bottom:""})r.get(u)==null&&(r.panels[u]=n.extend(!0,{},t.prototype.panel,{type:u,hidden:!0,size:50}));return n(this).length>0&&r.render(n(this)[0]),w2ui[r.name]=r,r}},t.prototype={panel:{type:null,size:100,minSize:20,hidden:!1,resizable:!1,overflow:"auto",style:"",content:"",tabs:null,toolbar:null,width:null,height:null,show:{toolbar:!1,tabs:!1},onRefresh:null,onShow:null,onHide:null},html:function(n,t,i){return this.content(n,t,i)},content:function(t,i,r){var s=this,u=this.get(t),o,h,c,e,f;return t=="css"?(n("#layout_"+s.name+"_panel_css").html(""),!0):u==null?!1:n("#layout_"+this.name+"_panel2_"+u.type).length>0?!1:(n("#layout_"+this.name+"_panel_"+u.type).scrollTop(0),i==null||typeof i=="undefined")?u.content:i instanceof jQuery?(console.log("ERROR: You can not pass jQuery object to w2layout.content() method"),!1):(o=n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-content"),h=n(o).position().top,o.attr("class","w2ui-panel-content"),o.length>0&&typeof u.style!="undefined"&&(o[0].style.cssText=u.style),u.content==""?(u.content=i,u.hidden||this.refresh(t)):(u.content=i,u.hidden||(r!=null&&r!=""&&typeof r!="undefined"?(c="layout_"+this.name+"_panel_"+u.type,e=n("#"+c+" > .w2ui-panel-content"),e.after('
      '),f=n("#"+c+" > .w2ui-panel-content.new-panel"),e.css("top",h),f.css("top",h),typeof i=="object"?(i.box=f[0],i.render()):f.html(i),w2utils.transition(e[0],f[0],r,function(){e.remove(),f.removeClass("new-panel"),f.css("overflow",u.overflow),window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){s.resize()},100)})):u.hidden||this.refresh(t))),window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){s.resize()},100),!0)},load:function(t,i,r,u){var f=this;return t=="css"?(n.get(i,function(n,i,r){f.content(t,r.responseText),u&&u()}),!0):this.get(t)!=null?(n.get(i,function(n,i,e){f.content(t,e.responseText,r),u&&u(),window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){f.resize()},100)}),!0):!1},sizeTo:function(t,i){var r=this,u=r.get(t);return u==null?!1:(n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":".35s","-moz-transition":".35s","-ms-transition":".35s","-o-transition":".35s"}),setTimeout(function(){r.set(t,{size:i})},1),setTimeout(function(){n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":"0s","-moz-transition":"0s","-ms-transition":"0s","-o-transition":"0s"}),r.resize()},500),!0)},show:function(t,i){var r=this,f=this.trigger({phase:"before",type:"show",target:t,object:this.get(t),immediate:i}),u;return f.isCancelled===!0?!1:(u=r.get(t),u==null)?!1:(u.hidden=!1,i===!0?(n("#layout_"+r.name+"_panel_"+t).css({opacity:"1"}),u.resizabled&&n("#layout_"+r.name+"_resizer_"+t).show(),r.trigger(n.extend(f,{phase:"after"})),r.resize()):(u.resizabled&&n("#layout_"+r.name+"_resizer_"+t).show(),n("#layout_"+r.name+"_panel_"+t).css({opacity:"0"}),n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":".2s","-moz-transition":".2s","-ms-transition":".2s","-o-transition":".2s"}),setTimeout(function(){r.resize()},1),setTimeout(function(){n("#layout_"+r.name+"_panel_"+t).css({opacity:"1"})},250),setTimeout(function(){n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":"0s","-moz-transition":"0s","-ms-transition":"0s","-o-transition":"0s"}),r.trigger(n.extend(f,{phase:"after"})),r.resize()},500)),!0)},hide:function(t,i){var r=this,f=this.trigger({phase:"before",type:"hide",target:t,object:this.get(t),immediate:i}),u;return f.isCancelled===!0?!1:(u=r.get(t),u==null)?!1:(u.hidden=!0,i===!0?(n("#layout_"+r.name+"_panel_"+t).css({opacity:"0"}),n("#layout_"+r.name+"_resizer_"+t).hide(),r.trigger(n.extend(f,{phase:"after"})),r.resize()):(n("#layout_"+r.name+"_resizer_"+t).hide(),n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":".2s","-moz-transition":".2s","-ms-transition":".2s","-o-transition":".2s"}),n("#layout_"+r.name+"_panel_"+t).css({opacity:"0"}),setTimeout(function(){r.resize()},1),setTimeout(function(){n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":"0s","-moz-transition":"0s","-ms-transition":"0s","-o-transition":"0s"}),r.trigger(n.extend(f,{phase:"after"})),r.resize()},500)),!0)},toggle:function(n,t){var i=this.get(n);return i==null?!1:i.hidden?this.show(n,t):this.hide(n,t)},set:function(t,i){var r=this.get(t,!0);return r==null?!1:(n.extend(this.panels[r],i),this.refresh(t),this.resize(),!0)},get:function(n,t){var r=null,i;for(i in this.panels)if(this.panels[i].type==n)return t===!0?i:this.panels[i];return null},el:function(t){var i=n("#layout_"+this.name+"_panel_"+t+" .w2ui-panel-content");return i.length!=1?null:i[0]},hideToolbar:function(t){var i=this.get(t);i&&(i.show.toolbar=!1,n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-toolbar").hide(),this.resize())},showToolbar:function(t){var i=this.get(t);i&&(i.show.toolbar=!0,n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-toolbar").show(),this.resize())},toggleToolbar:function(n){var t=this.get(n);t&&(t.show.toolbar?this.hideToolbar(n):this.showToolbar(n))},hideTabs:function(t){var i=this.get(t);i&&(i.show.tabs=!1,n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-tabs").hide(),this.resize())},showTabs:function(t){var i=this.get(t);i&&(i.show.tabs=!0,n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-tabs").show(),this.resize())},toggleTabs:function(n){var t=this.get(n);t&&(t.show.tabs?this.hideTabs(n):this.showTabs(n))},render:function(t){function a(){i.tmp.events={resize:function(){w2ui[i.name].resize()},resizeStart:c,mousemove:h,mouseup:s};n(window).on("resize",i.tmp.events.resize);n(document).on("mousemove",i.tmp.events.mousemove);n(document).on("mouseup",i.tmp.events.mouseup)}function c(t,r){i.box&&(r||(r=window.event),window.addEventListener||window.document.attachEvent("onselectstart",function(){return!1}),i.tmp.resize={type:t,x:r.screenX,y:r.screenY,div_x:0,div_y:0,value:0},(t=="left"||t=="right")&&(i.tmp.resize.value=parseInt(n("#layout_"+i.name+"_resizer_"+t)[0].style.left)),(t=="top"||t=="preview"||t=="bottom")&&(i.tmp.resize.value=parseInt(n("#layout_"+i.name+"_resizer_"+t)[0].style.top)))}function s(t){var u,f;if(i.box&&(t||(t=window.event),window.addEventListener||window.document.attachEvent("onselectstart",function(){return!1}),typeof i.tmp.resize!="undefined")){if(i.tmp.div_x!=0||i.tmp.resize.div_y!=0){var e=i.get("top"),o=i.get("bottom"),r=i.get(i.tmp.resize.type),h=parseInt(n(i.box).height()),c=parseInt(n(i.box).width()),s=String(r.size);switch(i.tmp.resize.type){case"top":u=parseInt(r.sizeCalculated)+i.tmp.resize.div_y,f=0;break;case"bottom":u=parseInt(r.sizeCalculated)-i.tmp.resize.div_y,f=0;break;case"preview":u=parseInt(r.sizeCalculated)-i.tmp.resize.div_y,f=(e&&!e.hidden?e.sizeCalculated:0)+(o&&!o.hidden?o.sizeCalculated:0);break;case"left":u=parseInt(r.sizeCalculated)+i.tmp.resize.div_x,f=0;break;case"right":u=parseInt(r.sizeCalculated)-i.tmp.resize.div_x,f=0}r.size=s.substr(s.length-1)=="%"?Math.floor(u*100/(r.type=="left"||r.type=="right"?c:h-f)*100)/100+"%":u,i.resize()}n("#layout_"+i.name+"_resizer_"+i.tmp.resize.type).removeClass("active"),delete i.tmp.resize}}function h(t){var f,u,r;if(i.box&&(t||(t=window.event),typeof i.tmp.resize!="undefined")){if(f=i.get(i.tmp.resize.type),u=i.trigger({phase:"before",type:"resizing",target:i.tmp.resize.type,object:f,originalEvent:t}),u.isCancelled===!0)return!1;r=n("#layout_"+i.name+"_resizer_"+i.tmp.resize.type),r.hasClass("active")||r.addClass("active"),i.tmp.resize.div_x=t.screenX-i.tmp.resize.x,i.tmp.resize.div_y=t.screenY-i.tmp.resize.y,i.tmp.resizing=="left"&&i.get("left").minSize-i.tmp.resize.div_x>i.get("left").width&&(i.tmp.resize.div_x=i.get("left").minSize-i.get("left").width),i.tmp.resize.type=="left"&&i.get("main").minSize+i.tmp.resize.div_x>i.get("main").width&&(i.tmp.resize.div_x=i.get("main").width-i.get("main").minSize),i.tmp.resize.type=="right"&&i.get("right").minSize+i.tmp.resize.div_x>i.get("right").width&&(i.tmp.resize.div_x=i.get("right").width-i.get("right").minSize),i.tmp.resize.type=="right"&&i.get("main").minSize-i.tmp.resize.div_x>i.get("main").width&&(i.tmp.resize.div_x=i.get("main").minSize-i.get("main").width),i.tmp.resize.type=="top"&&i.get("top").minSize-i.tmp.resize.div_y>i.get("top").height&&(i.tmp.resize.div_y=i.get("top").minSize-i.get("top").height),i.tmp.resize.type=="top"&&i.get("main").minSize+i.tmp.resize.div_y>i.get("main").height&&(i.tmp.resize.div_y=i.get("main").height-i.get("main").minSize),i.tmp.resize.type=="bottom"&&i.get("bottom").minSize+i.tmp.resize.div_y>i.get("bottom").height&&(i.tmp.resize.div_y=i.get("bottom").height-i.get("bottom").minSize),i.tmp.resize.type=="bottom"&&i.get("main").minSize-i.tmp.resize.div_y>i.get("main").height&&(i.tmp.resize.div_y=i.get("main").minSize-i.get("main").height),i.tmp.resize.type=="preview"&&i.get("preview").minSize+i.tmp.resize.div_y>i.get("preview").height&&(i.tmp.resize.div_y=i.get("preview").height-i.get("preview").minSize),i.tmp.resize.type=="preview"&&i.get("main").minSize-i.tmp.resize.div_y>i.get("main").height&&(i.tmp.resize.div_y=i.get("main").minSize-i.get("main").height);switch(i.tmp.resize.type){case"top":case"preview":case"bottom":i.tmp.resize.div_x=0,r.length>0&&(r[0].style.top=i.tmp.resize.value+i.tmp.resize.div_y+"px");break;case"left":case"right":i.tmp.resize.div_y=0,r.length>0&&(r[0].style.left=i.tmp.resize.value+i.tmp.resize.div_x+"px")}i.trigger(n.extend(u,{phase:"after"}))}}var i=this,o,f,r,u,l,e;if((window.getSelection&&window.getSelection().removeAllRanges(),o=+new Date,f=i.trigger({phase:"before",type:"render",target:i.name,box:t}),f.isCancelled===!0)||(typeof t!="undefined"&&t!=null&&(n(i.box).find("#layout_"+i.name+"_panel_main").length>0&&n(i.box).removeAttr("name").removeClass("w2ui-layout").html(""),i.box=t),!i.box))return!1;n(i.box).attr("name",i.name).addClass("w2ui-layout").html("
      "),n(i.box).length>0&&(n(i.box)[0].style.cssText+=i.style),r=["top","left","main","preview","right","bottom"];for(u in r)l=i.get(r[u]),e='
      \t
      \t
      \t
      ',n(i.box).find(" > div").append(e);return n(i.box).find(" > div").append('
      0&&(f.css("overflow",i.overflow)[0].style.cssText+=";"+i.style),i.resizable===!0?n("#layout_"+this.name+"_resizer_"+t).show():n("#layout_"+this.name+"_resizer_"+t).hide(),typeof i.content=="object"&&i.content.render?(i.content.box=n("#layout_"+r.name+"_panel_"+i.type+" > .w2ui-panel-content")[0],i.content.render()):n("#layout_"+r.name+"_panel_"+i.type+" > .w2ui-panel-content").html(i.content),u=n(r.box).find("#layout_"+r.name+"_panel_"+i.type+" .w2ui-panel-tabs"),i.show.tabs?u.find("[name="+i.tabs.name+"]").length==0&&i.tabs!=null?u.w2render(i.tabs):i.tabs.refresh():u.html("").removeClass("w2ui-tabs").hide(),u=n(r.box).find("#layout_"+r.name+"_panel_"+i.type+" .w2ui-panel-toolbar"),i.show.toolbar?u.find("[name="+i.toolbar.name+"]").length==0&&i.toolbar!=null?u.w2render(i.toolbar):i.toolbar.refresh():u.html("").removeClass("w2ui-toolbar").hide()}else{if(n("#layout_"+r.name+"_panel_main").length<=0){r.render();return}r.resize();for(i in this.panels)r.refresh(this.panels[i].type)}return r.trigger(n.extend(e,{phase:"after"})),+new Date-o}},resize:function(){var ut,nt,y,h,u,tt,b,a,p;if((window.getSelection&&window.getSelection().removeAllRanges(),!this.box)||(ut=+new Date,nt=this.trigger({phase:"before",type:"resize",target:this.name,panel:this.tmp.resizing}),nt.isCancelled===!0))return!1;this.padding<0&&(this.padding=0),y=parseInt(n(this.box).width()),h=parseInt(n(this.box).height()),n(this.box).find(" > div").css({width:y+"px",height:h+"px"});var p=this,it=this.get("main"),l=this.get("preview"),s=this.get("left"),c=this.get("right"),r=this.get("top"),f=this.get("bottom"),et=!0,ft=l!=null&&l.hidden!=!0?!0:!1,d=s!=null&&s.hidden!=!0?!0:!1,rt=c!=null&&c.hidden!=!0?!0:!1,w=r!=null&&r.hidden!=!0?!0:!1,g=f!=null&&f.hidden!=!0?!0:!1;for(a in{top:"",left:"",right:"",bottom:"",preview:""})u=this.get(a),tt=String(u.size),u&&tt.substr(tt.length-1)=="%"?(b=h,u.type=="preview"&&(b=b-(r&&!r.hidden?r.sizeCalculated:0)-(f&&!f.hidden?f.sizeCalculated:0)),u.sizeCalculated=parseInt((u.type=="left"||u.type=="right"?y:b)*parseFloat(u.size)/100)):u.sizeCalculated=parseInt(u.size),u.sizeCalculatedthis.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_top").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ns-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("top",n),!1}))}else n("#layout_"+this.name+"_panel_top").hide();if(s!=null&&s.hidden!=!0){var o=0,e=0+(w?r.sizeCalculated+this.padding:0),t=s.sizeCalculated,i=h-(w?r.sizeCalculated+this.padding:0)-(g?f.sizeCalculated+this.padding:0),v=n("#layout_"+this.name+"_panel_left");window.navigator.userAgent.indexOf("MSIE")>0&&v.length>0&&v[0].clientHeightthis.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_left").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ew-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("left",n),!1}))}else n("#layout_"+this.name+"_panel_left").hide(),n("#layout_"+this.name+"_resizer_left").hide();if(c!=null&&c.hidden!=!0){var o=y-c.sizeCalculated,e=0+(w?r.sizeCalculated+this.padding:0),t=c.sizeCalculated,i=h-(w?r.sizeCalculated+this.padding:0)-(g?f.sizeCalculated+this.padding:0);n("#layout_"+this.name+"_panel_right").css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px"}).show(),c.width=t,c.height=i,c.resizable&&(o=o-this.padding,t=this.resizer>this.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_right").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ew-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("right",n),!1}))}else n("#layout_"+this.name+"_panel_right").hide();if(f!=null&&f.hidden!=!0){var o=0,e=h-f.sizeCalculated,t=y,i=f.sizeCalculated;n("#layout_"+this.name+"_panel_bottom").css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px"}).show(),f.width=t,f.height=i,f.resizable&&(e=e-(this.padding==0?0:this.padding),i=this.resizer>this.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_bottom").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ns-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("bottom",n),!1}))}else n("#layout_"+this.name+"_panel_bottom").hide();var o=0+(d?s.sizeCalculated+this.padding:0),e=0+(w?r.sizeCalculated+this.padding:0),t=y-(d?s.sizeCalculated+this.padding:0)-(rt?c.sizeCalculated+this.padding:0),i=h-(w?r.sizeCalculated+this.padding:0)-(g?f.sizeCalculated+this.padding:0)-(ft?l.sizeCalculated+this.padding:0),v=n("#layout_"+this.name+"_panel_main");if(window.navigator.userAgent.indexOf("MSIE")>0&&v.length>0&&v[0].clientHeight0&&v.length>0&&v[0].clientHeightthis.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_preview").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ns-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("preview",n),!1}))}else n("#layout_"+this.name+"_panel_preview").hide();for(a in{top:"",left:"",main:"",preview:"",right:"",bottom:""}){var k=this.get(a),u="#layout_"+this.name+"_panel_"+a+" > .w2ui-panel-",h=0;k.show.tabs&&(k.tabs!=null&&w2ui[this.name+"_"+a+"_tabs"]&&w2ui[this.name+"_"+a+"_tabs"].resize(),h+=w2utils.getSize(n(u+"tabs").css({display:"block"}),"height")),k.show.toolbar&&(k.toolbar!=null&&w2ui[this.name+"_"+a+"_toolbar"]&&w2ui[this.name+"_"+a+"_toolbar"].resize(),h+=w2utils.getSize(n(u+"toolbar").css({top:h+"px",display:"block"}),"height")),n(u+"content").css({display:"block"}).css({top:h+"px"})}return p=this,clearTimeout(this._resize_timer),this._resize_timer=setTimeout(function(){var t,i;for(t in w2ui)typeof w2ui[t].resize=="function"&&(w2ui[t].panels=="undefined"&&w2ui[t].resize(),i=n(w2ui[t].box).parents(".w2ui-layout"),i.length>0&&i.attr("name")==p.name&&w2ui[t].resize())},100),this.trigger(n.extend(nt,{phase:"after"})),+new Date-ut},destroy:function(){var t=this.trigger({phase:"before",type:"destroy",target:this.name});return t.isCancelled===!0?!1:typeof w2ui[this.name]=="undefined"?!1:(n(this.box).find("#layout_"+this.name+"_panel_main").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-layout").html(""),delete w2ui[this.name],this.trigger(n.extend(t,{phase:"after"})),this.tmp.events&&this.tmp.events.resize&&n(window).off("resize",this.tmp.events.resize),this.tmp.events&&this.tmp.events.mousemove&&n(document).off("mousemove",this.tmp.events.mousemove),this.tmp.events&&this.tmp.events.mouseup&&n(document).off("mouseup",this.tmp.events.mouseup),!0)},lock:function(t,i,r){if(n.inArray(String(t),["left","right","top","bottom","preview","main"])==-1){console.log("ERROR: First parameter needs to be the a valid panel name.");return}var u="#layout_"+this.name+"_panel_"+t;w2utils.lock(u,i,r)},unlock:function(t){if(n.inArray(String(t),["left","right","top","bottom","preview","main"])==-1){console.log("ERROR: First parameter needs to be the a valid panel name.");return}var i="#layout_"+this.name+"_panel_"+t;w2utils.unlock(i)}},n.extend(t.prototype,w2utils.event),w2obj.layout=t}(jQuery),w2popup={},function(n){n.fn.w2popup=function(t,i){typeof t=="undefined"&&(i={},t="open"),n.isPlainObject(t)&&(i=t,t="open"),t=t.toLowerCase(),t=="load"&&typeof i=="string"&&(i={url:i}),t=="open"&&typeof i.url!="undefined"&&(t="load"),typeof i=="undefined"&&(i={});var r={};return n(this).length>0&&(n(this).find("div[rel=title], div[rel=body], div[rel=buttons]").length>0?(n(this).find("div[rel=title]").length>0&&(r.title=n(this).find("div[rel=title]").html()),n(this).find("div[rel=body]").length>0&&(r.body=n(this).find("div[rel=body]").html(),r.style=n(this).find("div[rel=body]")[0].style.cssText),n(this).find("div[rel=buttons]").length>0&&(r.buttons=n(this).find("div[rel=buttons]").html())):(r.title=" ",r.body=n(this).html()),parseInt(n(this).css("width"))!=0&&(r.width=parseInt(n(this).css("width"))),parseInt(n(this).css("height"))!=0&&(r.height=parseInt(n(this).css("height")))),w2popup[t](n.extend({},r,i))},w2popup={defaults:{title:"",body:"",buttons:"",style:"",color:"#000",opacity:.4,speed:.3,modal:!1,maximized:!1,keyboard:!0,width:500,height:300,showClose:!0,showMax:!1,transition:null},handlers:[],onOpen:null,onClose:null,onMax:null,onMin:null,onKeydown:null,open:function(t){function w(n){if(n||(n=window.event),window.addEventListener||window.document.attachEvent("onselectstart",function(){return!1}),i.resizing=!0,i.tmp_x=n.screenX,i.tmp_y=n.screenY,n.stopPropagation?n.stopPropagation():n.cancelBubble=!0,n.preventDefault)n.preventDefault();else return!1}function c(t){i.resizing==!0&&(t||(t=window.event),i.tmp_div_x=t.screenX-i.tmp_x,i.tmp_div_y=t.screenY-i.tmp_y,n("#w2ui-popup").css({"-webkit-transition":"none","-webkit-transform":"translate3d("+i.tmp_div_x+"px, "+i.tmp_div_y+"px, 0px)","-moz-transition":"none","-moz-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)","-ms-transition":"none","-ms-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)","-o-transition":"none","-o-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)"}),n("#w2ui-panel").css({"-webkit-transition":"none","-webkit-transform":"translate3d("+i.tmp_div_x+"px, "+i.tmp_div_y+"px, 0px)","-moz-transition":"none","-moz-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)","-ms-transition":"none","-ms-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px","-o-transition":"none","-o-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)"}))}function h(t){i.resizing==!0&&(t||(t=window.event),i.tmp_div_x=t.screenX-i.tmp_x,i.tmp_div_y=t.screenY-i.tmp_y,n("#w2ui-popup").css({"-webkit-transition":"none","-webkit-transform":"translate3d(0px, 0px, 0px)","-moz-transition":"none","-moz-transform":"translate(0px, 0px)","-ms-transition":"none","-ms-transform":"translate(0px, 0px)","-o-transition":"none","-o-transform":"translate(0px, 0px)",left:parseInt(n("#w2ui-popup").css("left"))+parseInt(i.tmp_div_x)+"px",top:parseInt(n("#w2ui-popup").css("top"))+parseInt(i.tmp_div_y)+"px"}),n("#w2ui-panel").css({"-webkit-transition":"none","-webkit-transform":"translate3d(0px, 0px, 0px)","-moz-transition":"none","-moz-transform":"translate(0px, 0px)","-ms-transition":"none","-ms-transform":"translate(0px, 0px)","-o-transition":"none","-o-transform":"translate(0px, 0px)",left:parseInt(n("#w2ui-panel").css("left"))+parseInt(i.tmp_div_x)+"px",top:parseInt(n("#w2ui-panel").css("top"))+parseInt(i.tmp_div_y)+"px"}),i.resizing=!1)}var p=this,o=n("#w2ui-popup").data("options"),t=n.extend({},this.defaults,{body:""},o,t),e,f,v,y,r,u,a,l,s,i;if(n("#w2ui-popup").length==0&&(w2popup.handlers=[],w2popup.onMax=null,w2popup.onMin=null,w2popup.onOpen=null,w2popup.onClose=null,w2popup.onKeydown=null),t.onOpen&&(w2popup.onOpen=t.onOpen),t.onClose&&(w2popup.onClose=t.onClose),t.onMax&&(w2popup.onMax=t.onMax),t.onMin&&(w2popup.onMin=t.onMin),t.onKeydown&&(w2popup.onKeydown=t.onKeydown),window.innerHeight==undefined?(e=document.documentElement.offsetWidth,f=document.documentElement.offsetHeight,w2utils.engine=="IE7"&&(e+=21,f+=4)):(e=window.innerWidth,f=window.innerHeight),parseInt(e)-10',t.title!=""&&(r+='
      '+(t.showClose?'
      Close
      ':"")+(t.showMax?'
      Max
      ':"")+t.title+"
      "),r+='
      ',r+='
      '+t.body+"
      ",r+="
      ",r+='
      ',r+='
      ',r+="
      ",t.buttons!=""&&(r+='
      '+t.buttons+"
      "),r+="
      ",n("body").append(r),setTimeout(function(){n("#w2ui-popup .w2ui-box2").hide(),n("#w2ui-popup").css({"-webkit-transition":t.speed+"s opacity, "+t.speed+"s -webkit-transform","-webkit-transform":"scale(1)","-moz-transition":t.speed+"s opacity, "+t.speed+"s -moz-transform","-moz-transform":"scale(1)","-ms-transition":t.speed+"s opacity, "+t.speed+"s -ms-transform","-ms-transform":"scale(1)","-o-transition":t.speed+"s opacity, "+t.speed+"s -o-transform","-o-transform":"scale(1)",opacity:"1"})},1),setTimeout(function(){n("#w2ui-popup").css({"-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":""}),p.trigger(n.extend(u,{phase:"after"}))},t.speed*1e3)}else{if(u=this.trigger({phase:"before",type:"open",target:"popup",options:t,present:!0}),u.isCancelled===!0)return;(typeof o=="undefined"||o.width!=t.width||o.height!=t.height)&&(n("#w2ui-panel").remove(),w2popup.resize(t.width,t.height)),a=n("#w2ui-popup .w2ui-box2 > .w2ui-msg-body").html(t.body),a.length>0&&(a[0].style.cssText=t.style),n("#w2ui-popup .w2ui-msg-buttons").html(t.buttons),n("#w2ui-popup .w2ui-msg-title").html((t.showClose?'
      Close
      ':"")+(t.showMax?'
      Max
      ':"")+t.title),l=n("#w2ui-popup .w2ui-box1")[0],s=n("#w2ui-popup .w2ui-box2")[0],w2utils.transition(l,s,t.transition),s.className="w2ui-box1",l.className="w2ui-box2",n(s).addClass("w2ui-current-box"),n("#w2ui-popup").data("prev-size",null),setTimeout(function(){p.trigger(n.extend(u,{phase:"after"}))},1)}if(t._last_w2ui_name=w2utils.keyboard.active(),w2utils.keyboard.active(null),n("#w2ui-popup").data("options",t),t.keyboard)n(document).on("keydown",this.keydown);i={resizing:!1};n("#w2ui-popup .w2ui-msg-title").on("mousedown",function(n){w(n)}).on("mousemove",function(n){c(n)}).on("mouseup",function(n){h(n)});n("#w2ui-popup .w2ui-msg-body").on("mousemove",function(n){c(n)}).on("mouseup",function(n){h(n)});n("#w2ui-lock").on("mousemove",function(n){c(n)}).on("mouseup",function(n){h(n)});return this},keydown:function(t){var r=n("#w2ui-popup").data("options"),i;if(r.keyboard&&(i=w2popup.trigger({phase:"before",type:"keydown",target:"popup",options:r,object:w2popup,originalEvent:t}),i.isCancelled!==!0)){switch(t.keyCode){case 27:t.preventDefault(),n("#w2ui-popup .w2ui-popup-message").length>0?w2popup.message():w2popup.close()}w2popup.trigger(n.extend(i,{phase:"after"}))}},close:function(t){var r=this,t=n.extend({},n("#w2ui-popup").data("options"),t),i=this.trigger({phase:"before",type:"close",target:"popup",options:t});i.isCancelled!==!0&&(n("#w2ui-popup, #w2ui-panel").css({"-webkit-transition":t.speed+"s opacity, "+t.speed+"s -webkit-transform","-webkit-transform":"scale(0.9)","-moz-transition":t.speed+"s opacity, "+t.speed+"s -moz-transform","-moz-transform":"scale(0.9)","-ms-transition":t.speed+"s opacity, "+t.speed+"s -ms-transform","-ms-transform":"scale(0.9)","-o-transition":t.speed+"s opacity, "+t.speed+"s -o-transform","-o-transform":"scale(0.9)",opacity:"0"}),w2popup.unlockScreen(),setTimeout(function(){n("#w2ui-popup").remove(),n("#w2ui-panel").remove(),r.trigger(n.extend(i,{phase:"after"}))},t.speed*1e3),w2utils.keyboard.active(t._last_w2ui_name),t.keyboard&&n(document).off("keydown",this.keydown))},toggle:function(){var t=n("#w2ui-popup").data("options");t.maximized===!0?w2popup.min():w2popup.max()},max:function(){var r=this,t=n("#w2ui-popup").data("options"),i;t.maximized!==!0&&(i=this.trigger({phase:"before",type:"max",target:"popup",options:t}),i.isCancelled!==!0)&&(t.maximized=!0,t.prevSize=n("#w2ui-popup").css("width")+":"+n("#w2ui-popup").css("height"),n("#w2ui-popup").data("options",t),w2popup.resize(1e4,1e4,function(){r.trigger(n.extend(i,{phase:"after"}))}))},min:function(){var u=this,t=n("#w2ui-popup").data("options"),i,r;t.maximized===!0&&(i=t.prevSize.split(":"),r=this.trigger({phase:"before",type:"min",target:"popup",options:t}),r.isCancelled!==!0)&&(t.maximized=!1,t.prevSize=null,n("#w2ui-popup").data("options",t),w2popup.resize(i[0],i[1],function(){u.trigger(n.extend(r,{phase:"after"}))}))},get:function(){return n("#w2ui-popup").data("options")},set:function(n){w2popup.open(n)},clear:function(){n("#w2ui-popup .w2ui-msg-title").html(""),n("#w2ui-popup .w2ui-msg-body").html(""),n("#w2ui-popup .w2ui-msg-buttons").html("")},reset:function(){w2popup.open(w2popup.defaults)},load:function(t){function u(i,r){if(delete t.url,n("body").append('"),typeof r!="undefined"&&n("#w2ui-tmp #"+r).length>0?n("#w2ui-tmp #"+r).w2popup(t):n("#w2ui-tmp > div").w2popup(t),n("#w2ui-tmp > style").length>0){var u=n("
      ").append(n("#w2ui-tmp > style").clone()).html();n("#w2ui-popup #div-style").length==0&&n("#w2ui-ppopup").append('
      '),n("#w2ui-popup #div-style").html(u)}n("#w2ui-tmp").remove()}var i;if(String(t.url)=="undefined"){console.log("ERROR: The url parameter is empty.");return}var f=String(t.url).split("#"),r=f[0],e=f[1];String(t)=="undefined"&&(t={}),i=n("#w2ui-popup").data(r),typeof i!="undefined"&&i!=null?u(i,e):n.get(r,function(t,i,f){u(f.responseText,e),n("#w2ui-popup").data(r,f.responseText)})},message:function(t){var r,u,i,t;n().w2tag(),t||(t={width:200,height:100}),parseInt(t.width)<10&&(t.width=10),parseInt(t.height)<10&&(t.height=10),typeof t.hideOnClick=="undefined"&&(t.hideOnClick=!1),r=n("#w2ui-popup .w2ui-msg-title"),n("#w2ui-popup .w2ui-popup-message").length==0?(u=parseInt(n("#w2ui-popup").width()),n("#w2ui-popup .w2ui-box1").before('"),n("#w2ui-popup .w2ui-popup-message").data("options",t)):(typeof t.width=="undefined"&&(t.width=w2utils.getSize(n("#w2ui-popup .w2ui-popup-message"),"width")),typeof t.height=="undefined"&&(t.height=w2utils.getSize(n("#w2ui-popup .w2ui-popup-message"),"height"))),i=n("#w2ui-popup .w2ui-popup-message").css("display"),n("#w2ui-popup .w2ui-popup-message").css({"-webkit-transform":i=="none"?"translateY(-"+t.height+"px)":"translateY(0px)","-moz-transform":i=="none"?"translateY(-"+t.height+"px)":"translateY(0px)","-ms-transform":i=="none"?"translateY(-"+t.height+"px)":"translateY(0px)","-o-transform":i=="none"?"translateY(-"+t.height+"px)":"translateY(0px)"}),i=="none"?(n("#w2ui-popup .w2ui-popup-message").show().html(t.html),setTimeout(function(){n("#w2ui-popup .w2ui-popup-message").css({"-webkit-transition":"0s","-moz-transition":"0s","-ms-transition":"0s","-o-transition":"0s","z-Index":1500}),w2popup.lock(),typeof t.onOpen=="function"&&t.onOpen()},300)):(n("#w2ui-popup .w2ui-popup-message").css("z-Index",250),t=n("#w2ui-popup .w2ui-popup-message").data("options"),n("#w2ui-popup .w2ui-popup-message").remove(),w2popup.unlock(),typeof t.onClose=="function"&&t.onClose()),setTimeout(function(){n("#w2ui-popup .w2ui-popup-message").css({"-webkit-transform":i=="none"?"translateY(0px)":"translateY(-"+t.height+"px)","-moz-transform":i=="none"?"translateY(0px)":"translateY(-"+t.height+"px)","-ms-transform":i=="none"?"translateY(0px)":"translateY(-"+t.height+"px)","-o-transform":i=="none"?"translateY(0px)":"translateY(-"+t.height+"px)"})},1)},lock:function(t,i){w2utils.lock(n("#w2ui-popup"),t,i)},unlock:function(){w2utils.unlock(n("#w2ui-popup"))},lockScreen:function(t){if(n("#w2ui-lock").length>0)return!1;if(typeof t=="undefined"&&(t=n("#w2ui-popup").data("options")),typeof t=="undefined"&&(t={}),t=n.extend({},w2popup.defaults,t),n("body").append('
      '),setTimeout(function(){n("#w2ui-lock").css({"-webkit-transition":t.speed+"s opacity","-moz-transition":t.speed+"s opacity","-ms-transition":t.speed+"s opacity","-o-transition":t.speed+"s opacity",opacity:t.opacity})},1),t.modal==!0){n("#w2ui-lock").on("mousedown",function(){n("#w2ui-lock").css({"-webkit-transition":".1s","-moz-transition":".1s","-ms-transition":".1s","-o-transition":".1s",opacity:"0.6"}),window.getSelection&&window.getSelection().removeAllRanges()});n("#w2ui-lock").on("mouseup",function(){setTimeout(function(){n("#w2ui-lock").css({"-webkit-transition":".1s","-moz-transition":".1s","-ms-transition":".1s","-o-transition":".1s",opacity:t.opacity})},100),window.getSelection&&window.getSelection().removeAllRanges()})}else n("#w2ui-lock").on("mouseup",function(){w2popup.close()});return!0},unlockScreen:function(){if(n("#w2ui-lock").length==0)return!1;var t=n.extend({},n("#w2ui-popup").data("options"),t);return n("#w2ui-lock").css({"-webkit-transition":t.speed+"s opacity","-moz-transition":t.speed+"s opacity","-ms-transition":t.speed+"s opacity","-o-transition":t.speed+"s opacity",opacity:0}),setTimeout(function(){n("#w2ui-lock").remove()},t.speed*1e3),!0},resize:function(t,i,r){var u=n("#w2ui-popup").data("options"),e,f;parseInt(n(window).width())-100?w2popup.message({width:400,height:150,html:'
      \t\t
      '+n+'
      \t\t
      ',onClose:function(){typeof i=="function"&&i()}}):w2popup.open({width:450,height:200,showMax:!1,title:t,body:'
      '+n+"
      ",buttons:'',onClose:function(){typeof i=="function"&&i()}})},w2confirm=function(n,t,i){(typeof i=="undefined"||typeof t=="function")&&(i=t,t=w2utils.lang("Confirmation")),typeof t=="undefined"&&(t=w2utils.lang("Confirmation")),jQuery("#w2ui-popup").length>0?w2popup.message({width:400,height:150,html:'
      \t\t
      '+n+'
      \t\t\t\t
      ',onOpen:function(){jQuery("#w2ui-popup .w2ui-popup-message .w2ui-popup-button").on("click",function(n){w2popup.message(),typeof i=="function"&&i(n.target.id)})},onKeydown:function(n){switch(n.originalEvent.keyCode){case 13:typeof i=="function"&&i("Yes"),w2popup.message();break;case 27:typeof i=="function"&&i("No"),w2popup.message()}}}):w2popup.open({width:450,height:200,title:t,modal:!0,showClose:!1,body:'
      '+n+"
      ",buttons:'',onOpen:function(n){n.onComplete=function(){jQuery("#w2ui-popup .w2ui-popup-button").on("click",function(n){w2popup.close(),typeof i=="function"&&i(n.target.id)})}},onKeydown:function(n){switch(n.originalEvent.keyCode){case 13:typeof i=="function"&&i("Yes"),w2popup.close();break;case 27:typeof i=="function"&&i("No"),w2popup.close()}}})},function(n){var t=function(t){this.box=null,this.name=null,this.active=null,this.tabs=[],this.right="",this.style="",this.onClick=null,this.onClose=null,this.onRender=null,this.onRefresh=null,this.onResize=null,this.onDestroy=null,n.extend(!0,this,w2obj.tabs,t)};n.fn.w2tabs=function(i){var e,r,f,u;if(typeof i!="object"&&i){if(w2ui[n(this).attr("name")])return u=w2ui[n(this).attr("name")],u[i].apply(u,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+i+" does not exist on jQuery.w2tabs")}else{if(!i||typeof i.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2tabs().');return}if(typeof w2ui[i.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+i.name+").");return}if(!w2utils.isAlphaNumeric(i.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}e=i.tabs,r=new t(i),n.extend(r,{tabs:[],handlers:[]});for(f in e)r.tabs[f]=n.extend({},t.prototype.tab,e[f]);return n(this).length!=0&&r.render(n(this)[0]),w2ui[r.name]=r,r}},t.prototype={tab:{id:null,text:"",hidden:!1,disabled:!1,closable:!1,hint:"",onClick:null,onRefresh:null,onClose:null},add:function(n){return this.insert(null,n)},insert:function(t,i){var r,f,e,i,u;n.isArray(i)||(i=[i]);for(r in i){if(String(i[r].id)=="undefined"){console.log('ERROR: The parameter "id" is required but not supplied. (obj: '+this.name+")");return}f=!0;for(e in this.tabs)if(this.tabs[e].id==i[r].id){f=!1;break}if(!f){console.log('ERROR: The parameter "id='+i[r].id+'" is not unique within the current tabs. (obj: '+this.name+")");return}if(!w2utils.isAlphaNumeric(i[r].id)){console.log('ERROR: The parameter "id='+i[r].id+'" must be alpha-numeric + "-_". (obj: '+this.name+")");return}i=n.extend({},i,i[r]),t==null||typeof t=="undefined"?this.tabs.push(i):(u=this.get(t,!0),this.tabs=this.tabs.slice(0,u).concat([i],this.tabs.slice(u))),this.refresh(i[r].id)}},remove:function(){for(var u=0,r,i=0;i
      ":"")+'\t
      "+i.text+"
      ",r.length==0?(u="",i.hidden&&(u+="display: none;"),i.disabled&&(u+="opacity: 0.2; -moz-opacity: 0.2; -webkit-opacity: 0.2; -o-opacity: 0.2; filter:alpha(opacity=20);"),html='
      ",this.get(t,!0)!=this.tabs.length-1&&n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.tabs[parseInt(this.get(t,!0))+1].id)).length>0?n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.tabs[parseInt(this.get(t,!0))+1].id)).before(html):n(this.box).find("#tabs_"+this.name+"_right").before(html)):(r.html(f),i.hidden?r.css("display","none"):r.css("display",""),i.disabled?r.css({opacity:"0.2","-moz-opacity":"0.2","-webkit-opacity":"0.2","-o-opacity":"0.2",filter:"alpha(opacity=20)"}):r.css({opacity:"1","-moz-opacity":"1","-webkit-opacity":"1","-o-opacity":"1",filter:"alpha(opacity=100)"})),this.trigger(n.extend(e,{phase:"after"})),+new Date-s)},render:function(t){var u=+new Date,i=this.trigger({phase:"before",type:"render",target:this.name,box:t}),r;return i.isCancelled===!0?!1:(window.getSelection&&window.getSelection().removeAllRanges(),String(t)!="undefined"&&t!=null&&(n(this.box).find("> table #tabs_"+this.name+"_right").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-tabs").html(""),this.box=t),!this.box)?void 0:(r='
      '+(i!==!0?"
      "+t+"
      ":"")+"
      '+(i!==!0?'\t
      \t\t\t
      ":"")+"
      '+(i!==!0?'\t
      \t\t"+e+"
      ":"")+"
      "+p+"
      '+f+"
      \t
      '+this.right+"
      ",n(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-tabs").html(r),n(this.box).length>0&&(n(this.box)[0].style.cssText+=this.style),this.trigger(n.extend(i,{phase:"after"})),this.refresh(),+new Date-u)},resize:function(){window.getSelection&&window.getSelection().removeAllRanges();var t=this.trigger({phase:"before",type:"resize",target:this.name});if(t.isCancelled===!0)return!1;this.trigger(n.extend(t,{phase:"after"}))},destroy:function(){var t=this.trigger({phase:"before",type:"destroy",target:this.name});if(t.isCancelled===!0)return!1;n(this.box).find("> table #tabs_"+this.name+"_right").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-tabs").html(""),delete w2ui[this.name],this.trigger(n.extend(t,{phase:"after"}))},click:function(t,i){var u=this.get(t),r;if(u==null||u.disabled||(r=this.trigger({phase:"before",type:"click",target:t,object:this.get(t),originalEvent:i}),r.isCancelled===!0))return!1;n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.active)+" .w2ui-tab").removeClass("active"),this.active=u.id,this.trigger(n.extend(r,{phase:"after"})),this.refresh(t)},animateClose:function(t,i){var u=this.get(t),f,r;if(u==null||u.disabled||(f=this.trigger({phase:"before",type:"close",target:t,object:this.get(t),originalEvent:i}),f.isCancelled===!0))return!1;r=this,n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(u.id)).css({"-webkit-transition":".2s","-moz-transition":"2s","-ms-transition":".2s","-o-transition":".2s",opacity:"0"}),setTimeout(function(){var t=n(r.box).find("#tabs_"+r.name+"_tab_"+w2utils.escapeId(u.id)).width();n(r.box).find("#tabs_"+r.name+"_tab_"+w2utils.escapeId(u.id)).html('
      '),setTimeout(function(){n(r.box).find("#tabs_"+r.name+"_tab_"+w2utils.escapeId(u.id)).find(":first-child").css({width:"0px"})},50)},200),setTimeout(function(){r.remove(t)},450),this.trigger(n.extend(f,{phase:"after"})),this.refresh()},animateInsert:function(t,i){var f,e,o,s,r,u;if(this.get(t)!=null&&n.isPlainObject(i)){f=!0;for(e in this.tabs)if(this.tabs[e].id==i.id){f=!1;break}if(!f){console.log('ERROR: The parameter "id='+i.id+'" is not unique within the current tabs. (obj: '+this.name+")");return}(o=n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(i.id)),o.length==0)&&(typeof i.caption!="undefined"&&(i.text=i.caption),s='
      '+(i.closable?'
      ':"")+'\t
      '+i.text+"
      ",n("body").append(s),tabHTML='
       
      ',r="",i.hidden&&(r+="display: none;"),i.disabled&&(r+="opacity: 0.2; -moz-opacity: 0.2; -webkit-opacity: 0.2; -o-opacity: 0.2; filter:alpha(opacity=20);"),html=''+tabHTML+"",this.get(t,!0)!=this.tabs.length&&n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.tabs[parseInt(this.get(t,!0))].id)).length>0?n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.tabs[parseInt(this.get(t,!0))].id)).before(html):n(this.box).find("#tabs_"+this.name+"_right").before(html),u=this,setTimeout(function(){var t=n("#_tmp_simple_tab").width();n("#_tmp_tabs").remove(),n("#tabs_"+u.name+"_tab_"+w2utils.escapeId(i.id)+" > div").css("width",t+"px")},1),setTimeout(function(){u.insert(t,i)},200))}}},n.extend(t.prototype,w2utils.event),w2obj.tabs=t}(jQuery),function(n){var t=function(t){this.box=null,this.name=null,this.items=[],this.right="",this.onClick=null,this.onRender=null,this.onRefresh=null,this.onResize=null,this.onDestroy=null,n.extend(!0,this,w2obj.toolbar,t)};n.fn.w2toolbar=function(i){var e,r,f,u;if(typeof i!="object"&&i){if(w2ui[n(this).attr("name")])return u=w2ui[n(this).attr("name")],u[i].apply(u,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+i+" does not exist on jQuery.w2toolbar")}else{if(!i||typeof i.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2toolbar().');return}if(typeof w2ui[i.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+i.name+").");return}if(!w2utils.isAlphaNumeric(i.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}e=i.items,r=new t(i),n.extend(r,{items:[],handlers:[]});for(f in e)r.items[f]=n.extend({},t.prototype.item,e[f]);return n(this).length!=0&&r.render(n(this)[0]),w2ui[r.name]=r,r}},t.prototype={item:{id:null,type:"button",text:"",html:"",img:null,icon:null,hidden:!1,disabled:!1,checked:!1,arrow:!0,hint:"",group:null,items:null,onClick:null},add:function(n){this.insert(null,n)},insert:function(i,r){var u,s,e,f,o;n.isArray(r)||(r=[r]);for(u in r){if(typeof r[u].type=="undefined"){console.log('ERROR: The parameter "type" is required but not supplied in w2toolbar.add() method.');return}if(n.inArray(String(r[u].type),["button","check","radio","drop","menu","break","html","spacer"])==-1){console.log('ERROR: The parameter "type" should be one of the following [button, check, radio, drop, menu, break, html, spacer] in w2toolbar.add() method.');return}if(typeof r[u].id=="undefined"){console.log('ERROR: The parameter "id" is required but not supplied in w2toolbar.add() method.');return}for(s=!0,e=0;e table #tb_"+this.name+"_right").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-toolbar").html(""),this.box=t),this.box){for(r='',u=0;u':'");r+='",r+="
      '+this.getItemHTML(i)+"'+this.right+"
      ",n(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-toolbar").html(r),n(this.box).length>0&&(n(this.box)[0].style.cssText+=this.style),this.trigger(n.extend(f,{phase:"after"}))}},refresh:function(t){var o=+new Date,e,f,i,r,u;if(window.getSelection&&window.getSelection().removeAllRanges(),e=this.trigger({phase:"before",type:"refresh",target:typeof t!="undefined"?t:this.name,item:this.get(t)}),e.isCancelled===!0)return!1;if(typeof t=="undefined")for(f=0;f':''+u+"",this.get(t,!0)==this.items.length-1?n(this.box).find("#tb_"+this.name+"_right").before(u):n(this.box).find("#tb_"+this.name+"_item_"+w2utils.escapeId(this.items[parseInt(this.get(t,!0))+1].id)).before(u)):(r.html(u),i.hidden?r.css("display","none"):r.css("display",""),i.disabled?r.addClass("disabled"):r.removeClass("disabled")),this.trigger(n.extend(e,{phase:"after"})),+new Date-o},resize:function(){var i=+new Date,t;return(window.getSelection&&window.getSelection().removeAllRanges(),t=this.trigger({phase:"before",type:"resize",target:this.name}),t.isCancelled===!0)?!1:(this.trigger(n.extend(t,{phase:"after"})),+new Date-i)},destroy:function(){var t=this.trigger({phase:"before",type:"destroy",target:this.name});if(t.isCancelled===!0)return!1;n(this.box).find("> table #tb_"+this.name+"_right").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-toolbar").html(""),n(this.box).html(""),delete w2ui[this.name],this.trigger(n.extend(t,{phase:"after"}))},getItemHTML:function(n){var t="",r,i;typeof n.caption!="undefined"&&(n.text=n.caption),typeof n.hint=="undefined"&&(n.hint=""),typeof n.text=="undefined"&&(n.text="");switch(n.type){case"menu":case"button":case"check":case"radio":case"drop":r=" ",n.img&&(r='
      '),n.icon&&(r='
      '),t+='
      '+r+(n.text!=""?'":"")+((n.type=="drop"||n.type=="menu")&&n.arrow!==!1?'':"")+"
      '+n.text+"   
      ";break;case"break":t+='
       
      ';break;case"html":t+='
      '+n.html+"
      "}return i="",typeof n.onRender=="function"&&(i=n.onRender.call(this,n.id,t)),typeof this.onRender=="function"&&(i=this.onRender(n.id,t)),i!=""&&typeof i!="undefined"&&(t=i),t},menuClick:function(t,i,r){var e,f,u;if(window.getSelection&&window.getSelection().removeAllRanges(),e=this,f=this.get(t),f&&!f.disabled){if(u=this.trigger({phase:"before",type:"click",target:typeof t!="undefined"?t:this.name,item:this.get(t),subItem:typeof i!="undefined"&&this.get(t)?this.get(t).items[i]:null,originalEvent:r}),u.isCancelled===!0)return!1;this.trigger(n.extend(u,{phase:"after"}))}},click:function(t,i){var f,r,o,e,u;if(window.getSelection&&window.getSelection().removeAllRanges(),f=this,r=this.get(t),r&&!r.disabled){if(o=this.trigger({phase:"before",type:"click",target:typeof t!="undefined"?t:this.name,item:this.get(t),originalEvent:i}),o.isCancelled===!0)return!1;if(n("#tb_"+this.name+"_item_"+w2utils.escapeId(r.id)+" table.w2ui-button").removeClass("down"),r.type=="radio"){for(e=0;e0&&this.insert(e,null,h)}return this.refresh(i.id),e},remove:function(){for(var r=0,n,i,t=0;t0&&arguments.length==1?this.refresh(n.parent.id):this.refresh(),r},set:function(t,i,r){var u,f;if(arguments.length==2&&(r=i,i=t,t=this),this._tmp=null,typeof t=="string"&&(t=this.get(t)),t.nodes==null)return null;for(u=0;u+
      '),r.expanded=!1,this.trigger(n.extend(i,{phase:"after"})),this.resize()},collapseAll:function(n){if(typeof n=="undefined"&&(n=this),typeof n=="string"&&(n=this.get(n)),n.nodes==null)return null;for(var t=0;t0&&this.collapseAll(n.nodes[t]);this.refresh(n.id)},expand:function(t){var r=this.get(t),i=this.trigger({phase:"before",type:"expand",target:t,object:r});if(i.isCancelled===!0)return!1;n(this.box).find("#node_"+w2utils.escapeId(t)+"_sub").slideDown("fast"),n(this.box).find("#node_"+w2utils.escapeId(t)+" .w2ui-node-dots:first-child").html('
      -
      '),r.expanded=!0,this.trigger(n.extend(i,{phase:"after"})),this.resize()},expandAll:function(n){if(typeof n=="undefined"&&(n=this),typeof n=="string"&&(n=this.get(n)),n.nodes==null)return null;for(var t=0;t0&&this.collapseAll(n.nodes[t]);this.refresh(n.id)},expandParents:function(n){var t=this.get(n);t!=null&&(t.parent&&(t.parent.expanded=!0,this.expandParents(t.parent.id)),this.refresh(n))},click:function(t,i){var r=this,f=this.get(t),u;f!=null&&((u=this.selected,f.disabled||f.group)||(n(r.box).find("#node_"+w2utils.escapeId(u)).removeClass("w2ui-selected").find(".w2ui-icon").removeClass("w2ui-icon-selected"),n(r.box).find("#node_"+w2utils.escapeId(t)).addClass("w2ui-selected").find(".w2ui-icon").addClass("w2ui-icon-selected"),setTimeout(function(){var e=r.trigger({phase:"before",type:"click",target:t,originalEvent:i,object:f});if(e.isCancelled===!0)return n(r.box).find("#node_"+w2utils.escapeId(t)).removeClass("w2ui-selected").find(".w2ui-icon").removeClass("w2ui-icon-selected"),n(r.box).find("#node_"+w2utils.escapeId(u)).addClass("w2ui-selected").find(".w2ui-icon").addClass("w2ui-icon-selected"),!1;u!=null&&(r.get(u).selected=!1),r.get(t).selected=!0,r.selected=t,r.trigger(n.extend(e,{phase:"after"}))},1)))},keydown:function(t){function f(n,t){var u;if(n==null)return null;var e=n.parent,o=i.get(n.id,!0),r=null;return n.expanded&&n.nodes.length>0&&t!==!0?(u=n.nodes[0],r=u.disabled||u.group?f(u):u):r=e&&o+10?(t=f.nodes[u-1],t.expanded&&t.nodes.length>0&&(r=t.nodes[t.nodes.length-1],t=r.disabled||r.group?e(r):r)):(t=f,o=!0),t!=null&&(t.disabled||t.group)&&(t=e(t)),t}var i=this,r=i.get(i.selected),o,u;if(r&&i.keyboard===!0){if(o=i.trigger({phase:"before",type:"keydown",target:i.name,originalEvent:t}),o.isCancelled===!0)return!1;(t.keyCode==13||t.keyCode==32)&&r.nodes.length>0&&i.toggle(i.selected),t.keyCode==37&&(r.nodes.length>0?i.collapse(i.selected):!r.parent||r.parent.disabled||r.parent.group||(i.collapse(r.parent.id),i.click(r.parent.id),setTimeout(function(){i.scrollIntoView()},50))),t.keyCode==39&&r.nodes.length>0&&i.expand(i.selected),t.keyCode==38&&(u=e(r),u!=null&&(i.click(u.id,t),setTimeout(function(){i.scrollIntoView()},50))),t.keyCode==40&&(u=f(r),u!=null&&(i.click(u.id,t),setTimeout(function(){i.scrollIntoView()},50))),n.inArray(t.keyCode,[13,32,37,38,39,40])!=-1&&(t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()),i.trigger(n.extend(o,{phase:"after"}));return}},scrollIntoView:function(t){var f;if(typeof t=="undefined"&&(t=this.selected),f=this.get(t),f!=null){var i=n(this.box).find(".w2ui-sidebar-div"),u=n(this.box).find("#node_"+w2utils.escapeId(t)),r=u.offset().top-i.offset().top;r+u.height()>i.height()&&i.animate({scrollTop:i.scrollTop()+i.height()/1.3}),r<=0&&i.animate({scrollTop:i.scrollTop()-i.height()/1.3})}},dblClick:function(t,i){window.getSelection&&window.getSelection().removeAllRanges();var u=this.get(t),r=this.trigger({phase:"before",type:"dblClick",target:t,originalEvent:i,object:u});if(r.isCancelled===!0)return!1;u.nodes.length>0&&this.toggle(t),this.trigger(n.extend(r,{phase:"after"}))},contextMenu:function(t,i){var r=this,u=r.get(t);t!=r.selected&&r.click(t),setTimeout(function(){var f=r.trigger({phase:"before",type:"contextMenu",target:t,originalEvent:i,object:u});if(f.isCancelled===!0)return!1;u.group||u.disabled||(r.menu.length>0&&n(r.box).find("#node_"+w2utils.escapeId(t)).w2menu(r.menu,{left:(i?i.offsetX||i.pageX:50)-25,select:function(n,i,u){r.menuClick(t,u,i)}}),r.trigger(n.extend(f,{phase:"after"})))},1)},menuClick:function(t,i,r){var u=this,f=u.trigger({phase:"before",type:"menuClick",target:t,originalEvent:r,menuIndex:i,menuItem:u.menu[i]});if(f.isCancelled===!0)return!1;u.trigger(n.extend(f,{phase:"after"}))},render:function(t){var i=this.trigger({phase:"before",type:"render",target:this.name,box:t});if(i.isCancelled===!0)return!1;(typeof t!="undefined"&&t!=null&&(n(this.box).find("> div > div.w2ui-sidebar-div").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-sidebar").html(""),this.box=t),this.box)&&(n(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-sidebar").html('
      '),n(this.box).find("> div").css({width:n(this.box).width()+"px",height:n(this.box).height()+"px"}),n(this.box).length>0&&(n(this.box)[0].style.cssText+=this.style),this.topHTML!=""&&(n(this.box).find(".w2ui-sidebar-top").html(this.topHTML),n(this.box).find(".w2ui-sidebar-div").css("top",n(this.box).find(".w2ui-sidebar-top").height()+"px")),this.bottomHTML!=""&&(n(this.box).find(".w2ui-sidebar-bottom").html(this.bottomHTML),n(this.box).find(".w2ui-sidebar-div").css("bottom",n(this.box).find(".w2ui-sidebar-bottom").height()+"px")),this.trigger(n.extend(i,{phase:"after"})),this.refresh())},refresh:function(t){function h(n){var e="",f=n.img,i,u,t;for(f==null&&(f=this.img),i=n.icon,i==null&&(i=this.icon),t=n.parent,u=0;t&&t.parent!=null;)t.group&&u--,t=t.parent,u++;return typeof n.caption!="undefined"&&(n.text=n.caption),n.group?e='
      \t"+(!n.hidden&&n.expanded?w2utils.lang("Hide"):w2utils.lang("Show"))+"\t"+n.text+'
      ':(n.selected&&!n.disabled&&(r.selected=n.id),t="",f&&(t='
      '),i&&(t='
      '),e='
      \t
      '+(n.nodes.length>0?n.expanded?"-":"+":n.plus?"+":"")+'
      '+t+(n.count!==""?'
      '+n.count+"
      ":"")+'
      '+n.text+'
      '),e}var c=+new Date,s,r,i,f,o,u,e;if(window.getSelection&&window.getSelection().removeAllRanges(),s=this.trigger({phase:"before",type:"refresh",target:typeof t!="undefined"?t:this.name}),s.isCancelled===!0)return!1;if(this.topHTML!=""&&(n(this.box).find(".w2ui-sidebar-top").html(this.topHTML),n(this.box).find(".w2ui-sidebar-div").css("top",n(this.box).find(".w2ui-sidebar-top").height()+"px")),this.bottomHTML!=""&&(n(this.box).find(".w2ui-sidebar-bottom").html(this.bottomHTML),n(this.box).find(".w2ui-sidebar-div").css("bottom",n(this.box).find(".w2ui-sidebar-bottom").height()+"px")),n(this.box).find("> div").css({width:n(this.box).width()+"px",height:n(this.box).height()+"px"}),r=this,typeof t=="undefined")i=this,f=".w2ui-sidebar-div";else{if(i=this.get(t),i==null)return;f="#node_"+w2utils.escapeId(i.id)+"_sub"}for(i!=this&&(o="#node_"+w2utils.escapeId(i.id),e=h(i),n(this.box).find(o).before(''),n(this.box).find(o).remove(),n(this.box).find(f).remove(),n("#sidebar_"+this.name+"_tmp").before(e),n("#sidebar_"+this.name+"_tmp").remove()),n(this.box).find(f).html(""),u=0;u div").css({width:n(this.box).width()+"px",height:n(this.box).height()+"px"}),this.trigger(n.extend(t,{phase:"after"})),+new Date-i)},destroy:function(){var t=this.trigger({phase:"before",type:"destroy",target:this.name});if(t.isCancelled===!0)return!1;n(this.box).find("> div > div.w2ui-sidebar-div").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-sidebar").html(""),delete w2ui[this.name],this.trigger(n.extend(t,{phase:"after"}))},lock:function(t,i){var r=n(this.box).find("> div:first-child");w2utils.lock(r,t,i)},unlock:function(){w2utils.unlock(this.box)}},n.extend(t.prototype,w2utils.event),w2obj.sidebar=t}(jQuery),function(n){var t=new function(){this.customTypes=[]};n.fn.w2field=function(n){if(t[n])return t[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object")return t.init.apply(this,arguments);if(typeof n=="string")return t.init.apply(this,[{type:n}]);console.log("ERROR: Method "+n+" does not exist on jQuery.w2field")},n.extend(t,{init:function(i){var r=t;return n(this).each(function(){var l,s,y,f,h,o,c,a;if(typeof t.customTypes[i.type.toLowerCase()]=="function"){t.customTypes[i.type.toLowerCase()].call(this,i);return}l=i.type.toLowerCase();switch(l){case"clear":n(this).off("focus").off("blur").off("keypress").off("keydown").off("change").removeData(),n(this).prev().hasClass("w2ui-list")&&(n(this).prev().remove(),n(this).removeAttr("tabindex").css("border-color","").show()),n(this).prev().hasClass("w2ui-upload")&&(n(this).prev().remove(),n(this).removeAttr("tabindex").css("border-color","").show()),n(this).prev().hasClass("w2ui-field-helper")&&(n(this).css("padding-left",n(this).css("padding-top")),n(this).prev().remove()),n(this).next().hasClass("w2ui-field-helper")&&(n(this).css("padding-right",n(this).css("padding-top")),n(this).next().remove()),n(this).next().hasClass("w2ui-field-helper")&&n(this).next().remove();break;case"text":case"int":case"float":case"money":case"alphanumeric":case"hex":s=this,h={min:null,max:null,arrows:!1,keyboard:!0,suffix:"",prefix:""},i=n.extend({},h,i),["text","alphanumeric","hex"].indexOf(l)!=-1&&(i.arrows=!1,i.keyboard=!1);n(this).data("options",i).on("keypress",function(t){if(!t.metaKey&&!t.ctrlKey&&!t.altKey&&(t.charCode==t.keyCode||!(t.keyCode>0))){t.keyCode==13&&n(this).change();var i=String.fromCharCode(t.charCode);if(!v(i,!0))return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,!1}}).on("keydown",function(t,r){var e,u,o,f;if(i.keyboard){e=!1,u=n(s).val(),u=v(u)?parseFloat(u):i.min||0,o=t.keyCode||r.keyCode,f=1,(t.ctrlKey||t.metaKey)&&(f=10);switch(o){case 38:n(s).val(u+f<=i.max||i.max==null?u+f:i.max).change(),l=="money"&&n(s).val(Number(n(s).val()).toFixed(2)),e=!0;break;case 40:n(s).val(u-f>=i.min||i.min==null?u-f:i.min).change(),l=="money"&&n(s).val(Number(n(s).val()).toFixed(2)),e=!0}e&&(t.preventDefault(),setTimeout(function(){s.setSelectionRange(s.value.length,s.value.length)},0))}}).on("change",function(t){var r=n(s).val(),u=!1;if(i.min!=null&&r!=""&&ri.max&&(n(s).val(i.max).change(),u=!0),u)return t.stopPropagation(),t.preventDefault(),!1;this.value==""||v(this.value)||n(this).val(i.min!=null?i.min:"")});if(n(this).val()==""&&i.min!=null&&n(this).val(i.min),i.prefix!=""){n(this).before('
      '+i.prefix+"
      "),o=n(this).prev();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),"padding-top":n(this).css("padding-top"),"padding-bottom":n(this).css("padding-bottom"),"padding-left":n(this).css("padding-left"),"padding-right":0,"margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":parseInt(n(this).css("margin-bottom"))+1+"px","margin-left":0,"margin-right":0}).on("click",function(){n(this).next().focus()});n(this).css("padding-left",o.width()+parseInt(n(this).css("padding-left"))+5+"px")}if(c=parseInt(n(this).css("padding-right")),i.arrows!=""){n(this).after('
       \t
      \t\t
      \t
      \t
      \t\t
      \t
      \t
      '),y=w2utils.getSize(this,"height"),o=n(this).next();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),height:n(this).height()+parseInt(n(this).css("padding-top"))+parseInt(n(this).css("padding-bottom"))+"px",padding:"0px","margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":"0px","border-left":"1px solid silver"}).css("margin-left","-"+(o.width()+parseInt(n(this).css("margin-right"))+12)+"px").on("mousedown",function(t){function r(){clearTimeout(n("body").data("_field_update_timer")),n("body").off("mouseup",r)}function i(t){n(s).focus().trigger(n.Event("keydown"),{keyCode:n(u.target).attr("type")=="up"?38:40}),t!==!1&&n("body").data("_field_update_timer",setTimeout(i,60))}var f=this,u=t;n("body").on("mouseup",r);n("body").data("_field_update_timer",setTimeout(i,700)),i(!1)});c+=o.width()+12,n(this).css("padding-right",c+"px")}if(i.suffix!=""){n(this).after('
      '+i.suffix+"
      "),o=n(this).next();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),"padding-top":n(this).css("padding-top"),"padding-bottom":n(this).css("padding-bottom"),"padding-left":"3px","padding-right":n(this).css("padding-right"),"margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":parseInt(n(this).css("margin-bottom"))+1+"px"}).on("click",function(){n(this).prev().focus()});o.css("margin-left","-"+(o.width()+parseInt(n(this).css("padding-right"))+5)+"px"),c+=o.width()+3,n(this).css("padding-right",c+"px")}function v(n,t){switch(l){case"int":return t&&["-"].indexOf(n)!=-1?!0:w2utils.isInt(n);case"float":return t&&["-","."].indexOf(n)!=-1?!0:w2utils.isFloat(n);case"money":return t&&["-",".","$","€","£","¥"].indexOf(n)!=-1?!0:w2utils.isMoney(n);case"hex":return w2utils.isHex(n);case"alphanumeric":return w2utils.isAlphaNumeric(n)}return!0}break;case"date":f=this,h={format:w2utils.settings.date_format,start:"",end:"",blocked:{},colored:{}},i=n.extend({},h,i);n(this).css({transition:"none","-webkit-transition":"none","-moz-transition":"none","-ms-transition":"none","-o-transition":"none"}).data("options",i).on("focus",function(){var e=parseFloat(n(f).offset().top)+parseFloat(f.offsetHeight),u=parseFloat(n(f).offset().left),t,r;clearInterval(n(f).data("mtimer")),n("#global_calendar_div").remove(),n("body").append('
      '),n("#global_calendar_div").html(n().w2field("calendar_get",f.value,i)).css({left:u+"px",top:e+"px"}).data("el",f).show(),t=n(window).width()+n(document).scrollLeft()-1,u+n("#global_calendar_div").width()>t&&n("#global_calendar_div").css("left",t-n("#global_calendar_div").width()+"px"),r=setInterval(function(){var i=n(window).width()+n(document).scrollLeft()-1,t=n(f).offset().left;if(t+n("#global_calendar_div").width()>i&&(t=i-n("#global_calendar_div").width()),n("#global_calendar_div").data("position")!=n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)&&n("#global_calendar_div").css({"-webkit-transition":".2s",left:t+"px",top:n(f).offset().top+f.offsetHeight+"px"}).data("position",n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)),n(f).length==0||n(f).offset().left==0&&n(f).offset().top==0){clearInterval(r),n("#global_calendar_div").remove();return}},100),n(f).data("mtimer",r)}).on("blur",function(){n(f).val(n.trim(n(f).val())),n.trim(n(f).val())==""||w2utils.isDate(n(f).val(),i.format)||n(this).w2tag(w2utils.lang("Not a valid date")+": "+i.format),clearInterval(n(f).data("mtimer")),n("#global_calendar_div").remove()}).on("keypress",function(){var r=this;setTimeout(function(){n("#global_calendar_div").html(n().w2field("calendar_get",r.value,i))},10)});setTimeout(function(){w2utils.isInt(f.value)&&(f.value=w2utils.formatDate(f.value,i.format))},1);break;case"time":break;case"datetime":break;case"color":f=this,h={prefix:"#",suffix:'
      '},i=n.extend({},h,i);n(this).attr("maxlength",6).on("focus",function(){var u=parseFloat(n(f).offset().top)+parseFloat(f.offsetHeight),r=parseFloat(n(f).offset().left),t,i;clearInterval(n(f).data("mtimer")),n("#global_color_div").remove(),n("body").append('
      '),n("#global_color_div").html(n().w2field("getColorHTML",f.value)).css({left:r+"px",top:u+"px"}).data("el",f).show(),t=n(window).width()+n(document).scrollLeft()-1,r+n("#global_color_div").width()>t&&n("#global_color_div").css("left",t-n("#global_color_div").width()+"px"),i=setInterval(function(){var r=n(window).width()+n(document).scrollLeft()-1,t=n(f).offset().left;if(t+n("#global_color_div").width()>r&&(t=r-n("#global_color_div").width()),n("#global_color_div").data("position")!=n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)&&n("#global_color_div").css({"-webkit-transition":".2s",left:t+"px",top:n(f).offset().top+f.offsetHeight+"px"}).data("position",n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)),n(f).length==0||n(f).offset().left==0&&n(f).offset().top==0){clearInterval(i),n("#global_color_div").remove();return}},100),n(f).data("mtimer",i)}).on("click",function(){n(this).trigger("focus")}).on("blur",function(){n(f).val(n.trim(n(f).val())),clearInterval(n(f).data("mtimer")),n("#global_color_div").remove()}).on("keydown",function(t){if(t.keyCode==86&&(t.ctrlKey||t.metaKey)){var i=this;n(this).prop("maxlength",7),setTimeout(function(){var t=n(i).val();t.substr(0,1)=="#"&&(t=t.substr(1)),w2utils.isHex(t)||(t=""),n(i).val(t).prop("maxlength",6).change()},20)}}).on("keyup",function(t){t.keyCode==86&&(t.ctrlKey||t.metaKey)&&n(this).prop("maxlength",6)}).on("keypress",function(t){t.keyCode==13&&n(this).change();var i=String.fromCharCode(t.charCode);if(!w2utils.isHex(i,!0))return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,!1}).on("change",function(){var i="#"+n(this).val();n(this).val().length!=6&&n(this).val().length!=3&&(i=""),n(this).next().find("div").css("background-color",i)});if(i.prefix!=""){n(this).before('
      '+i.prefix+"
      "),o=n(this).prev();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),"padding-top":n(this).css("padding-top"),"padding-bottom":n(this).css("padding-bottom"),"padding-left":n(this).css("padding-left"),"padding-right":0,"margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":parseInt(n(this).css("margin-bottom"))+1+"px","margin-left":0,"margin-right":0}).on("click",function(){n(this).next().focus()});n(this).css("padding-left",o.width()+parseInt(n(this).css("padding-left"))+2+"px")}if(i.suffix!=""){n(this).after('
      '+i.suffix+"
      "),o=n(this).next();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),"padding-top":n(this).css("padding-top"),"padding-bottom":n(this).css("padding-bottom"),"padding-left":"3px","padding-right":n(this).css("padding-right"),"margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":parseInt(n(this).css("margin-bottom"))+1+"px"}).on("click",function(){n(this).prev().focus()});o.css("margin-left","-"+(o.width()+parseInt(n(this).css("padding-right"))+4)+"px"),c=o.width()+parseInt(n(this).css("padding-right"))+4,n(this).css("padding-right",c+"px"),o.find("div").css("background-color","#"+n(f).val())}break;case"select":case"list":if(this.tagName!="SELECT"){console.log("ERROR: You can only apply $().w2field('list') to a SELECT element");return}var h={url:"",items:[],value:null,showNone:!0},f=this,e=n.extend({},h,i);n(f).data("settings",e),f.refresh=function(){var i=n(f).data("settings"),e="",r=t.cleanItems(i.items),u;i.showNone&&(e='");for(u in r)i.showNone||i.value!=null||(i.value=r[u].id),e+='";n(f).html(e),n(f).val(i.value),n(f).val()!=i.value&&n(f).change()},e.url!=""?n.ajax({type:"GET",dataType:"text",url:e.url,complete:function(i,r){if(r=="success"){var e=n.parseJSON(i.responseText),u=n(f).data("settings");u.items=t.cleanItems(e.items),n(f).data("settings",u),f.refresh()}}}):f.refresh();break;case"enum":if(this.tagName!="INPUT"){console.log("ERROR: You can only apply $().w2field('enum') to an INPUT element");return}var h={url:"",items:[],selected:[],max:0,maxHeight:172,showAll:!1,match:"begins with",render:null,maxCache:500,onShow:null,onHide:null,onAdd:null,onRemove:null,onItemOver:null,onItemOut:null,onItemClick:null},f=this,e=n.extend({},h,i);e.items=t.cleanItems(e.items),e.selected=t.cleanItems(e.selected),n(this).data("selected",e.selected),n(this).css({padding:"0px","border-color":"transparent","background-color":"transparent",outline:"none"}),this.add=function(t){var i,r,u;n(this).attr("readonly")||(i=n(this).data("selected"),r=n(this).data("settings"),typeof r.onAdd!="function"||(u=r.onAdd(t,r),u!==!1))&&(n.isArray(i)||(i=[]),r.max!=0&&r.max<=i.length&&i.splice(i.length-1,1),i.push(t),n(this).data("last_del",null),n(this).trigger("change"))},this.remove=function(i){var r=n(this).data("settings"),u;(typeof r.onRemove!="function"||(u=r.onRemove(i,r),u!==!1))&&(n(this).attr("readonly")||(n(this).data("selected").splice(i,1),n(this).parent().find("[title=Remove][index="+i+"]").remove(),this.refresh(),t.list_render.call(this),n(this).trigger("change")))},this.show=function(){var i,u,r;if(!n(this).attr("readonly")){if(i=n(this).data("settings"),n("#w2ui-global-items").length==0)n("body").append('
      ');else return;u=n("#w2ui-global-items"),u.css({display:"block",left:n(f).offset().left+"px",top:n(f).offset().top+f.offsetHeight+3+"px"}).width(w2utils.getSize(f,"width")).data("position",n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)),t.list_render.call(f),r=function(){var i=n("#w2ui-global-items");if(n(f).length==0||n(f).offset().left==0&&n(f).offset().top==0){clearInterval(n(f).data("mtimer")),hide();return}i.data("position")!=n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)&&(i.css({"-webkit-transition":".2s",left:n(f).offset().left+"px",top:n(f).offset().top+f.offsetHeight+3+"px"}).data("position",n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)),setTimeout(function(){t.list_render.call(f,n(f).data("last_search"))},200)),i.length>0&&n(f).data("mtimer",setTimeout(r,100))},n(f).data("mtimer",setTimeout(r,100)),typeof i.onShow=="function"&&i.onShow.call(this,i)}},this.hide=function(){var t=n(this).data("settings");clearTimeout(n(f).data("mtimer")),n("#w2ui-global-items").remove(),typeof t.onHide=="function"&&t.onHide.call(this,t)},this.refresh=function(){var r=this,i,t;n(n(this).data("div")).remove();var o="margin-top: "+n(this).css("margin-top")+"; margin-bottom: "+n(this).css("margin-bottom")+"; margin-left: "+n(this).css("margin-left")+"; margin-right: "+n(this).css("margin-right")+"; width: "+(w2utils.getSize(this,"width")-parseInt(n(this).css("margin-left"))-parseInt(n(this).css("margin-right")))+"px; ",u='
        ',f=n(this).data("selected");for(i in f)u+='
      • \t
          
        '+f[i].text+"
      • ";u+='
      • \t
      ',n(this).before(u),t=n(this).prev()[0],n(this).data("div",t);n(t).find("li").data("mouse","out").on("click",function(t){if(!n(t.target).hasClass("nomouse")){if(t.target.title==w2utils.lang("Remove")){r.remove(n(t.target).attr("index"));return}t.stopPropagation(),typeof e.onItemClick=="function"&&e.onItemClick.call(this,e)}}).on("mouseover",function(t){var i=t.target;(i.tagName!="LI"&&(i=i.parentNode),n(i).hasClass("nomouse"))||(n(i).data("mouse")=="out"&&typeof e.onItemOver=="function"&&e.onItemOver.call(this,e),n(i).data("mouse","over"))}).on("mouseout",function(t){var i=t.target;(i.tagName!="LI"&&(i=i.parentNode),n(i).hasClass("nomouse"))||(n(i).data("mouse","leaving"),setTimeout(function(){n(i).data("mouse")=="leaving"&&(n(i).data("mouse","out"),typeof e.onItemOut=="function"&&e.onItemOut.call(this,e))},0))});n(t).on("click",function(){n(this).find("input").focus()}).find("input").on("focus",function(i){n(t).css({outline:"auto 5px -webkit-focus-ring-color","outline-offset":"-2px"}),r.show(),i.stopPropagation?i.stopPropagation():i.cancelBubble=!0}).on("blur",function(i){n(t).css("outline","none"),r.hide(),i.stopPropagation?i.stopPropagation():i.cancelBubble=!0});r.resize()},this.resize=function(){var r=n(this).data("settings"),i=n(this).prev(),t=n(i).find(">div").height();t<23&&(t=23),t>r.maxHeight&&(t=r.maxHeight),n(i).height(t+(t%23==0?0:23-t%23)),i.length>0&&(i[0].scrollTop=1e3),n(this).height(t)},n(this).data("settings",e).attr("tabindex",-1),f.refresh();break;case"upload":if(this.tagName!="INPUT"){console.log("ERROR: You can only apply $().w2field('upload') to an INPUT element");return}var h={url:"",base64:!0,hint:w2utils.lang("Attach files by dragging and dropping or Click to Select"),max:0,maxSize:0,maxFileSize:0,onAdd:null,onRemove:null,onItemClick:null,onItemDblClick:null,onItemOver:null,onItemOut:null,onProgress:null,onComplete:null},f=this,e=n.extend({},h,i);e.base64===!0&&(e.maxSize==0&&(e.maxSize=20971520),e.maxFileSize==0&&(e.maxFileSize=20971520)),a=e.selected,delete e.selected,n.isArray(a)||(a=[]),n(this).data("selected",a).data("settings",e).attr("tabindex",-1),t.upload_init.call(this),this.refresh=function(){var o=this,r=n(this).data("div"),i=n(this).data("settings"),c=n(this).data("selected"),h,t,s,l,e,f,u;n(r).find("li").remove(),n(r).find("> span:first-child").css("line-height",n(r).height()-w2utils.getSize(r,"+height")-8+"px");for(h in c){t=c[h],s=n(r).find(".file-list li").length,n(r).find("> span:first-child").remove(),n(r).find(".file-list").append('
    • \t
        
      \t'+t.name+'\t - '+w2utils.size(t.size)+"
    • "),l=n(r).find(".file-list #file-"+s),e="",/image/i.test(t.type)&&(e='
      \t
      '),f='style="padding: 3px; text-align: right; color: #777;"',u='style="padding: 3px"',e+='
      \t\t\t\t\t\t
      Name:"+t.name+"
      Size:"+w2utils.size(t.size)+"
      Type:\t\t'+t.type+"\t
      Modified:"+w2utils.date(t.modified)+"
      ";l.data("file",t).on("click",function(t){if(typeof i.onItemClick=="function"){var r=i.onItemClick.call(o,n(this).data("file"));if(r===!1)return}n(t.target).hasClass("file-delete")||t.stopPropagation()}).on("dblclick",function(t){if(typeof i.onItemDblClick=="function"){var r=i.onItemDblClick.call(o,n(this).data("file"));if(r===!1)return}t.stopPropagation(),document.selection?document.selection.empty():document.defaultView.getSelection().removeAllRanges()}).on("mouseover",function(){var u,r;(typeof i.onItemOver!="function"||(u=i.onItemOver.call(o,n(this).data("file")),u!==!1))&&(r=n(this).data("file"),n(this).w2overlay(e.replace("##FILE##",r.content?"data:"+r.type+";base64,"+r.content:""),{top:-4}))}).on("mouseout",function(){if(typeof i.onItemOut=="function"){var t=i.onItemOut.call(o,n(this).data("file"));if(t===!1)return}n(this).w2overlay()})}},this.refresh();break;case"slider":break;default:console.log('ERROR: w2field does not recognize "'+i.type+'" field type.')}})},addType:function(n,i){t.customTypes[String(n).toLowerCase()]=i},cleanItems:function(t){var e=[],f;for(f in t){var r="",u="",i=t[f];if(i!=null){if(n.isPlainObject(t))r=f,u=i;else if(typeof i=="object"&&(typeof i.id!="undefined"&&(r=i.id),typeof i.value!="undefined"&&(r=i.value),typeof i.txt!="undefined"&&(u=i.txt),typeof i.text!="undefined"&&(u=i.text)),typeof i=="string"){if(String(i)=="")continue;r=i,u=i,i={}}w2utils.isInt(r)&&(r=parseInt(r)),w2utils.isFloat(r)&&(r=parseFloat(r)),e.push(n.extend({},i,{id:r,text:u}))}}return e},upload_init:function(){var i=this,o=n(this).data("settings"),u=n(i).prev(),e,f,r;u.length>0&&u[0].tagName=="DIV"&&u.hasClass("w2ui-upload")&&u.remove(),e="margin-top: "+n(i).css("margin-top")+"; margin-bottom: "+n(i).css("margin-bottom")+"; margin-left: "+n(i).css("margin-left")+"; margin-right: "+n(i).css("margin-right")+"; width: "+(w2utils.getSize(i,"width")-parseInt(n(i).css("margin-left"))-parseInt(n(i).css("margin-right")))+"px; height: "+(w2utils.getSize(i,"height")-parseInt(n(i).css("margin-top"))-parseInt(n(i).css("margin-bottom")))+"px; ",f='
      \t'+o.hint+'\t
        \t
        ',n(i).css({display1:"none","border-color":"transparent"}).before(f),n(i).data("div",n(i).prev()[0]),r=n(i).data("div");n(r).find(".file-input").off("change").on("change",function(){if(typeof this.files!="undefined")for(var n=0,r=this.files.length;ni.maxFileSize){r="Maximum file size is "+w2utils.size(i.maxFileSize),n(o).w2tag(r),console.log("ERROR: "+r);return}if(i.maxSize!=0&&l+f.size>i.maxSize){r="Maximum total size is "+w2utils.size(i.maxFileSize),n(o).w2tag(r),console.log("ERROR: "+r);return}if(i.max!=0&&a>=i.max){r="Maximum number of files is "+i.max,n(o).w2tag(r),console.log("ERROR: "+r);return}(typeof i.onAdd!="function"||(h=i.onAdd.call(u,f),h!==!1))&&(s.push(f),typeof FileReader!="undefined"&&i.base64===!0?(e=new FileReader,e.onload=function(){return function(t){var i=t.target.result,r=i.indexOf(",");f.content=i.substr(r+1),u.refresh(),n(u).trigger("change")}}(),e.readAsDataURL(t)):(u.refresh(),n(u).trigger("change")))},upload_remove:function(t){var r=this,s=n(r).data("div"),e=n(r).data("settings"),u=n(r).data("selected"),f=n(t).data("file"),o,i;if(typeof e.onRemove=="function"&&(o=e.onRemove.call(r,f),o===!1))return!1;for(i=u.length-1;i>=0;i--)u[i].name==f.name&&u[i].size==f.size&&u.splice(i,1);n(t).fadeOut("fast"),setTimeout(function(){n(t).remove(),u.length==0&&n(s).prepend(""+e.hint+""),r.refresh(),n(r).trigger("change")},300)},list_render:function(i){var r=this,e=n("#w2ui-global-items"),u=n(this).data("settings"),o=u.items,v=n(this).data("selected"),k,a,w,f,c,h,g,y;if(e.length!=0){typeof i=="undefined"&&(k="",k+='
        ',e.html(k),i=""),n(this).data("last_search",i),(typeof n(r).data("last_index")=="undefined"||n(r).data("last_index")==null)&&n(r).data("last_index",0),typeof u.last_total=="undefined"&&(u.last_total=-1),typeof u.last_search_len=="undefined"&&(u.last_search_len=0),typeof u.last_search_match=="undefined"&&(u.last_search_match=-1),u.url!=""&&(o.length==0&&u.last_total!=0||i.length>u.last_search_len&&u.last_total>u.maxCache||i.length",d=[];for(f in v)d.push(w2utils.isInt(v[f].id)?parseInt(v[f].id):String(v[f].id));w="";for(f in o)if(c=o[f].id,h=o[f].text,n.inArray(w2utils.isInt(c)?parseInt(c):String(c),d)==-1||u.showAll===!0){var p=String(i).toLowerCase(),b=h.toLowerCase(),a=p.length<=b.length&&b.substr(0,p.length)==p;u.match.toLowerCase()=="contains"&&b.indexOf(p)!=-1&&(a=!0),a&&(typeof u.render=="function"&&(h=u.render(o[f],v)),h!==!1&&(typeof o[f].group!="undefined"&&o[f].group!=w&&(w=o[f].group,l+='
      • '+w+"
      • "),l+='\n
      • '+h+"
      • ",s==n(r).data("last_index")&&n(r).data("last_item",o[f]),s++))}l+="",s==0&&(l='
        '+w2utils.lang("No items found")+"
        ",g=!0),e.find(".w2ui-items-list").html(l),n(this).data("last_max",s-1),e.find("li.selected").length>0&&e.find("li.selected")[0].scrollIntoView(!1),e.css({"-webkit-transition":"0s",height:"auto"}),y=parseInt(n(document).height())-parseInt(e.offset().top)-8,parseInt(e.height())>y&&(e.css({height:y-5+"px",overflow:"show"}),n(e).find(".w2ui-items-list").css({height:y-15+"px",overflow:"auto"}));n(e).off("mousedown").on("mousedown",function(i){var e=i.target,f,o;if(e.tagName!="LI"&&(e=n(e).parents("li")),f=n(e).attr("index"),f){if(o=u.items[f],typeof f=="undefined")if(i.preventDefault)i.preventDefault();else return!1;r.add(o),n(r).data("last_index",0),r.refresh(),t.list_render.call(r,"")}});n(r).prev().find("li > input").val(i).css("max-width",n(e).width()-25+"px").width((i.length+2)*6+"px").focus().on("click",function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}).off("keyup").on("keyup",function(i){var u=this;setTimeout(function(){var f=n(r).data("last_index"),e;switch(i.keyCode){case 38:f--,f<0&&(f=0),n(r).data("last_index",f),i.preventDefault&&i.preventDefault();break;case 40:f++,f>n(r).data("last_max")&&(f=n(r).data("last_max")),n(r).data("last_index",f),i.preventDefault&&i.preventDefault();break;case 13:if(typeof n(r).data("last_item")=="undefined"||n(r).data("last_item")==null||g===!0)break;e=n(r).data("selected"),r.add(n(r).data("last_item")),f>n(r).data("last_max")-1&&(f=n(r).data("last_max")-1),n(r).data("last_index",f),n(r).data("last_item",null),n(u).val(""),r.refresh(),i.preventDefault&&i.preventDefault();break;case 8:String(u.value)==""&&(typeof n(r).data("last_del")=="undefined"||n(r).data("last_del")==null?(e=n(r).data("selected"),n.isArray(e)||(e=[]),n(r).data("last_del",e.length-1),r.refresh()):(e=n(r).data("selected"),r.remove(e.length-1)));break;default:n(r).data("last_index",0),n(r).data("last_del",null)}r.resize(),i.keyCode==8&&String(u.value)==""||(n(r).prev().find("li").css("opacity","1"),n(r).data("last_del",null)),n.inArray(i.keyCode,[16,91,37,39])==-1&&t.list_render.call(r,u.value)},10)})}},calendar_get:function(t,i){var e=new Date,s=Number(e.getMonth())+1+"/"+e.getDate()+"/"+(String(e.getYear()).length>3?e.getYear():e.getYear()+1900),o;(String(t)==""||String(t)=="undefined")&&(t=w2utils.formatDate(s,i.format)),w2utils.isDate(t,i.format)||(t=w2utils.formatDate(s,i.format));var r=t.replace(/-/g,"/").replace(/\./g,"/").toLowerCase().split("/"),f=i.format.replace(/-/g,"/").replace(/\./g,"/").toLowerCase(),u=new Date;return f=="mm/dd/yyyy"&&(u=new Date(r[0]+"/"+r[1]+"/"+r[2])),f=="m/d/yyyy"&&(u=new Date(r[0]+"/"+r[1]+"/"+r[2])),f=="dd/mm/yyyy"&&(u=new Date(r[1]+"/"+r[0]+"/"+r[2])),f=="d/m/yyyy"&&(u=new Date(r[1]+"/"+r[0]+"/"+r[2])),f=="yyyy/dd/mm"&&(u=new Date(r[2]+"/"+r[1]+"/"+r[0])),f=="yyyy/d/m"&&(u=new Date(r[2]+"/"+r[1]+"/"+r[0])),f=="yyyy/mm/dd"&&(u=new Date(r[1]+"/"+r[2]+"/"+r[0])),f=="yyyy/m/d"&&(u=new Date(r[1]+"/"+r[2]+"/"+r[0])),o='
        '+n().w2field("calendar_month",u.getMonth()+1,u.getFullYear(),i)+"
        "},calendar_next:function(t){var f=String(t).split("/"),i=f[0],u=f[1],r;parseInt(i)<12?i=parseInt(i)+1:(i=1,u=parseInt(u)+1),r=n(n("#global_calendar_div.w2ui-calendar").data("el")).data("options"),n("#global_calendar_div.w2ui-calendar").html(n().w2field("calendar_get",w2utils.formatDate(i+"/1/"+u,r.format),r))},calendar_previous:function(t){var f=String(t).split("/"),i=f[0],u=f[1],r;parseInt(i)>1?i=parseInt(i)-1:(i=12,u=parseInt(u)-1),r=n(n("#global_calendar_div.w2ui-calendar").data("el")).data("options"),n("#global_calendar_div.w2ui-calendar").html(n().w2field("calendar_get",w2utils.formatDate(i+"/1/"+u,r.format),r))},calendar_month:function(t,i,r){var u=new Date,rt=w2utils.settings.fullmonths,et=w2utils.settings.fulldays,p=["31","28","31","30","31","30","31","31","30","31","30","31"],ft=Number(u.getMonth())+1+"/"+u.getDate()+"/"+(String(u.getYear()).length>3?u.getYear():u.getYear()+1900),c,g,e,s,f,v,o,h,l;i=Number(i),t=Number(t),(i===null||i==="")&&(i=String(u.getYear()).length>3?u.getYear():u.getYear()+1900),(t===null||t==="")&&(t=Number(u.getMonth())+1),t>12&&(t=t-12,i++),(t<1||t==0)&&(t=t+12,i--),p[1]=i/4==Math.floor(i/4)?"29":"28",i==null&&(i=u.getYear()),t==null&&(t=u.getMonth()-1),u=new Date,u.setDate(1),u.setMonth(t-1),u.setYear(i);var y=u.getDay(),nt=w2utils.settings.shortdays,d="";for(c=0,g=nt.length;c"+nt[c]+"";for(e='
        \t
        <-
        \t
        ->
        "+rt[t-1]+", "+i+'
        \t'+d+"\t",s=1,f=1;f<43;f++){if(y==0&&f==1){for(v=0;v<6;v++)e+='';f+=6}else if(fp[t-1]){e+='',f%7==0&&(e+="");continue}o=t+"/"+s+"/"+i,h="",f%7==6&&(h="w2ui-saturday"),f%7==0&&(h="w2ui-sunday"),o==ft&&(h+=" w2ui-today");var ut=s,b="",w="",a="";if(r.colored&&r.colored[o]!=undefined&&(tmp=r.colored[o].split(":"),w="background-color: "+tmp[0]+";",b="color: "+tmp[1]+";"),l=!1,r.start||r.end){var tt=new Date(r.start),it=new Date(r.end),k=new Date(o);(kit)&&(a=" w2ui-blocked-date",l=!0)}r.blocked&&n.inArray(o,r.blocked)!=-1&&(a=" w2ui-blocked-date",l=!0),e+='"),s++}return e+="
          
        ",(f%7==0||y==0&&f==1)&&(e+="
        "},getColorHTML:function(n){for(var r='
        ',u=[["000000","444444","666666","999999","CCCCCC","EEEEEE","F3F3F3","FFFFFF"],["FF011B","FF9838","FFFD59","01FD55","00FFFE","0424F3","9B24F4","FF21F5"],["F4CCCC","FCE5CD","FFF2CC","D9EAD3","D0E0E3","CFE2F3","D9D1E9","EAD1DC"],["EA9899","F9CB9C","FEE599","B6D7A8","A2C4C9","9FC5E8","B4A7D6","D5A6BD"],["E06666","F6B26B","FED966","93C47D","76A5AF","6FA8DC","8E7CC3","C27BA0"],["CC0814","E69138","F1C232","6AA84F","45818E","3D85C6","674EA7","A54D79"],["99050C","B45F17","BF901F","37761D","124F5C","0A5394","351C75","741B47"],["660205","783F0B","7F6011","274E12","0C343D","063762","20124D","4C1030"]],i,t=0;t<8;t++){for(r+="",i=0;i<8;i++)r+="";r+="",t<2&&(r+='')}return r+="
        \t
        \t\t'+(n==u[t][i]?"•":" ")+"\t
        "}}),w2obj.field=t}(jQuery),function($){var w2form=function(n){this.name=null,this.header="",this.box=null,this.url="",this.formURL="",this.formHTML="",this.page=0,this.recid=0,this.fields=[],this.actions={},this.record={},this.original={},this.postData={},this.toolbar={},this.tabs={},this.style="",this.focus=0,this.msgNotJSON=w2utils.lang("Return data is not in JSON format."),this.msgRefresh=w2utils.lang("Refreshing..."),this.msgSaving=w2utils.lang("Saving..."),this.onRequest=null,this.onLoad=null,this.onValidate=null,this.onSubmit=null,this.onSave=null,this.onChange=null,this.onRender=null,this.onRefresh=null,this.onResize=null,this.onDestroy=null,this.onAction=null,this.onToolbar=null,this.onError=null,this.isGenerated=!1,this.last={xhr:null},$.extend(!0,this,w2obj.form,n)};$.fn.w2form=function(n){var s,u,i,r;if(typeof n!="object"&&n){if(w2ui[$(this).attr("name")])return r=w2ui[$(this).attr("name")],r[n].apply(r,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+n+" does not exist on jQuery.w2form")}else{if(r=this,!n||typeof n.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2form().');return}if(typeof w2ui[n.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+n.name+").");return}if(!w2utils.isAlphaNumeric(n.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}var o=n.record,e=n.original,h=n.fields,c=n.toolbar,f=n.tabs,t=new w2form(n);if($.extend(t,{record:{},original:{},fields:[],tabs:{},toolbar:{},handlers:[]}),$.isArray(f)){$.extend(!0,t.tabs,{tabs:[]});for(s in f)u=f[s],typeof u=="object"?t.tabs.tabs.push(u):t.tabs.tabs.push({id:u,caption:u})}else $.extend(!0,t.tabs,f);$.extend(!0,t.toolbar,c);for(i in h)t.fields[i]=$.extend(!0,{},h[i]);for(i in o)t.record[i]=$.isPlainObject(o[i])?$.extend(!0,{},o[i]):o[i];for(i in e)t.original[i]=$.isPlainObject(e[i])?$.extend(!0,{},e[i]):e[i];return r.length>0&&(t.box=r[0]),t.formURL!=""?$.get(t.formURL,function(n){t.formHTML=n,t.isGenerated=!0,($(t.box).length!=0||n.length!=0)&&($(t.box).html(n),t.render(t.box))}):t.formHTML!=""||(t.formHTML=$(this).length!=0&&$.trim($(this).html())!=""?$(this).html():t.generateHTML()),w2ui[t.name]=t,t.formURL==""&&(String(t.formHTML).indexOf("w2ui-page")==-1&&(t.formHTML='
        '+t.formHTML+"
        "),$(t.box).html(t.formHTML),t.isGenerated=!0,t.render(t.box)),t}},w2form.prototype={get:function(n,t){for(var i in this.fields)if(this.fields[i].name==n)return t===!0?i:this.fields[i];return null},set:function(n,t){for(var i in this.fields)if(this.fields[i].name==n)return $.extend(this.fields[i],t),this.refresh(),!0;return!1},reload:function(n){var t=typeof this.url!="object"?this.url:this.url.get;t&&this.recid!=0?this.request(n):(this.refresh(),typeof n=="function"&&n())},clear:function(){var n,t;this.recid=0,this.record={};for(n in this.fields)t=this.fields[n];$().w2tag(),this.refresh()},error:function(n){var i=this,t=this.trigger({target:this.name,type:"error",message:n,xhr:this.last.xhr});if(t.isCancelled===!0)return typeof callBack=="function"&&callBack(),!1;setTimeout(function(){w2alert(n,"Error")},1),this.trigger($.extend(t,{phase:"after"}))},validate:function(n){var i,e,t,u,r,o,f;typeof n=="undefined"&&(n=!0),i=[];for(e in this.fields){t=this.fields[e],this.record[t.name]==null&&(this.record[t.name]="");switch(t.type){case"int":this.record[t.name]&&!w2utils.isInt(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not an integer")});break;case"float":this.record[t.name]&&!w2utils.isFloat(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not a float")});break;case"money":this.record[t.name]&&!w2utils.isMoney(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not in money format")});break;case"hex":this.record[t.name]&&!w2utils.isHex(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not a hex number")});break;case"email":this.record[t.name]&&!w2utils.isEmail(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not a valid email")});break;case"checkbox":this.record[t.name]=this.record[t.name]==!0?1:0;break;case"date":this.record[t.name]&&!w2utils.isDate(this.record[t.name],t.options.format)&&i.push({field:t,error:w2utils.lang("Not a valid date")+": "+t.options.format})}u=this.record[t.name],t.required&&(u===""||$.isArray(u)&&u.length==0)&&i.push({field:t,error:w2utils.lang("Required field")}),t.equalto&&this.record[t.name]!=this.record[t.equalto]&&i.push({field:t,error:w2utils.lang("Field should be equal to ")+t.equalto})}if(r=this.trigger({phase:"before",target:this.name,type:"validate",errors:i}),r.isCancelled===!0)return i;if(n)for(o in r.errors)f=r.errors[o],$(f.field.el).w2tag(f.error,{"class":"w2ui-error"});return this.trigger($.extend(r,{phase:"after"})),i},request:function(postData,callBack){var obj=this,params,eventData,url;if(typeof postData=="function"&&(callBack=postData,postData=null),(typeof postData=="undefined"||postData==null)&&(postData={}),this.url&&(typeof this.url!="object"||this.url.get)){if((this.recid==null||typeof this.recid=="undefined")&&(this.recid=0),params={},params.cmd="get-record",params.name=this.name,params.recid=this.recid,$.extend(params,this.postData),$.extend(params,postData),eventData=this.trigger({phase:"before",type:"request",target:this.name,url:this.url,postData:params}),eventData.isCancelled===!0)return typeof callBack=="function"&&callBack({status:"error",message:"Request aborted."}),!1;if(this.record={},this.original={},this.lock(this.msgRefresh),url=eventData.url,typeof eventData.url=="object"&&eventData.url.get&&(url=eventData.url.get),this.last.xhr)try{this.last.xhr.abort()}catch(e){}this.last.xhr=$.ajax({type:"GET",url:url,data:String($.param(eventData.postData,!1)).replace(/%5B/g,"[").replace(/%5D/g,"]"),dataType:"text",complete:function(xhr,status){var eventData,responseText,data;if(obj.unlock(),eventData=obj.trigger({phase:"before",target:obj.name,type:"load",xhr:xhr,status:status}),eventData.isCancelled===!0)return typeof callBack=="function"&&callBack({status:"error",message:"Request aborted."}),!1;if(responseText=obj.last.xhr.responseText,status!="error"){if(typeof responseText!="undefined"&&responseText!=""){if(typeof responseText=="object")data=responseText;else try{eval("data = "+responseText)}catch(e){}typeof data=="undefined"&&(data={status:"error",message:obj.msgNotJSON,responseText:responseText}),data.status=="error"?obj.error(data.message):(obj.record=$.extend({},data.record),obj.original=$.extend({},data.record))}}else obj.error("AJAX Error "+xhr.status+": "+xhr.statusText);obj.trigger($.extend(eventData,{phase:"after"})),obj.refresh(),typeof callBack=="function"&&callBack(data)}}),this.trigger($.extend(eventData,{phase:"after"}))}},submit:function(n,t){return this.save(n,t)},save:function(postData,callBack){var obj=this,errors;if(typeof postData=="function"&&(callBack=postData,postData=null),errors=obj.validate(!0),errors.length!==0){obj.goto(errors[0].field.page);return}if((typeof postData=="undefined"||postData==null)&&(postData={}),!obj.url||typeof obj.url=="object"&&!obj.url.save){console.log("ERROR: Form cannot be saved because no url is defined.");return}obj.lock(obj.msgSaving+' '),setTimeout(function(){var params={},f,field,tmp,dt,eventData,url;params.cmd="save-record",params.name=obj.name,params.recid=obj.recid,$.extend(params,obj.postData),$.extend(params,postData),params.record=$.extend(!0,{},obj.record);for(f in obj.fields){field=obj.fields[f];switch(String(field.type).toLowerCase()){case"date":dt=params.record[field.name],(field.options.format.toLowerCase()=="dd/mm/yyyy"||field.options.format.toLowerCase()=="dd-mm-yyyy"||field.options.format.toLowerCase()=="dd.mm.yyyy")&&(tmp=dt.replace(/-/g,"/").replace(/\./g,"/").split("/"),dt=new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0])),params.record[field.name]=w2utils.formatDate(dt,"yyyy-mm-dd")}}if(eventData=obj.trigger({phase:"before",type:"submit",target:obj.name,url:obj.url,postData:params}),eventData.isCancelled===!0)return typeof callBack=="function"&&callBack({status:"error",message:"Saving aborted."}),!1;if(url=eventData.url,typeof eventData.url=="object"&&eventData.url.save&&(url=eventData.url.save),obj.last.xhr)try{obj.last.xhr.abort()}catch(e){}obj.last.xhr=$.ajax({type:w2utils.settings.RESTfull?obj.recid==0?"POST":"PUT":"POST",url:url,data:String($.param(eventData.postData,!1)).replace(/%5B/g,"[").replace(/%5D/g,"]"),dataType:"text",xhr:function(){var n=new window.XMLHttpRequest;return n.upload.addEventListener("progress",function(n){if(n.lengthComputable){var t=Math.round(n.loaded/n.total*100);$("#"+obj.name+"_progress").text(""+t+"%")}},!1),n},complete:function(xhr,status){var eventData,responseText,data;if(obj.unlock(),eventData=obj.trigger({phase:"before",target:obj.name,type:"save",xhr:xhr,status:status}),eventData.isCancelled===!0)return typeof callBack=="function"&&callBack({status:"error",message:"Saving aborted."}),!1;if(responseText=xhr.responseText,status!="error"){if(typeof responseText!="undefined"&&responseText!=""){if(typeof responseText=="object")data=responseText;else try{eval("data = "+responseText)}catch(e){}typeof data=="undefined"&&(data={status:"error",message:obj.msgNotJSON,responseText:responseText}),data.status=="error"?obj.error(data.message):obj.original=$.extend({},obj.record)}}else obj.error("AJAX Error "+xhr.status+": "+xhr.statusText);obj.trigger($.extend(eventData,{phase:"after"})),obj.refresh(),typeof callBack=="function"&&callBack(data)}}),obj.trigger($.extend(eventData,{phase:"after"}))},50)},lock:function(n,t){var i=$(this.box).find("> div:first-child");w2utils.lock(i,n,t)},unlock:function(){var n=this;setTimeout(function(){w2utils.unlock(n.box)},25)},goto:function(n){typeof n!="undefined"&&(this.page=n),$(this.box).data("auto-size")===!0&&$(this.box).height(0),this.refresh()},generateHTML:function(){var t=[],e,f,n,r,o,i,u;for(e in this.fields)f="",n=this.fields[e],typeof n.html=="undefined"&&(n.html={}),n.html=$.extend(!0,{caption:"",span:6,attr:"",text:"",page:0},n.html),n.html.caption==""&&(n.html.caption=n.name),r='",n.type=="list"&&(r='"),n.type=="checkbox"&&(r='"),n.type=="textarea"&&(r='"),f+='\n
        '+n.html.caption+':
        \n
        '+r+n.html.text+"
        ",typeof t[n.html.page]=="undefined"&&(t[n.html.page]='
        '),t[n.html.page]+=f;for(o in t)t[o]+="\n
        ";if(i="",!$.isEmptyObject(this.actions)){i+='\n
        ';for(u in this.actions)i+='\n ';i+="\n
        "}return t.join("")+i},action:function(n,t){var i=this.trigger({phase:"before",target:n,type:"action",originalEvent:t});if(i.isCancelled===!0)return!1;typeof this.actions[n]=="function"&&this.actions[n].call(this,t),this.trigger($.extend(i,{phase:"after"}))},resize:function(){function o(){s.width($(n.box).width()).height($(n.box).height()),i.css("top",n.header!=""?w2utils.getSize(t,"height"):0),f.css("top",(n.header!=""?w2utils.getSize(t,"height"):0)+(n.toolbar.items.length>0?w2utils.getSize(i,"height"):0)),u.css("top",(n.header!=""?w2utils.getSize(t,"height"):0)+(n.toolbar.items.length>0?w2utils.getSize(i,"height")+5:0)+(n.tabs.tabs.length>0?w2utils.getSize(f,"height")+5:0)),u.css("bottom",r.length>0?w2utils.getSize(r,"height"):0)}var n=this,e=this.trigger({phase:"before",target:this.name,type:"resize"});if(e.isCancelled===!0)return!1;var s=$(this.box).find("> div"),t=$(this.box).find("> div .w2ui-form-header"),i=$(this.box).find("> div .w2ui-form-toolbar"),f=$(this.box).find("> div .w2ui-form-tabs"),u=$(this.box).find("> div .w2ui-page"),h=$(this.box).find("> div .w2ui-page.page-"+this.page),c=$(this.box).find("> div .w2ui-page.page-"+this.page+" > div"),r=$(this.box).find("> div .w2ui-buttons");o(),(parseInt($(this.box).height())==0||$(this.box).data("auto-size")===!0)&&($(this.box).height((t.length>0?w2utils.getSize(t,"height"):0)+(this.tabs.tabs.length>0?w2utils.getSize(f,"height"):0)+(this.toolbar.items.length>0?w2utils.getSize(i,"height"):0)+(u.length>0?w2utils.getSize(c,"height")+w2utils.getSize(h,"+height")+12:0)+(r.length>0?w2utils.getSize(r,"height"):0)),$(this.box).data("auto-size",!0)),o(),n.trigger($.extend(e,{phase:"after"}))},refresh:function(){var i=this,e,f,n,t,u,r;if(this.box&&this.isGenerated&&typeof $(this.box).html()!="undefined"){if($(this.box).find("input, textarea, select").each(function(n,t){var e=typeof $(t).attr("name")!="undefined"?$(t).attr("name"):$(t).attr("id"),f=i.get(e),u,r;if(f&&(u=$(t).parents(".w2ui-page"),u.length>0))for(r=0;r<100;r++)if(u.hasClass("page-"+r)){f.page=r;break}}),e=this.trigger({phase:"before",target:this.name,type:"refresh",page:this.page}),e.isCancelled===!0)return!1;$(this.box).find(".w2ui-page").hide(),$(this.box).find(".w2ui-page.page-"+this.page).show(),$(this.box).find(".w2ui-form-header").html(this.header),typeof this.tabs=="object"&&this.tabs.tabs.length>0?($("#form_"+this.name+"_tabs").show(),this.tabs.active=this.tabs.tabs[this.page].id,this.tabs.refresh()):$("#form_"+this.name+"_tabs").hide(),typeof this.toolbar=="object"&&this.toolbar.items.length>0?($("#form_"+this.name+"_toolbar").show(),this.toolbar.refresh()):$("#form_"+this.name+"_toolbar").hide();for(f in this.fields){n=this.fields[f],n.el=$(this.box).find('[name="'+String(n.name).replace(/\\/g,"\\\\")+'"]')[0],typeof n.el=="undefined"&&console.log('ERROR: Cannot associate field "'+n.name+'" with html control. Make sure html control exists with the same name.'),n.el&&(n.el.id=n.name);$(n.el).off("change").on("change",function(){var r=this.value,s=i.record[this.name]?i.record[this.name]:"",u=i.get(this.name),n,f,t;if((u.type=="enum"||u.type=="upload")&&$(this).data("selected")){var e=$(this).data("selected"),o=i.record[this.name],r=[],s=[];if($.isArray(e))for(n in e)r[n]=$.extend(!0,{},e[n]);if($.isArray(o))for(n in o)s[n]=$.extend(!0,{},o[n])}if(f=i.trigger({phase:"before",target:this.name,type:"change",value_new:r,value_previous:s}),f.isCancelled===!0)return $(this).val(i.record[this.name]),!1;t=this.value,this.type=="checkbox"&&(t=this.checked?!0:!1),this.type=="radio"&&(t=this.checked?!0:!1),u.type=="enum"&&(t=r),u.type=="upload"&&(t=r),i.record[this.name]=t,i.trigger($.extend(f,{phase:"after"}))});n.required?$(n.el).parent().addClass("w2ui-required"):$(n.el).parent().removeClass("w2ui-required")}$(this.box).find("button, input[type=button]").each(function(n,t){$(t).off("click").on("click",function(n){var t=this.value;this.name&&(t=this.name),this.id&&(t=this.id),i.action(t,n)})});for(f in this.fields)if(n=this.fields[f],t=typeof this.record[n.name]!="undefined"?this.record[n.name]:"",n.el)switch(String(n.type).toLowerCase()){case"email":case"text":case"textarea":n.el.value=t;break;case"date":n.options||(n.options={}),n.options.format||(n.options.format=w2utils.settings.date_format),n.el.value=t,this.record[n.name]=t,$(n.el).w2field($.extend({},n.options,{type:"date"}));break;case"int":n.el.value=t,$(n.el).w2field("int");break;case"float":n.el.value=t,$(n.el).w2field("float");break;case"money":n.el.value=t,$(n.el).w2field("money");break;case"hex":n.el.value=t,$(n.el).w2field("hex");break;case"alphanumeric":n.el.value=t,$(n.el).w2field("alphaNumeric");break;case"checkbox":this.record[n.name]==!0||this.record[n.name]==1||this.record[n.name]=="t"?$(n.el).prop("checked",!0):$(n.el).prop("checked",!1);break;case"password":n.el.value=t;break;case"select":case"list":$(n.el).w2field($.extend({},n.options,{type:"list",value:t}));break;case"enum":if(typeof n.options=="undefined"||typeof n.options.url=="undefined"&&typeof n.options.items=="undefined"){console.log("ERROR: (w2form."+i.name+") the field "+n.name+" defined as enum but not field.options.url or field.options.items provided.");break}this.record[n.name]=w2obj.field.cleanItems(t),t=this.record[n.name],$(n.el).w2field($.extend({},n.options,{type:"enum",selected:t}));break;case"upload":$(n.el).w2field($.extend({},n.options,{type:"upload",selected:t}));break;default:console.log('ERROR: field type "'+n.type+'" is not recognized.')}for(u=$(this.box).find(".w2ui-page"),r=0;r *").length>1&&$(u[r]).wrapInner("
        ");this.trigger($.extend(e,{phase:"after"})),this.resize()}},render:function(n){function f(){var n=$(t.box).find("input, select, textarea");n.length>t.focus&&n[t.focus].focus()}var t=this,i,u,r;if(typeof n=="object"&&($(this.box).find("#form_"+this.name+"_tabs").length>0&&$(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-form").html(""),this.box=n),this.isGenerated){if(i=this.trigger({phase:"before",target:this.name,type:"render",box:typeof n!="undefined"?n:this.box}),i.isCancelled===!0)return!1;if(u="
        "+(this.header!=""?'
        '+this.header+"
        ":"")+'\t
        \t
        '+this.formHTML+"
        ",$(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-form").html(u),$(this.box).length>0&&($(this.box)[0].style.cssText+=this.style),typeof this.toolbar.render=="undefined"){this.toolbar=$().w2toolbar($.extend({},this.toolbar,{name:this.name+"_toolbar",owner:this}));this.toolbar.on("click",function(n){var i=t.trigger({phase:"before",type:"toolbar",target:n.target,originalEvent:n});if(i.isCancelled===!0)return!1;t.trigger($.extend(i,{phase:"after"}))})}if(typeof this.toolbar=="object"&&typeof this.toolbar.render=="function"&&this.toolbar.render($("#form_"+this.name+"_toolbar")[0]),typeof this.tabs.render=="undefined"){this.tabs=$().w2tabs($.extend({},this.tabs,{name:this.name+"_tabs",owner:this}));this.tabs.on("click",function(n){t.goto(this.get(n.target,!0))})}if(typeof this.tabs=="object"&&typeof this.tabs.render=="function"&&this.tabs.render($("#form_"+this.name+"_tabs")[0]),this.trigger($.extend(i,{phase:"after"})),this.resize(),r=typeof this.url!="object"?this.url:this.url.get,r&&this.recid!=0?this.request():this.refresh(),$(".w2ui-layout").length==0){this.tmp_resize=function(){w2ui[t.name].resize()};$(window).off("resize","body").on("resize","body",this.tmp_resize)}setTimeout(function(){t.resize(),t.refresh()},150),this.focus>=0&&setTimeout(f,500)}},destroy:function(){var n=this.trigger({phase:"before",target:this.name,type:"destroy"});if(n.isCancelled===!0)return!1;typeof this.toolbar=="object"&&this.toolbar.destroy&&this.toolbar.destroy(),typeof this.tabs=="object"&&this.tabs.destroy&&this.tabs.destroy(),$(this.box).find("#form_"+this.name+"_tabs").length>0&&$(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-form").html(""),delete w2ui[this.name],this.trigger($.extend(n,{phase:"after"})),$(window).off("resize","body")}},$.extend(w2form.prototype,w2utils.event),w2obj.form=w2form}(jQuery); \ No newline at end of file diff --git a/langs/index.html b/langs/index.html new file mode 100644 index 0000000..25d941d --- /dev/null +++ b/langs/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/simple-ads-manager-be_BY.mo b/langs/simple-ads-manager-be_BY.mo similarity index 100% rename from simple-ads-manager-be_BY.mo rename to langs/simple-ads-manager-be_BY.mo diff --git a/simple-ads-manager-be_BY.po b/langs/simple-ads-manager-be_BY.po similarity index 100% rename from simple-ads-manager-be_BY.po rename to langs/simple-ads-manager-be_BY.po diff --git a/simple-ads-manager-de_DE.mo b/langs/simple-ads-manager-de_DE.mo similarity index 100% rename from simple-ads-manager-de_DE.mo rename to langs/simple-ads-manager-de_DE.mo diff --git a/simple-ads-manager-de_DE.po b/langs/simple-ads-manager-de_DE.po similarity index 100% rename from simple-ads-manager-de_DE.po rename to langs/simple-ads-manager-de_DE.po diff --git a/simple-ads-manager-es_ES.mo b/langs/simple-ads-manager-es_ES.mo similarity index 100% rename from simple-ads-manager-es_ES.mo rename to langs/simple-ads-manager-es_ES.mo diff --git a/simple-ads-manager-es_ES.po b/langs/simple-ads-manager-es_ES.po similarity index 100% rename from simple-ads-manager-es_ES.po rename to langs/simple-ads-manager-es_ES.po diff --git a/langs/simple-ads-manager-ru_RU.mo b/langs/simple-ads-manager-ru_RU.mo new file mode 100644 index 0000000..c3a6c76 Binary files /dev/null and b/langs/simple-ads-manager-ru_RU.mo differ diff --git a/simple-ads-manager-ru_RU.po b/langs/simple-ads-manager-ru_RU.po similarity index 65% rename from simple-ads-manager-ru_RU.po rename to langs/simple-ads-manager-ru_RU.po index 58679d9..1c25da4 100644 --- a/simple-ads-manager-ru_RU.po +++ b/langs/simple-ads-manager-ru_RU.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Simple Ads Manager\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-31 12:19+0300\n" +"POT-Creation-Date: 2013-12-29 20:06+0300\n" "PO-Revision-Date: \n" "Last-Translator: minimus \n" "Language-Team: minimus \n" @@ -17,63 +17,193 @@ msgstr "" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;__ngettext;" -"_n:1,2;_nc:1,2;esc_attr__\n" +"_n:1,2;_nc:4c,1,2;esc_attr__;_en:1,2;_ex:1,2c;_x:1,2c\n" "X-Poedit-Basepath: .\n" -"X-Generator: Poedit 1.5.7\n" +"X-Generator: Poedit 1.6.3\n" "X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: ..\n" -#: ad.class.php:78 ad.class.php:477 +#: ../ad.class.php:87 msgid "Flash ad" msgstr "Флеш объявление" -#: ad.class.php:193 +#: ../ad.class.php:208 msgid "Empty data..." msgstr "Нет данных ..." -#: admin.class.php:172 +#: ../admin.class.php:150 +msgid "Active W3 Total Cache plugin detected." +msgstr "Обнаружен активный плагин W3 Total Cache." + +#: ../admin.class.php:151 +msgid "Active WP Super Cache plugin detected." +msgstr "Обнаружен активный плагин WP Super Cache." + +#: ../admin.class.php:156 +msgid "Active bbPress Forum plugin detected." +msgstr "Обнаружен активный плагин bbPress." + +#: ../admin.class.php:175 +msgid "Cache of WP Super Cache plugin is flushed." +msgstr "Кэш плагина WP Super Cache обновлён." + +#: ../admin.class.php:179 +msgid "Cache of W3 Total Cache plugin is flushed." +msgstr "Кэш плагина W3 Total Cache обновлён." + +#: ../admin.class.php:399 ../editor.admin.class.php:1487 +msgid "Advertiser Name" +msgstr "Имя рекламодателя" + +#: ../admin.class.php:400 +msgid "Advertiser Nick" +msgstr "Ник рекламодателя" + +#: ../admin.class.php:401 ../editor.admin.class.php:1491 +msgid "Advertiser e-mail" +msgstr "e-mail рекламодателя" + +#: ../admin.class.php:405 +msgid "Category Title" +msgstr "Наименование рубрики" + +#: ../admin.class.php:406 +msgid "Category Slug" +msgstr "Ярлык рубрики" + +#: ../admin.class.php:410 ../admin.class.php:429 +msgid "Display Name" +msgstr "Показываемое имя" + +#: ../admin.class.php:411 ../admin.class.php:430 +msgid "User Name" +msgstr "Имя пользователя" + +#: ../admin.class.php:415 +msgid "Tag Title" +msgstr "Название метки" + +#: ../admin.class.php:416 +msgid "Tag Slug" +msgstr "Ярлык метки" + +#: ../admin.class.php:419 +msgid "Custom Type Title" +msgstr "Заголовок пользовательского типа" + +#: ../admin.class.php:420 +msgid "Custom Type Slug" +msgstr "Ярлык пользовательского типа" + +#: ../admin.class.php:424 +msgid "Publication Title" +msgstr "Заголовок публикации" + +#: ../admin.class.php:425 +msgid "Publication Type" +msgstr "Тип публикации" + +#: ../admin.class.php:431 +msgid "Role" +msgstr "Роль" + +#: ../admin.class.php:434 ../block.list.admin.class.php:88 +#: ../block.list.admin.class.php:94 ../errorlog.admin.class.php:83 +#: ../errorlog.admin.class.php:93 ../list.admin.class.php:173 +#: ../list.admin.class.php:184 ../list.admin.class.php:360 +#: ../list.admin.class.php:370 ../zone.list.admin.class.php:88 +#: ../zone.list.admin.class.php:94 +msgid "ID" +msgstr "ID" + +#: ../admin.class.php:435 +msgid "Term Name" +msgstr "Имя термина" + +#: ../admin.class.php:436 +msgid "Custom Taxonomy Name" +msgstr "Имя пользовательской таксономии" + +#: ../admin.class.php:442 +msgid "Full Size" +msgstr "Полный размер" + +#: ../admin.class.php:503 +msgid "" +"Shortcode [name] will be replaced with advertiser's name. " +"Shortcode [site] will be replaced with name of your site. " +"Shotcode [month] will be replaced with name of month of " +"reporting period." +msgstr "" +"Шаблон [name] будет заменён на имя рекламодателя. Шаблон " +"[site] будет заменён на имя Вашего сайта. Шаблон [month] будет заменён на имя месяца отчётного периода." + +#: ../admin.class.php:507 ../editor.admin.class.php:479 +#: ../editor.admin.class.php:1008 +msgid "General" +msgstr "Основные параметры" + +#: ../admin.class.php:508 msgid "General Settings" msgstr "Основные параметры" -#: admin.class.php:173 +#: ../admin.class.php:509 +msgid "Extended Options" +msgstr "Дополнительные параметры" + +#: ../admin.class.php:510 +msgid "Admin Layout" +msgstr "Параметры административных страниц" + +#: ../admin.class.php:511 +msgid "Plugin Deactivating" +msgstr "Деактивация плагина" + +#: ../admin.class.php:513 +msgid "Auto Inserting" +msgstr "Автовставка" + +#: ../admin.class.php:514 msgid "Auto Inserting Settings" msgstr "Параметры автовставки" -#: admin.class.php:174 -msgid "Extended Options" -msgstr "Дополнительные параметры" +#: ../admin.class.php:516 +msgid "Google" +msgstr "Google" -#: admin.class.php:175 +#: ../admin.class.php:517 msgid "Google DFP Settings" msgstr "Параметры Google DFP" -#: admin.class.php:176 help.class.php:68 help.class.php:195 +#: ../admin.class.php:519 +msgid "Tools" +msgstr "Инструменты" + +#: ../admin.class.php:520 ../help.class.php:68 ../help.class.php:195 msgid "Statistics Settings" msgstr "Параметры статистики" -#: admin.class.php:177 -msgid "Admin Layout" -msgstr "Параметры административных страниц" - -#: admin.class.php:178 -msgid "Plugin Deactivating" -msgstr "Деактивация плагина" +#: ../admin.class.php:521 +msgid "Mailing System" +msgstr "Система рассылки" -#: admin.class.php:180 +#: ../admin.class.php:524 msgid "Views per Cycle" msgstr "Показов в цикле" -#: admin.class.php:180 +#: ../admin.class.php:524 msgid "" "Number of hits of one ad for a full cycle of rotation (maximal activity)." msgstr "" "Количество показов одного рекламного объявления за полный цикл ротации при " "максимальной активности (см. \"вес объявления\")." -#: admin.class.php:181 +#: ../admin.class.php:525 msgid "Minimum Level for access to menu" msgstr "Минимальный уровень для доступа к меню" -#: admin.class.php:181 +#: ../admin.class.php:525 msgid "" "Who can use menu of plugin - Minimum User Level needed for access to menu of " "plugin. In any case only Super Admin and Administrator can use Settings Menu " @@ -83,79 +213,144 @@ msgstr "" "необходимый для доступа к меню плагина. В любом случае, доступ к меню " "настроек плагина имеют только Администратор и Супер Администратор." -#: admin.class.php:181 admin.class.php:418 admin.class.php:558 +#: ../admin.class.php:525 ../admin.class.php:653 ../admin.class.php:794 msgid "Super Admin" msgstr "Супер Админ" -#: admin.class.php:181 admin.class.php:419 admin.class.php:557 +#: ../admin.class.php:525 ../admin.class.php:654 ../admin.class.php:793 msgid "Administrator" msgstr "Администратор" -#: admin.class.php:181 admin.class.php:420 admin.class.php:556 +#: ../admin.class.php:525 ../admin.class.php:655 ../admin.class.php:792 msgid "Editor" msgstr "Редактор" -#: admin.class.php:181 admin.class.php:421 admin.class.php:554 +#: ../admin.class.php:525 ../admin.class.php:656 ../admin.class.php:791 msgid "Author" msgstr "Автор" -#: admin.class.php:181 admin.class.php:422 admin.class.php:553 +#: ../admin.class.php:525 ../admin.class.php:657 ../admin.class.php:790 msgid "Contributor" msgstr "Участник" -#: admin.class.php:182 +#: ../admin.class.php:526 +msgid "Ad Output Mode" +msgstr "Режим вывода объявления" + +#: ../admin.class.php:526 +msgid "" +"Standard (PHP) mode is more faster but is not compatible with caching " +"plugins. If your blog use caching plugin (i.e WP Super Cache or W3 Total " +"Cache) select \"Caching Compatible (Javascript)\" mode. Due to the confusion " +"around \"mfunc\" in caching plugins, I decided to refrain from development " +"of special support of these plugins." +msgstr "" +"Стандартный (PHP) режим более быстрый, но не совместим с плагинами " +"кэширования. Если на Вашем блоге установлены плагины кэширования (например: " +"WP Super Cache или W3 Total Cache), выберите режим совместимости с " +"кэшированием. В связи с неразберихой по поводу \"mfunc\" в плагинах " +"кэширования, я решил воздержаться от разработки специальной поддержки этих " +"плагинов. Режим Javascript неплохо решает проблему совместной работы с " +"плагинами кэширования." + +#: ../admin.class.php:526 +msgid "Standard (PHP)" +msgstr "Стандартный (PHP)" + +#: ../admin.class.php:526 +msgid "Caching Compatible (Javascript)" +msgstr "Совместимость с кэшированием (Javascript)" + +#: ../admin.class.php:527 msgid "Display Ad Source in" msgstr "Открывать ссылку в" -#: admin.class.php:182 +#: ../admin.class.php:527 msgid "Target wintow (tab) for advetisement source." msgstr "Открытие окна (вкладки) для рекламного объявления." -#: admin.class.php:182 +#: ../admin.class.php:527 msgid "New Window (Tab)" msgstr "Новое окно (вкладка)" -#: admin.class.php:182 +#: ../admin.class.php:527 msgid "Current Window (Tab)" msgstr "Текущее окно (вкладка)" -#: admin.class.php:184 +#: ../admin.class.php:528 +msgid "Allow displaying ads on bbPress forum pages" +msgstr "Разрешить показ объявленийна страницах форумов bbPress" + +#: ../admin.class.php:530 msgid "Ads Place before content" msgstr "Рекламное место до контента" -#: admin.class.php:185 +#: ../admin.class.php:531 msgid "Allow Ads Place auto inserting before post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места перед контентом статьи/" "страницы" -#: admin.class.php:186 admin.class.php:189 admin.class.php:192 +#: ../admin.class.php:532 +msgid "" +"Allow Ads Place auto inserting before post/page or post/page excerpt in the " +"loop" +msgstr "" +"Разрешить автоматическую вставку рекламного места перед контентом или " +"анонсом в цикле" + +#: ../admin.class.php:533 +msgid "Allow Ads Place auto inserting before bbPress Forum topic content" +msgstr "" +"Разрешить автоматическую вставку рекламного места перед контентом форумов " +"bbPress" + +#: ../admin.class.php:534 +msgid "Allow Ads Place auto inserting into bbPress Forum forums/topics lists" +msgstr "" +"Разрешить автоматическую вставку рекламного места в на страницах списков " +"форумов/топиков bbPress" + +#: ../admin.class.php:535 ../admin.class.php:539 ../admin.class.php:543 msgid "Allow using predefined Ads Place HTML codes (before and after codes)" msgstr "" "Использовать заранее заданные коды рекламного места (коды рекламного места " "\"до\" и \"после\")" -#: admin.class.php:187 +#: ../admin.class.php:536 msgid "Ads Place in the middle of content" msgstr "Рекламное место в средней части контента" -#: admin.class.php:188 +#: ../admin.class.php:537 msgid "Allow Ads Place auto inserting into the middle of post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места в середину контента статьи/" "страницы" -#: admin.class.php:190 +#: ../admin.class.php:538 +msgid "" +"Allow Ads Place auto inserting into the middle of bbPress Forum topic content" +msgstr "" +"Разрешить автоматическую вставку рекламного места в середину контента топика " +"форумов bbPress" + +#: ../admin.class.php:540 msgid "Ads Place after content" msgstr "Рекламное место после контента" -#: admin.class.php:191 +#: ../admin.class.php:541 msgid "Allow Ads Place auto inserting after post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места после контента статьи/" "страницы" -#: admin.class.php:194 +#: ../admin.class.php:542 +msgid "Allow Ads Place auto inserting after bbPress Forum topic content" +msgstr "" +"Разрешить автоматическую вставку рекламного места после контента топика " +"форумов bbPress" + +#: ../admin.class.php:545 msgid "" "I use (plan to use) my own flash (SWF) banners. In other words, allow " "loading the script \"SWFObject\" on the pages of the blog." @@ -163,35 +358,35 @@ msgstr "" "Я использую (планирую использовать) мои собственные флеш (SWF) баннеры. " "Другими словами, разрешить загрузку скрипта \"SWFObject\" на страницах блога." -#: admin.class.php:195 +#: ../admin.class.php:546 msgid "Turn on/off the error log." msgstr "Включить/выключить журнал ошибок." -#: admin.class.php:196 +#: ../admin.class.php:547 msgid "Turn on/off the error log for Face Side." msgstr "Включить/выключить журнал ошибок для Face Side." -#: admin.class.php:198 +#: ../admin.class.php:549 msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" msgstr "Разрешить использование кодов Google DoubleClick for Publishers (DFP)" -#: admin.class.php:199 +#: ../admin.class.php:550 msgid "Google DFP Pub Code" msgstr "Pub-код Google DFP" -#: admin.class.php:199 +#: ../admin.class.php:550 msgid "Your Google DFP Pub code. i.e:" msgstr "Ваш pub-код Google DFP. Например:" -#: admin.class.php:201 +#: ../admin.class.php:552 msgid "Allow Bots and Crawlers detection" msgstr "Разрешить обнаружение ботов и сканеров" -#: admin.class.php:202 +#: ../admin.class.php:553 msgid "Accuracy of Bots and Crawlers Detection" msgstr "Точность обнаружения ботов и сканеров" -#: admin.class.php:202 +#: ../admin.class.php:553 msgid "" "If bot is detected hits of ads won't be counted. Use with caution! More " "exact detection requires more server resources." @@ -199,23 +394,23 @@ msgstr "" "Если обнаружен бот, показы объявлений не будут защитаны. Используйте с " "осторожностью! Чем точнее определение, тем больше ресурсов сервера требуется." -#: admin.class.php:202 +#: ../admin.class.php:553 msgid "Inexact detection" msgstr "Неточное определение" -#: admin.class.php:202 +#: ../admin.class.php:553 msgid "Exact detection" msgstr "Точное определение" -#: admin.class.php:202 +#: ../admin.class.php:553 msgid "More exact detection" msgstr "Более точное определение" -#: admin.class.php:203 help.class.php:70 help.class.php:197 +#: ../admin.class.php:554 ../help.class.php:70 ../help.class.php:197 msgid "Display of Currency" msgstr "Показ валюты" -#: admin.class.php:203 help.class.php:70 help.class.php:197 +#: ../admin.class.php:554 ../help.class.php:70 ../help.class.php:197 msgid "" "Define display of currency. Auto - auto detection of currency from blog " "settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." @@ -224,23 +419,23 @@ msgstr "" "валюты из параметров настройки блога. Доллары США, Евро - принудительное " "отображение валюты в долларах США или евро." -#: admin.class.php:203 +#: ../admin.class.php:554 msgid "Auto" msgstr "Автоопределение" -#: admin.class.php:203 +#: ../admin.class.php:554 msgid "USD" msgstr "Доллары США" -#: admin.class.php:203 +#: ../admin.class.php:554 msgid "EUR" msgstr "Евро" -#: admin.class.php:205 +#: ../admin.class.php:556 msgid "TinyMCE Editor Button Mode" msgstr "Режим кнопки плагина в редакторе TinyMCE" -#: admin.class.php:205 +#: ../admin.class.php:556 msgid "" "If you do not want to use the modern dropdown button in your TinyMCE editor, " "or use of this button causes a problem, you can use classic TinyMCE buttons. " @@ -251,19 +446,19 @@ msgstr "" "можете использовать классические кнопки TinyMCE. В этом случае выберите " "\"Классические кнопки TinyMCE\"." -#: admin.class.php:205 +#: ../admin.class.php:556 msgid "Modern TinyMCE Button" msgstr "Современная кнопка TinyMCE" -#: admin.class.php:205 +#: ../admin.class.php:556 msgid "Classic TinyMCE Buttons" msgstr "Классические кнопки TinyMCE" -#: admin.class.php:206 +#: ../admin.class.php:557 msgid "Ads Places per Page" msgstr "Рекламных мест на страницу" -#: admin.class.php:206 +#: ../admin.class.php:557 msgid "" "Ads Places Management grid pagination. How many Ads Places will be shown on " "one page of grid." @@ -271,11 +466,11 @@ msgstr "" "Разбиение на страницы таблицы представления рекламных мест. Сколько " "рекламных мест будет показано в таблице на одной странице." -#: admin.class.php:207 +#: ../admin.class.php:558 msgid "Ads per Page" msgstr "Объявлений на страницу" -#: admin.class.php:207 +#: ../admin.class.php:558 msgid "" "Ads of Ads Place Management grid pagination. How many Ads will be shown on " "one page of grid." @@ -283,92 +478,150 @@ msgstr "" "Разбиение на страницы таблицы представления рекламных объявлений. Сколько " "рекламных объявлений будет показано в таблице на одной странице." -#: admin.class.php:209 +#: ../admin.class.php:560 msgid "Delete plugin options during deactivating plugin" msgstr "Удалить параметры плагина при деактивации" -#: admin.class.php:210 +#: ../admin.class.php:561 msgid "Delete database tables of plugin during deactivating plugin" msgstr "Удалить таблицы базы данных плагина во время деактивации" -#: admin.class.php:211 +#: ../admin.class.php:562 msgid "Delete custom images folder of plugin during deactivating plugin" msgstr "" "Удалить папку пользовательских изображений плагина во время деактивации" -#: admin.class.php:219 +#: ../admin.class.php:564 +msgid "Allow SAM Mailing System to send statistical data to advertisers" +msgstr "" +"Разрешить Системе Рассылки плагина отправлять статистические данные " +"рекламодателям." + +#: ../admin.class.php:565 +msgid "Mail Subject" +msgstr "Тема письма" + +#: ../admin.class.php:565 +msgid "Mail subject of sending email." +msgstr "Тема отправляемого письма." + +#: ../admin.class.php:566 +msgid "Mail Greeting String" +msgstr "Строка приветствия" + +#: ../admin.class.php:566 +msgid "Greeting string of sending email." +msgstr "Строка приветствия отправляемого письма." + +#: ../admin.class.php:567 +msgid "Mail Text before statistical data table" +msgstr "Текст перед таблицей статистической отчётности." + +#: ../admin.class.php:567 +msgid "Some text before statistical data table of sending email." +msgstr "" +"Любой, необходимый текст перед таблицей, содержащей статистические данные за " +"отчётный период." + +#: ../admin.class.php:568 +msgid "Mail Text after statistical data table" +msgstr "Текст после таблицы статистической отчётности" + +#: ../admin.class.php:568 +msgid "Some text after statistical data table of sending email." +msgstr "" +"Любой, необходимый текст после таблицы, содержащей статистические данные за " +"отчётный период." + +#: ../admin.class.php:569 +msgid "Mail Warning 1" +msgstr "Предупреждение 1" + +#: ../admin.class.php:569 +msgid "This text will be placed at the end of sending email." +msgstr "Текст будет помещён в конце посылаемого письма." + +#: ../admin.class.php:570 +msgid "Mail Warning 2" +msgstr "Предупреждение 2" + +#: ../admin.class.php:570 +msgid "This text will be placed at the very end of sending email." +msgstr "Текст будет помещён в самом конце посылаемого письма." + +#: ../admin.class.php:578 msgid "Ads" msgstr "Реклама" -#: admin.class.php:220 +#: ../admin.class.php:579 msgid "Ads List" msgstr "Список рекламных объявлений" -#: admin.class.php:220 +#: ../admin.class.php:579 msgid "Ads Places" msgstr "Рекламные места" -#: admin.class.php:222 +#: ../admin.class.php:580 msgid "Ad Editor" msgstr "Редактор рекламного объявления" -#: admin.class.php:222 +#: ../admin.class.php:580 msgid "New Place" msgstr "Новое место" -#: admin.class.php:225 +#: ../admin.class.php:581 msgid "Ads Zones List" msgstr "Список зон рекламных объявлений" -#: admin.class.php:225 +#: ../admin.class.php:581 msgid "Ads Zones" msgstr "Рекламные зоны" -#: admin.class.php:227 +#: ../admin.class.php:582 msgid "Ads Zone Editor" msgstr "Редактор рекламной зоны" -#: admin.class.php:227 +#: ../admin.class.php:582 msgid "New Zone" msgstr "Новая зона" -#: admin.class.php:230 +#: ../admin.class.php:583 msgid "Ads Blocks List" msgstr "Список блоков рекламных объявлений" -#: admin.class.php:230 +#: ../admin.class.php:583 msgid "Ads Blocks" msgstr "Рекламные блоки" -#: admin.class.php:232 block.editor.admin.class.php:391 +#: ../admin.class.php:584 ../block.editor.admin.class.php:402 msgid "Ads Block Editor" msgstr "Редактор рекламного блока" -#: admin.class.php:232 +#: ../admin.class.php:584 msgid "New Block" msgstr "Новый блок" -#: admin.class.php:235 admin.class.php:873 +#: ../admin.class.php:585 ../admin.class.php:1167 msgid "Simple Ads Manager Settings" msgstr "Параметры Simple Ads Manager" -#: admin.class.php:235 +#: ../admin.class.php:585 msgid "Settings" msgstr "Параметры" -#: admin.class.php:238 +#: ../admin.class.php:586 msgid "Simple Ads Manager Error Log" msgstr "Журнал ошибок Simple Ads Manager" -#: admin.class.php:238 errorlog.admin.class.php:57 +#: ../admin.class.php:586 ../errorlog.admin.class.php:57 msgid "Error Log" msgstr "Журнал ошибок" -#: admin.class.php:348 admin.class.php:370 editor.admin.class.php:388 +#: ../admin.class.php:701 ../admin.class.php:773 ../editor.admin.class.php:460 msgid "Name of Ads Place" msgstr "Имя рекламного места" -#: admin.class.php:348 admin.class.php:370 +#: ../admin.class.php:701 ../admin.class.php:773 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks, plugin's widgets or autoinserting of ads." @@ -377,12 +630,11 @@ msgstr "" "если вы планируете использовать блоки рекламных объявлений, виджеты плагина " "или автовставку объявлений." -#: admin.class.php:349 admin.class.php:371 editor.admin.class.php:874 +#: ../admin.class.php:702 ../admin.class.php:774 ../editor.admin.class.php:988 msgid "Name of Ad" msgstr "Имя рекламного объявления" -#: admin.class.php:349 admin.class.php:350 admin.class.php:371 -#: admin.class.php:372 +#: ../admin.class.php:702 ../admin.class.php:774 ../admin.class.php:822 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks or plugin's widgets." @@ -391,15 +643,73 @@ msgstr "" "если вы планируете использовать блоки рекламных объявлений или виджеты " "плагина." -#: admin.class.php:350 admin.class.php:372 zone.editor.admin.class.php:341 +#: ../admin.class.php:703 ../admin.class.php:775 +msgid "Select Banner Image" +msgstr "Выбор изображения баннера" + +#: ../admin.class.php:703 ../admin.class.php:775 +msgid "Select" +msgstr "Выбрать" + +#: ../admin.class.php:707 ../admin.class.php:781 +msgid "Uploading" +msgstr "Загружается" + +#: ../admin.class.php:708 ../admin.class.php:782 +msgid "Uploaded." +msgstr "загружен." + +#: ../admin.class.php:709 ../admin.class.php:783 +msgid "Only JPG, PNG or GIF files are allowed" +msgstr "Разрешается загрузка файлов формата JPG, PNG или GIF" + +#: ../admin.class.php:710 ../admin.class.php:784 +msgid "File" +msgstr "Файл" + +#: ../admin.class.php:714 ../admin.class.php:718 ../admin.class.php:795 +#: ../editor.admin.class.php:609 ../editor.admin.class.php:939 +#: ../editor.admin.class.php:1550 ../list.admin.class.php:176 +#: ../list.admin.class.php:187 ../list.admin.class.php:235 +#: ../list.admin.class.php:363 ../list.admin.class.php:373 +#: ../list.admin.class.php:425 +msgid "Hits" +msgstr "Показы" + +#: ../admin.class.php:714 ../admin.class.php:719 ../admin.class.php:795 +#: ../editor.admin.class.php:610 ../editor.admin.class.php:941 +#: ../editor.admin.class.php:1551 ../list.admin.class.php:236 +#: ../list.admin.class.php:364 ../list.admin.class.php:374 +#: ../list.admin.class.php:426 +msgid "Clicks" +msgstr "Клики" + +#: ../admin.class.php:717 ../block.editor.admin.class.php:308 +#: ../editor.admin.class.php:459 ../zone.editor.admin.class.php:381 +msgid "Name" +msgstr "Наименование" + +#: ../admin.class.php:787 +msgid "Post" +msgstr "Статья" + +#: ../admin.class.php:788 ../editor.admin.class.php:1136 +msgid "Page" +msgstr "Страница" + +#: ../admin.class.php:789 +msgid "Subscriber" +msgstr "Подписчик" + +#: ../admin.class.php:822 ../zone.editor.admin.class.php:382 msgid "Name of Ads Zone" msgstr "Имя рекламной зоны" -#: admin.class.php:351 admin.class.php:373 block.editor.admin.class.php:298 +#: ../admin.class.php:823 ../block.editor.admin.class.php:309 msgid "Name of Ads Block" msgstr "Имя рекламного блока" -#: admin.class.php:351 admin.class.php:373 +#: ../admin.class.php:823 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use plugin's widgets." @@ -407,136 +717,58 @@ msgstr "" "Необязательный параметр. Однако, настоятельно рекомендуется определить его, " "если вы планируете использовать виджеты плагина." -#: admin.class.php:390 +#: ../admin.class.php:842 msgid "Error ID" msgstr "ID ошибки" -#: admin.class.php:391 +#: ../admin.class.php:843 msgid "Error Date" msgstr "Дата ошибки" -#: admin.class.php:392 errorlog.admin.class.php:86 errorlog.admin.class.php:96 +#: ../admin.class.php:844 ../errorlog.admin.class.php:86 +#: ../errorlog.admin.class.php:96 msgid "Table" msgstr "Таблица" -#: admin.class.php:393 +#: ../admin.class.php:845 msgid "Error Message" msgstr "Сообщение об ошибке" -#: admin.class.php:394 +#: ../admin.class.php:846 msgid "Error SQL" msgstr "SQL вызвавший ошибку" -#: admin.class.php:395 errorlog.admin.class.php:87 errorlog.admin.class.php:97 +#: ../admin.class.php:847 ../errorlog.admin.class.php:87 +#: ../errorlog.admin.class.php:97 msgid "Type" msgstr "Тип ошибки" -#: admin.class.php:396 +#: ../admin.class.php:848 msgid "Close" msgstr "Закрыть" -#: admin.class.php:398 errorlog.admin.class.php:116 -#: errorlog.admin.class.php:132 +#: ../admin.class.php:850 ../admin.class.php:911 +#: ../errorlog.admin.class.php:116 ../errorlog.admin.class.php:132 msgid "Warning" msgstr "Внимание" -#: admin.class.php:398 errorlog.admin.class.php:136 +#: ../admin.class.php:850 ../errorlog.admin.class.php:136 msgid "Ok" msgstr "Ok" -#: admin.class.php:552 -msgid "Subscriber" -msgstr "Подписчик" - -#: admin.class.php:598 -msgid "Post" -msgstr "Статья" - -#: admin.class.php:601 editor.admin.class.php:1036 -msgid "Page" -msgstr "Страница" - -#: admin.class.php:604 -msgid "Post:" -msgstr "Статья:" - -#: admin.class.php:610 -msgid "Uploading" -msgstr "Загружается" - -#: admin.class.php:611 -msgid "Uploaded." -msgstr "загружен." - -#: admin.class.php:612 -msgid "Only JPG, PNG or GIF files are allowed" -msgstr "Разрешается загрузка файлов формата JPG, PNG или GIF" - -#: admin.class.php:613 -msgid "File" -msgstr "Файл" - -#: admin.class.php:619 -msgid "Category Title" -msgstr "Наименование рубрики" - -#: admin.class.php:620 -msgid "Category Slug" -msgstr "Ярлык рубрики" - -#: admin.class.php:627 admin.class.php:664 -msgid "Display Name" -msgstr "Показываемое имя" - -#: admin.class.php:628 admin.class.php:665 -msgid "User Name" -msgstr "Имя пользователя" - -#: admin.class.php:635 -msgid "Tag Title" -msgstr "Название метки" - -#: admin.class.php:636 -msgid "Tag Slug" -msgstr "Ярлык метки" - -#: admin.class.php:642 -msgid "Custom Type Title" -msgstr "Заголовок пользовательского типа" - -#: admin.class.php:643 -msgid "Custom Type Slug" -msgstr "Ярлык пользовательского типа" - -#: admin.class.php:650 -msgid "Publication Title" -msgstr "Заголовок публикации" - -#: admin.class.php:651 -msgid "Publication Type" -msgstr "Тип публикации" - -#: admin.class.php:658 editor.admin.class.php:1349 -msgid "Advertiser Name" -msgstr "Имя рекламодателя" - -#: admin.class.php:659 -msgid "Advertiser Nick" -msgstr "Ник рекламодателя" - -#: admin.class.php:660 editor.admin.class.php:1353 -msgid "Advertiser e-mail" -msgstr "e-mail рекламодателя" +#: ../admin.class.php:911 ../errorlog.admin.class.php:116 +msgid "Update Error" +msgstr "Ошибка обновления" -#: admin.class.php:666 -msgid "Role" -msgstr "Роль" +#: ../admin.class.php:911 ../errorlog.admin.class.php:116 +msgid "Output Error" +msgstr "Ошибка вывода" -#: admin.class.php:740 +#: ../admin.class.php:1022 msgid "There are general options." msgstr "Основные параметры плагина." -#: admin.class.php:744 +#: ../admin.class.php:1026 msgid "" "Single post/page auto inserting options. Use these parameters for allowing/" "defining Ads Places which will be automatically inserted before/after post/" @@ -546,90 +778,99 @@ msgstr "" "Используйте эти параметры для разрешения/определения рекламных мест, которые " "будут автоматически вставлены до/после контента статьи/страницы." -#: admin.class.php:752 +#: ../admin.class.php:1034 msgid "Adjust parameters of your Google DFP account." msgstr "Настройте параметры вашей учётной записи Google DFP." -#: admin.class.php:756 +#: ../admin.class.php:1038 msgid "Adjust parameters of plugin statistics." msgstr "Настройте параметры статистики плагина." -#: admin.class.php:760 +#: ../admin.class.php:1042 msgid "This options define layout for Ads Managin Pages." msgstr "" "Эти параметры определяют внешний вид страниц управления рекламными " "объявлениями и рекламными местами." -#: admin.class.php:764 +#: ../admin.class.php:1046 msgid "Are you allow to perform these actions during deactivating plugin?" msgstr "Вы разрешаете выполнение этих деиствий в ходе деактивации плагина?" -#: admin.class.php:886 +#: ../admin.class.php:1054 +msgid "Next mailing is scheduled on" +msgstr "Следующая рассылка запланирована на" + +#: ../admin.class.php:1056 +msgid "Adjust parameters of Mailing System." +msgstr "Настройте параметры Системы рассылки." + +#: ../admin.class.php:1181 msgid "Simple Ads Manager Settings Updated." msgstr "Параметры Simple Ads Manager сохранены." -#: admin.class.php:894 +#: ../admin.class.php:1189 msgid "System Info" msgstr "Системная информация" -#: admin.class.php:901 +#: ../admin.class.php:1196 msgid "Wordpress Version" msgstr "Версия Wordpress" -#: admin.class.php:902 +#: ../admin.class.php:1197 msgid "SAM Version" msgstr "Версия плагина" -#: admin.class.php:903 +#: ../admin.class.php:1198 msgid "SAM DB Version" msgstr "Версия таблиц БД плагина" -#: admin.class.php:904 +#: ../admin.class.php:1199 msgid "PHP Version" msgstr "Версия PHP" -#: admin.class.php:905 +#: ../admin.class.php:1200 msgid "MySQL Version" msgstr "Версия MySQL" -#: admin.class.php:906 +#: ../admin.class.php:1201 msgid "Memory Limit" msgstr "Лимит памяти" -#: admin.class.php:910 +#: ../admin.class.php:1205 msgid "Note! If you have detected a bug, include this data to bug report." msgstr "" "Обратите внимание! Если вы обнаружили ошибку, не забудьте включить эти " "данные в отчет об ошибке." -#: admin.class.php:915 +#: ../admin.class.php:1210 msgid "Resources" msgstr "Ресурсы" -#: admin.class.php:918 +#: ../admin.class.php:1213 msgid "Wordpress Plugin Page" msgstr "Страница плагина на Wordpress" -#: admin.class.php:919 +#: ../admin.class.php:1214 msgid "Author Plugin Page" msgstr "Страница плагина" -#: admin.class.php:920 help.class.php:34 help.class.php:51 help.class.php:58 -#: help.class.php:72 help.class.php:105 help.class.php:113 help.class.php:124 -#: help.class.php:141 help.class.php:150 help.class.php:166 help.class.php:182 -#: help.class.php:199 +#: ../admin.class.php:1215 ../help.class.php:34 ../help.class.php:51 +#: ../help.class.php:58 ../help.class.php:72 ../help.class.php:105 +#: ../help.class.php:113 ../help.class.php:124 ../help.class.php:141 +#: ../help.class.php:150 ../help.class.php:166 ../help.class.php:182 +#: ../help.class.php:199 msgid "Support Forum" msgstr "Форум поддержки" -#: admin.class.php:921 +#: ../admin.class.php:1216 msgid "Author's Blog" msgstr "Блог автора" -#: admin.class.php:926 +#: ../admin.class.php:1221 msgid "Donations" msgstr "Пожертвования" -#: admin.class.php:930 +#: ../admin.class.php:1233 #, php-format msgid "" "If you have found this plugin useful, please consider making a %s to help " @@ -639,46 +880,28 @@ msgstr "" "%s, чтобы поддержать дальнейшие работы по разработке плагина. Ваша поддержка " "будет оценена по достоинству. Спасибо!" -#: admin.class.php:931 admin.class.php:938 +#: ../admin.class.php:1234 msgid "Donate Now!" msgstr "Пожертвовать!" -#: admin.class.php:931 +#: ../admin.class.php:1234 msgid "donation" msgstr "пожертвование" -#: admin.class.php:935 admin.class.php:948 -msgid "Donate via" -msgstr "Пожертвовать через" - -#: admin.class.php:943 -#, php-format -msgid "" -"Warning! The default value of donation is %s. Don't worry! This is not my " -"appetite, this is default value defined by Payoneer service." -msgstr "" -"Внимание! Значение по умолчанию для пожертвования составляет %s. Не " -"волнуйтесь! Это не мой аппетит, это - значение по умолчанию, определенное " -"службой Payoneer." - -#: admin.class.php:943 -msgid " You can change it to any value you want!" -msgstr " Вы можете изменить его на любое значение, которое посчитаете нужным!" - -#: admin.class.php:960 +#: ../admin.class.php:1252 msgid "Another Plugins" msgstr "Другие плагины" -#: admin.class.php:964 +#: ../admin.class.php:1256 #, php-format msgid "Another plugins from %s" msgstr "Другие плагины от %s'а" -#: admin.class.php:970 +#: ../admin.class.php:1262 msgid "Highlights any portion of text as text in the colored boxes." msgstr "Подсветка любой части текста в виде текста в цветной рамке." -#: admin.class.php:971 +#: ../admin.class.php:1263 msgid "" "Adds simple counters badge (FeedBurner subscribers and Twitter followers) to " "your blog." @@ -686,136 +909,146 @@ msgstr "" "Добавляет бейджик счётчиков (подписчики Feedburner и последователи Twitter) " "на все страницы блога." -#: admin.class.php:972 +#: ../admin.class.php:1264 msgid "This plugin is WordPress shell for FloatBox library by Byron McGregor." msgstr "Wordpress оболочка для плагина FloatBox от Байрона МакГрегора." -#: admin.class.php:973 +#: ../admin.class.php:1265 msgid "Adds copyright notice in the end of each post of your blog. " msgstr "" "Добавляет строку уведомления об авторском праве в конец каждой статьи блога." -#: block.editor.admin.class.php:73 block.editor.admin.class.php:253 -#: block.editor.admin.class.php:303 block.editor.admin.class.php:317 -#: block.editor.admin.class.php:335 block.editor.admin.class.php:361 -#: block.editor.admin.class.php:390 editor.admin.class.php:335 -#: editor.admin.class.php:393 editor.admin.class.php:407 -#: editor.admin.class.php:428 editor.admin.class.php:505 -#: editor.admin.class.php:810 editor.admin.class.php:879 -#: editor.admin.class.php:901 editor.admin.class.php:987 -#: editor.admin.class.php:1086 editor.admin.class.php:1129 -#: editor.admin.class.php:1341 editor.admin.class.php:1361 -#: editor.admin.class.php:1393 zone.editor.admin.class.php:296 -#: zone.editor.admin.class.php:346 zone.editor.admin.class.php:360 +#: ../admin.class.php:1281 +msgctxt "Copyright String" +msgid "Simple Ads Manager plugin for Wordpress." +msgstr "Wordpress плагин Simple Ads Manager" + +#: ../admin.class.php:1281 +msgctxt "Copyright String" +msgid "All rights reserved." +msgstr "Все права защищены." + +#: ../block.editor.admin.class.php:73 ../block.editor.admin.class.php:253 +#: ../block.editor.admin.class.php:314 ../block.editor.admin.class.php:328 +#: ../block.editor.admin.class.php:346 ../block.editor.admin.class.php:372 +#: ../block.editor.admin.class.php:401 ../editor.admin.class.php:396 +#: ../editor.admin.class.php:465 ../editor.admin.class.php:486 +#: ../editor.admin.class.php:507 ../editor.admin.class.php:527 +#: ../editor.admin.class.php:617 ../editor.admin.class.php:913 +#: ../editor.admin.class.php:993 ../editor.admin.class.php:1017 +#: ../editor.admin.class.php:1087 ../editor.admin.class.php:1187 +#: ../editor.admin.class.php:1432 ../editor.admin.class.php:1479 +#: ../editor.admin.class.php:1499 ../editor.admin.class.php:1560 +#: ../zone.editor.admin.class.php:326 ../zone.editor.admin.class.php:387 +#: ../zone.editor.admin.class.php:401 msgid "Click to toggle" msgstr "Кликнуть для переключения" -#: block.editor.admin.class.php:74 +#: ../block.editor.admin.class.php:74 msgid "Item" msgstr "Элемент" -#: block.editor.admin.class.php:77 help.class.php:125 widget.class.php:15 -#: js/dialog.php:48 +#: ../block.editor.admin.class.php:77 ../help.class.php:125 +#: ../widget.class.php:16 ../js/dialog.php:53 msgid "Ads Place" msgstr "Рекламное место" -#: block.editor.admin.class.php:79 block.editor.admin.class.php:92 -#: block.editor.admin.class.php:105 +#: ../block.editor.admin.class.php:79 ../block.editor.admin.class.php:92 +#: ../block.editor.admin.class.php:105 msgid "Non selected" msgstr "Не выбрано" -#: block.editor.admin.class.php:90 widget.class.php:293 +#: ../block.editor.admin.class.php:90 ../widget.class.php:291 msgid "Single Ad" msgstr "Рекламное объявление" -#: block.editor.admin.class.php:103 widget.class.php:149 widget.class.php:154 -#: js/dialog-zone.php:48 +#: ../block.editor.admin.class.php:103 ../widget.class.php:150 +#: ../widget.class.php:155 ../js/dialog-zone.php:53 msgid "Ads Zone" msgstr "Рекламная зона" -#: block.editor.admin.class.php:173 block.editor.admin.class.php:217 -#: block.editor.admin.class.php:243 editor.admin.class.php:266 -#: editor.admin.class.php:298 editor.admin.class.php:315 -#: editor.admin.class.php:316 editor.admin.class.php:317 -#: editor.admin.class.php:325 editor.admin.class.php:637 -#: editor.admin.class.php:727 editor.admin.class.php:791 -#: editor.admin.class.php:792 editor.admin.class.php:793 -#: zone.editor.admin.class.php:158 zone.editor.admin.class.php:253 -#: zone.editor.admin.class.php:286 +#: ../block.editor.admin.class.php:173 ../block.editor.admin.class.php:217 +#: ../block.editor.admin.class.php:243 ../editor.admin.class.php:327 +#: ../editor.admin.class.php:359 ../editor.admin.class.php:376 +#: ../editor.admin.class.php:377 ../editor.admin.class.php:378 +#: ../editor.admin.class.php:386 ../editor.admin.class.php:727 +#: ../editor.admin.class.php:826 ../editor.admin.class.php:894 +#: ../editor.admin.class.php:895 ../editor.admin.class.php:896 +#: ../zone.editor.admin.class.php:172 ../zone.editor.admin.class.php:282 +#: ../zone.editor.admin.class.php:316 msgid "Undefined" msgstr "Не определено" -#: block.editor.admin.class.php:184 +#: ../block.editor.admin.class.php:184 msgid "Ads Block Data Updated." msgstr "Данные рекламного блока сохранены." -#: block.editor.admin.class.php:243 +#: ../block.editor.admin.class.php:243 msgid "New Ads Block" msgstr "Новый рекламный блок" -#: block.editor.admin.class.php:243 +#: ../block.editor.admin.class.php:243 msgid "Edit Ads Block" msgstr "Изменить рекламный блок" -#: block.editor.admin.class.php:254 editor.admin.class.php:336 -#: editor.admin.class.php:811 errorlog.admin.class.php:84 -#: errorlog.admin.class.php:94 zone.editor.admin.class.php:297 +#: ../block.editor.admin.class.php:254 ../editor.admin.class.php:397 +#: ../editor.admin.class.php:914 ../errorlog.admin.class.php:84 +#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:327 msgid "Status" msgstr "Статус" -#: block.editor.admin.class.php:261 +#: ../block.editor.admin.class.php:263 msgid "Back to Blocks List" msgstr "Назад, к списку блоков" -#: block.editor.admin.class.php:267 js/dialog-block.php:66 +#: ../block.editor.admin.class.php:270 ../js/dialog-block.php:71 msgid "Ads Block ID" msgstr "ID рекламного блока" -#: block.editor.admin.class.php:273 editor.admin.class.php:363 -#: zone.editor.admin.class.php:316 +#: ../block.editor.admin.class.php:276 ../editor.admin.class.php:427 +#: ../zone.editor.admin.class.php:349 msgid "Is Active" msgstr "Активно" -#: block.editor.admin.class.php:274 editor.admin.class.php:364 -#: editor.admin.class.php:850 zone.editor.admin.class.php:317 +#: ../block.editor.admin.class.php:277 ../editor.admin.class.php:428 +#: ../editor.admin.class.php:956 ../zone.editor.admin.class.php:350 msgid "Is In Trash" msgstr "В корзине" -#: block.editor.admin.class.php:281 editor.admin.class.php:371 -#: editor.admin.class.php:857 zone.editor.admin.class.php:324 -#: js/dialog-ad.php:89 js/dialog-block.php:79 js/dialog-zone.php:89 -#: js/dialog.php:89 +#: ../block.editor.admin.class.php:284 ../block.editor.admin.class.php:289 +#: ../editor.admin.class.php:435 ../editor.admin.class.php:440 +#: ../editor.admin.class.php:963 ../editor.admin.class.php:968 +#: ../zone.editor.admin.class.php:357 ../zone.editor.admin.class.php:363 +#: ../js/dialog-ad.php:94 ../js/dialog-block.php:84 ../js/dialog-zone.php:94 +#: ../js/dialog.php:94 msgid "Cancel" msgstr "Отмена" -#: block.editor.admin.class.php:284 editor.admin.class.php:374 -#: editor.admin.class.php:860 zone.editor.admin.class.php:327 +#: ../block.editor.admin.class.php:293 ../block.editor.admin.class.php:295 +#: ../editor.admin.class.php:444 ../editor.admin.class.php:446 +#: ../editor.admin.class.php:972 ../editor.admin.class.php:974 +#: ../zone.editor.admin.class.php:360 ../zone.editor.admin.class.php:367 msgid "Save" msgstr "Сохранить" -#: block.editor.admin.class.php:297 editor.admin.class.php:387 -#: zone.editor.admin.class.php:340 -msgid "Name" -msgstr "Наименование" - -#: block.editor.admin.class.php:298 editor.admin.class.php:874 -#: zone.editor.admin.class.php:341 +#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:988 +#: ../zone.editor.admin.class.php:382 msgid "Required for SAM widgets." msgstr "Требуется для виджетов плагина." -#: block.editor.admin.class.php:304 block.editor.admin.class.php:308 -#: editor.admin.class.php:394 editor.admin.class.php:398 -#: editor.admin.class.php:883 zone.editor.admin.class.php:347 -#: zone.editor.admin.class.php:351 +#: ../block.editor.admin.class.php:315 ../block.editor.admin.class.php:319 +#: ../editor.admin.class.php:466 ../editor.admin.class.php:470 +#: ../editor.admin.class.php:997 ../zone.editor.admin.class.php:388 +#: ../zone.editor.admin.class.php:392 msgid "Description" msgstr "Описание" -#: block.editor.admin.class.php:306 block.editor.admin.class.php:393 +#: ../block.editor.admin.class.php:317 msgid "Enter description of this Ads Block." msgstr "Введите описание для этого рекламного блока." -#: block.editor.admin.class.php:311 editor.admin.class.php:401 -#: editor.admin.class.php:887 zone.editor.admin.class.php:354 +#: ../block.editor.admin.class.php:322 ../editor.admin.class.php:473 +#: ../editor.admin.class.php:1001 ../zone.editor.admin.class.php:395 msgid "" "This description is not used anywhere and is added solely for the " "convenience of managing advertisements." @@ -823,23 +1056,23 @@ msgstr "" "Это описание нигде не используется и введено исключительно для удобства в " "уравлении рекламными объявлениями." -#: block.editor.admin.class.php:318 +#: ../block.editor.admin.class.php:329 msgid "Block Structure" msgstr "Структура блока" -#: block.editor.admin.class.php:320 +#: ../block.editor.admin.class.php:331 msgid "Ads Block Structure Properties." msgstr "Параметры структуры блока." -#: block.editor.admin.class.php:322 +#: ../block.editor.admin.class.php:333 msgid "Block Lines" msgstr "Строк" -#: block.editor.admin.class.php:326 +#: ../block.editor.admin.class.php:337 msgid "Block Columns" msgstr "Колонок" -#: block.editor.admin.class.php:329 +#: ../block.editor.admin.class.php:340 msgid "" "After changing these properties you must save Ads Block settings before " "using Ads Block Editor." @@ -847,61 +1080,61 @@ msgstr "" "После изменения этих параметров Вы должны сохранить параметры блока " "рекламных объявлений перед использованием Редактора Блока." -#: block.editor.admin.class.php:336 +#: ../block.editor.admin.class.php:347 msgid "Block Styles" msgstr "Стили блока" -#: block.editor.admin.class.php:338 +#: ../block.editor.admin.class.php:349 msgid "Configure Styles for this Ads Block." msgstr "Настройте стили для этого блока рекламных объявлений." -#: block.editor.admin.class.php:340 block.editor.admin.class.php:366 +#: ../block.editor.admin.class.php:351 ../block.editor.admin.class.php:377 msgid "Margins" msgstr "Внешние отступы" -#: block.editor.admin.class.php:344 block.editor.admin.class.php:370 +#: ../block.editor.admin.class.php:355 ../block.editor.admin.class.php:381 msgid "Padding" msgstr "Внутренние отступы" -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 +#: ../block.editor.admin.class.php:359 ../block.editor.admin.class.php:385 msgid "Background" msgstr "Фон" -#: block.editor.admin.class.php:352 block.editor.admin.class.php:378 +#: ../block.editor.admin.class.php:363 ../block.editor.admin.class.php:389 msgid "Borders" msgstr "Окантовка" -#: block.editor.admin.class.php:355 block.editor.admin.class.php:381 +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 msgid "Use Stylesheet rules for defining these properties." msgstr "" "Используйте Правила таблиц стилей для определения этих " "параметров." -#: block.editor.admin.class.php:355 block.editor.admin.class.php:381 +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 msgid "For example:" msgstr "Например:" -#: block.editor.admin.class.php:355 block.editor.admin.class.php:381 +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 msgid "for background property or" msgstr "для параметра \"Фон\" или" -#: block.editor.admin.class.php:355 block.editor.admin.class.php:381 +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 msgid "for border property" msgstr "для параметра \"Окантовка\"" -#: block.editor.admin.class.php:362 +#: ../block.editor.admin.class.php:373 msgid "Block Items Styles" msgstr "Стили элементов блока" -#: block.editor.admin.class.php:364 +#: ../block.editor.admin.class.php:375 msgid "Configure Styles for this Ads Block Items." msgstr "Настройте стили для элементов этого блока рекламных объявлений." -#: block.editor.admin.class.php:382 +#: ../block.editor.admin.class.php:393 msgid "Important Note" msgstr "Важная информация" -#: block.editor.admin.class.php:382 +#: ../block.editor.admin.class.php:393 msgid "" "As the Ads Block is the regular structure, predefined styles of individual " "items for drawing Ads Block's elements aren't used. Define styles for Ads " @@ -912,222 +1145,224 @@ msgstr "" "Блока Рекламных Объявлений не используются. Определите стили для элементов " "Блока Рекламных Объявлений здесь!" -#: block.editor.admin.class.php:395 +#: ../block.editor.admin.class.php:404 +msgid "Adjust items settings of this Ads Block." +msgstr "Настройте элементы для этого рекламного блока." + +#: ../block.editor.admin.class.php:406 msgid "Block Editor." msgstr "Редактор рекламного блока." -#: block.list.admin.class.php:48 errorlog.admin.class.php:49 -#: list.admin.class.php:129 list.admin.class.php:312 -#: zone.list.admin.class.php:48 +#: ../block.list.admin.class.php:48 ../errorlog.admin.class.php:49 +#: ../list.admin.class.php:130 ../list.admin.class.php:313 +#: ../zone.list.admin.class.php:48 msgid "«" msgstr "«" -#: block.list.admin.class.php:49 errorlog.admin.class.php:50 -#: list.admin.class.php:130 list.admin.class.php:313 -#: zone.list.admin.class.php:49 +#: ../block.list.admin.class.php:49 ../errorlog.admin.class.php:50 +#: ../list.admin.class.php:131 ../list.admin.class.php:314 +#: ../zone.list.admin.class.php:49 msgid "»" msgstr "»" -#: block.list.admin.class.php:56 +#: ../block.list.admin.class.php:56 msgid "Managing Ads Blocks" msgstr "Управление рекламными блоками" -#: block.list.admin.class.php:63 errorlog.admin.class.php:59 -#: list.admin.class.php:144 list.admin.class.php:327 -#: zone.list.admin.class.php:63 +#: ../block.list.admin.class.php:63 ../errorlog.admin.class.php:59 +#: ../list.admin.class.php:145 ../list.admin.class.php:328 +#: ../zone.list.admin.class.php:63 msgid "All" msgstr "Все" -#: block.list.admin.class.php:64 errorlog.admin.class.php:60 -#: list.admin.class.php:145 list.admin.class.php:328 -#: zone.list.admin.class.php:64 +#: ../block.list.admin.class.php:64 ../errorlog.admin.class.php:60 +#: ../list.admin.class.php:146 ../list.admin.class.php:329 +#: ../zone.list.admin.class.php:64 msgid "Active" msgstr "Активные" -#: block.list.admin.class.php:65 list.admin.class.php:146 -#: list.admin.class.php:329 zone.list.admin.class.php:65 +#: ../block.list.admin.class.php:65 ../list.admin.class.php:147 +#: ../list.admin.class.php:330 ../zone.list.admin.class.php:65 msgid "Trash" msgstr "Корзина" -#: block.list.admin.class.php:70 block.list.admin.class.php:144 -#: list.admin.class.php:151 list.admin.class.php:271 list.admin.class.php:335 -#: list.admin.class.php:469 zone.list.admin.class.php:70 -#: zone.list.admin.class.php:144 +#: ../block.list.admin.class.php:70 ../block.list.admin.class.php:144 +#: ../list.admin.class.php:152 ../list.admin.class.php:272 +#: ../list.admin.class.php:336 ../list.admin.class.php:455 +#: ../zone.list.admin.class.php:70 ../zone.list.admin.class.php:144 msgid "Clear Trash" msgstr "Очистить корзину" -#: block.list.admin.class.php:72 block.list.admin.class.php:146 +#: ../block.list.admin.class.php:72 ../block.list.admin.class.php:146 msgid "Add New Block" msgstr "Добавить новый блок" -#: block.list.admin.class.php:76 block.list.admin.class.php:150 -#: errorlog.admin.class.php:71 errorlog.admin.class.php:179 -#: list.admin.class.php:160 list.admin.class.php:280 list.admin.class.php:345 -#: list.admin.class.php:478 zone.list.admin.class.php:76 -#: zone.list.admin.class.php:150 +#: ../block.list.admin.class.php:76 ../block.list.admin.class.php:150 +#: ../errorlog.admin.class.php:71 ../errorlog.admin.class.php:173 +#: ../list.admin.class.php:161 ../list.admin.class.php:281 +#: ../list.admin.class.php:346 ../list.admin.class.php:464 +#: ../zone.list.admin.class.php:76 ../zone.list.admin.class.php:150 #, php-format msgid "Displaying %s–%s of %s" msgstr "Показано %s–%s из %s" -#: block.list.admin.class.php:88 block.list.admin.class.php:94 -#: errorlog.admin.class.php:83 errorlog.admin.class.php:93 -#: list.admin.class.php:172 list.admin.class.php:183 list.admin.class.php:359 -#: list.admin.class.php:369 zone.list.admin.class.php:88 -#: zone.list.admin.class.php:94 -msgid "ID" -msgstr "ID" - -#: block.list.admin.class.php:89 block.list.admin.class.php:95 +#: ../block.list.admin.class.php:89 ../block.list.admin.class.php:95 msgid "Block Name" msgstr "Имя блока" -#: block.list.admin.class.php:113 errorlog.admin.class.php:121 -#: list.admin.class.php:216 list.admin.class.php:418 -#: zone.list.admin.class.php:113 +#: ../block.list.admin.class.php:113 ../errorlog.admin.class.php:121 +#: ../list.admin.class.php:217 ../list.admin.class.php:404 +#: ../zone.list.admin.class.php:113 msgid "There are no data ..." msgstr "Нет данных для показа ..." -#: block.list.admin.class.php:121 list.admin.class.php:241 -#: list.admin.class.php:446 zone.list.admin.class.php:121 +#: ../block.list.admin.class.php:121 ../list.admin.class.php:242 +#: ../list.admin.class.php:432 ../zone.list.admin.class.php:121 msgid "in Trash" msgstr "в корзине" -#: block.list.admin.class.php:123 +#: ../block.list.admin.class.php:123 msgid "Edit Block" msgstr "Изменить рекламный блок" -#: block.list.admin.class.php:123 list.admin.class.php:243 -#: list.admin.class.php:448 zone.list.admin.class.php:123 +#: ../block.list.admin.class.php:123 ../list.admin.class.php:244 +#: ../list.admin.class.php:434 ../zone.list.admin.class.php:123 msgid "Edit" msgstr "Изменить" -#: block.list.admin.class.php:127 errorlog.admin.class.php:151 +#: ../block.list.admin.class.php:127 ../errorlog.admin.class.php:151 msgid "Restore this Block from the Trash" msgstr "Восстановить этот блок из корзины" -#: block.list.admin.class.php:127 list.admin.class.php:247 -#: list.admin.class.php:452 zone.list.admin.class.php:127 +#: ../block.list.admin.class.php:127 ../list.admin.class.php:248 +#: ../list.admin.class.php:438 ../zone.list.admin.class.php:127 msgid "Restore" msgstr "Восстановить" -#: block.list.admin.class.php:128 errorlog.admin.class.php:152 +#: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 msgid "Remove this Block permanently" msgstr "Удалить этот рекламный блок навсегда" -#: block.list.admin.class.php:128 errorlog.admin.class.php:152 -#: list.admin.class.php:248 list.admin.class.php:453 -#: zone.list.admin.class.php:128 +#: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 +#: ../list.admin.class.php:249 ../list.admin.class.php:439 +#: ../zone.list.admin.class.php:128 msgid "Remove permanently" msgstr "Удалить навсегда" -#: block.list.admin.class.php:133 errorlog.admin.class.php:157 +#: ../block.list.admin.class.php:133 ../errorlog.admin.class.php:157 msgid "Move this Block to the Trash" msgstr "Поместить этот блок в корзину" -#: block.list.admin.class.php:133 list.admin.class.php:253 -#: list.admin.class.php:454 zone.list.admin.class.php:133 +#: ../block.list.admin.class.php:133 ../list.admin.class.php:254 +#: ../list.admin.class.php:440 ../zone.list.admin.class.php:133 msgid "Delete" msgstr "Удалить" -#: editor.admin.class.php:71 editor.admin.class.php:191 -#: list.admin.class.php:23 +#: ../editor.admin.class.php:71 ../editor.admin.class.php:191 +#: ../list.admin.class.php:23 msgid "Custom sizes" msgstr "Пользовательские размеры" -#: editor.admin.class.php:74 editor.admin.class.php:135 -#: list.admin.class.php:26 +#: ../editor.admin.class.php:74 ../editor.admin.class.php:135 +#: ../list.admin.class.php:26 msgid "Large Leaderboard" msgstr "Большая доска почёта" -#: editor.admin.class.php:75 editor.admin.class.php:136 -#: list.admin.class.php:27 +#: ../editor.admin.class.php:75 ../editor.admin.class.php:136 +#: ../list.admin.class.php:27 msgid "Leaderboard" msgstr "Доска почёта" -#: editor.admin.class.php:76 editor.admin.class.php:78 -#: editor.admin.class.php:79 editor.admin.class.php:137 -#: editor.admin.class.php:139 editor.admin.class.php:140 -#: list.admin.class.php:28 list.admin.class.php:30 list.admin.class.php:31 +#: ../editor.admin.class.php:76 ../editor.admin.class.php:78 +#: ../editor.admin.class.php:79 ../editor.admin.class.php:137 +#: ../editor.admin.class.php:139 ../editor.admin.class.php:140 +#: ../list.admin.class.php:28 ../list.admin.class.php:30 +#: ../list.admin.class.php:31 msgid "Small Leaderboard" msgstr "Малая доска почёта" -#: editor.admin.class.php:77 editor.admin.class.php:138 -#: list.admin.class.php:29 +#: ../editor.admin.class.php:77 ../editor.admin.class.php:138 +#: ../list.admin.class.php:29 msgid "Mega Unit" msgstr "Мегаблок" -#: editor.admin.class.php:80 editor.admin.class.php:81 -#: editor.admin.class.php:82 editor.admin.class.php:84 -#: editor.admin.class.php:85 editor.admin.class.php:86 -#: editor.admin.class.php:141 editor.admin.class.php:142 -#: editor.admin.class.php:143 editor.admin.class.php:145 -#: editor.admin.class.php:146 editor.admin.class.php:147 -#: list.admin.class.php:32 list.admin.class.php:33 list.admin.class.php:34 -#: list.admin.class.php:36 list.admin.class.php:37 list.admin.class.php:38 +#: ../editor.admin.class.php:80 ../editor.admin.class.php:81 +#: ../editor.admin.class.php:82 ../editor.admin.class.php:84 +#: ../editor.admin.class.php:85 ../editor.admin.class.php:86 +#: ../editor.admin.class.php:141 ../editor.admin.class.php:142 +#: ../editor.admin.class.php:143 ../editor.admin.class.php:145 +#: ../editor.admin.class.php:146 ../editor.admin.class.php:147 +#: ../list.admin.class.php:32 ../list.admin.class.php:33 +#: ../list.admin.class.php:34 ../list.admin.class.php:36 +#: ../list.admin.class.php:37 ../list.admin.class.php:38 msgid "Tall Banner" msgstr "Высокий баннер" -#: editor.admin.class.php:83 editor.admin.class.php:144 -#: list.admin.class.php:35 +#: ../editor.admin.class.php:83 ../editor.admin.class.php:144 +#: ../list.admin.class.php:35 msgid "Banner" msgstr "Баннер" -#: editor.admin.class.php:87 editor.admin.class.php:89 -#: editor.admin.class.php:119 editor.admin.class.php:120 -#: editor.admin.class.php:148 editor.admin.class.php:150 -#: editor.admin.class.php:184 editor.admin.class.php:185 -#: list.admin.class.php:39 list.admin.class.php:41 list.admin.class.php:71 -#: list.admin.class.php:72 +#: ../editor.admin.class.php:87 ../editor.admin.class.php:89 +#: ../editor.admin.class.php:119 ../editor.admin.class.php:120 +#: ../editor.admin.class.php:148 ../editor.admin.class.php:150 +#: ../editor.admin.class.php:184 ../editor.admin.class.php:185 +#: ../list.admin.class.php:39 ../list.admin.class.php:41 +#: ../list.admin.class.php:71 ../list.admin.class.php:72 msgid "Half Banner" msgstr "Полубаннер" -#: editor.admin.class.php:88 editor.admin.class.php:117 -#: editor.admin.class.php:118 editor.admin.class.php:149 -#: editor.admin.class.php:182 editor.admin.class.php:183 -#: list.admin.class.php:40 list.admin.class.php:69 list.admin.class.php:70 +#: ../editor.admin.class.php:88 ../editor.admin.class.php:117 +#: ../editor.admin.class.php:118 ../editor.admin.class.php:149 +#: ../editor.admin.class.php:182 ../editor.admin.class.php:183 +#: ../list.admin.class.php:40 ../list.admin.class.php:69 +#: ../list.admin.class.php:70 msgid "Tall Half Banner" msgstr "Высокий полубаннер" -#: editor.admin.class.php:90 editor.admin.class.php:91 -#: editor.admin.class.php:116 editor.admin.class.php:123 -#: editor.admin.class.php:124 editor.admin.class.php:151 -#: editor.admin.class.php:152 editor.admin.class.php:181 -#: editor.admin.class.php:188 editor.admin.class.php:189 -#: list.admin.class.php:42 list.admin.class.php:43 list.admin.class.php:68 -#: list.admin.class.php:75 list.admin.class.php:76 +#: ../editor.admin.class.php:90 ../editor.admin.class.php:91 +#: ../editor.admin.class.php:116 ../editor.admin.class.php:123 +#: ../editor.admin.class.php:124 ../editor.admin.class.php:151 +#: ../editor.admin.class.php:152 ../editor.admin.class.php:181 +#: ../editor.admin.class.php:188 ../editor.admin.class.php:189 +#: ../list.admin.class.php:42 ../list.admin.class.php:43 +#: ../list.admin.class.php:68 ../list.admin.class.php:75 +#: ../list.admin.class.php:76 msgid "Button" msgstr "Кнопка" -#: editor.admin.class.php:92 editor.admin.class.php:153 -#: list.admin.class.php:44 +#: ../editor.admin.class.php:92 ../editor.admin.class.php:153 +#: ../list.admin.class.php:44 msgid "Micro Bar" msgstr "Микро-бар" -#: editor.admin.class.php:93 editor.admin.class.php:94 -#: editor.admin.class.php:95 editor.admin.class.php:96 -#: editor.admin.class.php:154 editor.admin.class.php:155 -#: editor.admin.class.php:156 editor.admin.class.php:157 -#: list.admin.class.php:45 list.admin.class.php:46 list.admin.class.php:47 -#: list.admin.class.php:48 +#: ../editor.admin.class.php:93 ../editor.admin.class.php:94 +#: ../editor.admin.class.php:95 ../editor.admin.class.php:96 +#: ../editor.admin.class.php:154 ../editor.admin.class.php:155 +#: ../editor.admin.class.php:156 ../editor.admin.class.php:157 +#: ../list.admin.class.php:45 ../list.admin.class.php:46 +#: ../list.admin.class.php:47 ../list.admin.class.php:48 msgid "Thin Banner" msgstr "Тонкий баннер" -#: editor.admin.class.php:93 editor.admin.class.php:94 -#: editor.admin.class.php:95 editor.admin.class.php:96 -#: editor.admin.class.php:117 editor.admin.class.php:118 -#: editor.admin.class.php:119 editor.admin.class.php:120 -#: editor.admin.class.php:121 editor.admin.class.php:122 -#: editor.admin.class.php:123 editor.admin.class.php:124 -#: editor.admin.class.php:154 editor.admin.class.php:155 -#: editor.admin.class.php:156 editor.admin.class.php:157 -#: editor.admin.class.php:182 editor.admin.class.php:183 -#: editor.admin.class.php:184 editor.admin.class.php:185 -#: editor.admin.class.php:186 editor.admin.class.php:187 -#: editor.admin.class.php:188 editor.admin.class.php:189 -#: list.admin.class.php:45 list.admin.class.php:46 list.admin.class.php:47 -#: list.admin.class.php:48 list.admin.class.php:69 list.admin.class.php:70 -#: list.admin.class.php:71 list.admin.class.php:72 list.admin.class.php:73 -#: list.admin.class.php:74 list.admin.class.php:75 list.admin.class.php:76 +#: ../editor.admin.class.php:93 ../editor.admin.class.php:94 +#: ../editor.admin.class.php:95 ../editor.admin.class.php:96 +#: ../editor.admin.class.php:117 ../editor.admin.class.php:118 +#: ../editor.admin.class.php:119 ../editor.admin.class.php:120 +#: ../editor.admin.class.php:121 ../editor.admin.class.php:122 +#: ../editor.admin.class.php:123 ../editor.admin.class.php:124 +#: ../editor.admin.class.php:154 ../editor.admin.class.php:155 +#: ../editor.admin.class.php:156 ../editor.admin.class.php:157 +#: ../editor.admin.class.php:182 ../editor.admin.class.php:183 +#: ../editor.admin.class.php:184 ../editor.admin.class.php:185 +#: ../editor.admin.class.php:186 ../editor.admin.class.php:187 +#: ../editor.admin.class.php:188 ../editor.admin.class.php:189 +#: ../list.admin.class.php:45 ../list.admin.class.php:46 +#: ../list.admin.class.php:47 ../list.admin.class.php:48 +#: ../list.admin.class.php:69 ../list.admin.class.php:70 +#: ../list.admin.class.php:71 ../list.admin.class.php:72 +#: ../list.admin.class.php:73 ../list.admin.class.php:74 +#: ../list.admin.class.php:75 ../list.admin.class.php:76 #, php-format msgid "%d Link" msgid_plural "%d Links" @@ -1135,157 +1370,269 @@ msgstr[0] "%d ссылка" msgstr[1] "%d ссылки" msgstr[2] "%d ссылок" -#: editor.admin.class.php:97 editor.admin.class.php:160 -#: list.admin.class.php:49 +#: ../editor.admin.class.php:97 ../editor.admin.class.php:160 +#: ../list.admin.class.php:49 msgid "Wide Skyscraper" msgstr "Широкий небоскрёб" -#: editor.admin.class.php:98 editor.admin.class.php:161 -#: list.admin.class.php:50 +#: ../editor.admin.class.php:98 ../editor.admin.class.php:161 +#: ../list.admin.class.php:50 msgid "Skyscraper" msgstr "Небоскрёб" -#: editor.admin.class.php:99 editor.admin.class.php:162 -#: list.admin.class.php:51 +#: ../editor.admin.class.php:99 ../editor.admin.class.php:162 +#: ../list.admin.class.php:51 msgid "Wide Half Banner" msgstr "Широкий полубаннер" -#: editor.admin.class.php:100 editor.admin.class.php:163 -#: list.admin.class.php:52 +#: ../editor.admin.class.php:100 ../editor.admin.class.php:163 +#: ../list.admin.class.php:52 msgid "Vertical Rectangle" msgstr "Вертикальный прямоугольник" -#: editor.admin.class.php:101 editor.admin.class.php:102 -#: editor.admin.class.php:164 editor.admin.class.php:165 -#: list.admin.class.php:53 list.admin.class.php:54 +#: ../editor.admin.class.php:101 ../editor.admin.class.php:102 +#: ../editor.admin.class.php:164 ../editor.admin.class.php:165 +#: ../list.admin.class.php:53 ../list.admin.class.php:54 msgid "Tall Rectangle" msgstr "Высокий прямоугольник" -#: editor.admin.class.php:103 editor.admin.class.php:166 -#: list.admin.class.php:55 +#: ../editor.admin.class.php:103 ../editor.admin.class.php:166 +#: ../list.admin.class.php:55 msgid "Vertical Banner" msgstr "Вертикальный баннер" -#: editor.admin.class.php:104 editor.admin.class.php:169 -#: list.admin.class.php:56 +#: ../editor.admin.class.php:104 ../editor.admin.class.php:169 +#: ../list.admin.class.php:56 msgid "Large Rectangle" msgstr "Большой прямоугольник" -#: editor.admin.class.php:105 editor.admin.class.php:106 -#: editor.admin.class.php:170 editor.admin.class.php:171 -#: list.admin.class.php:57 list.admin.class.php:58 +#: ../editor.admin.class.php:105 ../editor.admin.class.php:106 +#: ../editor.admin.class.php:170 ../editor.admin.class.php:171 +#: ../list.admin.class.php:57 ../list.admin.class.php:58 msgid "Wide Rectangle" msgstr "Широкий прямоугольник" -#: editor.admin.class.php:107 editor.admin.class.php:172 -#: list.admin.class.php:59 +#: ../editor.admin.class.php:107 ../editor.admin.class.php:172 +#: ../list.admin.class.php:59 msgid "Medium Rectangle" msgstr "Средний прямоугольник" -#: editor.admin.class.php:108 editor.admin.class.php:109 -#: editor.admin.class.php:173 editor.admin.class.php:174 -#: list.admin.class.php:60 list.admin.class.php:61 +#: ../editor.admin.class.php:108 ../editor.admin.class.php:109 +#: ../editor.admin.class.php:173 ../editor.admin.class.php:174 +#: ../list.admin.class.php:60 ../list.admin.class.php:61 msgid "Small Wide Rectangle" msgstr "Малый широкий прямоугольник" -#: editor.admin.class.php:110 editor.admin.class.php:175 -#: list.admin.class.php:62 +#: ../editor.admin.class.php:110 ../editor.admin.class.php:175 +#: ../list.admin.class.php:62 msgid "Mini Wide Rectangle" msgstr "Маленький широкий прямоугольник" -#: editor.admin.class.php:111 editor.admin.class.php:176 -#: editor.admin.class.php:196 list.admin.class.php:63 +#: ../editor.admin.class.php:111 ../editor.admin.class.php:176 +#: ../editor.admin.class.php:196 ../list.admin.class.php:63 msgid "Square" msgstr "Прямоугольники" -#: editor.admin.class.php:112 editor.admin.class.php:115 -#: editor.admin.class.php:177 editor.admin.class.php:180 -#: list.admin.class.php:64 list.admin.class.php:67 +#: ../editor.admin.class.php:112 ../editor.admin.class.php:115 +#: ../editor.admin.class.php:177 ../editor.admin.class.php:180 +#: ../list.admin.class.php:64 ../list.admin.class.php:67 msgid "Small Square" msgstr "Малый квадрат" -#: editor.admin.class.php:113 editor.admin.class.php:114 -#: editor.admin.class.php:178 editor.admin.class.php:179 -#: list.admin.class.php:65 list.admin.class.php:66 +#: ../editor.admin.class.php:113 ../editor.admin.class.php:114 +#: ../editor.admin.class.php:178 ../editor.admin.class.php:179 +#: ../list.admin.class.php:65 ../list.admin.class.php:66 msgid "Small Rectangle" msgstr "Малый прямоугольник" -#: editor.admin.class.php:121 editor.admin.class.php:122 -#: editor.admin.class.php:186 editor.admin.class.php:187 -#: list.admin.class.php:73 list.admin.class.php:74 +#: ../editor.admin.class.php:121 ../editor.admin.class.php:122 +#: ../editor.admin.class.php:186 ../editor.admin.class.php:187 +#: ../list.admin.class.php:73 ../list.admin.class.php:74 msgid "Tall Button" msgstr "Широкая кнопка" -#: editor.admin.class.php:194 +#: ../editor.admin.class.php:194 msgid "Horizontal" msgstr "Горизонтальные" -#: editor.admin.class.php:195 +#: ../editor.admin.class.php:195 msgid "Vertical" msgstr "Вертикальные" -#: editor.admin.class.php:197 +#: ../editor.admin.class.php:197 msgid "Custom width and height" msgstr "Пользовательские высота и ширина" -#: editor.admin.class.php:279 +#: ../editor.admin.class.php:224 +msgid "January" +msgstr "Январь" + +#: ../editor.admin.class.php:225 +msgid "February" +msgstr "Февраль" + +#: ../editor.admin.class.php:226 +msgid "Mart" +msgstr "Март" + +#: ../editor.admin.class.php:227 +msgid "April" +msgstr "Апрель" + +#: ../editor.admin.class.php:228 +msgid "May" +msgstr "Май" + +#: ../editor.admin.class.php:229 +msgid "June" +msgstr "Июнь" + +#: ../editor.admin.class.php:230 +msgid "July" +msgstr "Июль" + +#: ../editor.admin.class.php:231 +msgid "August" +msgstr "Август" + +#: ../editor.admin.class.php:232 +msgid "September" +msgstr "Сентябрь" + +#: ../editor.admin.class.php:233 +msgid "October" +msgstr "Октябрь" + +#: ../editor.admin.class.php:234 +msgid "November" +msgstr "Ноябрь" + +#: ../editor.admin.class.php:235 +msgid "December" +msgstr "Декабрь" + +#: ../editor.admin.class.php:243 +msgid "Image Tools" +msgstr "Инструменты" + +#: ../editor.admin.class.php:246 +msgid "Media Library" +msgstr "Медиафайлы" + +#: ../editor.admin.class.php:247 +msgid "Server" +msgstr "Сервер" + +#: ../editor.admin.class.php:248 +msgid "Local Computer" +msgstr "Компьютер" + +#: ../editor.admin.class.php:252 +msgid "Select Image from Media Library" +msgstr "Выберите изображение из библиотеки медиафайлов" + +#: ../editor.admin.class.php:254 +msgid "Select or Upload" +msgstr "Выбрать или загрузить" + +#: ../editor.admin.class.php:256 +msgid "" +"You can upload your banners to Wordpress Media Library or select banner " +"image from it." +msgstr "" +"Вы можете загрузить Ваши баннеры в библиотеку медиафайлов Wordpress или " +"выбрать баннер из медиабиблиотеки." + +#: ../editor.admin.class.php:261 +msgid "Select File" +msgstr "Выберите файл" + +#: ../editor.admin.class.php:266 +msgid "Apply" +msgstr "Применить" + +#: ../editor.admin.class.php:268 +msgid "Select file from your blog server." +msgstr "Выберите файл, расположенный на сервере Вашего блога." + +#: ../editor.admin.class.php:273 +msgid "Upload File" +msgstr "Загрузить файл" + +#: ../editor.admin.class.php:275 +msgid "Upload" +msgstr "Загрузить" + +#: ../editor.admin.class.php:279 +msgid "Select and upload file from your local computer." +msgstr "Выберите и загрузите файл на сервер с Вашего локального компьютера." + +#: ../editor.admin.class.php:340 msgid "Ads Place Data Updated." msgstr "Данные рекламного места сохранены." -#: editor.admin.class.php:325 +#: ../editor.admin.class.php:386 msgid "New Ads Place" msgstr "Новое рекламное место" -#: editor.admin.class.php:325 +#: ../editor.admin.class.php:386 msgid "Edit Ads Place" msgstr "Изменить рекламное место" -#: editor.admin.class.php:343 +#: ../editor.admin.class.php:406 msgid "Back to Places List" msgstr "Назад, к списку мест" -#: editor.admin.class.php:349 js/dialog.php:66 +#: ../editor.admin.class.php:413 ../js/dialog.php:71 msgid "Ads Place ID" msgstr "ID рекламного места" -#: editor.admin.class.php:355 editor.admin.class.php:839 -#: list.admin.class.php:174 list.admin.class.php:185 +#: ../editor.admin.class.php:419 ../editor.admin.class.php:945 +#: ../list.admin.class.php:175 ../list.admin.class.php:186 msgid "Size" msgstr "Размеры" -#: editor.admin.class.php:357 editor.admin.class.php:841 +#: ../editor.admin.class.php:421 ../editor.admin.class.php:947 msgid "Width" msgstr "Ширина" -#: editor.admin.class.php:359 editor.admin.class.php:843 +#: ../editor.admin.class.php:423 ../editor.admin.class.php:949 msgid "Height" msgstr "Высота" -#: editor.admin.class.php:388 +#: ../editor.admin.class.php:460 msgid "Required for SAM widgets and settings." msgstr "Требуется для виджетов и параметров плагина." -#: editor.admin.class.php:396 +#: ../editor.admin.class.php:468 msgid "Enter description of this Ads Place." msgstr "Введите описание для этого рекламного места." -#: editor.admin.class.php:408 +#: ../editor.admin.class.php:480 +msgid "Default Ad" +msgstr "Объявление по умолчанию" + +#: ../editor.admin.class.php:481 ../editor.admin.class.php:1012 +msgid "Statistic" +msgstr "Статистика" + +#: ../editor.admin.class.php:487 msgid "Ads Place Size" msgstr "Размеры рекламного места" -#: editor.admin.class.php:410 +#: ../editor.admin.class.php:489 msgid "Select size of this Ads Place." msgstr "Выберите размеры для этого рекламного места." -#: editor.admin.class.php:415 +#: ../editor.admin.class.php:494 msgid "Custom Width" msgstr "Ширина, заданная пользователем" -#: editor.admin.class.php:419 +#: ../editor.admin.class.php:498 msgid "Custom Height" msgstr "Высота, заданная пользователем" -#: editor.admin.class.php:422 +#: ../editor.admin.class.php:501 msgid "" "These values are not used and are added solely for the convenience of " "advertising management. Will be used in the future..." @@ -1293,22 +1640,46 @@ msgstr "" "Эти значения нигде не используется и введены исключительно для удобства в " "уравлении рекламными объявлениями. Будут использоваться в будущем ..." -#: editor.admin.class.php:429 +#: ../editor.admin.class.php:508 +msgid "Codes" +msgstr "Коды" + +#: ../editor.admin.class.php:510 +msgid "Enter the code to output before and after the codes of Ads Place." +msgstr "Введите коды для вывода до и после кода места рекламных объявлений." + +#: ../editor.admin.class.php:512 +msgid "Code Before" +msgstr "Код до" + +#: ../editor.admin.class.php:516 +msgid "Code After" +msgstr "Код после" + +#: ../editor.admin.class.php:519 +msgid "" +"You can enter any HTML codes here for the further withdrawal of their before " +"and after the code of Ads Place." +msgstr "" +"Вы можете ввести здесь любой HTML код для дальнейшего вывода его до и после " +"кода рекламного места." + +#: ../editor.admin.class.php:528 msgid "Ads Place Patch" msgstr "Заглушка рекламного места" -#: editor.admin.class.php:431 +#: ../editor.admin.class.php:530 msgid "" "Select type of the code of a patch and fill data entry fields with the " "appropriate data." msgstr "" "Выберите тип заплатки и заполните нужные поля соответствующими данными." -#: editor.admin.class.php:433 editor.admin.class.php:437 +#: ../editor.admin.class.php:532 ../editor.admin.class.php:536 msgid "Image" msgstr "Изображение" -#: editor.admin.class.php:441 +#: ../editor.admin.class.php:541 msgid "" "This image is a patch for advertising space. This may be an image with the " "text \"Place your ad here\"." @@ -1316,52 +1687,24 @@ msgstr "" "Введите путь к изображению для заплатки рекламного места. Это может быть " "изображение содержащее текст \"Разместите своё рекламное объявление здесь\"." -#: editor.admin.class.php:444 +#: ../editor.admin.class.php:544 msgid "Target" msgstr "Цель" -#: editor.admin.class.php:448 +#: ../editor.admin.class.php:548 msgid "This is a link to a page where are your suggestions for advertisers." msgstr "" "Это ссылка на страницу, на которой размещены Ваши предложения рекламодателям." -#: editor.admin.class.php:451 editor.admin.class.php:952 -msgid "Image Tools" -msgstr "Инструменты" - -#: editor.admin.class.php:453 editor.admin.class.php:954 -msgid "Select File" -msgstr "Выберите файл" - -#: editor.admin.class.php:457 editor.admin.class.php:958 -msgid "Apply" -msgstr "Применить" - -#: editor.admin.class.php:458 editor.admin.class.php:959 -msgid "Select file from your blog server." -msgstr "Выберите файл, расположенный на сервере Вашего блога." - -#: editor.admin.class.php:461 editor.admin.class.php:962 -msgid "Upload File" -msgstr "Загрузить файл" - -#: editor.admin.class.php:462 editor.admin.class.php:963 -msgid "Upload" -msgstr "Загрузить" - -#: editor.admin.class.php:465 editor.admin.class.php:966 -msgid "Select and upload file from your local computer." -msgstr "Выберите и загрузите файл на сервер с Вашего локального компьютера." - -#: editor.admin.class.php:471 +#: ../editor.admin.class.php:554 msgid "HTML or Javascript Code" msgstr "Код HTML или Javascript" -#: editor.admin.class.php:475 +#: ../editor.admin.class.php:558 msgid "Patch Code" msgstr "Код заглушки" -#: editor.admin.class.php:480 +#: ../editor.admin.class.php:563 msgid "" "This is one-block code of third-party AdServer rotator. Selecting this " "checkbox prevents displaying contained ads." @@ -1370,7 +1713,7 @@ msgstr "" "Выбор этого параметра останавливает показ содержащихся в рекламном месте " "объявлений для показа только этого кода." -#: editor.admin.class.php:483 +#: ../editor.admin.class.php:566 msgid "" "This is a HTML-code patch of advertising space. For example: use the code to " "display AdSense advertisement. " @@ -1378,19 +1721,19 @@ msgstr "" "Это HTML-код заплатки рекламного места. Например: используйте код показа " "рекламы от AdSense." -#: editor.admin.class.php:488 +#: ../editor.admin.class.php:571 msgid "Google DFP" msgstr "Блок Google DFP" -#: editor.admin.class.php:492 +#: ../editor.admin.class.php:575 msgid "DFP Block Name" msgstr "Имя блока DFP" -#: editor.admin.class.php:496 +#: ../editor.admin.class.php:579 msgid "This is name of Google DFP block!" msgstr "Это имя блока от Google DFP!" -#: editor.admin.class.php:499 +#: ../editor.admin.class.php:582 msgid "" "The patch (default advertisement) will be shown that if the logic of the " "plugin can not show any contained advertisement on the current page of the " @@ -1400,127 +1743,113 @@ msgstr "" "когда логика плагина не позволяет показать какое-либо рекламное объявление " "на текущей странице документа." -#: editor.admin.class.php:506 -msgid "Codes" -msgstr "Коды" +#: ../editor.admin.class.php:598 ../editor.admin.class.php:1539 +msgid "Select Period" +msgstr "Выбрать период" -#: editor.admin.class.php:508 -msgid "Enter the code to output before and after the codes of Ads Place." -msgstr "Введите коды для вывода до и после кода места рекламных объявлений." +#: ../editor.admin.class.php:600 ../editor.admin.class.php:1541 +msgid "This Month" +msgstr "Этот месяц" -#: editor.admin.class.php:510 -msgid "Code Before" -msgstr "Код до" +#: ../editor.admin.class.php:601 ../editor.admin.class.php:1542 +msgid "Previous Month" +msgstr "Предыдущий месяц" -#: editor.admin.class.php:514 -msgid "Code After" -msgstr "Код после" +#: ../editor.admin.class.php:608 ../editor.admin.class.php:1549 +#: ../list.admin.class.php:237 ../list.admin.class.php:427 +msgid "Total" +msgstr "Всего" -#: editor.admin.class.php:517 -msgid "" -"You can enter any HTML codes here for the further withdrawal of their before " -"and after the code of Ads Place." -msgstr "" -"Вы можете ввести здесь любой HTML код для дальнейшего вывода его до и после " -"кода рекламного места." +#: ../editor.admin.class.php:618 +msgid "Contained Ads" +msgstr "Объявления рекламного места" -#: editor.admin.class.php:648 +#: ../editor.admin.class.php:738 msgid "Ad Data Updated." msgstr "Данные рекламного объявления сохранены." -#: editor.admin.class.php:800 +#: ../editor.admin.class.php:903 msgid "New advertisement" msgstr "Новое рекламное объявление" -#: editor.admin.class.php:800 +#: ../editor.admin.class.php:903 msgid "Edit advertisement" msgstr "Изменить рекламное объявление" -#: editor.admin.class.php:818 +#: ../editor.admin.class.php:923 msgid "Back to Ads List" msgstr "Назад, к списку объявлений" -#: editor.admin.class.php:824 +#: ../editor.admin.class.php:930 msgid "Advertisement ID" msgstr "ID объявления" -#: editor.admin.class.php:831 list.admin.class.php:361 -#: list.admin.class.php:371 +#: ../editor.admin.class.php:937 ../list.admin.class.php:362 +#: ../list.admin.class.php:372 msgid "Activity" msgstr "Активность" -#: editor.admin.class.php:832 +#: ../editor.admin.class.php:938 msgid "Ad is Active" msgstr "Активно" -#: editor.admin.class.php:832 +#: ../editor.admin.class.php:938 msgid "Ad is Inactive" msgstr "Неактивно" -#: editor.admin.class.php:833 list.admin.class.php:175 -#: list.admin.class.php:186 list.admin.class.php:234 list.admin.class.php:362 -#: list.admin.class.php:372 list.admin.class.php:439 -msgid "Hits" -msgstr "Показы" - -#: editor.admin.class.php:835 list.admin.class.php:235 -#: list.admin.class.php:363 list.admin.class.php:373 list.admin.class.php:440 -msgid "Clicks" -msgstr "Клики" - -#: editor.admin.class.php:848 +#: ../editor.admin.class.php:954 msgid "Is in Rotation" msgstr "В ротации" -#: editor.admin.class.php:873 +#: ../editor.admin.class.php:987 msgid "Title" msgstr "Имя" -#: editor.admin.class.php:880 +#: ../editor.admin.class.php:994 msgid "Advertisement Description" msgstr "Описание рекламного объявления" -#: editor.admin.class.php:894 -msgid "General" -msgstr "Основные параметры" - -#: editor.admin.class.php:895 +#: ../editor.admin.class.php:1009 msgid "Extended Restrictions" msgstr "Дополнительные ограничения" -#: editor.admin.class.php:896 +#: ../editor.admin.class.php:1010 +msgid "Targeting" +msgstr "Таргетинг" + +#: ../editor.admin.class.php:1011 msgid "Earnings settings" msgstr "Параметры доходов" -#: editor.admin.class.php:902 editor.admin.class.php:977 +#: ../editor.admin.class.php:1018 ../editor.admin.class.php:1077 msgid "Ad Code" msgstr "Код рекламного объявления" -#: editor.admin.class.php:906 +#: ../editor.admin.class.php:1022 msgid "Image Mode" msgstr "Режим изображения" -#: editor.admin.class.php:910 +#: ../editor.admin.class.php:1026 msgid "Ad Image" msgstr "Изображение объявления" -#: editor.admin.class.php:914 +#: ../editor.admin.class.php:1031 msgid "Ad Target" msgstr "Ссылка объявления" -#: editor.admin.class.php:918 +#: ../editor.admin.class.php:1035 msgid "Ad Alternative Text" msgstr "Альтернативный текст" -#: editor.admin.class.php:923 +#: ../editor.admin.class.php:1040 msgid "Count clicks for this advertisement" msgstr "Считать клики для этого рекламного объявления" -#: editor.admin.class.php:925 +#: ../editor.admin.class.php:1042 msgid "Use carefully!" msgstr "Используйте крайне осторожно!" -#: editor.admin.class.php:925 +#: ../editor.admin.class.php:1042 msgid "" "Do not use if the wp-admin folder is password protected. In this case the " "viewer will be prompted to enter a username and password during ajax " @@ -1530,83 +1859,83 @@ msgstr "" "этом случае, во время Ajax запроса посетителю будет предложено ввести имя " "пользователя и пароль." -#: editor.admin.class.php:928 +#: ../editor.admin.class.php:1045 msgid "This is flash (SWF) banner" msgstr "Это флеш (SWF) баннер" -#: editor.admin.class.php:931 +#: ../editor.admin.class.php:1048 msgid "Flash banner \"flashvars\"" msgstr "Параметр \"flashvars\"" -#: editor.admin.class.php:933 +#: ../editor.admin.class.php:1050 msgid "Insert \"flashvars\" parameters between braces..." msgstr "Вставьте параметры \"flashvars\" между фигурными скобками" -#: editor.admin.class.php:934 +#: ../editor.admin.class.php:1051 msgid "Flash banner \"params\"" msgstr "Параметр \"params\"" -#: editor.admin.class.php:936 +#: ../editor.admin.class.php:1053 msgid "Insert \"params\" parameters between braces..." msgstr "Вставьте параметры \"params\" между фигурными скобками" -#: editor.admin.class.php:937 +#: ../editor.admin.class.php:1054 msgid "Flash banner \"attributes\"" msgstr "Параметр \"attributes\"" -#: editor.admin.class.php:939 +#: ../editor.admin.class.php:1056 msgid "Insert \"attributes\" parameters between braces..." msgstr "Вставьте параметры \"attributes\" между фигурными скобками" -#: editor.admin.class.php:942 +#: ../editor.admin.class.php:1059 msgid "Add to ad" msgstr "Добавить теги" -#: editor.admin.class.php:944 +#: ../editor.admin.class.php:1061 msgid "Non Selected" msgstr "Не выбрано" -#: editor.admin.class.php:945 +#: ../editor.admin.class.php:1062 msgid "nofollow" msgstr "nofollow" -#: editor.admin.class.php:946 +#: ../editor.admin.class.php:1063 msgid "noindex" msgstr "noindex" -#: editor.admin.class.php:947 +#: ../editor.admin.class.php:1064 msgid "nofollow and noindex" msgstr "nofollow и noindex" -#: editor.admin.class.php:973 +#: ../editor.admin.class.php:1073 msgid "Code Mode" msgstr "Режим кода" -#: editor.admin.class.php:979 +#: ../editor.admin.class.php:1079 msgid "This code of ad contains PHP script" msgstr "Этот код объявления содержит PHP скрипт" -#: editor.admin.class.php:988 +#: ../editor.admin.class.php:1088 msgid "Restrictions of advertisements showing" msgstr "Ограничения показа объявления" -#: editor.admin.class.php:991 +#: ../editor.admin.class.php:1091 msgid "Ad Weight" msgstr "Вес объявления" -#: editor.admin.class.php:998 +#: ../editor.admin.class.php:1098 msgid "Inactive" msgstr "Неактивно" -#: editor.admin.class.php:999 +#: ../editor.admin.class.php:1099 msgid "Minimal Activity" msgstr "Минимальная активность" -#: editor.admin.class.php:1000 +#: ../editor.admin.class.php:1100 msgid "Maximal Activity" msgstr "Максимальная активность" -#: editor.admin.class.php:1010 +#: ../editor.admin.class.php:1110 msgid "" "Ad weight - coefficient of frequency of show of the advertisement for one " "cycle of advertisements rotation." @@ -1614,79 +1943,79 @@ msgstr "" "Вес рекламного объявления является коэффициентом частоты показа рекламного " "объявления за однин цикл ротации." -#: editor.admin.class.php:1012 +#: ../editor.admin.class.php:1112 msgid "0 - ad is inactive" msgstr "0 - объявление не активно" -#: editor.admin.class.php:1013 +#: ../editor.admin.class.php:1113 msgid "1 - minimal activity of this advertisement" msgstr "1 - минимальная активность этого объявления" -#: editor.admin.class.php:1015 +#: ../editor.admin.class.php:1115 msgid "10 - maximal activity of this ad." msgstr "10 - максимальная активность данного объявления" -#: editor.admin.class.php:1021 help.class.php:20 help.class.php:161 +#: ../editor.admin.class.php:1121 ../help.class.php:20 ../help.class.php:161 msgid "Show ad on all pages of blog" msgstr "Показывать объявление на всех страницах блога" -#: editor.admin.class.php:1025 +#: ../editor.admin.class.php:1125 msgid "Show ad only on pages of this type" msgstr "Показывать объявление только на страницах данного типа" -#: editor.admin.class.php:1029 +#: ../editor.admin.class.php:1129 msgid "Home Page (Home or Front Page)" msgstr "Главная страница (главная или фронтальная страница)" -#: editor.admin.class.php:1031 +#: ../editor.admin.class.php:1131 msgid "Singular Pages" msgstr "Сингулярные страницы" -#: editor.admin.class.php:1034 +#: ../editor.admin.class.php:1134 msgid "Single Post" msgstr "Страница статьи" -#: editor.admin.class.php:1038 +#: ../editor.admin.class.php:1138 msgid "Custom Post Type" msgstr "Пользовательский тип статьи" -#: editor.admin.class.php:1040 +#: ../editor.admin.class.php:1140 msgid "Attachment" msgstr "Приложение" -#: editor.admin.class.php:1043 +#: ../editor.admin.class.php:1143 msgid "Search Page" msgstr "Страница вывода результата поиска" -#: editor.admin.class.php:1045 +#: ../editor.admin.class.php:1145 msgid "\"Not found\" Page (HTTP 404: Not Found)" msgstr "Страница \"Не найдено\" (ошибка HTTP 404)" -#: editor.admin.class.php:1047 +#: ../editor.admin.class.php:1147 msgid "Archive Pages" msgstr "Страницы архивов" -#: editor.admin.class.php:1050 +#: ../editor.admin.class.php:1150 msgid "Taxonomy Archive Pages" msgstr "Страницы архивов таксономий" -#: editor.admin.class.php:1052 +#: ../editor.admin.class.php:1152 msgid "Category Archive Pages" msgstr "Страницы архивов рубрик" -#: editor.admin.class.php:1054 +#: ../editor.admin.class.php:1154 msgid "Tag Archive Pages" msgstr "Страницы архивов меток" -#: editor.admin.class.php:1056 +#: ../editor.admin.class.php:1156 msgid "Author Archive Pages" msgstr "Страницы архивов авторов" -#: editor.admin.class.php:1058 +#: ../editor.admin.class.php:1158 msgid "Custom Post Type Archive Pages" msgstr "Страницы архивов пользовательскии типов" -#: editor.admin.class.php:1060 +#: ../editor.admin.class.php:1160 msgid "" "Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " "daily or time-based archive)" @@ -1694,15 +2023,15 @@ msgstr "" "Страницы архивов по датам (любые основанные на датах страницы архивов, " "другими словами, архивы по месяцам, по годам, по дням и по времени)" -#: editor.admin.class.php:1065 +#: ../editor.admin.class.php:1165 msgid "Show ad only in certain posts/pages" msgstr "Показывать объявление только в определённых статьях/страницах" -#: editor.admin.class.php:1069 editor.admin.class.php:1138 +#: ../editor.admin.class.php:1169 ../editor.admin.class.php:1196 msgid "Posts/Pages" msgstr "Статьи/Страницы" -#: editor.admin.class.php:1076 +#: ../editor.admin.class.php:1176 msgid "" "Use this setting to display an ad only in certain posts/pages. Select posts/" "pages." @@ -1710,47 +2039,15 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "выбранных статьях/страницах. Выберите статьи/страницы." -#: editor.admin.class.php:1087 -msgid "Users" -msgstr "Пользователи" - -#: editor.admin.class.php:1089 -msgid "Show this ad for" -msgstr "Показывать это рекламное объявление для" - -#: editor.admin.class.php:1092 -msgid "all users" -msgstr "всех пользователей" - -#: editor.admin.class.php:1097 -msgid "these users" -msgstr "этих пользователей" - -#: editor.admin.class.php:1102 -msgid "Unregistered Users" -msgstr "Незарегистрированные пользователи" - -#: editor.admin.class.php:1106 editor.admin.class.php:1114 -msgid "Registered Users" -msgstr "Зарегистрированные пользователи" - -#: editor.admin.class.php:1111 -msgid "Exclude these users" -msgstr "Исключая этих пользователей" - -#: editor.admin.class.php:1122 -msgid "Do not show this ad for advertiser" -msgstr "Не показывать объявление рекламодателю" - -#: editor.admin.class.php:1130 +#: ../editor.admin.class.php:1188 msgid "Extended restrictions of advertisements showing" msgstr "Дополнительные ограничения показа объявления" -#: editor.admin.class.php:1134 +#: ../editor.admin.class.php:1192 msgid "Do not show ad on certain posts/pages" msgstr "Не показывать объявление в определённых статьях/страницах" -#: editor.admin.class.php:1146 +#: ../editor.admin.class.php:1204 msgid "" "Use this setting to not display an ad on certain posts/pages. Select posts/" "pages." @@ -1758,17 +2055,17 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "выбранных статьях/страницах. Выберите статьи/страницы." -#: editor.admin.class.php:1151 +#: ../editor.admin.class.php:1209 msgid "" "Show ad only in single posts or categories archives of certain categories" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных рубрик" -#: editor.admin.class.php:1154 editor.admin.class.php:1174 +#: ../editor.admin.class.php:1212 ../editor.admin.class.php:1232 msgid "Categories" msgstr "Рубрики" -#: editor.admin.class.php:1161 +#: ../editor.admin.class.php:1219 msgid "" "Use this setting to display an ad only in single posts or categories " "archives of certain categories." @@ -1776,8 +2073,9 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных рубрик." -#: editor.admin.class.php:1165 editor.admin.class.php:1200 -#: editor.admin.class.php:1235 editor.admin.class.php:1270 +#: ../editor.admin.class.php:1223 ../editor.admin.class.php:1257 +#: ../editor.admin.class.php:1291 ../editor.admin.class.php:1326 +#: ../editor.admin.class.php:1361 msgid "" "This display logic parameter will be applied only when you use the \"Show ad " "on all pages of blog\" and \"Show your ad only on the pages of this type\" " @@ -1788,12 +2086,12 @@ msgstr "" "объявление только на страницах данного типа\". В противном случае, параметр " "будет проигнорирован." -#: editor.admin.class.php:1171 +#: ../editor.admin.class.php:1229 msgid "" "Do not show ad in single posts or categories archives of certain categories" msgstr "Не показывать объявление в одиночных статьях и архивах заданных рубрик" -#: editor.admin.class.php:1181 +#: ../editor.admin.class.php:1239 msgid "" "Use this setting to not display an ad in single posts or categories archives " "of certain categories." @@ -1801,16 +2099,46 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных рубрик." -#: editor.admin.class.php:1186 +#: ../editor.admin.class.php:1244 +msgid "" +"Show ad only in single posts or archives of certain Custom Taxonomies Terms" +msgstr "" +"Показывать объявление только в одиночных статьях и архивах заданных терминов " +"пользовательских таксономий" + +#: ../editor.admin.class.php:1253 +msgid "" +"Use this setting to display an ad only in single posts or archives of " +"certain Custom Taxonomies Terms." +msgstr "" +"Используйте этот параметр для показа рекламного объявления только в " +"одиночных статьях и архивах выбранных терминов пользовательских таксономий." + +#: ../editor.admin.class.php:1263 +msgid "" +"Do not show ad in single posts or archives of certain Custom Taxonomies Terms" +msgstr "" +"Не показывать объявление в одиночных статьях и архивах заданных терминов " +"пользовательских таксономий" + +#: ../editor.admin.class.php:1272 +msgid "" +"Use this setting to not display an ad only in single posts or archives of " +"certain Custom Taxonomies Terms." +msgstr "" +"Используйте этот параметр для блокировки показа рекламного объявления в " +"одиночных статьях и архивах выбранных терминов пользовательских таксономий." + +#: ../editor.admin.class.php:1277 msgid "Show ad only in single posts or authors archives of certain authors" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных авторов" -#: editor.admin.class.php:1189 editor.admin.class.php:1209 +#: ../editor.admin.class.php:1280 ../editor.admin.class.php:1300 msgid "Authors" msgstr "Авторы" -#: editor.admin.class.php:1196 +#: ../editor.admin.class.php:1287 msgid "" "Use this setting to display an ad only in single posts or authors archives " "of certain authors." @@ -1818,12 +2146,12 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных авторов." -#: editor.admin.class.php:1206 +#: ../editor.admin.class.php:1297 msgid "Do not show ad in single posts or authors archives of certain authors" msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных авторов" -#: editor.admin.class.php:1216 +#: ../editor.admin.class.php:1307 msgid "" "Use this setting to not display an ad in single posts or authors archives of " "certain authors." @@ -1831,16 +2159,16 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных авторов." -#: editor.admin.class.php:1221 +#: ../editor.admin.class.php:1312 msgid "Show ad only in single posts or tags archives of certain tags" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных меток" -#: editor.admin.class.php:1224 editor.admin.class.php:1244 +#: ../editor.admin.class.php:1315 ../editor.admin.class.php:1335 msgid "Tags" msgstr "Метки" -#: editor.admin.class.php:1231 +#: ../editor.admin.class.php:1322 msgid "" "Use this setting to display an ad only in single posts or tags archives of " "certain tags." @@ -1848,11 +2176,11 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных меток." -#: editor.admin.class.php:1241 +#: ../editor.admin.class.php:1332 msgid "Do not show ad in single posts or tags archives of certain tags" msgstr "Не показывать объявление в одиночных статьях и архивах заданных меток" -#: editor.admin.class.php:1251 +#: ../editor.admin.class.php:1342 msgid "" "Use this setting to not display an ad in single posts or tags archives of " "certain tags." @@ -1860,7 +2188,7 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных меток." -#: editor.admin.class.php:1256 +#: ../editor.admin.class.php:1347 msgid "" "Show ad only in custom type single posts or custom post type archives of " "certain custom post types" @@ -1868,11 +2196,11 @@ msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных " "пользовательских типов" -#: editor.admin.class.php:1259 editor.admin.class.php:1279 +#: ../editor.admin.class.php:1350 ../editor.admin.class.php:1370 msgid "Custom post types" msgstr "Пользовательские типы" -#: editor.admin.class.php:1266 +#: ../editor.admin.class.php:1357 msgid "" "Use this setting to display an ad only in custom type single posts or custom " "post type archives of certain custom post types." @@ -1880,7 +2208,7 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных пользовательских типов." -#: editor.admin.class.php:1276 +#: ../editor.admin.class.php:1367 msgid "" "Do not show ad in custom type single posts or custom post type archives of " "certain custom post types" @@ -1888,7 +2216,7 @@ msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных " "пользовательских типов" -#: editor.admin.class.php:1286 +#: ../editor.admin.class.php:1377 msgid "" "Use this setting to not display an ad in custom type single posts or custom " "post type archives of certain custom post types." @@ -1896,76 +2224,108 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных пользовательских типов." -#: editor.admin.class.php:1291 +#: ../editor.admin.class.php:1382 msgid "Use the schedule for this ad" msgstr "Использовать расписание для этого объявления" -#: editor.admin.class.php:1295 +#: ../editor.admin.class.php:1386 msgid "Campaign Start Date" msgstr "Дата начала кампании" -#: editor.admin.class.php:1299 +#: ../editor.admin.class.php:1390 msgid "Campaign End Date" msgstr "Дата окончания кампании" -#: editor.admin.class.php:1304 +#: ../editor.admin.class.php:1395 msgid "" "Use these parameters for displaying ad during the certain period of time." msgstr "" "Используйте эти параметры для показа объявления в течение определенного " "периода времени." -#: editor.admin.class.php:1309 +#: ../editor.admin.class.php:1400 msgid "Use limitation by hits" msgstr "Использовать ограничение по показам" -#: editor.admin.class.php:1313 +#: ../editor.admin.class.php:1404 msgid "Hits Limit" msgstr "Лимит показов" -#: editor.admin.class.php:1318 +#: ../editor.admin.class.php:1409 msgid "Use this parameter for limiting displaying of ad by hits." msgstr "" "Используйте этот параметр для ограничения показа объявлений по просмотрам." -#: editor.admin.class.php:1323 +#: ../editor.admin.class.php:1414 msgid "Use limitation by clicks" msgstr "Использовать ограничение по кликам" -#: editor.admin.class.php:1327 +#: ../editor.admin.class.php:1418 msgid "Clicks Limit" msgstr "Лимит кликов" -#: editor.admin.class.php:1332 +#: ../editor.admin.class.php:1423 msgid "Use this parameter for limiting displaying of ad by clicks." msgstr "Используйте этот параметр для ограничения показа объявлений по кликам." -#: editor.admin.class.php:1342 +#: ../editor.admin.class.php:1433 +msgid "Users" +msgstr "Пользователи" + +#: ../editor.admin.class.php:1435 +msgid "Show this ad for" +msgstr "Показывать это рекламное объявление для" + +#: ../editor.admin.class.php:1438 +msgid "all users" +msgstr "всех пользователей" + +#: ../editor.admin.class.php:1443 +msgid "these users" +msgstr "этих пользователей" + +#: ../editor.admin.class.php:1448 +msgid "Unregistered Users" +msgstr "Незарегистрированные пользователи" + +#: ../editor.admin.class.php:1452 ../editor.admin.class.php:1460 +msgid "Registered Users" +msgstr "Зарегистрированные пользователи" + +#: ../editor.admin.class.php:1457 +msgid "Exclude these users" +msgstr "Исключая этих пользователей" + +#: ../editor.admin.class.php:1468 +msgid "Do not show this ad for advertiser" +msgstr "Не показывать объявление рекламодателю" + +#: ../editor.admin.class.php:1480 msgid "Advertiser" msgstr "Рекламодатель" -#: editor.admin.class.php:1345 +#: ../editor.admin.class.php:1483 msgid "Advertiser Nick Name" msgstr "Ник рекламодателя" -#: editor.admin.class.php:1362 help.class.php:32 help.class.php:180 +#: ../editor.admin.class.php:1500 ../help.class.php:32 ../help.class.php:180 msgid "Prices" msgstr "Расценки" -#: editor.admin.class.php:1365 +#: ../editor.admin.class.php:1503 msgid "Price of ad placement per month" msgstr "Цена размещения в месяц" -#: editor.admin.class.php:1369 +#: ../editor.admin.class.php:1507 msgid "Tthis parameter used only for scheduled ads." msgstr "" "Этот параметр используется только для объявлений, показываемых по расписанию." -#: editor.admin.class.php:1372 +#: ../editor.admin.class.php:1510 msgid "Price per Thousand Hits" msgstr "Цена за тысячу показов" -#: editor.admin.class.php:1376 +#: ../editor.admin.class.php:1514 msgid "" "Not only humans visit your blog, bots and crawlers too. In order not to " "deceive an advertiser, you must enable the detection of bots and crawlers." @@ -1973,11 +2333,11 @@ msgstr "" "Не только люди посещают Ваш блог ... Включите обнаружение ботов и сканеров " "для того, чтобы правильно считать показы и не обманывать рекламодателя." -#: editor.admin.class.php:1379 +#: ../editor.admin.class.php:1517 msgid "Price per Click" msgstr "Цена за клик" -#: editor.admin.class.php:1383 +#: ../editor.admin.class.php:1521 msgid "" "To calculate the earnings on clicks, you must enable counting of clicks for " "that ad." @@ -1985,60 +2345,52 @@ msgstr "" "Для подсчёта заработка по кликам, необходимо включить подсчёт кликов для " "этого объявления." -#: editor.admin.class.php:1394 +#: ../editor.admin.class.php:1561 msgid "Ad Preview" msgstr "Предварительный просмотр объявления" -#: errorlog.admin.class.php:61 errorlog.admin.class.php:145 -#: errorlog.admin.class.php:157 +#: ../errorlog.admin.class.php:61 ../errorlog.admin.class.php:145 +#: ../errorlog.admin.class.php:157 msgid "Resolved" msgstr "Исправлено" -#: errorlog.admin.class.php:65 errorlog.admin.class.php:173 +#: ../errorlog.admin.class.php:65 ../errorlog.admin.class.php:167 msgid "Clear Error Log" msgstr "Очистить журнал ошибок" -#: errorlog.admin.class.php:68 errorlog.admin.class.php:176 +#: ../errorlog.admin.class.php:68 ../errorlog.admin.class.php:170 msgid "Clear Resolved" msgstr "Очистить исправленные" -#: errorlog.admin.class.php:85 errorlog.admin.class.php:95 +#: ../errorlog.admin.class.php:85 ../errorlog.admin.class.php:95 msgid "Date" msgstr "Дата" -#: errorlog.admin.class.php:88 errorlog.admin.class.php:98 +#: ../errorlog.admin.class.php:88 ../errorlog.admin.class.php:98 msgid "Error Massage" msgstr "Сообщение об ошибке" -#: errorlog.admin.class.php:116 -msgid "Update Error" -msgstr "Ошибка обновления" - -#: errorlog.admin.class.php:116 -msgid "Output Error" -msgstr "Ошибка вывода" - -#: errorlog.admin.class.php:147 +#: ../errorlog.admin.class.php:147 msgid "More Info" msgstr "Подробнее" -#: errorlog.admin.class.php:151 +#: ../errorlog.admin.class.php:151 msgid "Not Resolved" msgstr "Не исправлено" -#: errorlog.admin.class.php:188 +#: ../errorlog.admin.class.php:182 msgid "Error Info" msgstr "Подробно" -#: errors.class.php:46 +#: ../errors.class.php:54 msgid "Simple Ads Manager Images Folder hasn't been created!" msgstr "Папка изображений плагина Simple Ads Manager не была создана." -#: errors.class.php:47 +#: ../errors.class.php:55 msgid "Try to reactivate plugin or create folder manually." msgstr "Попытайтесь реактивировать плагин или зоздайте папку вручную." -#: errors.class.php:47 +#: ../errors.class.php:55 msgid "" "Manually creation: Create folder 'sam-images' in 'wp-content/plugins' " "folder. Don't forget to set folder's permissions to 777." @@ -2046,17 +2398,17 @@ msgstr "" "Создание папки вручную: Создайте папку 'sam-images' в папке 'wp-content/" "plugins'. Не забудьте установить для созданной папки права доступа 777." -#: errors.class.php:54 +#: ../errors.class.php:62 #, php-format msgid "Database table %s hasn't been created!" msgstr "Таблица базы данных %s не была создана!" -#: errors.class.php:58 +#: ../errors.class.php:66 #, php-format msgid "Database table %s hasn't been upgraded!" msgstr "Таблица базы данных %s не была обновлена!" -#: help.class.php:14 help.class.php:155 +#: ../help.class.php:14 ../help.class.php:155 msgid "" "Enter a name and a description of the " "advertisement. These parameters are optional, because don’t influence " @@ -2067,7 +2419,7 @@ msgstr "" "объявления. Это необязательные параметры, т.к. ни на что не влияют, но " "помогают в визуальной идентификации объявления (не забыть что есть что)." -#: help.class.php:15 help.class.php:156 +#: ../help.class.php:15 ../help.class.php:156 msgid "" "Ad Code – code can be defined as a combination of the image " "URL and target page URL, or as HTML code, javascript code, or PHP code (for " @@ -2084,11 +2436,11 @@ msgstr "" "кликов, а так же инструменты для загрузки/выбора загруженного изображения " "баннера." -#: help.class.php:16 help.class.php:157 +#: ../help.class.php:16 ../help.class.php:157 msgid "Restrictions of advertisement Showing" msgstr "Ограничения показа объявления" -#: help.class.php:17 help.class.php:158 +#: ../help.class.php:17 ../help.class.php:158 msgid "" "Ad Weight – coefficient of frequency of show of the advertisement " "for one cycle of advertisements rotation. 0 – ad is inactive, 1 – minimal " @@ -2098,11 +2450,11 @@ msgstr "" "объявления за однин цикл ротации. 0 - объявление неактивно, 1 - минимальная " "активность, 10 - максимальная активность объявления." -#: help.class.php:18 help.class.php:159 +#: ../help.class.php:18 ../help.class.php:159 msgid "Restrictions by the type of pages – select restrictions:" msgstr "Ограничения по типу страниц - выберите режим ограничения:" -#: help.class.php:21 help.class.php:162 +#: ../help.class.php:21 ../help.class.php:162 msgid "" "Show ad only on pages of this type – ad will appear only on the pages of " "selected types" @@ -2110,7 +2462,7 @@ msgstr "" "Показывать на страницах только данного типа – объявление будет показываться " "только на страницах выбранных типов" -#: help.class.php:22 help.class.php:163 +#: ../help.class.php:22 ../help.class.php:163 msgid "" "Show ad only in certain posts – ad will be shown only on single posts pages " "with the given IDs (ID items separated by commas, no spaces)" @@ -2119,11 +2471,11 @@ msgstr "" "показываться только на страницах статей с заданными ID статей (ID статей " "разделять запятыми, без пробелов)" -#: help.class.php:24 +#: ../help.class.php:24 msgid "Additional restrictions" msgstr "Доплнительные ограничения" -#: help.class.php:26 help.class.php:174 +#: ../help.class.php:26 ../help.class.php:174 msgid "" "Show ad only in single posts or categories archives of certain categories – " "ad will be shown only on single posts pages or category archive pages of the " @@ -2133,7 +2485,7 @@ msgstr "" "– объявление будет показываться только на страницах статей, входящих в " "заданные рубрики и на страницах архивов заданных рубрик" -#: help.class.php:27 help.class.php:175 +#: ../help.class.php:27 ../help.class.php:175 msgid "" "Show ad only in single posts or authors archives of certain authors – ad " "will be shown only on single posts pages or author archive pages of the " @@ -2143,7 +2495,7 @@ msgstr "" "авторов – объявление будет показываться только на страницах статей и на " "страницах архивов заданных авторов." -#: help.class.php:29 help.class.php:177 +#: ../help.class.php:29 ../help.class.php:177 msgid "" "Use the schedule for this ad – if necessary, select checkbox " "labeled “Use the schedule for this ad” and set start and finish dates of ad " @@ -2153,7 +2505,7 @@ msgstr "" "«Использовать расписание для этого объявления» и установите даты начала и " "конца рекламной кампании." -#: help.class.php:30 help.class.php:178 +#: ../help.class.php:30 ../help.class.php:178 msgid "" "Use limitation by hits – if necessary, select checkbox labeled “Use " "limitation by hits” and set hits limit." @@ -2161,7 +2513,7 @@ msgstr "" "Использовать ограничение по показам – если необходимо, взведите " "флажок «Использовать ограничение по показам» и установите лимит показов." -#: help.class.php:31 help.class.php:179 +#: ../help.class.php:31 ../help.class.php:179 msgid "" "Use limitation by clicks – if necessary, select checkbox labeled " "“Use limitation by clicks” and set clicks limit." @@ -2169,7 +2521,7 @@ msgstr "" "Использовать ограничение по кликам – если необходимо, взведите " "флажок «Использовать ограничение по кликам» и установите лимит кликов." -#: help.class.php:32 help.class.php:180 +#: ../help.class.php:32 ../help.class.php:180 msgid "" "Use these parameters to get the statistics of incomes from advertisements " "placed in your blog. \"Price of ad placement per month\" - parameter used " @@ -2180,13 +2532,14 @@ msgstr "" "параметр используется для расчета статистики только для объявлений, " "показываемых по расписанию." -#: help.class.php:33 help.class.php:50 help.class.php:57 help.class.php:71 -#: help.class.php:104 help.class.php:112 help.class.php:123 help.class.php:140 -#: help.class.php:149 help.class.php:165 help.class.php:181 help.class.php:198 +#: ../help.class.php:33 ../help.class.php:50 ../help.class.php:57 +#: ../help.class.php:71 ../help.class.php:104 ../help.class.php:112 +#: ../help.class.php:123 ../help.class.php:140 ../help.class.php:149 +#: ../help.class.php:165 ../help.class.php:181 ../help.class.php:198 msgid "Manual" msgstr "Руководство" -#: help.class.php:39 help.class.php:129 +#: ../help.class.php:39 ../help.class.php:129 msgid "" "Enter a name and a description of the Ads " "Place. In principle, it is not mandatory parameters, because these " @@ -2198,7 +2551,7 @@ msgstr "" "однако опыт подсказывает, что через некоторое время всякие ID забываются и " "такая информация может быть полезной." -#: help.class.php:40 help.class.php:130 +#: ../help.class.php:40 ../help.class.php:130 msgid "" "Ads Place Size – in this version is only for informational " "purposes only, but in future I plan to use this option. It is desirable to " @@ -2208,7 +2561,7 @@ msgstr "" "исключительно информационную нагрузку, но в будущем я планирую использовать " "этот параметр. Желательно выставлять реальный размер." -#: help.class.php:41 help.class.php:131 +#: ../help.class.php:41 ../help.class.php:131 msgid "" "Ads Place Patch - it’s an ad that will appear in the event " "that the logic of basic ads outputing of this Ads Place on the current page " @@ -2232,19 +2585,19 @@ msgstr "" "ведущий на вашу страницу расценок публикации рекламных объявлений или баннер " "от AdSense." -#: help.class.php:42 help.class.php:132 +#: ../help.class.php:42 ../help.class.php:132 msgid "Patch can be defined" msgstr "Заглушка может быть задана" -#: help.class.php:44 help.class.php:134 +#: ../help.class.php:44 ../help.class.php:134 msgid "as combination of the image URL and target page URL" msgstr "как комбинация URL изображения и URL целевой страницы" -#: help.class.php:45 help.class.php:135 +#: ../help.class.php:45 ../help.class.php:135 msgid "as HTML code or javascript code" msgstr "как код HTML или Javascript" -#: help.class.php:46 help.class.php:136 +#: ../help.class.php:46 ../help.class.php:136 msgid "" "as name of Google DoubleClick for Publishers (DFP) block" @@ -2252,7 +2605,7 @@ msgstr "" "как имя блока Google DoubleClick for Publishers (DFP)" -#: help.class.php:48 help.class.php:138 +#: ../help.class.php:48 ../help.class.php:138 msgid "" "If you select the first option (image mode), tools to download/choosing of " "downloaded image banner become available for you." @@ -2260,7 +2613,7 @@ msgstr "" "В случае использования первого варианта (режим изображения) Вам становятся " "доступны инструменты для загрузки/выбора загруженного изображения баннера." -#: help.class.php:49 help.class.php:139 +#: ../help.class.php:49 ../help.class.php:139 msgid "" "Codes – as Ads Place can be inserted into the page code not " "only as widget, but as a short code or by using function, you can use code " @@ -2272,7 +2625,7 @@ msgstr "" "вполне резонно можно использовать коды «до» и «после» для центровки или " "выравнивания рекламного места на месте вставки. Используйте HTML теги." -#: help.class.php:63 help.class.php:190 +#: ../help.class.php:63 ../help.class.php:190 msgid "" "Views per Cycle – the number of impressions an ad for one " "cycle of rotation, provided that this ad has maximum weight (the activity). " @@ -2286,7 +2639,7 @@ msgstr "" "цикле равном 1000, объявление с весом 10 будет показано 1000 раз, а " "объявление с весом 3 будет показано 300 раз." -#: help.class.php:64 help.class.php:191 +#: ../help.class.php:64 ../help.class.php:191 msgid "" "Do not set this parameter to a value less than the maximum number of " "visitors which may simultaneously be on your site – it may violate the logic " @@ -2296,7 +2649,7 @@ msgstr "" "количество посетителей могущих одномоментно находиться на Вашем сайте – это " "может привести к нарушению логики ротации." -#: help.class.php:65 help.class.php:192 +#: ../help.class.php:65 ../help.class.php:192 msgid "" "Not worth it, though it has no special meaning, set this parameter to a " "value greater than the number of hits your web pages during a month. " @@ -2307,7 +2660,7 @@ msgstr "" "Оптимальным, пожалуй, является значение равное суточному показу страниц " "сайта." -#: help.class.php:66 help.class.php:193 +#: ../help.class.php:66 ../help.class.php:193 msgid "" "Auto Inserting Settings - here you can select the Ads " "Places and allow the display of their ads before and after the content of " @@ -2317,7 +2670,7 @@ msgstr "" "места и разрешить показ их рекламных объявлений до и после контента " "одиночной статьи." -#: help.class.php:67 help.class.php:194 +#: ../help.class.php:67 ../help.class.php:194 msgid "" "Google DFP Settings - if you want to use codes of Google " "DFP rotator, you must allow it's using and define your pub-code." @@ -2326,11 +2679,11 @@ msgstr "" "ротатора Google DFP, Вы должны разрешить их использование и определить Ваш " "pub-код." -#: help.class.php:69 help.class.php:196 +#: ../help.class.php:69 ../help.class.php:196 msgid "Bots and Crawlers detection" msgstr "Обнаружение ботов и сканеров" -#: help.class.php:69 help.class.php:196 +#: ../help.class.php:69 ../help.class.php:196 msgid "" "For obtaining of more exact indexes of statistics and incomes it is " "preferable to exclude data about visits of bots and crawlers from the data " @@ -2344,19 +2697,19 @@ msgstr "" "сканера данные о показе не будут записаны. Выберите точность обнаружения " "ботов, но помните, что чем точнее тем больше требуется ресурсов сервера." -#: help.class.php:103 +#: ../help.class.php:103 msgid "This is list of Ads Places" msgstr "Список рекламных мест" -#: help.class.php:107 help.class.php:115 help.class.php:201 +#: ../help.class.php:107 ../help.class.php:115 ../help.class.php:201 msgid "Help" msgstr "Справка" -#: help.class.php:111 +#: ../help.class.php:111 msgid "This is list of Ads" msgstr "Список рекламных объявлений" -#: help.class.php:122 +#: ../help.class.php:122 msgid "" "The main object of the plugin is “Ads Place“. Each Ads Place is a container " "for the advertisements and provides the logic of the show and rotation. In " @@ -2374,11 +2727,11 @@ msgstr "" "рекламном месте. Одно рекламное место может содержать любое количество " "объектов “рекламное объявление”." -#: help.class.php:142 help.class.php:168 +#: ../help.class.php:142 ../help.class.php:168 msgid "Parameters" msgstr "Параметры" -#: help.class.php:148 +#: ../help.class.php:148 msgid "" "Object “advertisement” rigidly attached to his container “Ads Place”. Its " "parameters determine frequency (weight) of displaying and limiting " @@ -2390,232 +2743,229 @@ msgstr "" "ограничения показа, от “показывать на всех страницах” до “показывать в " "статьях с ID …” и показывать с … по (расписание)." -#: help.class.php:151 list.admin.class.php:360 list.admin.class.php:370 +#: ../help.class.php:151 ../list.admin.class.php:361 +#: ../list.admin.class.php:371 msgid "Advertisement" msgstr "Рекламное объявление" -#: help.class.php:172 +#: ../help.class.php:172 msgid "Additional restrictions" msgstr "Доплнительные ограничения" -#: help.class.php:184 +#: ../help.class.php:184 msgid "Additional Parameters" msgstr "Доплнительные параметры" -#: list.admin.class.php:137 +#: ../list.admin.class.php:138 msgid "Managing Ads Places" msgstr "Управление рекламными местами" -#: list.admin.class.php:153 list.admin.class.php:273 +#: ../list.admin.class.php:154 ../list.admin.class.php:274 msgid "Add New Place" msgstr "Добавить новое место" -#: list.admin.class.php:157 list.admin.class.php:277 +#: ../list.admin.class.php:158 ../list.admin.class.php:278 msgid "Reset Statistics" msgstr "Очистить статистику" -#: list.admin.class.php:173 list.admin.class.php:184 +#: ../list.admin.class.php:174 ../list.admin.class.php:185 msgid "Place Name" msgstr "Имя места" -#: list.admin.class.php:176 list.admin.class.php:187 +#: ../list.admin.class.php:177 ../list.admin.class.php:188 msgid "Total Hits" msgstr "Всего показов" -#: list.admin.class.php:177 list.admin.class.php:188 +#: ../list.admin.class.php:178 ../list.admin.class.php:189 msgid "Total Ads" msgstr "Объявлений" -#: list.admin.class.php:178 list.admin.class.php:189 list.admin.class.php:364 -#: list.admin.class.php:374 +#: ../list.admin.class.php:179 ../list.admin.class.php:190 +#: ../list.admin.class.php:365 ../list.admin.class.php:375 msgid "Earnings" msgstr "Доходы" -#: list.admin.class.php:233 list.admin.class.php:438 +#: ../list.admin.class.php:234 ../list.admin.class.php:424 msgid "Placement" msgstr "Размещение" -#: list.admin.class.php:236 list.admin.class.php:441 -msgid "Total" -msgstr "Всего" - -#: list.admin.class.php:236 list.admin.class.php:441 +#: ../list.admin.class.php:237 ../list.admin.class.php:427 msgid "N/A" msgstr "Нет" -#: list.admin.class.php:243 +#: ../list.admin.class.php:244 msgid "Edit Place" msgstr "Изменить рекламное место" -#: list.admin.class.php:247 +#: ../list.admin.class.php:248 msgid "Restore this Place from the Trash" msgstr "Восстановить это место из корзины" -#: list.admin.class.php:248 +#: ../list.admin.class.php:249 msgid "Remove this Place permanently" msgstr "Удалить это рекламное место навсегда" -#: list.admin.class.php:253 +#: ../list.admin.class.php:254 msgid "Move this Place to the Trash" msgstr "Поместить это место в корзину" -#: list.admin.class.php:254 +#: ../list.admin.class.php:255 msgid "View List of Place Ads" msgstr "Показать список рекламных мест" -#: list.admin.class.php:254 +#: ../list.admin.class.php:255 msgid "View Ads" msgstr "Объявления" -#: list.admin.class.php:255 +#: ../list.admin.class.php:256 msgid "Create New Ad" msgstr "Создать новое объявление" -#: list.admin.class.php:255 +#: ../list.admin.class.php:256 msgid "New Ad" msgstr "Новое объявление" -#: list.admin.class.php:320 +#: ../list.admin.class.php:321 msgid "Managing Items of Ads Place" msgstr "Управление объявлениями рекламного места" -#: list.admin.class.php:337 list.admin.class.php:471 +#: ../list.admin.class.php:338 ../list.admin.class.php:457 msgid "Add New Ad" msgstr "Добавить новое рекламное объявление" -#: list.admin.class.php:341 list.admin.class.php:475 +#: ../list.admin.class.php:342 ../list.admin.class.php:461 msgid "Back to Ads Places Management" msgstr "Назад, к списку мест" -#: list.admin.class.php:432 +#: ../list.admin.class.php:418 msgid "Yes" msgstr "Да" -#: list.admin.class.php:433 +#: ../list.admin.class.php:419 msgid "No" msgstr "Нет" -#: list.admin.class.php:448 +#: ../list.admin.class.php:434 msgid "Edit this Item of Ads Place" msgstr "Изменить этот элемент рекламного места" -#: list.admin.class.php:452 +#: ../list.admin.class.php:438 msgid "Restore this Ad from the Trash" msgstr "Восстановить это объявление из корзины" -#: list.admin.class.php:453 +#: ../list.admin.class.php:439 msgid "Remove this Ad permanently" msgstr "Удалить это рекламное объявление навсегда" -#: list.admin.class.php:454 +#: ../list.admin.class.php:440 msgid "Move this item to the Trash" msgstr "Поместить этот элемент в корзину" -#: updater.class.php:25 +#: ../updater.class.php:53 msgid "An error occurred during updating process..." msgstr "Произошла ошибка во время процесса обновления ..." -#: updater.class.php:39 +#: ../updater.class.php:67 msgid "Updated..." msgstr "Обновлено ..." -#: widget.class.php:10 +#: ../widget.class.php:11 msgid "Ads Place:" msgstr "Рекламное место" -#: widget.class.php:13 +#: ../widget.class.php:14 msgid "Ads Place rotator serviced by Simple Ads Manager." msgstr "" "Ротатор рекламных объявлений, обслуживаемый плагином Simple Ads Manager." -#: widget.class.php:101 widget.class.php:240 widget.class.php:379 -#: widget.class.php:516 +#: ../widget.class.php:101 ../widget.class.php:237 ../widget.class.php:374 +#: ../widget.class.php:509 msgid "Title:" msgstr "Заголовок:" -#: widget.class.php:124 widget.class.php:263 widget.class.php:402 -#: widget.class.php:539 +#: ../widget.class.php:124 ../widget.class.php:260 ../widget.class.php:397 +#: ../widget.class.php:532 msgid "Hide widget style." msgstr "Скрывать стиль виджета." -#: widget.class.php:133 widget.class.php:272 widget.class.php:411 +#: ../widget.class.php:133 ../widget.class.php:269 ../widget.class.php:406 msgid "" "Allow using previously defined \"before\" and \"after\" codes of Ads Place.." msgstr "" "Разрешить использование ранее определённых кодов \"до\" и \"после\" для " "рекламного места." -#: widget.class.php:152 +#: ../widget.class.php:153 msgid "Ads Zone selector serviced by Simple Ads Manager." msgstr "" "Селектор \"Зона рекламных объявлений\", обслуживаемый плагином Simple Ads " "Manager." -#: widget.class.php:288 js/dialog-ad.php:48 +#: ../widget.class.php:286 ../js/dialog-ad.php:53 msgid "Ad" msgstr "Рекламное объявление" -#: widget.class.php:291 +#: ../widget.class.php:289 msgid "Non-rotating single ad serviced by Simple Ads Manager." msgstr "" "Неротируемое одиночное рекламное объявление, обслуживаемое плагином Simple " "Ads Manager." -#: widget.class.php:427 +#: ../widget.class.php:423 msgid "Block" msgstr "Блок" -#: widget.class.php:430 +#: ../widget.class.php:426 msgid "Ads Block collector serviced by Simple Ads Manager." msgstr "" "Коллектор \"Блок рекламных объявлений\", обслуживаемый плагином Simple Ads " "Manager." -#: widget.class.php:432 js/dialog-block.php:48 +#: ../widget.class.php:428 ../js/dialog-block.php:53 msgid "Ads Block" msgstr "Рекламный блок" -#: zone.editor.admin.class.php:15 +#: ../zone.editor.admin.class.php:15 msgid "Default" msgstr "По умолчанию" -#: zone.editor.admin.class.php:16 +#: ../zone.editor.admin.class.php:16 msgid "None" msgstr "Нет" -#: zone.editor.admin.class.php:169 +#: ../zone.editor.admin.class.php:183 msgid "Ads Zone Data Updated." msgstr "Данные рекламной зоны сохранены." -#: zone.editor.admin.class.php:286 +#: ../zone.editor.admin.class.php:316 msgid "New Ads Zone" msgstr "Новая рекламная зона" -#: zone.editor.admin.class.php:286 +#: ../zone.editor.admin.class.php:316 msgid "Edit Ads Zone" msgstr "Изменить рекламную зону" -#: zone.editor.admin.class.php:304 +#: ../zone.editor.admin.class.php:336 msgid "Back to Zones List" msgstr "Назад, к списку зон" -#: zone.editor.admin.class.php:310 js/dialog-zone.php:66 +#: ../zone.editor.admin.class.php:343 ../js/dialog-zone.php:71 msgid "Ads Zone ID" msgstr "ID рекламноой зоны" -#: zone.editor.admin.class.php:349 +#: ../zone.editor.admin.class.php:390 msgid "Enter description of this Ads Zone." msgstr "Введите описание для этой рекламной зоны." -#: zone.editor.admin.class.php:361 +#: ../zone.editor.admin.class.php:402 msgid "Ads Zone Settings" msgstr "Параметры зоны рекламных объявлений" -#: zone.editor.admin.class.php:364 +#: ../zone.editor.admin.class.php:405 msgid "Default Ads Place" msgstr "Рекламное место по умолчанию" -#: zone.editor.admin.class.php:370 +#: ../zone.editor.admin.class.php:411 msgid "" "Select the Ads Place by default. This Ads Place will be displayed in the " "event that for the page of a given type the Ads Place value is set to " @@ -2625,85 +2975,89 @@ msgstr "" "экран для тех страниц, для которых параметр рекламного места установлен в " "значение \"По умолчанию\"." -#: zone.editor.admin.class.php:374 +#: ../zone.editor.admin.class.php:415 msgid "Home Page Ads Place" msgstr "Рекламное место главной страницы" -#: zone.editor.admin.class.php:380 +#: ../zone.editor.admin.class.php:421 msgid "Default Ads Place for Singular Pages" msgstr "Рекламное место по умолчанию для сингулярных страниц" -#: zone.editor.admin.class.php:387 +#: ../zone.editor.admin.class.php:428 msgid "Single Post Ads Place" msgstr "Рекламное место статьи" -#: zone.editor.admin.class.php:396 +#: ../zone.editor.admin.class.php:437 msgid "Default Ads Place for Single Custom Type Post" msgstr "" "Рекламное место по умолчанию для одиночных статей пользовательских типов" -#: zone.editor.admin.class.php:407 +#: ../zone.editor.admin.class.php:448 msgid "Ads Place for Single Post of Custom Type" msgstr "Рекламное место для одиночной статьи пользовательского типа" -#: zone.editor.admin.class.php:416 +#: ../zone.editor.admin.class.php:457 msgid "Page Ads Place" msgstr "Рекламное место страницы" -#: zone.editor.admin.class.php:422 +#: ../zone.editor.admin.class.php:463 msgid "Attachment Ads Place" msgstr "Рекламное место страницы вложения" -#: zone.editor.admin.class.php:429 +#: ../zone.editor.admin.class.php:470 msgid "Search Pages Ads Place" msgstr "Рекламное место страницы вывода результата поиска" -#: zone.editor.admin.class.php:435 +#: ../zone.editor.admin.class.php:476 msgid "404 Page Ads Place" msgstr "Рекламное место страницы ошибки 404" -#: zone.editor.admin.class.php:441 +#: ../zone.editor.admin.class.php:482 msgid "Default Ads Place for Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов" -#: zone.editor.admin.class.php:448 +#: ../zone.editor.admin.class.php:489 msgid "Default Ads Place for Taxonomies Pages" msgstr "Рекламное место по умолчанию для странц таксономий" -#: zone.editor.admin.class.php:455 +#: ../zone.editor.admin.class.php:502 +msgid "Ads Place for Custom Taxonomy Term" +msgstr "Рекламное место для термина пользовательской таксономии" + +#: ../zone.editor.admin.class.php:515 msgid "Default Ads Place for Category Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов рубрик" -#: zone.editor.admin.class.php:468 +#: ../zone.editor.admin.class.php:528 msgid "Ads Place for Category" msgstr "Рекламное место для рубрики" -#: zone.editor.admin.class.php:484 +#: ../zone.editor.admin.class.php:544 msgid "Default Ads Place for Archives of Custom Type Posts" msgstr "" "Рекламное место по умолчанию для страниц архивов пользовательских типов" -#: zone.editor.admin.class.php:494 +#: ../zone.editor.admin.class.php:554 msgid "Ads Place for Custom Type Posts Archive" msgstr "Рекламное место по умолчанию для страниц архива пользовательского типа" -#: zone.editor.admin.class.php:503 +#: ../zone.editor.admin.class.php:563 msgid "Tags Archive Pages Ads Place" msgstr "Рекламное место страницы архивов меток" -#: zone.editor.admin.class.php:510 +#: ../zone.editor.admin.class.php:569 msgid "Default Ads Place for Author Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов авторов" -#: zone.editor.admin.class.php:519 +#: ../zone.editor.admin.class.php:578 msgid "Ads Place for author" msgstr "Рекламное место для автора" -#: zone.editor.admin.class.php:528 +#: ../zone.editor.admin.class.php:587 msgid "Date Archive Pages Ads Place" msgstr "Рекламное место страницы архивов дат" -#: zone.editor.admin.class.php:535 +#: ../zone.editor.admin.class.php:594 msgid "" "Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " "are Ads Places by default for the low level pages of relevant pages." @@ -2712,84 +3066,102 @@ msgstr "" "архивных страниц являются рекламными местами по умолчанию для " "соответствующих страниц нижнего уровня." -#: zone.list.admin.class.php:56 +#: ../zone.list.admin.class.php:56 msgid "Managing Ads Zones" msgstr "Управление рекламными зонами" -#: zone.list.admin.class.php:72 zone.list.admin.class.php:146 +#: ../zone.list.admin.class.php:72 ../zone.list.admin.class.php:146 msgid "Add New Zone" msgstr "Добавить новую зону" -#: zone.list.admin.class.php:89 zone.list.admin.class.php:95 +#: ../zone.list.admin.class.php:89 ../zone.list.admin.class.php:95 msgid "Zone Name" msgstr "Имя зоны" -#: zone.list.admin.class.php:123 +#: ../zone.list.admin.class.php:123 msgid "Edit Zone" msgstr "Изменить зону" -#: zone.list.admin.class.php:127 +#: ../zone.list.admin.class.php:127 msgid "Restore this Zone from the Trash" msgstr "Восстановить эту зону из корзины" -#: zone.list.admin.class.php:128 +#: ../zone.list.admin.class.php:128 msgid "Remove this Zone permanently" msgstr "Удалить эту зону навсегда" -#: zone.list.admin.class.php:133 +#: ../zone.list.admin.class.php:133 msgid "Move this Zone to the Trash" msgstr "Поместить эту зону в корзину" -#: js/dialog-ad.php:27 +#: ../js/dialog-ad.php:27 msgid "Insert Single Ad" msgstr "Вставить рекламное объявление" -#: js/dialog-ad.php:41 js/dialog-block.php:41 js/dialog-zone.php:41 -#: js/dialog.php:41 +#: ../js/dialog-ad.php:46 ../js/dialog-block.php:46 ../js/dialog-zone.php:46 +#: ../js/dialog.php:46 msgid "Basic Settings" msgstr "Основные параметры" -#: js/dialog-ad.php:66 +#: ../js/dialog-ad.php:71 msgid "Single Ad ID" msgstr "ID объявления" -#: js/dialog-ad.php:69 +#: ../js/dialog-ad.php:74 msgid "Single Ad Name" msgstr "Имя объявления" -#: js/dialog-ad.php:79 js/dialog-zone.php:79 js/dialog.php:79 +#: ../js/dialog-ad.php:84 ../js/dialog-zone.php:84 ../js/dialog.php:84 msgid "Allow Ads Places predefined codes" msgstr "Использовать заданные коды рекламного места" -#: js/dialog-ad.php:92 js/dialog-block.php:82 js/dialog-zone.php:92 -#: js/dialog.php:92 +#: ../js/dialog-ad.php:97 ../js/dialog-block.php:87 ../js/dialog-zone.php:97 +#: ../js/dialog.php:97 msgid "Insert" msgstr "Вставить" -#: js/dialog-block.php:27 +#: ../js/dialog-block.php:27 msgid "Insert Ads Block" msgstr "Вставить блок объявлений" -#: js/dialog-block.php:69 +#: ../js/dialog-block.php:74 msgid "Ads Block Name" msgstr "Имя блока" -#: js/dialog-zone.php:27 +#: ../js/dialog-zone.php:27 msgid "Insert Ads Zone" msgstr "Вставить рекламную зону" -#: js/dialog-zone.php:69 +#: ../js/dialog-zone.php:74 msgid "Ads Zone Name" msgstr "Имя зоны" -#: js/dialog.php:27 +#: ../js/dialog.php:27 msgid "Insert Ads Place" msgstr "Вставить рекламное место" -#: js/dialog.php:69 +#: ../js/dialog.php:74 msgid "Ads Place Name" msgstr "Имя места" +#~ msgid "Post:" +#~ msgstr "Статья:" + +#~ msgid "Donate via" +#~ msgstr "Пожертвовать через" + +#~ msgid "" +#~ "Warning! The default value of donation is %s. Don't worry! This is not my " +#~ "appetite, this is default value defined by Payoneer service." +#~ msgstr "" +#~ "Внимание! Значение по умолчанию для пожертвования составляет %s. Не " +#~ "волнуйтесь! Это не мой аппетит, это - значение по умолчанию, определенное " +#~ "службой Payoneer." + +#~ msgid " You can change it to any value you want!" +#~ msgstr "" +#~ " Вы можете изменить его на любое значение, которое посчитаете нужным!" + #~ msgid "An error occurred during output process..." #~ msgstr "Произошла ошибка в процессе вывода объявления на страницу ..." diff --git a/langs/simple-ads-manager.pot b/langs/simple-ads-manager.pot new file mode 100644 index 0000000..f3c6bdb --- /dev/null +++ b/langs/simple-ads-manager.pot @@ -0,0 +1,2865 @@ +# Copyright (C) 2010 Simple Ads Manager +# This file is distributed under the same license as the Simple Ads Manager package. +msgid "" +msgstr "" +"Project-Id-Version: Simple Ads Manager 1.8.70\n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-ads-manager\n" +"POT-Creation-Date: 2013-12-29 20:08+0300\n" +"PO-Revision-Date: 2013-12-29 20:08+0300\n" +"Last-Translator: minimus \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.3\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;__ngettext;" +"_n:1,2;_nc:4c,1,2;esc_attr__;_en:1,2;_ex:1,2c;_x:1,2c\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: ..\n" + +#: ../ad.class.php:87 +msgid "Flash ad" +msgstr "" + +#: ../ad.class.php:208 +msgid "Empty data..." +msgstr "" + +#: ../admin.class.php:150 +msgid "Active W3 Total Cache plugin detected." +msgstr "" + +#: ../admin.class.php:151 +msgid "Active WP Super Cache plugin detected." +msgstr "" + +#: ../admin.class.php:156 +msgid "Active bbPress Forum plugin detected." +msgstr "" + +#: ../admin.class.php:175 +msgid "Cache of WP Super Cache plugin is flushed." +msgstr "" + +#: ../admin.class.php:179 +msgid "Cache of W3 Total Cache plugin is flushed." +msgstr "" + +#: ../admin.class.php:399 ../editor.admin.class.php:1487 +msgid "Advertiser Name" +msgstr "" + +#: ../admin.class.php:400 +msgid "Advertiser Nick" +msgstr "" + +#: ../admin.class.php:401 ../editor.admin.class.php:1491 +msgid "Advertiser e-mail" +msgstr "" + +#: ../admin.class.php:405 +msgid "Category Title" +msgstr "" + +#: ../admin.class.php:406 +msgid "Category Slug" +msgstr "" + +#: ../admin.class.php:410 ../admin.class.php:429 +msgid "Display Name" +msgstr "" + +#: ../admin.class.php:411 ../admin.class.php:430 +msgid "User Name" +msgstr "" + +#: ../admin.class.php:415 +msgid "Tag Title" +msgstr "" + +#: ../admin.class.php:416 +msgid "Tag Slug" +msgstr "" + +#: ../admin.class.php:419 +msgid "Custom Type Title" +msgstr "" + +#: ../admin.class.php:420 +msgid "Custom Type Slug" +msgstr "" + +#: ../admin.class.php:424 +msgid "Publication Title" +msgstr "" + +#: ../admin.class.php:425 +msgid "Publication Type" +msgstr "" + +#: ../admin.class.php:431 +msgid "Role" +msgstr "" + +#: ../admin.class.php:434 ../block.list.admin.class.php:88 +#: ../block.list.admin.class.php:94 ../errorlog.admin.class.php:83 +#: ../errorlog.admin.class.php:93 ../list.admin.class.php:173 +#: ../list.admin.class.php:184 ../list.admin.class.php:360 +#: ../list.admin.class.php:370 ../zone.list.admin.class.php:88 +#: ../zone.list.admin.class.php:94 +msgid "ID" +msgstr "" + +#: ../admin.class.php:435 +msgid "Term Name" +msgstr "" + +#: ../admin.class.php:436 +msgid "Custom Taxonomy Name" +msgstr "" + +#: ../admin.class.php:442 +msgid "Full Size" +msgstr "" + +#: ../admin.class.php:503 +msgid "" +"Shortcode [name] will be replaced with advertiser's name. " +"Shortcode [site] will be replaced with name of your site. " +"Shotcode [month] will be replaced with name of month of " +"reporting period." +msgstr "" + +#: ../admin.class.php:507 ../editor.admin.class.php:479 +#: ../editor.admin.class.php:1008 +msgid "General" +msgstr "" + +#: ../admin.class.php:508 +msgid "General Settings" +msgstr "" + +#: ../admin.class.php:509 +msgid "Extended Options" +msgstr "" + +#: ../admin.class.php:510 +msgid "Admin Layout" +msgstr "" + +#: ../admin.class.php:511 +msgid "Plugin Deactivating" +msgstr "" + +#: ../admin.class.php:513 +msgid "Auto Inserting" +msgstr "" + +#: ../admin.class.php:514 +msgid "Auto Inserting Settings" +msgstr "" + +#: ../admin.class.php:516 +msgid "Google" +msgstr "" + +#: ../admin.class.php:517 +msgid "Google DFP Settings" +msgstr "" + +#: ../admin.class.php:519 +msgid "Tools" +msgstr "" + +#: ../admin.class.php:520 ../help.class.php:68 ../help.class.php:195 +msgid "Statistics Settings" +msgstr "" + +#: ../admin.class.php:521 +msgid "Mailing System" +msgstr "" + +#: ../admin.class.php:524 +msgid "Views per Cycle" +msgstr "" + +#: ../admin.class.php:524 +msgid "" +"Number of hits of one ad for a full cycle of rotation (maximal activity)." +msgstr "" + +#: ../admin.class.php:525 +msgid "Minimum Level for access to menu" +msgstr "" + +#: ../admin.class.php:525 +msgid "" +"Who can use menu of plugin - Minimum User Level needed for access to menu of " +"plugin. In any case only Super Admin and Administrator can use Settings Menu " +"of SAM Plugin." +msgstr "" + +#: ../admin.class.php:525 ../admin.class.php:653 ../admin.class.php:794 +msgid "Super Admin" +msgstr "" + +#: ../admin.class.php:525 ../admin.class.php:654 ../admin.class.php:793 +msgid "Administrator" +msgstr "" + +#: ../admin.class.php:525 ../admin.class.php:655 ../admin.class.php:792 +msgid "Editor" +msgstr "" + +#: ../admin.class.php:525 ../admin.class.php:656 ../admin.class.php:791 +msgid "Author" +msgstr "" + +#: ../admin.class.php:525 ../admin.class.php:657 ../admin.class.php:790 +msgid "Contributor" +msgstr "" + +#: ../admin.class.php:526 +msgid "Ad Output Mode" +msgstr "" + +#: ../admin.class.php:526 +msgid "" +"Standard (PHP) mode is more faster but is not compatible with caching " +"plugins. If your blog use caching plugin (i.e WP Super Cache or W3 Total " +"Cache) select \"Caching Compatible (Javascript)\" mode. Due to the confusion " +"around \"mfunc\" in caching plugins, I decided to refrain from development " +"of special support of these plugins." +msgstr "" + +#: ../admin.class.php:526 +msgid "Standard (PHP)" +msgstr "" + +#: ../admin.class.php:526 +msgid "Caching Compatible (Javascript)" +msgstr "" + +#: ../admin.class.php:527 +msgid "Display Ad Source in" +msgstr "" + +#: ../admin.class.php:527 +msgid "Target wintow (tab) for advetisement source." +msgstr "" + +#: ../admin.class.php:527 +msgid "New Window (Tab)" +msgstr "" + +#: ../admin.class.php:527 +msgid "Current Window (Tab)" +msgstr "" + +#: ../admin.class.php:528 +msgid "Allow displaying ads on bbPress forum pages" +msgstr "" + +#: ../admin.class.php:530 +msgid "Ads Place before content" +msgstr "" + +#: ../admin.class.php:531 +msgid "Allow Ads Place auto inserting before post/page content" +msgstr "" + +#: ../admin.class.php:532 +msgid "" +"Allow Ads Place auto inserting before post/page or post/page excerpt in the " +"loop" +msgstr "" + +#: ../admin.class.php:533 +msgid "Allow Ads Place auto inserting before bbPress Forum topic content" +msgstr "" + +#: ../admin.class.php:534 +msgid "Allow Ads Place auto inserting into bbPress Forum forums/topics lists" +msgstr "" + +#: ../admin.class.php:535 ../admin.class.php:539 ../admin.class.php:543 +msgid "Allow using predefined Ads Place HTML codes (before and after codes)" +msgstr "" + +#: ../admin.class.php:536 +msgid "Ads Place in the middle of content" +msgstr "" + +#: ../admin.class.php:537 +msgid "Allow Ads Place auto inserting into the middle of post/page content" +msgstr "" + +#: ../admin.class.php:538 +msgid "" +"Allow Ads Place auto inserting into the middle of bbPress Forum topic content" +msgstr "" + +#: ../admin.class.php:540 +msgid "Ads Place after content" +msgstr "" + +#: ../admin.class.php:541 +msgid "Allow Ads Place auto inserting after post/page content" +msgstr "" + +#: ../admin.class.php:542 +msgid "Allow Ads Place auto inserting after bbPress Forum topic content" +msgstr "" + +#: ../admin.class.php:545 +msgid "" +"I use (plan to use) my own flash (SWF) banners. In other words, allow " +"loading the script \"SWFObject\" on the pages of the blog." +msgstr "" + +#: ../admin.class.php:546 +msgid "Turn on/off the error log." +msgstr "" + +#: ../admin.class.php:547 +msgid "Turn on/off the error log for Face Side." +msgstr "" + +#: ../admin.class.php:549 +msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" +msgstr "" + +#: ../admin.class.php:550 +msgid "Google DFP Pub Code" +msgstr "" + +#: ../admin.class.php:550 +msgid "Your Google DFP Pub code. i.e:" +msgstr "" + +#: ../admin.class.php:552 +msgid "Allow Bots and Crawlers detection" +msgstr "" + +#: ../admin.class.php:553 +msgid "Accuracy of Bots and Crawlers Detection" +msgstr "" + +#: ../admin.class.php:553 +msgid "" +"If bot is detected hits of ads won't be counted. Use with caution! More " +"exact detection requires more server resources." +msgstr "" + +#: ../admin.class.php:553 +msgid "Inexact detection" +msgstr "" + +#: ../admin.class.php:553 +msgid "Exact detection" +msgstr "" + +#: ../admin.class.php:553 +msgid "More exact detection" +msgstr "" + +#: ../admin.class.php:554 ../help.class.php:70 ../help.class.php:197 +msgid "Display of Currency" +msgstr "" + +#: ../admin.class.php:554 ../help.class.php:70 ../help.class.php:197 +msgid "" +"Define display of currency. Auto - auto detection of currency from blog " +"settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." +msgstr "" + +#: ../admin.class.php:554 +msgid "Auto" +msgstr "" + +#: ../admin.class.php:554 +msgid "USD" +msgstr "" + +#: ../admin.class.php:554 +msgid "EUR" +msgstr "" + +#: ../admin.class.php:556 +msgid "TinyMCE Editor Button Mode" +msgstr "" + +#: ../admin.class.php:556 +msgid "" +"If you do not want to use the modern dropdown button in your TinyMCE editor, " +"or use of this button causes a problem, you can use classic TinyMCE buttons. " +"In this case select \"Classic TinyMCE Buttons\"." +msgstr "" + +#: ../admin.class.php:556 +msgid "Modern TinyMCE Button" +msgstr "" + +#: ../admin.class.php:556 +msgid "Classic TinyMCE Buttons" +msgstr "" + +#: ../admin.class.php:557 +msgid "Ads Places per Page" +msgstr "" + +#: ../admin.class.php:557 +msgid "" +"Ads Places Management grid pagination. How many Ads Places will be shown on " +"one page of grid." +msgstr "" + +#: ../admin.class.php:558 +msgid "Ads per Page" +msgstr "" + +#: ../admin.class.php:558 +msgid "" +"Ads of Ads Place Management grid pagination. How many Ads will be shown on " +"one page of grid." +msgstr "" + +#: ../admin.class.php:560 +msgid "Delete plugin options during deactivating plugin" +msgstr "" + +#: ../admin.class.php:561 +msgid "Delete database tables of plugin during deactivating plugin" +msgstr "" + +#: ../admin.class.php:562 +msgid "Delete custom images folder of plugin during deactivating plugin" +msgstr "" + +#: ../admin.class.php:564 +msgid "Allow SAM Mailing System to send statistical data to advertisers" +msgstr "" + +#: ../admin.class.php:565 +msgid "Mail Subject" +msgstr "" + +#: ../admin.class.php:565 +msgid "Mail subject of sending email." +msgstr "" + +#: ../admin.class.php:566 +msgid "Mail Greeting String" +msgstr "" + +#: ../admin.class.php:566 +msgid "Greeting string of sending email." +msgstr "" + +#: ../admin.class.php:567 +msgid "Mail Text before statistical data table" +msgstr "" + +#: ../admin.class.php:567 +msgid "Some text before statistical data table of sending email." +msgstr "" + +#: ../admin.class.php:568 +msgid "Mail Text after statistical data table" +msgstr "" + +#: ../admin.class.php:568 +msgid "Some text after statistical data table of sending email." +msgstr "" + +#: ../admin.class.php:569 +msgid "Mail Warning 1" +msgstr "" + +#: ../admin.class.php:569 +msgid "This text will be placed at the end of sending email." +msgstr "" + +#: ../admin.class.php:570 +msgid "Mail Warning 2" +msgstr "" + +#: ../admin.class.php:570 +msgid "This text will be placed at the very end of sending email." +msgstr "" + +#: ../admin.class.php:578 +msgid "Ads" +msgstr "" + +#: ../admin.class.php:579 +msgid "Ads List" +msgstr "" + +#: ../admin.class.php:579 +msgid "Ads Places" +msgstr "" + +#: ../admin.class.php:580 +msgid "Ad Editor" +msgstr "" + +#: ../admin.class.php:580 +msgid "New Place" +msgstr "" + +#: ../admin.class.php:581 +msgid "Ads Zones List" +msgstr "" + +#: ../admin.class.php:581 +msgid "Ads Zones" +msgstr "" + +#: ../admin.class.php:582 +msgid "Ads Zone Editor" +msgstr "" + +#: ../admin.class.php:582 +msgid "New Zone" +msgstr "" + +#: ../admin.class.php:583 +msgid "Ads Blocks List" +msgstr "" + +#: ../admin.class.php:583 +msgid "Ads Blocks" +msgstr "" + +#: ../admin.class.php:584 ../block.editor.admin.class.php:402 +msgid "Ads Block Editor" +msgstr "" + +#: ../admin.class.php:584 +msgid "New Block" +msgstr "" + +#: ../admin.class.php:585 ../admin.class.php:1167 +msgid "Simple Ads Manager Settings" +msgstr "" + +#: ../admin.class.php:585 +msgid "Settings" +msgstr "" + +#: ../admin.class.php:586 +msgid "Simple Ads Manager Error Log" +msgstr "" + +#: ../admin.class.php:586 ../errorlog.admin.class.php:57 +msgid "Error Log" +msgstr "" + +#: ../admin.class.php:701 ../admin.class.php:773 ../editor.admin.class.php:460 +msgid "Name of Ads Place" +msgstr "" + +#: ../admin.class.php:701 ../admin.class.php:773 +msgid "" +"This is not required parameter. But it is strongly recommended to define it " +"if you plan to use Ads Blocks, plugin's widgets or autoinserting of ads." +msgstr "" + +#: ../admin.class.php:702 ../admin.class.php:774 ../editor.admin.class.php:988 +msgid "Name of Ad" +msgstr "" + +#: ../admin.class.php:702 ../admin.class.php:774 ../admin.class.php:822 +msgid "" +"This is not required parameter. But it is strongly recommended to define it " +"if you plan to use Ads Blocks or plugin's widgets." +msgstr "" + +#: ../admin.class.php:703 ../admin.class.php:775 +msgid "Select Banner Image" +msgstr "" + +#: ../admin.class.php:703 ../admin.class.php:775 +msgid "Select" +msgstr "" + +#: ../admin.class.php:707 ../admin.class.php:781 +msgid "Uploading" +msgstr "" + +#: ../admin.class.php:708 ../admin.class.php:782 +msgid "Uploaded." +msgstr "" + +#: ../admin.class.php:709 ../admin.class.php:783 +msgid "Only JPG, PNG or GIF files are allowed" +msgstr "" + +#: ../admin.class.php:710 ../admin.class.php:784 +msgid "File" +msgstr "" + +#: ../admin.class.php:714 ../admin.class.php:718 ../admin.class.php:795 +#: ../editor.admin.class.php:609 ../editor.admin.class.php:939 +#: ../editor.admin.class.php:1550 ../list.admin.class.php:176 +#: ../list.admin.class.php:187 ../list.admin.class.php:235 +#: ../list.admin.class.php:363 ../list.admin.class.php:373 +#: ../list.admin.class.php:425 +msgid "Hits" +msgstr "" + +#: ../admin.class.php:714 ../admin.class.php:719 ../admin.class.php:795 +#: ../editor.admin.class.php:610 ../editor.admin.class.php:941 +#: ../editor.admin.class.php:1551 ../list.admin.class.php:236 +#: ../list.admin.class.php:364 ../list.admin.class.php:374 +#: ../list.admin.class.php:426 +msgid "Clicks" +msgstr "" + +#: ../admin.class.php:717 ../block.editor.admin.class.php:308 +#: ../editor.admin.class.php:459 ../zone.editor.admin.class.php:381 +msgid "Name" +msgstr "" + +#: ../admin.class.php:787 +msgid "Post" +msgstr "" + +#: ../admin.class.php:788 ../editor.admin.class.php:1136 +msgid "Page" +msgstr "" + +#: ../admin.class.php:789 +msgid "Subscriber" +msgstr "" + +#: ../admin.class.php:822 ../zone.editor.admin.class.php:382 +msgid "Name of Ads Zone" +msgstr "" + +#: ../admin.class.php:823 ../block.editor.admin.class.php:309 +msgid "Name of Ads Block" +msgstr "" + +#: ../admin.class.php:823 +msgid "" +"This is not required parameter. But it is strongly recommended to define it " +"if you plan to use plugin's widgets." +msgstr "" + +#: ../admin.class.php:842 +msgid "Error ID" +msgstr "" + +#: ../admin.class.php:843 +msgid "Error Date" +msgstr "" + +#: ../admin.class.php:844 ../errorlog.admin.class.php:86 +#: ../errorlog.admin.class.php:96 +msgid "Table" +msgstr "" + +#: ../admin.class.php:845 +msgid "Error Message" +msgstr "" + +#: ../admin.class.php:846 +msgid "Error SQL" +msgstr "" + +#: ../admin.class.php:847 ../errorlog.admin.class.php:87 +#: ../errorlog.admin.class.php:97 +msgid "Type" +msgstr "" + +#: ../admin.class.php:848 +msgid "Close" +msgstr "" + +#: ../admin.class.php:850 ../admin.class.php:911 +#: ../errorlog.admin.class.php:116 ../errorlog.admin.class.php:132 +msgid "Warning" +msgstr "" + +#: ../admin.class.php:850 ../errorlog.admin.class.php:136 +msgid "Ok" +msgstr "" + +#: ../admin.class.php:911 ../errorlog.admin.class.php:116 +msgid "Update Error" +msgstr "" + +#: ../admin.class.php:911 ../errorlog.admin.class.php:116 +msgid "Output Error" +msgstr "" + +#: ../admin.class.php:1022 +msgid "There are general options." +msgstr "" + +#: ../admin.class.php:1026 +msgid "" +"Single post/page auto inserting options. Use these parameters for allowing/" +"defining Ads Places which will be automatically inserted before/after post/" +"page content." +msgstr "" + +#: ../admin.class.php:1034 +msgid "Adjust parameters of your Google DFP account." +msgstr "" + +#: ../admin.class.php:1038 +msgid "Adjust parameters of plugin statistics." +msgstr "" + +#: ../admin.class.php:1042 +msgid "This options define layout for Ads Managin Pages." +msgstr "" + +#: ../admin.class.php:1046 +msgid "Are you allow to perform these actions during deactivating plugin?" +msgstr "" + +#: ../admin.class.php:1054 +msgid "Next mailing is scheduled on" +msgstr "" + +#: ../admin.class.php:1056 +msgid "Adjust parameters of Mailing System." +msgstr "" + +#: ../admin.class.php:1181 +msgid "Simple Ads Manager Settings Updated." +msgstr "" + +#: ../admin.class.php:1189 +msgid "System Info" +msgstr "" + +#: ../admin.class.php:1196 +msgid "Wordpress Version" +msgstr "" + +#: ../admin.class.php:1197 +msgid "SAM Version" +msgstr "" + +#: ../admin.class.php:1198 +msgid "SAM DB Version" +msgstr "" + +#: ../admin.class.php:1199 +msgid "PHP Version" +msgstr "" + +#: ../admin.class.php:1200 +msgid "MySQL Version" +msgstr "" + +#: ../admin.class.php:1201 +msgid "Memory Limit" +msgstr "" + +#: ../admin.class.php:1205 +msgid "Note! If you have detected a bug, include this data to bug report." +msgstr "" + +#: ../admin.class.php:1210 +msgid "Resources" +msgstr "" + +#: ../admin.class.php:1213 +msgid "Wordpress Plugin Page" +msgstr "" + +#: ../admin.class.php:1214 +msgid "Author Plugin Page" +msgstr "" + +#: ../admin.class.php:1215 ../help.class.php:34 ../help.class.php:51 +#: ../help.class.php:58 ../help.class.php:72 ../help.class.php:105 +#: ../help.class.php:113 ../help.class.php:124 ../help.class.php:141 +#: ../help.class.php:150 ../help.class.php:166 ../help.class.php:182 +#: ../help.class.php:199 +msgid "Support Forum" +msgstr "" + +#: ../admin.class.php:1216 +msgid "Author's Blog" +msgstr "" + +#: ../admin.class.php:1221 +msgid "Donations" +msgstr "" + +#: ../admin.class.php:1233 +#, php-format +msgid "" +"If you have found this plugin useful, please consider making a %s to help " +"support future development. Your support will be much appreciated. Thank you!" +msgstr "" + +#: ../admin.class.php:1234 +msgid "Donate Now!" +msgstr "" + +#: ../admin.class.php:1234 +msgid "donation" +msgstr "" + +#: ../admin.class.php:1252 +msgid "Another Plugins" +msgstr "" + +#: ../admin.class.php:1256 +#, php-format +msgid "Another plugins from %s" +msgstr "" + +#: ../admin.class.php:1262 +msgid "Highlights any portion of text as text in the colored boxes." +msgstr "" + +#: ../admin.class.php:1263 +msgid "" +"Adds simple counters badge (FeedBurner subscribers and Twitter followers) to " +"your blog." +msgstr "" + +#: ../admin.class.php:1264 +msgid "This plugin is WordPress shell for FloatBox library by Byron McGregor." +msgstr "" + +#: ../admin.class.php:1265 +msgid "Adds copyright notice in the end of each post of your blog. " +msgstr "" + +#: ../admin.class.php:1281 +msgctxt "Copyright String" +msgid "Simple Ads Manager plugin for Wordpress." +msgstr "" + +#: ../admin.class.php:1281 +msgctxt "Copyright String" +msgid "All rights reserved." +msgstr "" + +#: ../block.editor.admin.class.php:73 ../block.editor.admin.class.php:253 +#: ../block.editor.admin.class.php:314 ../block.editor.admin.class.php:328 +#: ../block.editor.admin.class.php:346 ../block.editor.admin.class.php:372 +#: ../block.editor.admin.class.php:401 ../editor.admin.class.php:396 +#: ../editor.admin.class.php:465 ../editor.admin.class.php:486 +#: ../editor.admin.class.php:507 ../editor.admin.class.php:527 +#: ../editor.admin.class.php:617 ../editor.admin.class.php:913 +#: ../editor.admin.class.php:993 ../editor.admin.class.php:1017 +#: ../editor.admin.class.php:1087 ../editor.admin.class.php:1187 +#: ../editor.admin.class.php:1432 ../editor.admin.class.php:1479 +#: ../editor.admin.class.php:1499 ../editor.admin.class.php:1560 +#: ../zone.editor.admin.class.php:326 ../zone.editor.admin.class.php:387 +#: ../zone.editor.admin.class.php:401 +msgid "Click to toggle" +msgstr "" + +#: ../block.editor.admin.class.php:74 +msgid "Item" +msgstr "" + +#: ../block.editor.admin.class.php:77 ../help.class.php:125 +#: ../widget.class.php:16 ../js/dialog.php:53 +msgid "Ads Place" +msgstr "" + +#: ../block.editor.admin.class.php:79 ../block.editor.admin.class.php:92 +#: ../block.editor.admin.class.php:105 +msgid "Non selected" +msgstr "" + +#: ../block.editor.admin.class.php:90 ../widget.class.php:291 +msgid "Single Ad" +msgstr "" + +#: ../block.editor.admin.class.php:103 ../widget.class.php:150 +#: ../widget.class.php:155 ../js/dialog-zone.php:53 +msgid "Ads Zone" +msgstr "" + +#: ../block.editor.admin.class.php:173 ../block.editor.admin.class.php:217 +#: ../block.editor.admin.class.php:243 ../editor.admin.class.php:327 +#: ../editor.admin.class.php:359 ../editor.admin.class.php:376 +#: ../editor.admin.class.php:377 ../editor.admin.class.php:378 +#: ../editor.admin.class.php:386 ../editor.admin.class.php:727 +#: ../editor.admin.class.php:826 ../editor.admin.class.php:894 +#: ../editor.admin.class.php:895 ../editor.admin.class.php:896 +#: ../zone.editor.admin.class.php:172 ../zone.editor.admin.class.php:282 +#: ../zone.editor.admin.class.php:316 +msgid "Undefined" +msgstr "" + +#: ../block.editor.admin.class.php:184 +msgid "Ads Block Data Updated." +msgstr "" + +#: ../block.editor.admin.class.php:243 +msgid "New Ads Block" +msgstr "" + +#: ../block.editor.admin.class.php:243 +msgid "Edit Ads Block" +msgstr "" + +#: ../block.editor.admin.class.php:254 ../editor.admin.class.php:397 +#: ../editor.admin.class.php:914 ../errorlog.admin.class.php:84 +#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:327 +msgid "Status" +msgstr "" + +#: ../block.editor.admin.class.php:263 +msgid "Back to Blocks List" +msgstr "" + +#: ../block.editor.admin.class.php:270 ../js/dialog-block.php:71 +msgid "Ads Block ID" +msgstr "" + +#: ../block.editor.admin.class.php:276 ../editor.admin.class.php:427 +#: ../zone.editor.admin.class.php:349 +msgid "Is Active" +msgstr "" + +#: ../block.editor.admin.class.php:277 ../editor.admin.class.php:428 +#: ../editor.admin.class.php:956 ../zone.editor.admin.class.php:350 +msgid "Is In Trash" +msgstr "" + +#: ../block.editor.admin.class.php:284 ../block.editor.admin.class.php:289 +#: ../editor.admin.class.php:435 ../editor.admin.class.php:440 +#: ../editor.admin.class.php:963 ../editor.admin.class.php:968 +#: ../zone.editor.admin.class.php:357 ../zone.editor.admin.class.php:363 +#: ../js/dialog-ad.php:94 ../js/dialog-block.php:84 ../js/dialog-zone.php:94 +#: ../js/dialog.php:94 +msgid "Cancel" +msgstr "" + +#: ../block.editor.admin.class.php:293 ../block.editor.admin.class.php:295 +#: ../editor.admin.class.php:444 ../editor.admin.class.php:446 +#: ../editor.admin.class.php:972 ../editor.admin.class.php:974 +#: ../zone.editor.admin.class.php:360 ../zone.editor.admin.class.php:367 +msgid "Save" +msgstr "" + +#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:988 +#: ../zone.editor.admin.class.php:382 +msgid "Required for SAM widgets." +msgstr "" + +#: ../block.editor.admin.class.php:315 ../block.editor.admin.class.php:319 +#: ../editor.admin.class.php:466 ../editor.admin.class.php:470 +#: ../editor.admin.class.php:997 ../zone.editor.admin.class.php:388 +#: ../zone.editor.admin.class.php:392 +msgid "Description" +msgstr "" + +#: ../block.editor.admin.class.php:317 +msgid "Enter description of this Ads Block." +msgstr "" + +#: ../block.editor.admin.class.php:322 ../editor.admin.class.php:473 +#: ../editor.admin.class.php:1001 ../zone.editor.admin.class.php:395 +msgid "" +"This description is not used anywhere and is added solely for the " +"convenience of managing advertisements." +msgstr "" + +#: ../block.editor.admin.class.php:329 +msgid "Block Structure" +msgstr "" + +#: ../block.editor.admin.class.php:331 +msgid "Ads Block Structure Properties." +msgstr "" + +#: ../block.editor.admin.class.php:333 +msgid "Block Lines" +msgstr "" + +#: ../block.editor.admin.class.php:337 +msgid "Block Columns" +msgstr "" + +#: ../block.editor.admin.class.php:340 +msgid "" +"After changing these properties you must save Ads Block settings before " +"using Ads Block Editor." +msgstr "" + +#: ../block.editor.admin.class.php:347 +msgid "Block Styles" +msgstr "" + +#: ../block.editor.admin.class.php:349 +msgid "Configure Styles for this Ads Block." +msgstr "" + +#: ../block.editor.admin.class.php:351 ../block.editor.admin.class.php:377 +msgid "Margins" +msgstr "" + +#: ../block.editor.admin.class.php:355 ../block.editor.admin.class.php:381 +msgid "Padding" +msgstr "" + +#: ../block.editor.admin.class.php:359 ../block.editor.admin.class.php:385 +msgid "Background" +msgstr "" + +#: ../block.editor.admin.class.php:363 ../block.editor.admin.class.php:389 +msgid "Borders" +msgstr "" + +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 +msgid "Use Stylesheet rules for defining these properties." +msgstr "" + +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 +msgid "For example:" +msgstr "" + +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 +msgid "for background property or" +msgstr "" + +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 +msgid "for border property" +msgstr "" + +#: ../block.editor.admin.class.php:373 +msgid "Block Items Styles" +msgstr "" + +#: ../block.editor.admin.class.php:375 +msgid "Configure Styles for this Ads Block Items." +msgstr "" + +#: ../block.editor.admin.class.php:393 +msgid "Important Note" +msgstr "" + +#: ../block.editor.admin.class.php:393 +msgid "" +"As the Ads Block is the regular structure, predefined styles of individual " +"items for drawing Ads Block's elements aren't used. Define styles for Ads " +"Block Items here!" +msgstr "" + +#: ../block.editor.admin.class.php:404 +msgid "Adjust items settings of this Ads Block." +msgstr "" + +#: ../block.editor.admin.class.php:406 +msgid "Block Editor." +msgstr "" + +#: ../block.list.admin.class.php:48 ../errorlog.admin.class.php:49 +#: ../list.admin.class.php:130 ../list.admin.class.php:313 +#: ../zone.list.admin.class.php:48 +msgid "«" +msgstr "" + +#: ../block.list.admin.class.php:49 ../errorlog.admin.class.php:50 +#: ../list.admin.class.php:131 ../list.admin.class.php:314 +#: ../zone.list.admin.class.php:49 +msgid "»" +msgstr "" + +#: ../block.list.admin.class.php:56 +msgid "Managing Ads Blocks" +msgstr "" + +#: ../block.list.admin.class.php:63 ../errorlog.admin.class.php:59 +#: ../list.admin.class.php:145 ../list.admin.class.php:328 +#: ../zone.list.admin.class.php:63 +msgid "All" +msgstr "" + +#: ../block.list.admin.class.php:64 ../errorlog.admin.class.php:60 +#: ../list.admin.class.php:146 ../list.admin.class.php:329 +#: ../zone.list.admin.class.php:64 +msgid "Active" +msgstr "" + +#: ../block.list.admin.class.php:65 ../list.admin.class.php:147 +#: ../list.admin.class.php:330 ../zone.list.admin.class.php:65 +msgid "Trash" +msgstr "" + +#: ../block.list.admin.class.php:70 ../block.list.admin.class.php:144 +#: ../list.admin.class.php:152 ../list.admin.class.php:272 +#: ../list.admin.class.php:336 ../list.admin.class.php:455 +#: ../zone.list.admin.class.php:70 ../zone.list.admin.class.php:144 +msgid "Clear Trash" +msgstr "" + +#: ../block.list.admin.class.php:72 ../block.list.admin.class.php:146 +msgid "Add New Block" +msgstr "" + +#: ../block.list.admin.class.php:76 ../block.list.admin.class.php:150 +#: ../errorlog.admin.class.php:71 ../errorlog.admin.class.php:173 +#: ../list.admin.class.php:161 ../list.admin.class.php:281 +#: ../list.admin.class.php:346 ../list.admin.class.php:464 +#: ../zone.list.admin.class.php:76 ../zone.list.admin.class.php:150 +#, php-format +msgid "Displaying %s–%s of %s" +msgstr "" + +#: ../block.list.admin.class.php:89 ../block.list.admin.class.php:95 +msgid "Block Name" +msgstr "" + +#: ../block.list.admin.class.php:113 ../errorlog.admin.class.php:121 +#: ../list.admin.class.php:217 ../list.admin.class.php:404 +#: ../zone.list.admin.class.php:113 +msgid "There are no data ..." +msgstr "" + +#: ../block.list.admin.class.php:121 ../list.admin.class.php:242 +#: ../list.admin.class.php:432 ../zone.list.admin.class.php:121 +msgid "in Trash" +msgstr "" + +#: ../block.list.admin.class.php:123 +msgid "Edit Block" +msgstr "" + +#: ../block.list.admin.class.php:123 ../list.admin.class.php:244 +#: ../list.admin.class.php:434 ../zone.list.admin.class.php:123 +msgid "Edit" +msgstr "" + +#: ../block.list.admin.class.php:127 ../errorlog.admin.class.php:151 +msgid "Restore this Block from the Trash" +msgstr "" + +#: ../block.list.admin.class.php:127 ../list.admin.class.php:248 +#: ../list.admin.class.php:438 ../zone.list.admin.class.php:127 +msgid "Restore" +msgstr "" + +#: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 +msgid "Remove this Block permanently" +msgstr "" + +#: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 +#: ../list.admin.class.php:249 ../list.admin.class.php:439 +#: ../zone.list.admin.class.php:128 +msgid "Remove permanently" +msgstr "" + +#: ../block.list.admin.class.php:133 ../errorlog.admin.class.php:157 +msgid "Move this Block to the Trash" +msgstr "" + +#: ../block.list.admin.class.php:133 ../list.admin.class.php:254 +#: ../list.admin.class.php:440 ../zone.list.admin.class.php:133 +msgid "Delete" +msgstr "" + +#: ../editor.admin.class.php:71 ../editor.admin.class.php:191 +#: ../list.admin.class.php:23 +msgid "Custom sizes" +msgstr "" + +#: ../editor.admin.class.php:74 ../editor.admin.class.php:135 +#: ../list.admin.class.php:26 +msgid "Large Leaderboard" +msgstr "" + +#: ../editor.admin.class.php:75 ../editor.admin.class.php:136 +#: ../list.admin.class.php:27 +msgid "Leaderboard" +msgstr "" + +#: ../editor.admin.class.php:76 ../editor.admin.class.php:78 +#: ../editor.admin.class.php:79 ../editor.admin.class.php:137 +#: ../editor.admin.class.php:139 ../editor.admin.class.php:140 +#: ../list.admin.class.php:28 ../list.admin.class.php:30 +#: ../list.admin.class.php:31 +msgid "Small Leaderboard" +msgstr "" + +#: ../editor.admin.class.php:77 ../editor.admin.class.php:138 +#: ../list.admin.class.php:29 +msgid "Mega Unit" +msgstr "" + +#: ../editor.admin.class.php:80 ../editor.admin.class.php:81 +#: ../editor.admin.class.php:82 ../editor.admin.class.php:84 +#: ../editor.admin.class.php:85 ../editor.admin.class.php:86 +#: ../editor.admin.class.php:141 ../editor.admin.class.php:142 +#: ../editor.admin.class.php:143 ../editor.admin.class.php:145 +#: ../editor.admin.class.php:146 ../editor.admin.class.php:147 +#: ../list.admin.class.php:32 ../list.admin.class.php:33 +#: ../list.admin.class.php:34 ../list.admin.class.php:36 +#: ../list.admin.class.php:37 ../list.admin.class.php:38 +msgid "Tall Banner" +msgstr "" + +#: ../editor.admin.class.php:83 ../editor.admin.class.php:144 +#: ../list.admin.class.php:35 +msgid "Banner" +msgstr "" + +#: ../editor.admin.class.php:87 ../editor.admin.class.php:89 +#: ../editor.admin.class.php:119 ../editor.admin.class.php:120 +#: ../editor.admin.class.php:148 ../editor.admin.class.php:150 +#: ../editor.admin.class.php:184 ../editor.admin.class.php:185 +#: ../list.admin.class.php:39 ../list.admin.class.php:41 +#: ../list.admin.class.php:71 ../list.admin.class.php:72 +msgid "Half Banner" +msgstr "" + +#: ../editor.admin.class.php:88 ../editor.admin.class.php:117 +#: ../editor.admin.class.php:118 ../editor.admin.class.php:149 +#: ../editor.admin.class.php:182 ../editor.admin.class.php:183 +#: ../list.admin.class.php:40 ../list.admin.class.php:69 +#: ../list.admin.class.php:70 +msgid "Tall Half Banner" +msgstr "" + +#: ../editor.admin.class.php:90 ../editor.admin.class.php:91 +#: ../editor.admin.class.php:116 ../editor.admin.class.php:123 +#: ../editor.admin.class.php:124 ../editor.admin.class.php:151 +#: ../editor.admin.class.php:152 ../editor.admin.class.php:181 +#: ../editor.admin.class.php:188 ../editor.admin.class.php:189 +#: ../list.admin.class.php:42 ../list.admin.class.php:43 +#: ../list.admin.class.php:68 ../list.admin.class.php:75 +#: ../list.admin.class.php:76 +msgid "Button" +msgstr "" + +#: ../editor.admin.class.php:92 ../editor.admin.class.php:153 +#: ../list.admin.class.php:44 +msgid "Micro Bar" +msgstr "" + +#: ../editor.admin.class.php:93 ../editor.admin.class.php:94 +#: ../editor.admin.class.php:95 ../editor.admin.class.php:96 +#: ../editor.admin.class.php:154 ../editor.admin.class.php:155 +#: ../editor.admin.class.php:156 ../editor.admin.class.php:157 +#: ../list.admin.class.php:45 ../list.admin.class.php:46 +#: ../list.admin.class.php:47 ../list.admin.class.php:48 +msgid "Thin Banner" +msgstr "" + +#: ../editor.admin.class.php:93 ../editor.admin.class.php:94 +#: ../editor.admin.class.php:95 ../editor.admin.class.php:96 +#: ../editor.admin.class.php:117 ../editor.admin.class.php:118 +#: ../editor.admin.class.php:119 ../editor.admin.class.php:120 +#: ../editor.admin.class.php:121 ../editor.admin.class.php:122 +#: ../editor.admin.class.php:123 ../editor.admin.class.php:124 +#: ../editor.admin.class.php:154 ../editor.admin.class.php:155 +#: ../editor.admin.class.php:156 ../editor.admin.class.php:157 +#: ../editor.admin.class.php:182 ../editor.admin.class.php:183 +#: ../editor.admin.class.php:184 ../editor.admin.class.php:185 +#: ../editor.admin.class.php:186 ../editor.admin.class.php:187 +#: ../editor.admin.class.php:188 ../editor.admin.class.php:189 +#: ../list.admin.class.php:45 ../list.admin.class.php:46 +#: ../list.admin.class.php:47 ../list.admin.class.php:48 +#: ../list.admin.class.php:69 ../list.admin.class.php:70 +#: ../list.admin.class.php:71 ../list.admin.class.php:72 +#: ../list.admin.class.php:73 ../list.admin.class.php:74 +#: ../list.admin.class.php:75 ../list.admin.class.php:76 +#, php-format +msgid "%d Link" +msgid_plural "%d Links" +msgstr[0] "" +msgstr[1] "" + +#: ../editor.admin.class.php:97 ../editor.admin.class.php:160 +#: ../list.admin.class.php:49 +msgid "Wide Skyscraper" +msgstr "" + +#: ../editor.admin.class.php:98 ../editor.admin.class.php:161 +#: ../list.admin.class.php:50 +msgid "Skyscraper" +msgstr "" + +#: ../editor.admin.class.php:99 ../editor.admin.class.php:162 +#: ../list.admin.class.php:51 +msgid "Wide Half Banner" +msgstr "" + +#: ../editor.admin.class.php:100 ../editor.admin.class.php:163 +#: ../list.admin.class.php:52 +msgid "Vertical Rectangle" +msgstr "" + +#: ../editor.admin.class.php:101 ../editor.admin.class.php:102 +#: ../editor.admin.class.php:164 ../editor.admin.class.php:165 +#: ../list.admin.class.php:53 ../list.admin.class.php:54 +msgid "Tall Rectangle" +msgstr "" + +#: ../editor.admin.class.php:103 ../editor.admin.class.php:166 +#: ../list.admin.class.php:55 +msgid "Vertical Banner" +msgstr "" + +#: ../editor.admin.class.php:104 ../editor.admin.class.php:169 +#: ../list.admin.class.php:56 +msgid "Large Rectangle" +msgstr "" + +#: ../editor.admin.class.php:105 ../editor.admin.class.php:106 +#: ../editor.admin.class.php:170 ../editor.admin.class.php:171 +#: ../list.admin.class.php:57 ../list.admin.class.php:58 +msgid "Wide Rectangle" +msgstr "" + +#: ../editor.admin.class.php:107 ../editor.admin.class.php:172 +#: ../list.admin.class.php:59 +msgid "Medium Rectangle" +msgstr "" + +#: ../editor.admin.class.php:108 ../editor.admin.class.php:109 +#: ../editor.admin.class.php:173 ../editor.admin.class.php:174 +#: ../list.admin.class.php:60 ../list.admin.class.php:61 +msgid "Small Wide Rectangle" +msgstr "" + +#: ../editor.admin.class.php:110 ../editor.admin.class.php:175 +#: ../list.admin.class.php:62 +msgid "Mini Wide Rectangle" +msgstr "" + +#: ../editor.admin.class.php:111 ../editor.admin.class.php:176 +#: ../editor.admin.class.php:196 ../list.admin.class.php:63 +msgid "Square" +msgstr "" + +#: ../editor.admin.class.php:112 ../editor.admin.class.php:115 +#: ../editor.admin.class.php:177 ../editor.admin.class.php:180 +#: ../list.admin.class.php:64 ../list.admin.class.php:67 +msgid "Small Square" +msgstr "" + +#: ../editor.admin.class.php:113 ../editor.admin.class.php:114 +#: ../editor.admin.class.php:178 ../editor.admin.class.php:179 +#: ../list.admin.class.php:65 ../list.admin.class.php:66 +msgid "Small Rectangle" +msgstr "" + +#: ../editor.admin.class.php:121 ../editor.admin.class.php:122 +#: ../editor.admin.class.php:186 ../editor.admin.class.php:187 +#: ../list.admin.class.php:73 ../list.admin.class.php:74 +msgid "Tall Button" +msgstr "" + +#: ../editor.admin.class.php:194 +msgid "Horizontal" +msgstr "" + +#: ../editor.admin.class.php:195 +msgid "Vertical" +msgstr "" + +#: ../editor.admin.class.php:197 +msgid "Custom width and height" +msgstr "" + +#: ../editor.admin.class.php:224 +msgid "January" +msgstr "" + +#: ../editor.admin.class.php:225 +msgid "February" +msgstr "" + +#: ../editor.admin.class.php:226 +msgid "Mart" +msgstr "" + +#: ../editor.admin.class.php:227 +msgid "April" +msgstr "" + +#: ../editor.admin.class.php:228 +msgid "May" +msgstr "" + +#: ../editor.admin.class.php:229 +msgid "June" +msgstr "" + +#: ../editor.admin.class.php:230 +msgid "July" +msgstr "" + +#: ../editor.admin.class.php:231 +msgid "August" +msgstr "" + +#: ../editor.admin.class.php:232 +msgid "September" +msgstr "" + +#: ../editor.admin.class.php:233 +msgid "October" +msgstr "" + +#: ../editor.admin.class.php:234 +msgid "November" +msgstr "" + +#: ../editor.admin.class.php:235 +msgid "December" +msgstr "" + +#: ../editor.admin.class.php:243 +msgid "Image Tools" +msgstr "" + +#: ../editor.admin.class.php:246 +msgid "Media Library" +msgstr "" + +#: ../editor.admin.class.php:247 +msgid "Server" +msgstr "" + +#: ../editor.admin.class.php:248 +msgid "Local Computer" +msgstr "" + +#: ../editor.admin.class.php:252 +msgid "Select Image from Media Library" +msgstr "" + +#: ../editor.admin.class.php:254 +msgid "Select or Upload" +msgstr "" + +#: ../editor.admin.class.php:256 +msgid "" +"You can upload your banners to Wordpress Media Library or select banner " +"image from it." +msgstr "" + +#: ../editor.admin.class.php:261 +msgid "Select File" +msgstr "" + +#: ../editor.admin.class.php:266 +msgid "Apply" +msgstr "" + +#: ../editor.admin.class.php:268 +msgid "Select file from your blog server." +msgstr "" + +#: ../editor.admin.class.php:273 +msgid "Upload File" +msgstr "" + +#: ../editor.admin.class.php:275 +msgid "Upload" +msgstr "" + +#: ../editor.admin.class.php:279 +msgid "Select and upload file from your local computer." +msgstr "" + +#: ../editor.admin.class.php:340 +msgid "Ads Place Data Updated." +msgstr "" + +#: ../editor.admin.class.php:386 +msgid "New Ads Place" +msgstr "" + +#: ../editor.admin.class.php:386 +msgid "Edit Ads Place" +msgstr "" + +#: ../editor.admin.class.php:406 +msgid "Back to Places List" +msgstr "" + +#: ../editor.admin.class.php:413 ../js/dialog.php:71 +msgid "Ads Place ID" +msgstr "" + +#: ../editor.admin.class.php:419 ../editor.admin.class.php:945 +#: ../list.admin.class.php:175 ../list.admin.class.php:186 +msgid "Size" +msgstr "" + +#: ../editor.admin.class.php:421 ../editor.admin.class.php:947 +msgid "Width" +msgstr "" + +#: ../editor.admin.class.php:423 ../editor.admin.class.php:949 +msgid "Height" +msgstr "" + +#: ../editor.admin.class.php:460 +msgid "Required for SAM widgets and settings." +msgstr "" + +#: ../editor.admin.class.php:468 +msgid "Enter description of this Ads Place." +msgstr "" + +#: ../editor.admin.class.php:480 +msgid "Default Ad" +msgstr "" + +#: ../editor.admin.class.php:481 ../editor.admin.class.php:1012 +msgid "Statistic" +msgstr "" + +#: ../editor.admin.class.php:487 +msgid "Ads Place Size" +msgstr "" + +#: ../editor.admin.class.php:489 +msgid "Select size of this Ads Place." +msgstr "" + +#: ../editor.admin.class.php:494 +msgid "Custom Width" +msgstr "" + +#: ../editor.admin.class.php:498 +msgid "Custom Height" +msgstr "" + +#: ../editor.admin.class.php:501 +msgid "" +"These values are not used and are added solely for the convenience of " +"advertising management. Will be used in the future..." +msgstr "" + +#: ../editor.admin.class.php:508 +msgid "Codes" +msgstr "" + +#: ../editor.admin.class.php:510 +msgid "Enter the code to output before and after the codes of Ads Place." +msgstr "" + +#: ../editor.admin.class.php:512 +msgid "Code Before" +msgstr "" + +#: ../editor.admin.class.php:516 +msgid "Code After" +msgstr "" + +#: ../editor.admin.class.php:519 +msgid "" +"You can enter any HTML codes here for the further withdrawal of their before " +"and after the code of Ads Place." +msgstr "" + +#: ../editor.admin.class.php:528 +msgid "Ads Place Patch" +msgstr "" + +#: ../editor.admin.class.php:530 +msgid "" +"Select type of the code of a patch and fill data entry fields with the " +"appropriate data." +msgstr "" + +#: ../editor.admin.class.php:532 ../editor.admin.class.php:536 +msgid "Image" +msgstr "" + +#: ../editor.admin.class.php:541 +msgid "" +"This image is a patch for advertising space. This may be an image with the " +"text \"Place your ad here\"." +msgstr "" + +#: ../editor.admin.class.php:544 +msgid "Target" +msgstr "" + +#: ../editor.admin.class.php:548 +msgid "This is a link to a page where are your suggestions for advertisers." +msgstr "" + +#: ../editor.admin.class.php:554 +msgid "HTML or Javascript Code" +msgstr "" + +#: ../editor.admin.class.php:558 +msgid "Patch Code" +msgstr "" + +#: ../editor.admin.class.php:563 +msgid "" +"This is one-block code of third-party AdServer rotator. Selecting this " +"checkbox prevents displaying contained ads." +msgstr "" + +#: ../editor.admin.class.php:566 +msgid "" +"This is a HTML-code patch of advertising space. For example: use the code to " +"display AdSense advertisement. " +msgstr "" + +#: ../editor.admin.class.php:571 +msgid "Google DFP" +msgstr "" + +#: ../editor.admin.class.php:575 +msgid "DFP Block Name" +msgstr "" + +#: ../editor.admin.class.php:579 +msgid "This is name of Google DFP block!" +msgstr "" + +#: ../editor.admin.class.php:582 +msgid "" +"The patch (default advertisement) will be shown that if the logic of the " +"plugin can not show any contained advertisement on the current page of the " +"document." +msgstr "" + +#: ../editor.admin.class.php:598 ../editor.admin.class.php:1539 +msgid "Select Period" +msgstr "" + +#: ../editor.admin.class.php:600 ../editor.admin.class.php:1541 +msgid "This Month" +msgstr "" + +#: ../editor.admin.class.php:601 ../editor.admin.class.php:1542 +msgid "Previous Month" +msgstr "" + +#: ../editor.admin.class.php:608 ../editor.admin.class.php:1549 +#: ../list.admin.class.php:237 ../list.admin.class.php:427 +msgid "Total" +msgstr "" + +#: ../editor.admin.class.php:618 +msgid "Contained Ads" +msgstr "" + +#: ../editor.admin.class.php:738 +msgid "Ad Data Updated." +msgstr "" + +#: ../editor.admin.class.php:903 +msgid "New advertisement" +msgstr "" + +#: ../editor.admin.class.php:903 +msgid "Edit advertisement" +msgstr "" + +#: ../editor.admin.class.php:923 +msgid "Back to Ads List" +msgstr "" + +#: ../editor.admin.class.php:930 +msgid "Advertisement ID" +msgstr "" + +#: ../editor.admin.class.php:937 ../list.admin.class.php:362 +#: ../list.admin.class.php:372 +msgid "Activity" +msgstr "" + +#: ../editor.admin.class.php:938 +msgid "Ad is Active" +msgstr "" + +#: ../editor.admin.class.php:938 +msgid "Ad is Inactive" +msgstr "" + +#: ../editor.admin.class.php:954 +msgid "Is in Rotation" +msgstr "" + +#: ../editor.admin.class.php:987 +msgid "Title" +msgstr "" + +#: ../editor.admin.class.php:994 +msgid "Advertisement Description" +msgstr "" + +#: ../editor.admin.class.php:1009 +msgid "Extended Restrictions" +msgstr "" + +#: ../editor.admin.class.php:1010 +msgid "Targeting" +msgstr "" + +#: ../editor.admin.class.php:1011 +msgid "Earnings settings" +msgstr "" + +#: ../editor.admin.class.php:1018 ../editor.admin.class.php:1077 +msgid "Ad Code" +msgstr "" + +#: ../editor.admin.class.php:1022 +msgid "Image Mode" +msgstr "" + +#: ../editor.admin.class.php:1026 +msgid "Ad Image" +msgstr "" + +#: ../editor.admin.class.php:1031 +msgid "Ad Target" +msgstr "" + +#: ../editor.admin.class.php:1035 +msgid "Ad Alternative Text" +msgstr "" + +#: ../editor.admin.class.php:1040 +msgid "Count clicks for this advertisement" +msgstr "" + +#: ../editor.admin.class.php:1042 +msgid "Use carefully!" +msgstr "" + +#: ../editor.admin.class.php:1042 +msgid "" +"Do not use if the wp-admin folder is password protected. In this case the " +"viewer will be prompted to enter a username and password during ajax " +"request. It's not good." +msgstr "" + +#: ../editor.admin.class.php:1045 +msgid "This is flash (SWF) banner" +msgstr "" + +#: ../editor.admin.class.php:1048 +msgid "Flash banner \"flashvars\"" +msgstr "" + +#: ../editor.admin.class.php:1050 +msgid "Insert \"flashvars\" parameters between braces..." +msgstr "" + +#: ../editor.admin.class.php:1051 +msgid "Flash banner \"params\"" +msgstr "" + +#: ../editor.admin.class.php:1053 +msgid "Insert \"params\" parameters between braces..." +msgstr "" + +#: ../editor.admin.class.php:1054 +msgid "Flash banner \"attributes\"" +msgstr "" + +#: ../editor.admin.class.php:1056 +msgid "Insert \"attributes\" parameters between braces..." +msgstr "" + +#: ../editor.admin.class.php:1059 +msgid "Add to ad" +msgstr "" + +#: ../editor.admin.class.php:1061 +msgid "Non Selected" +msgstr "" + +#: ../editor.admin.class.php:1062 +msgid "nofollow" +msgstr "" + +#: ../editor.admin.class.php:1063 +msgid "noindex" +msgstr "" + +#: ../editor.admin.class.php:1064 +msgid "nofollow and noindex" +msgstr "" + +#: ../editor.admin.class.php:1073 +msgid "Code Mode" +msgstr "" + +#: ../editor.admin.class.php:1079 +msgid "This code of ad contains PHP script" +msgstr "" + +#: ../editor.admin.class.php:1088 +msgid "Restrictions of advertisements showing" +msgstr "" + +#: ../editor.admin.class.php:1091 +msgid "Ad Weight" +msgstr "" + +#: ../editor.admin.class.php:1098 +msgid "Inactive" +msgstr "" + +#: ../editor.admin.class.php:1099 +msgid "Minimal Activity" +msgstr "" + +#: ../editor.admin.class.php:1100 +msgid "Maximal Activity" +msgstr "" + +#: ../editor.admin.class.php:1110 +msgid "" +"Ad weight - coefficient of frequency of show of the advertisement for one " +"cycle of advertisements rotation." +msgstr "" + +#: ../editor.admin.class.php:1112 +msgid "0 - ad is inactive" +msgstr "" + +#: ../editor.admin.class.php:1113 +msgid "1 - minimal activity of this advertisement" +msgstr "" + +#: ../editor.admin.class.php:1115 +msgid "10 - maximal activity of this ad." +msgstr "" + +#: ../editor.admin.class.php:1121 ../help.class.php:20 ../help.class.php:161 +msgid "Show ad on all pages of blog" +msgstr "" + +#: ../editor.admin.class.php:1125 +msgid "Show ad only on pages of this type" +msgstr "" + +#: ../editor.admin.class.php:1129 +msgid "Home Page (Home or Front Page)" +msgstr "" + +#: ../editor.admin.class.php:1131 +msgid "Singular Pages" +msgstr "" + +#: ../editor.admin.class.php:1134 +msgid "Single Post" +msgstr "" + +#: ../editor.admin.class.php:1138 +msgid "Custom Post Type" +msgstr "" + +#: ../editor.admin.class.php:1140 +msgid "Attachment" +msgstr "" + +#: ../editor.admin.class.php:1143 +msgid "Search Page" +msgstr "" + +#: ../editor.admin.class.php:1145 +msgid "\"Not found\" Page (HTTP 404: Not Found)" +msgstr "" + +#: ../editor.admin.class.php:1147 +msgid "Archive Pages" +msgstr "" + +#: ../editor.admin.class.php:1150 +msgid "Taxonomy Archive Pages" +msgstr "" + +#: ../editor.admin.class.php:1152 +msgid "Category Archive Pages" +msgstr "" + +#: ../editor.admin.class.php:1154 +msgid "Tag Archive Pages" +msgstr "" + +#: ../editor.admin.class.php:1156 +msgid "Author Archive Pages" +msgstr "" + +#: ../editor.admin.class.php:1158 +msgid "Custom Post Type Archive Pages" +msgstr "" + +#: ../editor.admin.class.php:1160 +msgid "" +"Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " +"daily or time-based archive)" +msgstr "" + +#: ../editor.admin.class.php:1165 +msgid "Show ad only in certain posts/pages" +msgstr "" + +#: ../editor.admin.class.php:1169 ../editor.admin.class.php:1196 +msgid "Posts/Pages" +msgstr "" + +#: ../editor.admin.class.php:1176 +msgid "" +"Use this setting to display an ad only in certain posts/pages. Select posts/" +"pages." +msgstr "" + +#: ../editor.admin.class.php:1188 +msgid "Extended restrictions of advertisements showing" +msgstr "" + +#: ../editor.admin.class.php:1192 +msgid "Do not show ad on certain posts/pages" +msgstr "" + +#: ../editor.admin.class.php:1204 +msgid "" +"Use this setting to not display an ad on certain posts/pages. Select posts/" +"pages." +msgstr "" + +#: ../editor.admin.class.php:1209 +msgid "" +"Show ad only in single posts or categories archives of certain categories" +msgstr "" + +#: ../editor.admin.class.php:1212 ../editor.admin.class.php:1232 +msgid "Categories" +msgstr "" + +#: ../editor.admin.class.php:1219 +msgid "" +"Use this setting to display an ad only in single posts or categories " +"archives of certain categories." +msgstr "" + +#: ../editor.admin.class.php:1223 ../editor.admin.class.php:1257 +#: ../editor.admin.class.php:1291 ../editor.admin.class.php:1326 +#: ../editor.admin.class.php:1361 +msgid "" +"This display logic parameter will be applied only when you use the \"Show ad " +"on all pages of blog\" and \"Show your ad only on the pages of this type\" " +"modes. Otherwise, it will be ignored." +msgstr "" + +#: ../editor.admin.class.php:1229 +msgid "" +"Do not show ad in single posts or categories archives of certain categories" +msgstr "" + +#: ../editor.admin.class.php:1239 +msgid "" +"Use this setting to not display an ad in single posts or categories archives " +"of certain categories." +msgstr "" + +#: ../editor.admin.class.php:1244 +msgid "" +"Show ad only in single posts or archives of certain Custom Taxonomies Terms" +msgstr "" + +#: ../editor.admin.class.php:1253 +msgid "" +"Use this setting to display an ad only in single posts or archives of " +"certain Custom Taxonomies Terms." +msgstr "" + +#: ../editor.admin.class.php:1263 +msgid "" +"Do not show ad in single posts or archives of certain Custom Taxonomies Terms" +msgstr "" + +#: ../editor.admin.class.php:1272 +msgid "" +"Use this setting to not display an ad only in single posts or archives of " +"certain Custom Taxonomies Terms." +msgstr "" + +#: ../editor.admin.class.php:1277 +msgid "Show ad only in single posts or authors archives of certain authors" +msgstr "" + +#: ../editor.admin.class.php:1280 ../editor.admin.class.php:1300 +msgid "Authors" +msgstr "" + +#: ../editor.admin.class.php:1287 +msgid "" +"Use this setting to display an ad only in single posts or authors archives " +"of certain authors." +msgstr "" + +#: ../editor.admin.class.php:1297 +msgid "Do not show ad in single posts or authors archives of certain authors" +msgstr "" + +#: ../editor.admin.class.php:1307 +msgid "" +"Use this setting to not display an ad in single posts or authors archives of " +"certain authors." +msgstr "" + +#: ../editor.admin.class.php:1312 +msgid "Show ad only in single posts or tags archives of certain tags" +msgstr "" + +#: ../editor.admin.class.php:1315 ../editor.admin.class.php:1335 +msgid "Tags" +msgstr "" + +#: ../editor.admin.class.php:1322 +msgid "" +"Use this setting to display an ad only in single posts or tags archives of " +"certain tags." +msgstr "" + +#: ../editor.admin.class.php:1332 +msgid "Do not show ad in single posts or tags archives of certain tags" +msgstr "" + +#: ../editor.admin.class.php:1342 +msgid "" +"Use this setting to not display an ad in single posts or tags archives of " +"certain tags." +msgstr "" + +#: ../editor.admin.class.php:1347 +msgid "" +"Show ad only in custom type single posts or custom post type archives of " +"certain custom post types" +msgstr "" + +#: ../editor.admin.class.php:1350 ../editor.admin.class.php:1370 +msgid "Custom post types" +msgstr "" + +#: ../editor.admin.class.php:1357 +msgid "" +"Use this setting to display an ad only in custom type single posts or custom " +"post type archives of certain custom post types." +msgstr "" + +#: ../editor.admin.class.php:1367 +msgid "" +"Do not show ad in custom type single posts or custom post type archives of " +"certain custom post types" +msgstr "" + +#: ../editor.admin.class.php:1377 +msgid "" +"Use this setting to not display an ad in custom type single posts or custom " +"post type archives of certain custom post types." +msgstr "" + +#: ../editor.admin.class.php:1382 +msgid "Use the schedule for this ad" +msgstr "" + +#: ../editor.admin.class.php:1386 +msgid "Campaign Start Date" +msgstr "" + +#: ../editor.admin.class.php:1390 +msgid "Campaign End Date" +msgstr "" + +#: ../editor.admin.class.php:1395 +msgid "" +"Use these parameters for displaying ad during the certain period of time." +msgstr "" + +#: ../editor.admin.class.php:1400 +msgid "Use limitation by hits" +msgstr "" + +#: ../editor.admin.class.php:1404 +msgid "Hits Limit" +msgstr "" + +#: ../editor.admin.class.php:1409 +msgid "Use this parameter for limiting displaying of ad by hits." +msgstr "" + +#: ../editor.admin.class.php:1414 +msgid "Use limitation by clicks" +msgstr "" + +#: ../editor.admin.class.php:1418 +msgid "Clicks Limit" +msgstr "" + +#: ../editor.admin.class.php:1423 +msgid "Use this parameter for limiting displaying of ad by clicks." +msgstr "" + +#: ../editor.admin.class.php:1433 +msgid "Users" +msgstr "" + +#: ../editor.admin.class.php:1435 +msgid "Show this ad for" +msgstr "" + +#: ../editor.admin.class.php:1438 +msgid "all users" +msgstr "" + +#: ../editor.admin.class.php:1443 +msgid "these users" +msgstr "" + +#: ../editor.admin.class.php:1448 +msgid "Unregistered Users" +msgstr "" + +#: ../editor.admin.class.php:1452 ../editor.admin.class.php:1460 +msgid "Registered Users" +msgstr "" + +#: ../editor.admin.class.php:1457 +msgid "Exclude these users" +msgstr "" + +#: ../editor.admin.class.php:1468 +msgid "Do not show this ad for advertiser" +msgstr "" + +#: ../editor.admin.class.php:1480 +msgid "Advertiser" +msgstr "" + +#: ../editor.admin.class.php:1483 +msgid "Advertiser Nick Name" +msgstr "" + +#: ../editor.admin.class.php:1500 ../help.class.php:32 ../help.class.php:180 +msgid "Prices" +msgstr "" + +#: ../editor.admin.class.php:1503 +msgid "Price of ad placement per month" +msgstr "" + +#: ../editor.admin.class.php:1507 +msgid "Tthis parameter used only for scheduled ads." +msgstr "" + +#: ../editor.admin.class.php:1510 +msgid "Price per Thousand Hits" +msgstr "" + +#: ../editor.admin.class.php:1514 +msgid "" +"Not only humans visit your blog, bots and crawlers too. In order not to " +"deceive an advertiser, you must enable the detection of bots and crawlers." +msgstr "" + +#: ../editor.admin.class.php:1517 +msgid "Price per Click" +msgstr "" + +#: ../editor.admin.class.php:1521 +msgid "" +"To calculate the earnings on clicks, you must enable counting of clicks for " +"that ad." +msgstr "" + +#: ../editor.admin.class.php:1561 +msgid "Ad Preview" +msgstr "" + +#: ../errorlog.admin.class.php:61 ../errorlog.admin.class.php:145 +#: ../errorlog.admin.class.php:157 +msgid "Resolved" +msgstr "" + +#: ../errorlog.admin.class.php:65 ../errorlog.admin.class.php:167 +msgid "Clear Error Log" +msgstr "" + +#: ../errorlog.admin.class.php:68 ../errorlog.admin.class.php:170 +msgid "Clear Resolved" +msgstr "" + +#: ../errorlog.admin.class.php:85 ../errorlog.admin.class.php:95 +msgid "Date" +msgstr "" + +#: ../errorlog.admin.class.php:88 ../errorlog.admin.class.php:98 +msgid "Error Massage" +msgstr "" + +#: ../errorlog.admin.class.php:147 +msgid "More Info" +msgstr "" + +#: ../errorlog.admin.class.php:151 +msgid "Not Resolved" +msgstr "" + +#: ../errorlog.admin.class.php:182 +msgid "Error Info" +msgstr "" + +#: ../errors.class.php:54 +msgid "Simple Ads Manager Images Folder hasn't been created!" +msgstr "" + +#: ../errors.class.php:55 +msgid "Try to reactivate plugin or create folder manually." +msgstr "" + +#: ../errors.class.php:55 +msgid "" +"Manually creation: Create folder 'sam-images' in 'wp-content/plugins' " +"folder. Don't forget to set folder's permissions to 777." +msgstr "" + +#: ../errors.class.php:62 +#, php-format +msgid "Database table %s hasn't been created!" +msgstr "" + +#: ../errors.class.php:66 +#, php-format +msgid "Database table %s hasn't been upgraded!" +msgstr "" + +#: ../help.class.php:14 ../help.class.php:155 +msgid "" +"Enter a name and a description of the " +"advertisement. These parameters are optional, because don’t influence " +"anything, but help in the visual identification of the ad (do not forget " +"which is which)." +msgstr "" + +#: ../help.class.php:15 ../help.class.php:156 +msgid "" +"Ad Code – code can be defined as a combination of the image " +"URL and target page URL, or as HTML code, javascript code, or PHP code (for " +"PHP-code don’t forget to set the checkbox labeled \"This code of ad contains " +"PHP script\"). If you select the first option (image mode) you can keep " +"statistics of clicks and also tools for uploading/selecting the downloaded " +"image banner becomes available to you." +msgstr "" + +#: ../help.class.php:16 ../help.class.php:157 +msgid "Restrictions of advertisement Showing" +msgstr "" + +#: ../help.class.php:17 ../help.class.php:158 +msgid "" +"Ad Weight – coefficient of frequency of show of the advertisement " +"for one cycle of advertisements rotation. 0 – ad is inactive, 1 – minimal " +"activity of this advertisement, 10 – maximal activity of this ad." +msgstr "" + +#: ../help.class.php:18 ../help.class.php:159 +msgid "Restrictions by the type of pages – select restrictions:" +msgstr "" + +#: ../help.class.php:21 ../help.class.php:162 +msgid "" +"Show ad only on pages of this type – ad will appear only on the pages of " +"selected types" +msgstr "" + +#: ../help.class.php:22 ../help.class.php:163 +msgid "" +"Show ad only in certain posts – ad will be shown only on single posts pages " +"with the given IDs (ID items separated by commas, no spaces)" +msgstr "" + +#: ../help.class.php:24 +msgid "Additional restrictions" +msgstr "" + +#: ../help.class.php:26 ../help.class.php:174 +msgid "" +"Show ad only in single posts or categories archives of certain categories – " +"ad will be shown only on single posts pages or category archive pages of the " +"specified categories" +msgstr "" + +#: ../help.class.php:27 ../help.class.php:175 +msgid "" +"Show ad only in single posts or authors archives of certain authors – ad " +"will be shown only on single posts pages or author archive pages of the " +"specified authors" +msgstr "" + +#: ../help.class.php:29 ../help.class.php:177 +msgid "" +"Use the schedule for this ad – if necessary, select checkbox " +"labeled “Use the schedule for this ad” and set start and finish dates of ad " +"campaign." +msgstr "" + +#: ../help.class.php:30 ../help.class.php:178 +msgid "" +"Use limitation by hits – if necessary, select checkbox labeled “Use " +"limitation by hits” and set hits limit." +msgstr "" + +#: ../help.class.php:31 ../help.class.php:179 +msgid "" +"Use limitation by clicks – if necessary, select checkbox labeled " +"“Use limitation by clicks” and set clicks limit." +msgstr "" + +#: ../help.class.php:32 ../help.class.php:180 +msgid "" +"Use these parameters to get the statistics of incomes from advertisements " +"placed in your blog. \"Price of ad placement per month\" - parameter used " +"only for calculating statistic of scheduled ads." +msgstr "" + +#: ../help.class.php:33 ../help.class.php:50 ../help.class.php:57 +#: ../help.class.php:71 ../help.class.php:104 ../help.class.php:112 +#: ../help.class.php:123 ../help.class.php:140 ../help.class.php:149 +#: ../help.class.php:165 ../help.class.php:181 ../help.class.php:198 +msgid "Manual" +msgstr "" + +#: ../help.class.php:39 ../help.class.php:129 +msgid "" +"Enter a name and a description of the Ads " +"Place. In principle, it is not mandatory parameters, because these " +"parameters don’t influence anything, but experience suggests that after a " +"while all IDs usually will be forgotten and such information may be useful." +msgstr "" + +#: ../help.class.php:40 ../help.class.php:130 +msgid "" +"Ads Place Size – in this version is only for informational " +"purposes only, but in future I plan to use this option. It is desirable to " +"expose the real size." +msgstr "" + +#: ../help.class.php:41 ../help.class.php:131 +msgid "" +"Ads Place Patch - it’s an ad that will appear in the event " +"that the logic of basic ads outputing of this Ads Place on the current page " +"will not be able to choose a single basic ad for displaying. For example, if " +"all basic announcements are set to displaying only on archives pages or " +"single pages, in this case the patch ad of Ads Place will be shown on the " +"Home page. Conveniently to use the patch ad of Ads Place where you sell the " +"advertising place for a limited time – after the time expiration of ordered " +"ad will appear patch ad. It may be a banner leading to your page of " +"advertisement publication costs or a banner from AdSense." +msgstr "" + +#: ../help.class.php:42 ../help.class.php:132 +msgid "Patch can be defined" +msgstr "" + +#: ../help.class.php:44 ../help.class.php:134 +msgid "as combination of the image URL and target page URL" +msgstr "" + +#: ../help.class.php:45 ../help.class.php:135 +msgid "as HTML code or javascript code" +msgstr "" + +#: ../help.class.php:46 ../help.class.php:136 +msgid "" +"as name of Google DoubleClick for Publishers (DFP) block" +msgstr "" + +#: ../help.class.php:48 ../help.class.php:138 +msgid "" +"If you select the first option (image mode), tools to download/choosing of " +"downloaded image banner become available for you." +msgstr "" + +#: ../help.class.php:49 ../help.class.php:139 +msgid "" +"Codes – as Ads Place can be inserted into the page code not " +"only as widget, but as a short code or by using function, you can use code " +"“before” and “after” for centering or alignment of Ads Place on the place of " +"inserting or for something else you need. Use HTML tags." +msgstr "" + +#: ../help.class.php:63 ../help.class.php:190 +msgid "" +"Views per Cycle – the number of impressions an ad for one " +"cycle of rotation, provided that this ad has maximum weight (the activity). " +"In other words, if the number of hits in the series is 1000, an ad with a " +"weight of 10 will be shown in 1000, and the ad with a weight of 3 will be " +"shown 300 times." +msgstr "" + +#: ../help.class.php:64 ../help.class.php:191 +msgid "" +"Do not set this parameter to a value less than the maximum number of " +"visitors which may simultaneously be on your site – it may violate the logic " +"of rotation." +msgstr "" + +#: ../help.class.php:65 ../help.class.php:192 +msgid "" +"Not worth it, though it has no special meaning, set this parameter to a " +"value greater than the number of hits your web pages during a month. " +"Optimal, perhaps, is the value to the daily shows website pages." +msgstr "" + +#: ../help.class.php:66 ../help.class.php:193 +msgid "" +"Auto Inserting Settings - here you can select the Ads " +"Places and allow the display of their ads before and after the content of " +"single post." +msgstr "" + +#: ../help.class.php:67 ../help.class.php:194 +msgid "" +"Google DFP Settings - if you want to use codes of Google " +"DFP rotator, you must allow it's using and define your pub-code." +msgstr "" + +#: ../help.class.php:69 ../help.class.php:196 +msgid "Bots and Crawlers detection" +msgstr "" + +#: ../help.class.php:69 ../help.class.php:196 +msgid "" +"For obtaining of more exact indexes of statistics and incomes it is " +"preferable to exclude data about visits of bots and crawlers from the data " +"about all visits of your blog. If enabled and bot or crawler is detected, " +"hits of ads won't be counted. Select accuracy of detection but use with " +"caution - more exact detection requires more server resources." +msgstr "" + +#: ../help.class.php:103 +msgid "This is list of Ads Places" +msgstr "" + +#: ../help.class.php:107 ../help.class.php:115 ../help.class.php:201 +msgid "Help" +msgstr "" + +#: ../help.class.php:111 +msgid "This is list of Ads" +msgstr "" + +#: ../help.class.php:122 +msgid "" +"The main object of the plugin is “Ads Place“. Each Ads Place is a container " +"for the advertisements and provides the logic of the show and rotation. In " +"addition, one of the parameters of advertising space is “patch ad code”, ie " +"ad to be shown if and only if the logic of ads this Ads Place does not " +"permit to show none of the advertisements contained in this Ads Place. One " +"Ads Place can contain any number of objects “advertisement”." +msgstr "" + +#: ../help.class.php:142 ../help.class.php:168 +msgid "Parameters" +msgstr "" + +#: ../help.class.php:148 +msgid "" +"Object “advertisement” rigidly attached to his container “Ads Place”. Its " +"parameters determine frequency (weight) of displaying and limiting " +"displaying from “show all pages” to “show the articles with ID … ” and show " +"from date to date (the schedule)." +msgstr "" + +#: ../help.class.php:151 ../list.admin.class.php:361 +#: ../list.admin.class.php:371 +msgid "Advertisement" +msgstr "" + +#: ../help.class.php:172 +msgid "Additional restrictions" +msgstr "" + +#: ../help.class.php:184 +msgid "Additional Parameters" +msgstr "" + +#: ../list.admin.class.php:138 +msgid "Managing Ads Places" +msgstr "" + +#: ../list.admin.class.php:154 ../list.admin.class.php:274 +msgid "Add New Place" +msgstr "" + +#: ../list.admin.class.php:158 ../list.admin.class.php:278 +msgid "Reset Statistics" +msgstr "" + +#: ../list.admin.class.php:174 ../list.admin.class.php:185 +msgid "Place Name" +msgstr "" + +#: ../list.admin.class.php:177 ../list.admin.class.php:188 +msgid "Total Hits" +msgstr "" + +#: ../list.admin.class.php:178 ../list.admin.class.php:189 +msgid "Total Ads" +msgstr "" + +#: ../list.admin.class.php:179 ../list.admin.class.php:190 +#: ../list.admin.class.php:365 ../list.admin.class.php:375 +msgid "Earnings" +msgstr "" + +#: ../list.admin.class.php:234 ../list.admin.class.php:424 +msgid "Placement" +msgstr "" + +#: ../list.admin.class.php:237 ../list.admin.class.php:427 +msgid "N/A" +msgstr "" + +#: ../list.admin.class.php:244 +msgid "Edit Place" +msgstr "" + +#: ../list.admin.class.php:248 +msgid "Restore this Place from the Trash" +msgstr "" + +#: ../list.admin.class.php:249 +msgid "Remove this Place permanently" +msgstr "" + +#: ../list.admin.class.php:254 +msgid "Move this Place to the Trash" +msgstr "" + +#: ../list.admin.class.php:255 +msgid "View List of Place Ads" +msgstr "" + +#: ../list.admin.class.php:255 +msgid "View Ads" +msgstr "" + +#: ../list.admin.class.php:256 +msgid "Create New Ad" +msgstr "" + +#: ../list.admin.class.php:256 +msgid "New Ad" +msgstr "" + +#: ../list.admin.class.php:321 +msgid "Managing Items of Ads Place" +msgstr "" + +#: ../list.admin.class.php:338 ../list.admin.class.php:457 +msgid "Add New Ad" +msgstr "" + +#: ../list.admin.class.php:342 ../list.admin.class.php:461 +msgid "Back to Ads Places Management" +msgstr "" + +#: ../list.admin.class.php:418 +msgid "Yes" +msgstr "" + +#: ../list.admin.class.php:419 +msgid "No" +msgstr "" + +#: ../list.admin.class.php:434 +msgid "Edit this Item of Ads Place" +msgstr "" + +#: ../list.admin.class.php:438 +msgid "Restore this Ad from the Trash" +msgstr "" + +#: ../list.admin.class.php:439 +msgid "Remove this Ad permanently" +msgstr "" + +#: ../list.admin.class.php:440 +msgid "Move this item to the Trash" +msgstr "" + +#: ../updater.class.php:53 +msgid "An error occurred during updating process..." +msgstr "" + +#: ../updater.class.php:67 +msgid "Updated..." +msgstr "" + +#: ../widget.class.php:11 +msgid "Ads Place:" +msgstr "" + +#: ../widget.class.php:14 +msgid "Ads Place rotator serviced by Simple Ads Manager." +msgstr "" + +#: ../widget.class.php:101 ../widget.class.php:237 ../widget.class.php:374 +#: ../widget.class.php:509 +msgid "Title:" +msgstr "" + +#: ../widget.class.php:124 ../widget.class.php:260 ../widget.class.php:397 +#: ../widget.class.php:532 +msgid "Hide widget style." +msgstr "" + +#: ../widget.class.php:133 ../widget.class.php:269 ../widget.class.php:406 +msgid "" +"Allow using previously defined \"before\" and \"after\" codes of Ads Place.." +msgstr "" + +#: ../widget.class.php:153 +msgid "Ads Zone selector serviced by Simple Ads Manager." +msgstr "" + +#: ../widget.class.php:286 ../js/dialog-ad.php:53 +msgid "Ad" +msgstr "" + +#: ../widget.class.php:289 +msgid "Non-rotating single ad serviced by Simple Ads Manager." +msgstr "" + +#: ../widget.class.php:423 +msgid "Block" +msgstr "" + +#: ../widget.class.php:426 +msgid "Ads Block collector serviced by Simple Ads Manager." +msgstr "" + +#: ../widget.class.php:428 ../js/dialog-block.php:53 +msgid "Ads Block" +msgstr "" + +#: ../zone.editor.admin.class.php:15 +msgid "Default" +msgstr "" + +#: ../zone.editor.admin.class.php:16 +msgid "None" +msgstr "" + +#: ../zone.editor.admin.class.php:183 +msgid "Ads Zone Data Updated." +msgstr "" + +#: ../zone.editor.admin.class.php:316 +msgid "New Ads Zone" +msgstr "" + +#: ../zone.editor.admin.class.php:316 +msgid "Edit Ads Zone" +msgstr "" + +#: ../zone.editor.admin.class.php:336 +msgid "Back to Zones List" +msgstr "" + +#: ../zone.editor.admin.class.php:343 ../js/dialog-zone.php:71 +msgid "Ads Zone ID" +msgstr "" + +#: ../zone.editor.admin.class.php:390 +msgid "Enter description of this Ads Zone." +msgstr "" + +#: ../zone.editor.admin.class.php:402 +msgid "Ads Zone Settings" +msgstr "" + +#: ../zone.editor.admin.class.php:405 +msgid "Default Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:411 +msgid "" +"Select the Ads Place by default. This Ads Place will be displayed in the " +"event that for the page of a given type the Ads Place value is set to " +"\"Default\"." +msgstr "" + +#: ../zone.editor.admin.class.php:415 +msgid "Home Page Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:421 +msgid "Default Ads Place for Singular Pages" +msgstr "" + +#: ../zone.editor.admin.class.php:428 +msgid "Single Post Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:437 +msgid "Default Ads Place for Single Custom Type Post" +msgstr "" + +#: ../zone.editor.admin.class.php:448 +msgid "Ads Place for Single Post of Custom Type" +msgstr "" + +#: ../zone.editor.admin.class.php:457 +msgid "Page Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:463 +msgid "Attachment Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:470 +msgid "Search Pages Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:476 +msgid "404 Page Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:482 +msgid "Default Ads Place for Archive Pages" +msgstr "" + +#: ../zone.editor.admin.class.php:489 +msgid "Default Ads Place for Taxonomies Pages" +msgstr "" + +#: ../zone.editor.admin.class.php:502 +msgid "Ads Place for Custom Taxonomy Term" +msgstr "" + +#: ../zone.editor.admin.class.php:515 +msgid "Default Ads Place for Category Archive Pages" +msgstr "" + +#: ../zone.editor.admin.class.php:528 +msgid "Ads Place for Category" +msgstr "" + +#: ../zone.editor.admin.class.php:544 +msgid "Default Ads Place for Archives of Custom Type Posts" +msgstr "" + +#: ../zone.editor.admin.class.php:554 +msgid "Ads Place for Custom Type Posts Archive" +msgstr "" + +#: ../zone.editor.admin.class.php:563 +msgid "Tags Archive Pages Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:569 +msgid "Default Ads Place for Author Archive Pages" +msgstr "" + +#: ../zone.editor.admin.class.php:578 +msgid "Ads Place for author" +msgstr "" + +#: ../zone.editor.admin.class.php:587 +msgid "Date Archive Pages Ads Place" +msgstr "" + +#: ../zone.editor.admin.class.php:594 +msgid "" +"Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " +"are Ads Places by default for the low level pages of relevant pages." +msgstr "" + +#: ../zone.list.admin.class.php:56 +msgid "Managing Ads Zones" +msgstr "" + +#: ../zone.list.admin.class.php:72 ../zone.list.admin.class.php:146 +msgid "Add New Zone" +msgstr "" + +#: ../zone.list.admin.class.php:89 ../zone.list.admin.class.php:95 +msgid "Zone Name" +msgstr "" + +#: ../zone.list.admin.class.php:123 +msgid "Edit Zone" +msgstr "" + +#: ../zone.list.admin.class.php:127 +msgid "Restore this Zone from the Trash" +msgstr "" + +#: ../zone.list.admin.class.php:128 +msgid "Remove this Zone permanently" +msgstr "" + +#: ../zone.list.admin.class.php:133 +msgid "Move this Zone to the Trash" +msgstr "" + +#: ../js/dialog-ad.php:27 +msgid "Insert Single Ad" +msgstr "" + +#: ../js/dialog-ad.php:46 ../js/dialog-block.php:46 ../js/dialog-zone.php:46 +#: ../js/dialog.php:46 +msgid "Basic Settings" +msgstr "" + +#: ../js/dialog-ad.php:71 +msgid "Single Ad ID" +msgstr "" + +#: ../js/dialog-ad.php:74 +msgid "Single Ad Name" +msgstr "" + +#: ../js/dialog-ad.php:84 ../js/dialog-zone.php:84 ../js/dialog.php:84 +msgid "Allow Ads Places predefined codes" +msgstr "" + +#: ../js/dialog-ad.php:97 ../js/dialog-block.php:87 ../js/dialog-zone.php:97 +#: ../js/dialog.php:97 +msgid "Insert" +msgstr "" + +#: ../js/dialog-block.php:27 +msgid "Insert Ads Block" +msgstr "" + +#: ../js/dialog-block.php:74 +msgid "Ads Block Name" +msgstr "" + +#: ../js/dialog-zone.php:27 +msgid "Insert Ads Zone" +msgstr "" + +#: ../js/dialog-zone.php:74 +msgid "Ads Zone Name" +msgstr "" + +#: ../js/dialog.php:27 +msgid "Insert Ads Place" +msgstr "" + +#: ../js/dialog.php:74 +msgid "Ads Place Name" +msgstr "" diff --git a/list.admin.class.php b/list.admin.class.php index 63d12bf..1b0cbab 100644 --- a/list.admin.class.php +++ b/list.admin.class.php @@ -85,6 +85,7 @@ public function page() { global $wpdb; $pTable = $wpdb->prefix . "sam_places"; $aTable = $wpdb->prefix . "sam_ads"; + $sTable = $wpdb->prefix . 'sam_stats'; if(isset($_GET['mode'])) $mode = $_GET['mode']; else $mode = 'active'; @@ -192,25 +193,25 @@ public function page() { 0, ad_hits*cpm/1000, 0)) FROM $aTable WHERE $aTable.pid = $pTable.id), 0)) AS e_cpm, - (IFNULL((SELECT SUM(IF(cpc > 0, ad_clicks*cpc, 0)) FROM $aTable WHERE $aTable.pid = $pTable.id), 0)) AS e_cpc, - (IFNULL((SELECT SUM(IF(ad_schedule AND per_month > 0, DATEDIFF(CURDATE(), ad_start_date)*per_month/30, 0)) FROM $aTable WHERE $aTable.pid = $pTable.id), 0)) AS e_month, - $pTable.trash, - (SELECT COUNT(*) FROM $aTable WHERE $aTable.pid = $pTable.id) AS items - FROM $pTable". - (($mode !== 'all') ? " WHERE $pTable.trash = ".(($mode === 'trash') ? 'TRUE' : 'FALSE') : ''). - " LIMIT $offset, $places_per_page"; + sp.id, + sp.name, + sp.description, + sp.place_size, + sp.place_custom_width, + sp.place_custom_height, + @patch_hits := (IFNULL((SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = 0 AND ss.pid = sp.id AND ss.event_type = 0), 0)) AS patch_hits, + (IFNULL((SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id > 0 AND ss.pid = sp.id AND ss.event_type = 0), 0) + IFNULL(@patch_hits, 0)) as total_ad_hits, + (IFNULL((SELECT SUM(IF(sa.cpm > 0, IFNULL((SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0), 0) * sa.cpm / 1000, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_cpm, + (IFNULL((SELECT SUM(IF(sa.cpc > 0, IFNULL((SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1), 0) * sa.cpc, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_cpc, + (IFNULL((SELECT SUM(IF(sa.ad_schedule AND sa.per_month > 0, DATEDIFF(CURDATE(), sa.ad_start_date) * sa.per_month / 30, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_month, + sp.trash, + (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id) AS items + FROM $pTable sp". + (($mode !== 'all') ? " WHERE sp.trash = ".(($mode === 'trash') ? 'TRUE' : 'FALSE') : ''). + " LIMIT $offset, $places_per_page;"; $places = $wpdb->get_results($pSql, ARRAY_A); $i = 0; - if(!is_array($places) || empty ($places)) { + if(!is_array($places) || empty($places)) { ?> @@ -376,40 +377,25 @@ public function page() { 0, DATEDIFF(CURDATE(), ad_start_date)*per_month/30, 0)) AS e_month, - (cpm * ad_hits / 1000) AS e_cpm, - (cpc * ad_clicks) AS e_cpc, - trash, - IF(DATEDIFF($aTable.ad_end_date, NOW()) IS NULL OR DATEDIFF($aTable.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired - FROM $aTable - WHERE (pid = $item) AND (trash = ".(($mode === 'trash') ? 'TRUE' : 'FALSE').") - LIMIT $offset, $items_per_page"; - else - $aSql = "SELECT - id, - pid, - name, - description, - ad_hits, - ad_clicks, - ad_weight, - (IF(ad_schedule AND per_month > 0, DATEDIFF(CURDATE(), ad_start_date)*per_month/30, 0)) AS e_month, - (cpm * ad_hits / 1000) AS e_cpm, - (cpc * ad_clicks) AS e_cpc, - trash, - IF(DATEDIFF($aTable.ad_end_date, NOW()) IS NULL OR DATEDIFF($aTable.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired - FROM $aTable - WHERE pid = $item + sa.id, + sa.pid, + sa.name, + sa.description, + @ad_hits := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, + @ad_clicks := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, + sa.ad_weight, + (IF(sa.ad_schedule AND sa.per_month > 0, DATEDIFF(CURDATE(), sa.ad_start_date)*sa.per_month/30, 0)) AS e_month, + (sa.cpm * @ad_hits / 1000) AS e_cpm, + (sa.cpc * @ad_clicks) AS e_cpc, + sa.trash, + IF(DATEDIFF(sa.ad_end_date, NOW()) IS NULL OR DATEDIFF(sa.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired + FROM $aTable sa + WHERE (pid = $item) $trash LIMIT $offset, $items_per_page"; + $items = $wpdb->get_results($aSql, ARRAY_A); $i = 0; if(!is_array($items) || empty($items)) { diff --git a/readme.txt b/readme.txt index 3cf5c27..d6b5e99 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,10 @@ Contributors: minimus Donate link: https://load.payoneer.com/LoadToPage.aspx?email=minimus@simplelib.com Tags: ad, adbrite, adgridwork, adify, admin, adpinion, adroll, ads, adsense, adserver, advertisement, advertising, affiliate, banner, banners, chitika, cj, commercial, commission, crispads, dfp, google, income, junction, link, manager, media, money, plugin, random, referral, revenue, rotator, seo, server, shoppingads, widget, widgetbucks, yahoo, ypn Requires at least: 3.5 -Tested up to: 3.7.1 -Stable tag: 1.8.70-SE +Tested up to: 3.8 +Stable tag: 1.8.71 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html Advertisement rotation system with a flexible logic of displaying advertisements. @@ -12,6 +14,8 @@ Advertisement rotation system with a flexible logic of displaying advertisements Simple Ads Manager is easy to use plugin providing a flexible logic of displaying advertisements. +[![endorse](https://api.coderwall.com/minimus/endorsecount.png)](https://coderwall.com/minimus) + = Features = * Flexible logic of advertisements rotation based on defined weight of each advertisement in group (Ads Place) * Custom default ad for each Ads Place @@ -82,6 +86,15 @@ No questions now... == Changelog == += 1.8.71 = +* Javascript output of ads (for caching compatibility) is added +* Custom Taxonomies restrictions are added +* Building query for SQL request is optimised +* Admin interface is improved +* Loading/Selecting banners from Wordpress Media Library is added +* Updater is fixed and improved +* Language pack folder is added +* bbPress support is added = 1.7.63 = * Some bugs (Ads Block style, Click Tracker) are resolved. = 1.7.61 = diff --git a/sam-ajax-admin-stats.php b/sam-ajax-admin-stats.php new file mode 100644 index 0000000..8426318 --- /dev/null +++ b/sam-ajax-admin-stats.php @@ -0,0 +1,194 @@ +prefix . 'sam_stats'; +$oTable = $wpdb->prefix . 'options'; +$aTable = $wpdb->prefix . 'sam_ads'; + +$oSql = "SELECT $oTable.option_value FROM $oTable WHERE $oTable.option_name = 'blog_charset'"; +$charset = $wpdb->get_var($oSql); + +function samDaysInMonth($month, $year) { + return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31); +} + +@header("Content-Type: application/json; charset=$charset"); +@header( 'X-Robots-Tag: noindex' ); + +send_nosniff_header(); +nocache_headers(); + +$action = !empty($_REQUEST['action']) ? 'sam_ajax_' . stripslashes($_REQUEST['action']) : false; + +//A bit of security +$allowed_actions = array( + 'sam_ajax_load_item_stats', + 'sam_ajax_load_stats', + 'sam_ajax_load_ads' +); +$out = array(); + +if(in_array($action, $allowed_actions)) { + switch($action) { + case 'sam_ajax_load_stats': + if(isset($_POST['id'])) { + $pid = $_POST['id']; + $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; + + $date = new DateTime('now'); + $si = '-'.$sMonth.' month'; + $date->modify($si); + $month = $date->format('Y-m-d'); + $days = $date->format('t'); + + $sql = "SELECT + DATE_FORMAT(ss.event_time, %s) AS ed, + COUNT(*) AS hits + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d AND ss.pid = %d + GROUP BY ed;"; + $hits = $wpdb->get_results($wpdb->prepare($sql, '%e', $month, 0, $pid), ARRAY_A); + $clicks = $wpdb->get_results($wpdb->prepare($sql, '%e', $month, 1, $pid), ARRAY_A); + for($i = 1; $i <= $days; $i++) { + $hitsFull[$i - 1] = array( $i, 0); + $clicksFull[$i - 1] = array($i, 0); + } + foreach($hits as $hit) $hitsFull[$hit['ed'] - 1][1] = $hit['hits']; + foreach($clicks as $click) $clicksFull[$click['ed'] - 1][1] = $click['hits']; + + $sql = "SELECT + (SELECT + COUNT(*) + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = 0 AND ss.pid = %d) AS hits, + (SELECT + COUNT(*) + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = 1 AND ss.pid = %d) AS clicks;"; + $total = $wpdb->get_row($wpdb->prepare($sql, $month, $pid, $month, $pid)); + + $out = array('hits' => $hitsFull, 'clicks' => $clicksFull, 'total' => $total, 'test' => $test); + } + else $out = array("status" => "error", "message" => "Error"); + break; + + case 'sam_ajax_load_item_stats': + if(isset($_POST['id'])) { + $id = $_POST['id']; + $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; + + $date = new DateTime('now'); + $si = '-'.$sMonth.' month'; + $date->modify($si); + $month = $date->format('Y-m-d'); + $days = $date->format('t'); + + $sql = "SELECT + DATE_FORMAT(ss.event_time, %s) AS ed, + COUNT(*) AS hits + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d AND ss.id = %d + GROUP BY ed;"; + $hits = $wpdb->get_results($wpdb->prepare($sql, '%e', $month, 0, $id), ARRAY_A); + $clicks = $wpdb->get_results($wpdb->prepare($sql, '%e', $month, 1, $id), ARRAY_A); + for($i = 1; $i <= $days; $i++) { + $hitsFull[$i - 1] = array( $i, 0); + $clicksFull[$i - 1] = array($i, 0); + } + foreach($hits as $hit) $hitsFull[$hit['ed'] - 1][1] = $hit['hits']; + foreach($clicks as $click) $clicksFull[$click['ed'] - 1][1] = $click['hits']; + + $sql = "SELECT + (SELECT + COUNT(*) + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = 0 AND ss.id = %d) AS hits, + (SELECT + COUNT(*) + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = 1 AND ss.id = %d) AS clicks;"; + $total = $wpdb->get_row($wpdb->prepare($sql, $month, $id, $month, $id)); + + $out = array('hits' => $hitsFull, 'clicks' => $clicksFull, 'total' => $total); + } + else $out = array("status" => "error", "message" => "Error"); + break; + + case 'sam_ajax_load_ads': + if(isset($_POST['id'])) { + $id = $_POST['id']; + $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; + + $date = new DateTime('now'); + $si = '-'.$sMonth.' month'; + $date->modify($si); + $month = $date->format('Y-m-d'); + //$days = $date->format('t'); + + $sql = "SELECT + sa.id, + sa.pid, + sa.name, + sa.description, + @ad_hits := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, + @ad_clicks := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, + sa.ad_weight, + (sa.cpm / @ad_hits * 1000) AS e_cpm, + sa.cpc AS e_cpc, + (@ad_clicks / @ad_hits * 100) AS e_ctr + FROM $aTable sa + WHERE (sa.pid = %d) AND sa.trash = FALSE AND NOT (sa.ad_schedule AND sa.ad_end_date < NOW());"; + $rows = $wpdb->get_results($wpdb->prepare($sql, $month, $month, $id), ARRAY_A); + + $k = 0; + foreach($rows as &$row) { + $k++; + $row['recid'] = $k; + } + + $out = array( + 'status' => 'success', + 'total' => count($rows), + 'records' => $rows, + 'sql' => $wpdb->prepare($sql, $sMonth, $sMonth, $id) + ); + } + else $out = array('status' => 'error'); + break; + + default: + $out = array("status" => "error", "message" => "Error"); + break; + } + echo json_encode( $out ); wp_die(); +} +else $out = array("status" => "error", "message" => "Error"); + +wp_send_json_error($out); \ No newline at end of file diff --git a/sam-ajax-admin.php b/sam-ajax-admin.php new file mode 100644 index 0000000..1043354 --- /dev/null +++ b/sam-ajax-admin.php @@ -0,0 +1,259 @@ +prefix . 'sam_stats'; +$tTable = $wpdb->prefix . "terms"; +$ttTable = $wpdb->prefix . "term_taxonomy"; +$uTable = $wpdb->base_prefix . "users"; +$umTable = $wpdb->base_prefix . "usermeta"; +$postTable = $wpdb->prefix . "posts"; +$userLevel = $wpdb->base_prefix . 'user_level'; + +$oTable = $wpdb->prefix . 'options'; +$oSql = "SELECT $oTable.option_value FROM $oTable WHERE $oTable.option_name = 'blog_charset'"; +$charset = $wpdb->get_var($oSql); + +//Typical headers +@header("Content-Type: application/json; charset=$charset"); +@header( 'X-Robots-Tag: noindex' ); + +send_nosniff_header(); +nocache_headers(); + +$action = !empty($_REQUEST['action']) ? 'sam_ajax_' . stripslashes($_REQUEST['action']) : false; + +//A bit of security +$allowed_actions = array( + 'sam_ajax_load_cats', + 'sam_ajax_load_tags', + 'sam_ajax_load_authors', + 'sam_ajax_load_posts', + 'sam_ajax_load_users', + 'sam_ajax_load_combo_data', + 'sam_ajax_load_stats' +); +$out = array(); + +if(in_array($action, $allowed_actions)) { + switch($action) { + case 'sam_ajax_load_cats': + $sql = "SELECT wt.term_id AS id, wt.name AS title, wt.slug + FROM $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id + WHERE wtt.taxonomy = 'category' + ORDER BY wt.name;"; + + $cats = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($cats as &$val) { + $k++; + $val['recid'] = $k; + } + $out = $cats; + break; + + case 'sam_ajax_load_tags': + $sql = "SELECT wt.term_id AS id, wt.name AS title, wt.slug + FROM $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id + WHERE wtt.taxonomy = 'post_tag' + ORDER BY wt.name;"; + + $tags = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($tags as &$val) { + $k++; + $val['recid'] = $k; + } + $out = $tags; + break; + + case 'sam_ajax_load_authors': + $sql = "SELECT + wu.id, + wu.display_name AS title, + wu.user_nicename AS slug + FROM + $uTable wu + INNER JOIN $umTable wum + ON wu.id = wum.user_id + WHERE + wum.meta_key = '$userLevel' AND + wum.meta_value > 1 + ORDER BY wu.id;"; + + $auth = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($auth as &$val) { + $k++; + $val['recid'] = $k; + } + $out = $auth; + break; + + case 'sam_ajax_load_posts': + $custs = (isset($_REQUEST['cstr'])) ? $_REQUEST['cstr'] : ''; + $sPost = (isset($_REQUEST['sp'])) ? urldecode( $_REQUEST['sp'] ) : 'Post'; + $sPage = (isset($_REQUEST['spg'])) ? urldecode( $_REQUEST['spg'] ) : 'Page'; + + //set @row_num = 0; + //SELECT @row_num := @row_num + 1 AS recid + $sql = "SELECT + wp.id, + wp.post_title AS title, + wp.post_type AS type + FROM + $postTable wp + WHERE + wp.post_status = 'publish' AND + FIND_IN_SET(wp.post_type, 'post,page{$custs}') + ORDER BY wp.id;"; + + $posts = $wpdb->get_results($sql, ARRAY_A); + + $k = 0; + foreach($posts as &$val) { + switch($val['type']) { + case 'post': + $val['type'] = $sPost; + break; + case 'page': + $val['type'] = $sPage; + break; + default: + $val['type'] = $sPost . ': '.$val['type']; + break; + } + $k++; + $val['recid'] = $k; + } + $out = array( + 'status' => 'success', + 'total' => count($posts), + 'records' => $posts + ); + break; + + case 'sam_ajax_load_users': + $roleSubscriber = (isset($_REQUEST['subscriber'])) ? urldecode($_REQUEST['subscriber']) : 'Subscriber'; + $roleContributor = (isset($_REQUEST['contributor'])) ? urldecode($_REQUEST['contributor']) : 'Contributor'; + $roleAuthor = (isset($_REQUEST['author'])) ? urldecode($_REQUEST['author']) : 'Author'; + $roleEditor = (isset($_REQUEST['editor'])) ? urldecode($_REQUEST['editor']) : 'Editor'; + $roleAdministrator = (isset($_REQUEST["admin"])) ? urldecode($_REQUEST["admin"]) : 'Administrator'; + $roleSuperAdmin = (isset($_REQUEST['sadmin'])) ? urldecode($_REQUEST['sadmin']) : 'Super Admin'; + $sql = "SELECT + wu.id, + wu.display_name AS title, + wu.user_nicename AS slug, + (CASE wum.meta_value + WHEN 0 THEN '$roleSubscriber' + WHEN 1 THEN '$roleContributor' + WHEN 2 THEN '$roleAuthor' + ELSE + IF(wum.meta_value > 2 AND wum.meta_value <= 7, '$roleEditor', + IF(wum.meta_value > 7 AND wum.meta_value <= 10, '$roleAdministrator', + IF(wum.meta_value > 10, '$roleSuperAdmin', NULL) + ) + ) + END) AS role + FROM $uTable wu + INNER JOIN $umTable wum + ON wu.id = wum.user_id AND wum.meta_key = '$userLevel' + ORDER BY wu.id;"; + $users = $wpdb->get_results($sql, ARRAY_A); + + $k = 0; + foreach($users as &$val) { + $k++; + $val['recid'] = $k; + } + + $out = $users; + break; + + case 'sam_ajax_load_combo_data': + $page = $_GET['page']; + $rows = $_GET['rows']; + $searchTerm = $_GET['searchTerm']; + $offset = ((int)$page - 1) * (int)$rows; + + $sql = "SELECT + wu.id, + wu.display_name AS title, + wu.user_nicename AS slug, + wu.user_email AS email + FROM + $uTable wu + WHERE wu.user_nicename LIKE '{$searchTerm}%' + ORDER BY wu.id + LIMIT $offset, $rows;"; + $users = $wpdb->get_results($sql, ARRAY_A); + + $sql = "SELECT COUNT(*) FROM $uTable wu WHERE wu.user_nicename LIKE '{$searchTerm}%';"; + $rTotal = $wpdb->get_var($sql); + $total = ceil((int)$rTotal/(int)$rows); + + $out = array( + 'page' => $page, + 'records' => count($users), + 'rows' => $users, + 'total' => $total, + 'offset' => $offset + ); + + break; + + case 'sam_ajax_load_stats': + $sql = "SELECT + DATE_FORMAT(ss.event_time, %s) AS ed, + DATE_FORMAT(LAST_DAY(ss.event_time), %s) AS days, + COUNT(*) AS hits + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d + GROUP BY ed;"; + $hits = $wpdb->get_results($wpdb->prepare($sql, '%d', '%d', 0, 0), ARRAY_A); + $clicks = $wpdb->get_results($wpdb->prepare($sql, '%d', '%d', 0, 1), ARRAY_A); + $days = $hits[0]['days']; + for($i = 1; $i <= $days; $i++) { + $hitsFull[$i - 1] = array( $i, 0); + $clicksFull[$i - 1] = array($i, 0); + } + foreach($hits as $hit) $hitsFull[$hit['ed']][1] = $hit['hits']; + foreach($clicks as $click) $clicksFull[$click['ed']][1] = $click['hits']; + $out = array('hits' => $hitsFull, 'clicks' => $clicksFull, 'sql' => $sql); + break; + + default: + $out = array("status" => "error", "message" => "Error"); + break; + } + echo json_encode( $out ); wp_die(); +} +else $out = array("status" => "error", "message" => "Error"); +//exit(json_encode($output)); +wp_send_json_error($out); diff --git a/sam-ajax-loader.php b/sam-ajax-loader.php new file mode 100644 index 0000000..99f1e2d --- /dev/null +++ b/sam-ajax-loader.php @@ -0,0 +1,72 @@ +prefix . 'options'; +$oSql = "SELECT $oTable.option_value FROM $oTable WHERE $oTable.option_name = 'blog_charset'"; +$charset = $wpdb->get_var($oSql); + +//Typical headers +@header("Content-Type: application/json; charset=$charset"); +@header( 'X-Robots-Tag: noindex' ); + +send_nosniff_header(); +nocache_headers(); + +$action = !empty($_POST['action']) ? 'sam_ajax_' . stripslashes($_POST['action']) : false; + +//A bit of security +$allowed_actions = array( + 'sam_ajax_load_place', + 'sam_ajax_load_zone' +); + +if(in_array($action, $allowed_actions)) { + switch($action) { + case 'sam_ajax_load_place': + if(isset($_POST['id']) && isset($_POST['pid']) && isset($_POST['wc'])) { + $placeId = $_POST['pid']; + $adId = $_POST['id']; + $clauses = unserialize(base64_decode($_POST['wc'])); + $args = array('id' => ($adId == 0) ? $placeId : $adId); + if(isset($_POST['codes'])) $codes = (bool)($_POST['codes']); + else $codes = false; + include_once('ad.class.php'); + if($adId == 0) $ad = new SamAdPlace($args, $codes, false, $clauses, true); + else $ad = new SamAd($args, $codes, false, true); + echo json_encode(array( + 'success' => true, + 'ad' => $ad->ad, + 'id' => $ad->id, + 'pid' => $ad->pid, + 'cid' => $ad->cid, + 'clauses' => $clauses + )); + } + break; + } +} +else echo json_encode(array('success' => false, 'error' => 'Not allowed')); +wp_die(); \ No newline at end of file diff --git a/sam-ajax.php b/sam-ajax.php index 3c3faf7..421a2fd 100644 --- a/sam-ajax.php +++ b/sam-ajax.php @@ -26,6 +26,9 @@ $oTable = $wpdb->prefix . 'options'; $oSql = "SELECT $oTable.option_value FROM $oTable WHERE $oTable.option_name = 'blog_charset'"; $charset = $wpdb->get_var($oSql); +$aTable = $wpdb->prefix . "sam_ads"; +$pTable = $wpdb->prefix . 'sam_places'; +$sTable = $wpdb->prefix . 'sam_stats'; //Typical headers @header("Content-Type: application/json; charset=$charset"); @@ -39,7 +42,7 @@ //A bit of security $allowed_actions = array( 'sam_ajax_sam_click', - 'sam_ajax_sam_show' + 'sam_ajax_sam_hit' ); if(in_array($action, $allowed_actions)){ @@ -51,25 +54,53 @@ $aId = explode('_', $adId); $id = (integer) $aId[1]; } + elseif(isset($_POST['id'])) { + $id = $_POST['id']; + $pid = $_POST['pid']; + } else $id = -100; if($id > 0) { - $aTable = $wpdb->prefix . "sam_ads"; - - $aSql = "UPDATE $aTable SET $aTable.ad_clicks = $aTable.ad_clicks+1 WHERE $aTable.id = %d;"; - $result = $wpdb->query($wpdb->prepare($aSql, $id)); + //$aSql = "UPDATE $aTable sa SET sa.ad_clicks = sa.ad_clicks + 1 WHERE sa.id = %d;"; + $aSql = "INSERT HIGH_PRIORITY INTO $sTable (id, pid, event_time, event_type) VALUES (%d, %d, NOW(), 1);"; + $result = $wpdb->query($wpdb->prepare($aSql, $id, $pid)); if($result === 1) { - $out = array('id' => $id, 'result' => $result, 'charset' => $charset); - wp_send_json_success( $out ); + $out = array('success' => true, 'id' => $id, 'result' => $result, 'charset' => $charset); + echo json_encode( $out ); } - else wp_send_json_error(array('id' => $id, 'sql' => $wpdb->last_query, 'error' => $wpdb->last_error)); + else echo json_encode(array('success' => false, 'id' => $id, 'sql' => $wpdb->last_query, 'error' => $wpdb->last_error)); } - else wp_send_json_error(array('id' => $id)); + else echo json_encode(array('success' => false, 'id' => $id)); break; - case 'sam_ajax_sam_show': - + case 'sam_ajax_sam_hit': + if(isset($_POST['id']) && isset($_POST['pid'])) { + $id = $_POST['id']; + $pid = $_POST['pid']; + $cid = ($id == 0) ? $pid : $id; + $result = 0; + //if($id > 0) $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1, sa.ad_weight_hits = sa.ad_weight_hits + 1 WHERE sa.id = %d;"; + /*if($id > 0) $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1 WHERE sa.id = %d;"; + elseif($id == 0) $sql = "UPDATE $pTable sp SET sp.patch_hits = sp.patch_hits + 1 WHERE sp.id = %d;"; + else $sql = '';*/ + $sql = "INSERT HIGH_PRIORITY INTO $sTable (id, pid, event_time, event_type) VALUES (%d, %d, NOW(), 0);"; + if(!empty($sql)) $result = $wpdb->query($wpdb->prepare($sql, $id, $pid)); + if($result === 1) echo json_encode(array('success' => true, 'id' => $id, 'pid' => $pid)); + else echo json_encode(array( + 'success' => false, + 'id' => $id, + 'pid' => $pid, + 'cid' => $cid, + 'result' => $result, + 'sql' => $wpdb->prepare($sql, $cid) + )); + } + else echo json_encode(array('success' => false)); + break; + default: + echo json_encode(array('success' => false, 'error' => 'Data error')); break; } } -else wp_send_json_error(array('error' => 'Not allowed action')); \ No newline at end of file +else echo json_encode(array('success' => false, 'error' => 'Not allowed')); +wp_die(); diff --git a/browser.php b/sam-browser.php similarity index 99% rename from browser.php rename to sam-browser.php index b56a8f6..f9e3a47 100644 --- a/browser.php +++ b/sam-browser.php @@ -1,6 +1,6 @@ reset(); if( $useragent != "" ) { $this->setUserAgent($useragent); diff --git a/sam.class.php b/sam.class.php index 6c7cf47..993d666 100644 --- a/sam.class.php +++ b/sam.class.php @@ -1,7 +1,7 @@ null, 'db' => null); private $crawler = false; public $samNonce; @@ -9,6 +9,7 @@ class SimpleAdsManager { private $defaultSettings = array( 'adCycle' => 1000, + 'adShow' => 'php', // php|js 'adDisplay' => 'blank', 'placesPerPage' => 10, 'itemsPerPage' => 10, @@ -18,12 +19,17 @@ class SimpleAdsManager { 'beforePost' => 0, 'bpAdsId' => 0, 'bpUseCodes' => 0, + 'bpExcerpt' => 0, + 'bbpBeforePost' => 0, + 'bbpList' => 0, 'middlePost' => 0, 'mpAdsId' => 0, 'mpUseCodes' => 0, + 'bbpMiddlePost' => 0, 'afterPost' => 0, 'apAdsId' => 0, 'apUseCodes' => 0, + 'bbpAfterPost' => 0, 'useDFP' => 0, 'detectBots' => 0, 'detectingMode' => 'inexact', @@ -34,14 +40,24 @@ class SimpleAdsManager { 'useSWF' => 0, 'access' => 'manage_options', 'errorlog' => 1, - 'errorlogFS' => 1 + 'errorlogFS' => 1, + 'bbpActive' => 0, + 'bbpEnabled' => 0, + // Mailer + 'mailer' => 1, + 'mail_subject' => 'Ad campaign report ([month])', + 'mail_greeting' => 'Hi! [name]!', + 'mail_text_before' => 'This is your Ad Campaing Report:', + 'mail_text_after' => '', + 'mail_warning' => 'You received this mail because you are an advertiser of site [site]. If time of your campaign expires or if you refuse to post your ads on our site, you will be excluded from the mailing list automatically. Thank you for your cooperation.', + 'mail_message' => 'Do not respond to this mail! This mail was sent automatically by Wordpress plugin Simple Ads Manager.' ); public function __construct() { - define('SAM_VERSION', '1.8.70'); - define('SAM_DB_VERSION', '2.2'); + define('SAM_VERSION', '1.8.71'); + define('SAM_DB_VERSION', '2.5'); define('SAM_PATH', dirname( __FILE__ )); - define('SAM_URL', plugins_url('/' . str_replace( basename( __FILE__), "", plugin_basename( __FILE__ ) )) ); + define('SAM_URL', plugins_url( '/', __FILE__ ) ); define('SAM_IMG_URL', SAM_URL.'images/'); define('SAM_DOMAIN', 'simple-ads-manager'); define('SAM_OPTIONS_NAME', 'samPluginOptions'); @@ -67,7 +83,9 @@ public function __construct() { $this->getSettings(true); $this->getVersions(true); $this->crawler = $this->isCrawler(); - + + add_action('plugins_loaded', array(&$this, 'samMaintenance')); + if(!is_admin()) { add_action('wp_enqueue_scripts', array(&$this, 'headerScripts')); add_action('wp_head', array(&$this, 'headerCodes')); @@ -77,6 +95,14 @@ public function __construct() { add_shortcode('sam_zone', array(&$this, 'doZoneShortcode')); add_shortcode('sam_block', array(&$this, 'doBlockShortcode')); add_filter('the_content', array(&$this, 'addContentAds'), 8); + add_filter('get_the_excerpt', array(&$this, 'addExcerptAds'), 10); + if( $this->samOptions['bbpActive'] && $this->samOptions['bbpEnabled'] ) { + add_filter('bbp_get_reply_content', array(&$this, 'addBbpContentAds'), 39, 2); + add_filter('bbp_get_topic_content', array(&$this, 'addBbpContentAds'), 39, 2); + add_action('bbp_theme_after_forum_sub_forums', array(&$this, 'addBbpForumAds')); + add_action('bbp_theme_before_topic_started_by', array(&$this, 'addBbpForumAds')); + } + // For backward compatibility add_shortcode('sam-ad', array(&$this, 'doAdShortcode')); add_shortcode('sam-zone', array(&$this, 'doZoneShortcode')); @@ -124,14 +150,67 @@ private function isCustomPostType() { return (in_array(get_post_type(), $this->getCustomPostTypes())); } + private function customTaxonomiesTerms($id) { + $post = get_post($id); + $postType = $post->post_type; + $taxonomies = get_object_taxonomies($postType, 'objects'); + + $out = array(); + foreach ($taxonomies as $tax_slug => $taxonomy) { + $terms = get_the_terms($id, $tax_slug); + if(!empty($terms)) { + foreach($terms as $term) { + $out[] = $term->slug; + } + } + } + return $out; + } + + public function samMaintenance() { + $options = self::getSettings(); + if(false === ($mDate = get_transient( 'sam_maintenance_date' ))) { + $date = new DateTime('now'); + $date->modify('+1 month'); + $nextDate = new DateTime($date->format('Y-m-01 02:00')); + $diff = $nextDate->format('U') - $_SERVER['REQUEST_TIME']; + + if($options['mailer']) { + include_once('sam.tools.php'); + $mailer = new SamMailer($options); + $mailer->sendMails(); + } + + $format = get_option('date_format').' '.get_option('time_format'); + set_transient( 'sam_maintenance_date', $nextDate->format($format), $diff ); + } + } + + private function customTaxonomiesTerms2($id) { + global $wpdb; + + $tTable = $wpdb->prefix . "terms"; + $ttTable = $wpdb->prefix . "term_taxonomy"; + $trTable = $wpdb->prefix . 'term_relationships'; + + $sql = "SELECT wt.slug + FROM $trTable wtr + INNER JOIN $ttTable wtt + ON wtr.term_taxonomy_id = wtt.term_taxonomy_id + INNER JOIN $tTable wt + ON wtt.term_id = wt.term_id + WHERE NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format') AND wtr.object_id = %d"; + + $cTax = $wpdb->get_results($wpdb->prepare( $sql, $id ), ARRAY_A); + return $cTax; + } + public function buildWhereClause() { $settings = $this->getSettings(); if($settings['adCycle'] == 0) $cycle = 1000; else $cycle = $settings['adCycle']; - $el = (integer)$settings['errorlogFS']; - global $wpdb, $current_user; - $aTable = $wpdb->prefix . "sam_ads"; + global $current_user; $viewPages = 0; $wcc = ''; @@ -142,16 +221,18 @@ public function buildWhereClause() { $wcxc = ''; $wcxa = ''; $wcxt = ''; + $wcct = ''; + $wcxct = ''; if(is_user_logged_in()) { get_currentuserinfo(); $uSlug = $current_user->user_login; - $wcul = "IF($aTable.ad_users_reg = 1, IF($aTable.x_ad_users = 1, NOT FIND_IN_SET(\"$uSlug\", $aTable.x_view_users), TRUE) AND IF($aTable.ad_users_adv = 1, ($aTable.adv_nick <> \"$uSlug\"), TRUE), FALSE)"; + $wcul = "IF(sa.ad_users_reg = 1, IF(sa.x_ad_users = 1, NOT FIND_IN_SET(\"$uSlug\", sa.x_view_users), TRUE) AND IF(sa.ad_users_adv = 1, (sa.adv_nick <> \"$uSlug\"), TRUE), FALSE)"; } else { - $wcul = "($aTable.ad_users_unreg = 1)"; + $wcul = "(sa.ad_users_unreg = 1)"; } - $wcu = "(IF($aTable.ad_users = 0, TRUE, $wcul)) AND"; + $wcu = "(IF(sa.ad_users = 0, TRUE, $wcul)) AND"; if(is_home() || is_front_page()) $viewPages += SAM_IS_HOME; if(is_singular()) { @@ -161,8 +242,8 @@ public function buildWhereClause() { $viewPages |= SAM_IS_POST_TYPE; $postType = get_post_type(); - $wct .= " AND IF($aTable.view_type < 2 AND $aTable.ad_custom AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"$postType\", $aTable.view_custom), TRUE)"; - $wcxt .= " AND IF($aTable.view_type < 2 AND $aTable.x_custom AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"$postType\", $aTable.x_view_custom), TRUE)"; + $wct .= " AND IF(sa.view_type < 2 AND sa.ad_custom AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"$postType\", sa.view_custom), TRUE)"; + $wcxt .= " AND IF(sa.view_type < 2 AND sa.x_custom AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"$postType\", sa.x_view_custom), TRUE)"; } if(is_single()) { global $post; @@ -171,17 +252,18 @@ public function buildWhereClause() { $categories = get_the_category($post->ID); $tags = get_the_tags(); $postID = ((!empty($post->ID)) ? $post->ID : 0); + $customTerms = self::customTaxonomiesTerms($postID); if(!empty($categories)) { $wcc_0 = ''; $wcxc_0 = ''; - $wcc = " AND IF($aTable.view_type < 2 AND $aTable.ad_cats AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE),"; - $wcxc = " AND IF($aTable.view_type < 2 AND $aTable.x_cats AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE),"; + $wcc = " AND IF(sa.view_type < 2 AND sa.ad_cats AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; + $wcxc = " AND IF(sa.view_type < 2 AND sa.x_cats AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; foreach($categories as $category) { - if(empty($wcc_0)) $wcc_0 = " FIND_IN_SET(\"{$category->category_nicename}\", $aTable.view_cats)"; - else $wcc_0 .= " OR FIND_IN_SET(\"{$category->category_nicename}\", $aTable.view_cats)"; - if(empty($wcxc_0)) $wcxc_0 = " (NOT FIND_IN_SET(\"{$category->category_nicename}\", $aTable.x_view_cats))"; - else $wcxc_0 .= " AND (NOT FIND_IN_SET(\"{$category->category_nicename}\", $aTable.x_view_cats))"; + if(empty($wcc_0)) $wcc_0 = " FIND_IN_SET(\"{$category->category_nicename}\", sa.view_cats)"; + else $wcc_0 .= " OR FIND_IN_SET(\"{$category->category_nicename}\", sa.view_cats)"; + if(empty($wcxc_0)) $wcxc_0 = " (NOT FIND_IN_SET(\"{$category->category_nicename}\", sa.x_view_cats))"; + else $wcxc_0 .= " AND (NOT FIND_IN_SET(\"{$category->category_nicename}\", sa.x_view_cats))"; } $wcc .= $wcc_0.", TRUE)"; $wcxc .= $wcxc_0.", TRUE)"; @@ -190,31 +272,46 @@ public function buildWhereClause() { if(!empty($tags)) { $wct_0 = ''; $wcxt_0 = ''; - $wct .= " AND IF($aTable.view_type < 2 AND $aTable.ad_tags AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE),"; - $wcxt .= " AND IF($aTable.view_type < 2 AND $aTable.x_tags AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE),"; + $wct .= " AND IF(sa.view_type < 2 AND sa.ad_tags AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; + $wcxt .= " AND IF(sa.view_type < 2 AND sa.x_tags AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; foreach($tags as $tag) { - if(empty($wct_0)) $wct_0 = " FIND_IN_SET(\"{$tag->slug}\", $aTable.view_tags)"; - else $wct_0 .= " OR FIND_IN_SET(\"{$tag->slug}\", $aTable.view_tags)"; - if(empty($wcxt_0)) $wcxt_0 = " (NOT FIND_IN_SET(\"{$tag->slug}\", $aTable.x_view_tags))"; - else $wcxt_0 .= " AND (NOT FIND_IN_SET(\"{$tag->slug}\", $aTable.x_view_tags))"; + if(empty($wct_0)) $wct_0 = " FIND_IN_SET(\"{$tag->slug}\", sa.view_tags)"; + else $wct_0 .= " OR FIND_IN_SET(\"{$tag->slug}\", sa.view_tags)"; + if(empty($wcxt_0)) $wcxt_0 = " (NOT FIND_IN_SET(\"{$tag->slug}\", sa.x_view_tags))"; + else $wcxt_0 .= " AND (NOT FIND_IN_SET(\"{$tag->slug}\", sa.x_view_tags))"; } $wct .= $wct_0.", TRUE)"; $wcxt .= $wcxt_0.", TRUE)"; } - $wci = " OR ($aTable.view_type = 2 AND FIND_IN_SET({$postID}, $aTable.view_id))"; - $wcx = " AND IF($aTable.x_id, NOT FIND_IN_SET({$postID}, $aTable.x_view_id), TRUE)"; + if(!empty($customTerms)) { + $wcct_0 = ''; + $wcxct_0 = ''; + $wcct .= " AND IF(sa.view_type < 2 AND sa.ad_custom_tax_terms AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; + $wcxct .= " AND IF(sa.view_type < 2 AND sa.x_ad_custom_tax_terms AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; + foreach($customTerms as $cTerm) { + if(empty($wcct_0)) $wcct_0 = " FIND_IN_SET(\"{$cTerm}\", sa.view_custom_tax_terms)"; + else $wcct_0 .= " OR FIND_IN_SET(\"{$cTerm}\", sa.view_custom_tax_terms)"; + if(empty($wcxct_0)) $wcxct_0 = " (NOT FIND_IN_SET(\"{$cTerm}\", sa.x_view_custom_tax_terms))"; + else $wcxct_0 .= " AND (NOT FIND_IN_SET(\"{$cTerm}\", sa.x_view_custom_tax_terms))"; + } + $wcct .= $wcct_0 . ", TRUE)"; + $wcxct .= $wcxct_0 . ", TRUE)"; + } + + $wci = " OR (sa.view_type = 2 AND FIND_IN_SET({$postID}, sa.view_id))"; + $wcx = " AND IF(sa.x_id, NOT FIND_IN_SET({$postID}, sa.x_view_id), TRUE)"; $author = get_userdata($post->post_author); - $wca = " AND IF($aTable.view_type < 2 AND $aTable.ad_authors AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"{$author->display_name}\", $aTable.view_authors), TRUE)"; - $wcxa = " AND IF($aTable.view_type < 2 AND $aTable.x_authors AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"{$author->display_name}\", $aTable.x_view_authors), TRUE)"; + $wca = " AND IF(sa.view_type < 2 AND sa.ad_authors AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"{$author->user_login}\", sa.view_authors), TRUE)"; + $wcxa = " AND IF(sa.view_type < 2 AND sa.x_authors AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"{$author->user_login}\", sa.x_view_authors), TRUE)"; } if(is_page()) { global $post; $postID = ((!empty($post->ID)) ? $post->ID : 0); $viewPages |= SAM_IS_PAGE; - $wci = " OR ($aTable.view_type = 2 AND FIND_IN_SET({$postID}, $aTable.view_id))"; - $wcx = " AND IF($aTable.x_id, NOT FIND_IN_SET({$postID}, $aTable.x_view_id), TRUE)"; + $wci = " OR (sa.view_type = 2 AND FIND_IN_SET({$postID}, sa.view_id))"; + $wcx = " AND IF(sa.x_id, NOT FIND_IN_SET({$postID}, sa.x_view_id), TRUE)"; } if(is_attachment()) $viewPages |= SAM_IS_ATTACHMENT; } @@ -222,50 +319,55 @@ public function buildWhereClause() { if(is_404()) $viewPages |= SAM_IS_404; if(is_archive()) { $viewPages |= SAM_IS_ARCHIVE; - if(is_tax()) $viewPages |= SAM_IS_TAX; + if(is_tax()) { + $viewPages |= SAM_IS_TAX; + $term = get_query_var('term'); + $wcct = " AND IF(sa.view_type < 2 AND sa.ad_custom_tax_terms AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$term}', sa.view_custom_tax_terms), TRUE)"; + $wcxct = " AND IF(sa.view_type < 2 AND sa.x_ad_custom_tax_terms AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$term}', sa.x_view_custom_tax_terms), TRUE)"; + } if(is_category()) { $viewPages |= SAM_IS_CATEGORY; $cat = get_category(get_query_var('cat'), false); - $wcc = " AND IF($aTable.view_type < 2 AND $aTable.ad_cats AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"{$cat->category_nicename}\", $aTable.view_cats), TRUE)"; - $wcxc = " AND IF($aTable.view_type < 2 AND $aTable.x_cats AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"{$cat->category_nicename}\", $aTable.x_view_cats), TRUE)"; + $wcc = " AND IF(sa.view_type < 2 AND sa.ad_cats AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"{$cat->category_nicename}\", sa.view_cats), TRUE)"; + $wcxc = " AND IF(sa.view_type < 2 AND sa.x_cats AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"{$cat->category_nicename}\", sa.x_view_cats), TRUE)"; } if(is_tag()) { $viewPages |= SAM_IS_TAG; $tag = get_tag(get_query_var('tag_id')); - $wct = " AND IF($aTable.view_type < 2 AND $aTable.ad_tags AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$tag->slug}', $aTable.view_tags), TRUE)"; - $wcxt = " AND IF($aTable.view_type < 2 AND $aTable.x_tags AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$tag->slug}', $aTable.x_view_tags), TRUE)"; + $wct = " AND IF(sa.view_type < 2 AND sa.ad_tags AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$tag->slug}', sa.view_tags), TRUE)"; + $wcxt = " AND IF(sa.view_type < 2 AND sa.x_tags AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$tag->slug}', sa.x_view_tags), TRUE)"; } if(is_author()) { global $wp_query; $viewPages |= SAM_IS_AUTHOR; $author = $wp_query->get_queried_object(); - $wca = " AND IF($aTable.view_type < 2 AND $aTable.ad_authors = 1 AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$author->display_name}', $aTable.view_authors), TRUE)"; - $wcxa = " AND IF($aTable.view_type < 2 AND $aTable.x_authors AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$author->display_name}', $aTable.x_view_authors), TRUE)"; + $wca = " AND IF(sa.view_type < 2 AND sa.ad_authors = 1 AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$author->user_login}', sa.view_authors), TRUE)"; + $wcxa = " AND IF(sa.view_type < 2 AND sa.x_authors AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$author->user_login}', sa.x_view_authors), TRUE)"; } if(is_post_type_archive()) { $viewPages |= SAM_IS_POST_TYPE_ARCHIVE; //$postType = post_type_archive_title( '', false ); $postType = get_post_type(); - $wct = " AND IF($aTable.view_type < 2 AND $aTable.ad_custom AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$postType}', $aTable.view_custom), TRUE)"; - $wcxt = " AND IF($aTable.view_type < 2 AND $aTable.x_custom AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$postType}', $aTable.x_view_custom), TRUE)"; + $wct = " AND IF(sa.view_type < 2 AND sa.ad_custom AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$postType}', sa.view_custom), TRUE)"; + $wcxt = " AND IF(sa.view_type < 2 AND sa.x_custom AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$postType}', sa.x_view_custom), TRUE)"; } if(is_date()) $viewPages |= SAM_IS_DATE; } - if(empty($wcc)) $wcc = " AND ($aTable.ad_cats = 0)"; - if(empty($wca)) $wca = " AND ($aTable.ad_authors = 0)"; + if(empty($wcc)) $wcc = " AND (sa.ad_cats = 0)"; + if(empty($wca)) $wca = " AND (sa.ad_authors = 0)"; - $whereClause = "$wcu (($aTable.view_type = 1)"; - $whereClause .= " OR ($aTable.view_type = 0 AND ($aTable.view_pages+0 & $viewPages))"; + $whereClause = "$wcu ((sa.view_type = 1)"; + $whereClause .= " OR (sa.view_type = 0 AND (sa.view_pages+0 & $viewPages))"; $whereClause .= "$wci)"; - $whereClause .= "$wcc $wca $wct $wcx $wcxc $wcxa $wcxt"; - $whereClauseT = " AND IF($aTable.ad_schedule, CURDATE() BETWEEN $aTable.ad_start_date AND $aTable.ad_end_date, TRUE)"; - $whereClauseT .= " AND IF($aTable.limit_hits, $aTable.hits_limit > $aTable.ad_hits, TRUE)"; - $whereClauseT .= " AND IF($aTable.limit_clicks, $aTable.clicks_limit > $aTable.ad_clicks, TRUE)"; + $whereClause .= "$wcc $wca $wct $wcct $wcx $wcxc $wcxa $wcxt $wcxct"; + $whereClauseT = " AND IF(sa.ad_schedule, CURDATE() BETWEEN sa.ad_start_date AND sa.ad_end_date, TRUE)"; + $whereClauseT .= " AND IF(sa.limit_hits, sa.hits_limit > sa.ad_hits, TRUE)"; + $whereClauseT .= " AND IF(sa.limit_clicks, sa.clicks_limit > sa.ad_clicks, TRUE)"; - $whereClauseW = " AND IF($aTable.ad_weight > 0, ($aTable.ad_weight_hits*10/($aTable.ad_weight*$cycle)) < 1, FALSE)"; - $whereClause2W = "AND ($aTable.ad_weight > 0)"; + $whereClauseW = " AND IF(sa.ad_weight > 0, (sa.ad_weight_hits*10/(sa.ad_weight*$cycle)) < 1, FALSE)"; + $whereClause2W = "AND (sa.ad_weight > 0)"; return array('WC' => $whereClause, 'WCT' => $whereClauseT, 'WCW' => $whereClauseW, 'WC2W' => $whereClause2W); } @@ -275,20 +377,20 @@ public function headerScripts() { $this->samNonce = wp_create_nonce('samNonce'); $options = self::getSettings(); - $this->whereClauses = self::buildWhereClause(); + if(empty($this->whereClauses)) $this->whereClauses = self::buildWhereClause(); $SAM_Query = array('clauses' => $this->whereClauses); $clauses64 = base64_encode(serialize($SAM_Query['clauses'])); - //$dClauses64 = unserialize(base64_decode($clauses64)); wp_enqueue_script('jquery'); if($options['useSWF']) wp_enqueue_script('swfobject'); - wp_enqueue_script('samLayout', SAM_URL.'js/sam-layout.js', array('jquery'), SAM_VERSION); + wp_enqueue_script('samLayout', SAM_URL.'js/sam-layout.min.js', array('jquery'), SAM_VERSION); wp_localize_script('samLayout', 'samAjax', array( 'ajaxurl' => SAM_URL . 'sam-ajax.php', + 'loadurl' => SAM_URL . 'sam-ajax-loader.php', + 'load' => ($this->samOptions['adShow'] == 'js'), 'level' => count(explode('/', str_replace( ABSPATH, '', dirname( __FILE__ ) ))), - //'queries' => $dClauses64, - 'clauses' => $clauses64 //$this->whereClauses + 'clauses' => $clauses64 ) ); } @@ -333,8 +435,8 @@ private function isCrawler() { break; case 'exact': - if(!class_exists('Browser')) include_once('browser.php'); - $browser = new Browser(); + if(!class_exists('samBrowser')) include_once('sam-browser.php'); + $browser = new samBrowser(); $crawler = $browser->isRobot(); break; @@ -417,31 +519,31 @@ public function buildAdBlock( $args = null ) { } public function doAdShortcode($atts) { - extract(shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts )); - $ad = new SamAd(array('id' => $id, 'name' => $name), ($codes == 'true'), $this->crawler); + shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts ); + $ad = new SamAd(array('id' => $atts['id'], 'name' => $atts['name']), ($atts['codes'] == 'true'), $this->crawler); return $ad->ad; } public function doShortcode( $atts ) { - extract(shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts )); - $ad = new SamAdPlace(array('id' => $id, 'name' => $name), ($codes == 'true'), $this->crawler); + shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts ); + $ad = new SamAdPlace(array('id' => $atts['id'], 'name' => $atts['name']), ($atts['codes'] == 'true'), $this->crawler); return $ad->ad; } public function doZoneShortcode($atts) { - extract(shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts )); - $ad = new SamAdPlaceZone(array('id' => $id, 'name' => $name), ($codes == 'true'), $this->crawler); + shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts ); + $ad = new SamAdPlaceZone(array('id' => $atts['id'], 'name' => $atts['name']), ($atts['codes'] == 'true'), $this->crawler); return $ad->ad; } public function doBlockShortcode($atts) { - extract(shortcode_atts( array( 'id' => '', 'name' => ''), $atts )); - $block = new SamAdBlock(array('id' => $id, 'name' => $name), $this->crawler); + shortcode_atts( array( 'id' => '', 'name' => ''), $atts ); + $block = new SamAdBlock(array('id' => $atts['id'], 'name' => $atts['name']), $this->crawler); return $block->ad; } public function addContentAds( $content ) { - $options = $this->getSettings(); + $options = self::getSettings(); $bpAd = ''; $apAd = ''; $mpAd = ''; @@ -454,6 +556,10 @@ public function addContentAds( $content ) { if(!empty($options['afterPost']) && !empty($options['apAdsId'])) $apAd = $this->buildAd(array('id' => $options['apAdsId']), $options['apUseCodes']); } + elseif($options['bpExcerpt']) { + if(!empty($options['beforePost']) && !empty($options['bpAdsId'])) + $bpAd = $this->buildAd(array('id' => $options['bpAdsId']), $options['bpUseCodes']); + } if(!empty($mpAd)) { $xc = explode("\r\n", $content); @@ -465,6 +571,69 @@ public function addContentAds( $content ) { } else return $bpAd.$content.$apAd; } + + public function addExcerptAds( $excerpt ) { + $options = self::getSettings(); + $bpAd = ''; + if(!is_single()) { + if(empty($this->whereClauses)) $this->whereClauses = self::buildWhereClause(); + + if(!empty($options['beforePost']) && !empty($options['bpExcerpt']) && !empty($options['bpAdsId'])) { + $oBpAd = new SamAdPlace(array('id' => $options['bpAdsId']), $options['bpUseCodes'], false, $this->whereClauses); + $bpAd = $oBpAd->ad; + } + + return $bpAd.$excerpt; + } + else return $excerpt; + } + + public function addBbpContentAds( $content, $reply_id ) { + $options = self::getSettings(); + $bpAd = ''; + $apAd = ''; + $mpAd = ''; + if(empty($this->whereClauses)) $this->whereClauses = self::buildWhereClause(); + + if(!empty($options['bbpBeforePost']) && !empty($options['bpAdsId'])) { + $oBpAd = new SamAdPlace(array('id' => $options['bpAdsId']), $options['bpUseCodes'], false, $this->whereClauses); + $bpAd = $oBpAd->ad; + } + if(!empty($options['bbpMiddlePost']) && !empty($options['mpAdsId'])) { + $oMpAd = new SamAdPlace(array('id' => $options['mpAdsId']), $options['mpUseCodes'], false, $this->whereClauses); + $mpAd = $oMpAd->ad; + } + if(!empty($options['bbpAfterPost']) && !empty($options['apAdsId'])) { + $oApAd = new SamAdPlace(array('id' => $options['apAdsId']), $options['apUseCodes'], false, $this->whereClauses); + $apAd = $oApAd->ad; + } + + if(!empty($mpAd)) { + $xc = explode("\r\n", $content); + if(count($xc) < 3) return $bpAd.$content.$apAd; + else { + $hm = ceil(count($xc)/2); + $cntFirst = implode("\r\n", array_slice($xc, 0, $hm)); + $cntLast = implode("\r\n", array_slice($xc, $hm)); + + return $bpAd.$cntFirst.$mpAd.$cntLast.$apAd; + } + } + else return $bpAd.$content.$apAd; + } + + public function addBbpForumAds() { + $options = self::getSettings(); + $bpAd = ''; + if(empty($this->whereClauses)) $this->whereClauses = self::buildWhereClause(); + + if(!empty($options['bbpList']) && !empty($options['bpAdsId'])) { + $oBpAd = new SamAdPlace(array('id' => $options['bpAdsId']), $options['bpUseCodes'], false, $this->whereClauses); + $bpAd = $oBpAd->ad; + } + + echo $bpAd; + } } // end of class definition } // end of if not class SimpleAdsManager exists ?> \ No newline at end of file diff --git a/sam.tools.php b/sam.tools.php new file mode 100644 index 0000000..bf68d23 --- /dev/null +++ b/sam.tools.php @@ -0,0 +1,185 @@ +options = $settings; + $this->advertisersList = self::getAdvertisersList(); + } + + private function getAdvertisersList() { + global $wpdb; + + $aTable = $wpdb->prefix . 'sam_ads'; + + $sql = "SELECT sa.adv_nick, sa.adv_name, sa.adv_mail FROM $aTable sa WHERE sa.adv_mail > '' GROUP BY sa.adv_mail;"; + $list = $wpdb->get_results($sql, ARRAY_A); + + return $list; + } + + private function parseText( $text, $advert ) { + $out = str_replace('[name]', $advert['adv_name'], $text); + $out = str_replace('[site]', get_bloginfo('name'), $out); + $out = str_replace('Simple Ads Manager', "Simple Ads Manager", $out); + $out = str_replace('[month', $this->month, $out); + + return $out; + } + + private function buildMessage( $user ) { + global $wpdb; + + $options = $this->options; + $aTable = $wpdb->prefix . 'sam_ads'; + $sTable = $wpdb->prefix . 'sam_stats'; + $greeting = self::parseText($options['mail_greeting'], $user); + $textBefore = self::parseText($options['mail_text_before'], $user); + $textAfter = self::parseText($options['mail_text_after'], $user); + $warning = self::parseText($options['mail_warning'], $user); + $message = self::parseText($options['mail_message'], $user); + + $date = new DateTime('now'); + $date->modify('-1 month'); + $month = $date->format('Y-m-d'); + $monthL = $date->format('Y-m-t'); + $this->month = $date->format('F'); + + $sql = "SELECT + sa.id, + sa.pid, + sa.name, + sa.description, + @ad_hits := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, + @ad_clicks := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, + (sa.cpm / @ad_hits * 1000) AS e_cpm, + sa.cpc AS e_cpc, + (@ad_clicks / @ad_hits * 100) AS e_ctr + FROM $aTable sa + WHERE sa.adv_mail = %s AND sa.trash = FALSE AND NOT (sa.ad_schedule AND sa.ad_end_date <= %s);"; + $ads = $wpdb->get_results($wpdb->prepare($sql, $month, $month, $user['adv_mail'], $monthL), ARRAY_A); + + $mess = ''; + + if(!empty($ads) && is_array($ads)) { + $sql = "SELECT COUNT(*) + FROM $sTable ss + INNER JOIN $aTable sa + ON ss.id = sa.id + WHERE sa.adv_mail = %s + AND sa.trash = FALSE + AND (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = %d"; + $hits = $wpdb->get_var($wpdb->prepare($sql, $user['adv_mail'], $month, 0)); + $clicks = $wpdb->get_var($wpdb->prepare($sql, $user['adv_mail'], $month, 1)); + + $mess .= " + + + + Ad campaign report + + + +

        {$greeting}

        +

        {$textBefore}

        + + + + + + + + + + + + + "; + $k = 0; + foreach($ads as $ad) { + $class = ( ($k % 2) == 1 ) ? 'odd' : 'even'; + $mess .= ""; + $k++; + } + $mess .= "
        NameDescriptionHitsClicksCPMCPCCTR
        {$ad['name']}{$ad['description']}{$ad['ad_hits']}{$ad['ad_clicks']}{$ad['e_cpm']}{$ad['e_cpc']}{$ad['e_ctr']}
        "; + $mess .= " +

        Hits: {$hits}

        +

        Clicks: {$clicks}

        +

        {$textAfter}

        +

        {$warning}

        +

        {$message}

        + +"; + } + + return $mess; + } + + public function setContentType() { + return 'text/html'; + } + + public function sendMails() { + $k = 0; + $advertisers = $this->advertisersList; + if(!empty($advertisers) && is_array($advertisers)) { + $headers = 'Content-type: text/html; charset=UTF-8' . "\r\n"; + //$headers .= 'From: Tests ' . "\r\n"; + foreach($advertisers as $adv) { + $subject = self::parseText($this->options['mail_subject'], $adv); + $message = self::buildMessage($adv); + wp_mail($adv['adv_mail'], $subject, $message, $headers); + $k++; + } + } + return $k; + } + } +} \ No newline at end of file diff --git a/simple-ads-manager-ru_RU.mo b/simple-ads-manager-ru_RU.mo deleted file mode 100644 index 07b1cfc..0000000 Binary files a/simple-ads-manager-ru_RU.mo and /dev/null differ diff --git a/simple-ads-manager.php b/simple-ads-manager.php index 4ef5f75..329ad4e 100644 --- a/simple-ads-manager.php +++ b/simple-ads-manager.php @@ -3,7 +3,7 @@ Plugin Name: Simple Ads Manager Plugin URI: http://www.simplelib.com/?p=480 Description: "Simple Ads Manager" is easy to use plugin providing a flexible logic of displaying advertisements. Visit SimpleLib blog for more details. -Version: 1.8.70-SE +Version: 1.8.71 Author: minimus Author URI: http://blogcoding.ru */ @@ -28,12 +28,13 @@ global $samObject, $SAM_Query; define('SAM_MAIN_FILE', __FILE__); +if(is_admin()) define('SAM_IS_ADMIN', true); include_once('ad.class.php'); include_once('sam.class.php'); if (is_admin()) { - include_once('admin.class.php'); + include_once('admin.class.php'); if (class_exists("SimpleAdsManagerAdmin") && class_exists("SimpleAdsManager")) $samObject = new SimpleAdsManagerAdmin(); } @@ -42,8 +43,8 @@ } include_once('widget.class.php'); -if(class_exists('simple_ads_manager_widget')) - add_action('widgets_init', create_function('', 'return register_widget("simple_ads_manager_widget");')); +if(class_exists('simple_ads_manager_widget')) + add_action('widgets_init', create_function('', 'return register_widget("simple_ads_manager_widget");')); if(class_exists('simple_ads_manager_zone_widget')) add_action('widgets_init', create_function('', 'return register_widget("simple_ads_manager_zone_widget");')); if(class_exists('simple_ads_manager_ad_widget')) diff --git a/simple-ads-manager.pot b/simple-ads-manager.pot deleted file mode 100644 index 97eb319..0000000 --- a/simple-ads-manager.pot +++ /dev/null @@ -1,2071 +0,0 @@ -# Copyright (C) 2010 Simple Ads Manager -# This file is distributed under the same license as the Simple Ads Manager package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Ads Manager 1.0.32\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-ads-manager\n" -"POT-Creation-Date: 2011-07-18 20:33:15+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" - -#: zone.list.admin.class.php:48 block.list.admin.class.php:48 -#: list.admin.class.php:129 list.admin.class.php:308 -msgid "«" -msgstr "" - -#: zone.list.admin.class.php:49 block.list.admin.class.php:49 -#: list.admin.class.php:130 list.admin.class.php:309 -msgid "»" -msgstr "" - -#: zone.list.admin.class.php:56 -msgid "Managing Ads Zones" -msgstr "" - -#: zone.list.admin.class.php:58 block.list.admin.class.php:58 -#: list.admin.class.php:139 list.admin.class.php:318 -msgid "All" -msgstr "" - -#: zone.list.admin.class.php:59 block.list.admin.class.php:59 -#: list.admin.class.php:140 list.admin.class.php:319 -msgid "Active" -msgstr "" - -#: zone.list.admin.class.php:60 block.list.admin.class.php:60 -#: list.admin.class.php:141 list.admin.class.php:320 -msgid "Trash" -msgstr "" - -#: zone.list.admin.class.php:65 zone.list.admin.class.php:140 -#: block.list.admin.class.php:65 block.list.admin.class.php:140 -#: list.admin.class.php:146 list.admin.class.php:267 list.admin.class.php:326 -#: list.admin.class.php:461 -msgid "Clear Trash" -msgstr "" - -#: zone.list.admin.class.php:67 zone.list.admin.class.php:142 -msgid "Add New Zone" -msgstr "" - -#: zone.list.admin.class.php:71 zone.list.admin.class.php:146 -#: block.list.admin.class.php:71 block.list.admin.class.php:146 -#: list.admin.class.php:155 list.admin.class.php:276 list.admin.class.php:336 -#: list.admin.class.php:470 -msgid "Displaying %s–%s of %s" -msgstr "" - -#: zone.list.admin.class.php:83 zone.list.admin.class.php:89 -#: block.list.admin.class.php:83 block.list.admin.class.php:89 -#: list.admin.class.php:167 list.admin.class.php:178 list.admin.class.php:350 -#: list.admin.class.php:360 -msgid "ID" -msgstr "" - -#: zone.list.admin.class.php:84 zone.list.admin.class.php:90 -msgid "Zone Name" -msgstr "" - -#: zone.list.admin.class.php:109 block.list.admin.class.php:109 -#: list.admin.class.php:212 list.admin.class.php:410 -msgid "There are no data ..." -msgstr "" - -#: zone.list.admin.class.php:117 block.list.admin.class.php:117 -#: list.admin.class.php:237 list.admin.class.php:438 -msgid "in Trash" -msgstr "" - -#: zone.list.admin.class.php:119 block.list.admin.class.php:119 -msgid "Edit Zone" -msgstr "" - -#: zone.list.admin.class.php:119 block.list.admin.class.php:119 -#: list.admin.class.php:239 list.admin.class.php:440 -msgid "Edit" -msgstr "" - -#: zone.list.admin.class.php:123 -msgid "Restore this Zone from the Trash" -msgstr "" - -#: zone.list.admin.class.php:123 block.list.admin.class.php:123 -#: list.admin.class.php:243 list.admin.class.php:444 -msgid "Restore" -msgstr "" - -#: zone.list.admin.class.php:124 -msgid "Remove this Zone permanently" -msgstr "" - -#: zone.list.admin.class.php:124 block.list.admin.class.php:124 -#: list.admin.class.php:244 list.admin.class.php:445 -msgid "Remove permanently" -msgstr "" - -#: zone.list.admin.class.php:129 -msgid "Move this Zone to the Trash" -msgstr "" - -#: zone.list.admin.class.php:129 block.list.admin.class.php:129 -#: list.admin.class.php:249 list.admin.class.php:446 -msgid "Delete" -msgstr "" - -#: block.list.admin.class.php:56 -msgid "Managing Ads Blocks" -msgstr "" - -#: block.list.admin.class.php:67 block.list.admin.class.php:142 -msgid "Add New Block" -msgstr "" - -#: block.list.admin.class.php:84 block.list.admin.class.php:90 -msgid "Block Name" -msgstr "" - -#: block.list.admin.class.php:123 -msgid "Restore this Block from the Trash" -msgstr "" - -#: block.list.admin.class.php:124 -msgid "Remove this Block permanently" -msgstr "" - -#: block.list.admin.class.php:129 -msgid "Move this Block to the Trash" -msgstr "" - -#: list.admin.class.php:23 editor.admin.class.php:71 -#: editor.admin.class.php:191 -msgid "Custom sizes" -msgstr "" - -#: list.admin.class.php:26 editor.admin.class.php:74 -#: editor.admin.class.php:135 -msgid "Large Leaderboard" -msgstr "" - -#: list.admin.class.php:27 editor.admin.class.php:75 -#: editor.admin.class.php:136 -msgid "Leaderboard" -msgstr "" - -#: list.admin.class.php:28 list.admin.class.php:30 list.admin.class.php:31 -#: editor.admin.class.php:76 editor.admin.class.php:78 -#: editor.admin.class.php:79 editor.admin.class.php:137 -#: editor.admin.class.php:139 editor.admin.class.php:140 -msgid "Small Leaderboard" -msgstr "" - -#: list.admin.class.php:29 editor.admin.class.php:77 -#: editor.admin.class.php:138 -msgid "Mega Unit" -msgstr "" - -#: list.admin.class.php:32 list.admin.class.php:33 list.admin.class.php:34 -#: list.admin.class.php:36 list.admin.class.php:37 list.admin.class.php:38 -#: editor.admin.class.php:80 editor.admin.class.php:81 -#: editor.admin.class.php:82 editor.admin.class.php:84 -#: editor.admin.class.php:85 editor.admin.class.php:86 -#: editor.admin.class.php:141 editor.admin.class.php:142 -#: editor.admin.class.php:143 editor.admin.class.php:145 -#: editor.admin.class.php:146 editor.admin.class.php:147 -msgid "Tall Banner" -msgstr "" - -#: list.admin.class.php:35 editor.admin.class.php:83 -#: editor.admin.class.php:144 -msgid "Banner" -msgstr "" - -#: list.admin.class.php:39 list.admin.class.php:41 list.admin.class.php:71 -#: list.admin.class.php:72 editor.admin.class.php:87 editor.admin.class.php:89 -#: editor.admin.class.php:119 editor.admin.class.php:120 -#: editor.admin.class.php:148 editor.admin.class.php:150 -#: editor.admin.class.php:184 editor.admin.class.php:185 -msgid "Half Banner" -msgstr "" - -#: list.admin.class.php:40 list.admin.class.php:69 list.admin.class.php:70 -#: editor.admin.class.php:88 editor.admin.class.php:117 -#: editor.admin.class.php:118 editor.admin.class.php:149 -#: editor.admin.class.php:182 editor.admin.class.php:183 -msgid "Tall Half Banner" -msgstr "" - -#: list.admin.class.php:42 list.admin.class.php:43 list.admin.class.php:68 -#: list.admin.class.php:75 list.admin.class.php:76 editor.admin.class.php:90 -#: editor.admin.class.php:91 editor.admin.class.php:116 -#: editor.admin.class.php:123 editor.admin.class.php:124 -#: editor.admin.class.php:151 editor.admin.class.php:152 -#: editor.admin.class.php:181 editor.admin.class.php:188 -#: editor.admin.class.php:189 -msgid "Button" -msgstr "" - -#: list.admin.class.php:44 editor.admin.class.php:92 -#: editor.admin.class.php:153 -msgid "Micro Bar" -msgstr "" - -#: list.admin.class.php:45 list.admin.class.php:46 list.admin.class.php:47 -#: list.admin.class.php:48 editor.admin.class.php:93 editor.admin.class.php:94 -#: editor.admin.class.php:95 editor.admin.class.php:96 -#: editor.admin.class.php:154 editor.admin.class.php:155 -#: editor.admin.class.php:156 editor.admin.class.php:157 -msgid "Thin Banner" -msgstr "" - -#: list.admin.class.php:45 list.admin.class.php:46 list.admin.class.php:47 -#: list.admin.class.php:48 list.admin.class.php:69 list.admin.class.php:70 -#: list.admin.class.php:71 list.admin.class.php:72 list.admin.class.php:73 -#: list.admin.class.php:74 list.admin.class.php:75 list.admin.class.php:76 -#: editor.admin.class.php:93 editor.admin.class.php:94 -#: editor.admin.class.php:95 editor.admin.class.php:96 -#: editor.admin.class.php:117 editor.admin.class.php:118 -#: editor.admin.class.php:119 editor.admin.class.php:120 -#: editor.admin.class.php:121 editor.admin.class.php:122 -#: editor.admin.class.php:123 editor.admin.class.php:124 -#: editor.admin.class.php:154 editor.admin.class.php:155 -#: editor.admin.class.php:156 editor.admin.class.php:157 -#: editor.admin.class.php:182 editor.admin.class.php:183 -#: editor.admin.class.php:184 editor.admin.class.php:185 -#: editor.admin.class.php:186 editor.admin.class.php:187 -#: editor.admin.class.php:188 editor.admin.class.php:189 -msgid "%d Link" -msgid_plural "%d Links" -msgstr[0] "" -msgstr[1] "" - -#: list.admin.class.php:49 editor.admin.class.php:97 -#: editor.admin.class.php:160 -msgid "Wide Skyscraper" -msgstr "" - -#: list.admin.class.php:50 editor.admin.class.php:98 -#: editor.admin.class.php:161 -msgid "Skyscraper" -msgstr "" - -#: list.admin.class.php:51 editor.admin.class.php:99 -#: editor.admin.class.php:162 -msgid "Wide Half Banner" -msgstr "" - -#: list.admin.class.php:52 editor.admin.class.php:100 -#: editor.admin.class.php:163 -msgid "Vertical Rectangle" -msgstr "" - -#: list.admin.class.php:53 list.admin.class.php:54 editor.admin.class.php:101 -#: editor.admin.class.php:102 editor.admin.class.php:164 -#: editor.admin.class.php:165 -msgid "Tall Rectangle" -msgstr "" - -#: list.admin.class.php:55 editor.admin.class.php:103 -#: editor.admin.class.php:166 -msgid "Vertical Banner" -msgstr "" - -#: list.admin.class.php:56 editor.admin.class.php:104 -#: editor.admin.class.php:169 -msgid "Large Rectangle" -msgstr "" - -#: list.admin.class.php:57 list.admin.class.php:58 editor.admin.class.php:105 -#: editor.admin.class.php:106 editor.admin.class.php:170 -#: editor.admin.class.php:171 -msgid "Wide Rectangle" -msgstr "" - -#: list.admin.class.php:59 editor.admin.class.php:107 -#: editor.admin.class.php:172 -msgid "Medium Rectangle" -msgstr "" - -#: list.admin.class.php:60 list.admin.class.php:61 editor.admin.class.php:108 -#: editor.admin.class.php:109 editor.admin.class.php:173 -#: editor.admin.class.php:174 -msgid "Small Wide Rectangle" -msgstr "" - -#: list.admin.class.php:62 editor.admin.class.php:110 -#: editor.admin.class.php:175 -msgid "Mini Wide Rectangle" -msgstr "" - -#: list.admin.class.php:63 editor.admin.class.php:111 -#: editor.admin.class.php:176 editor.admin.class.php:196 -msgid "Square" -msgstr "" - -#: list.admin.class.php:64 list.admin.class.php:67 editor.admin.class.php:112 -#: editor.admin.class.php:115 editor.admin.class.php:177 -#: editor.admin.class.php:180 -msgid "Small Square" -msgstr "" - -#: list.admin.class.php:65 list.admin.class.php:66 editor.admin.class.php:113 -#: editor.admin.class.php:114 editor.admin.class.php:178 -#: editor.admin.class.php:179 -msgid "Small Rectangle" -msgstr "" - -#: list.admin.class.php:73 list.admin.class.php:74 editor.admin.class.php:121 -#: editor.admin.class.php:122 editor.admin.class.php:186 -#: editor.admin.class.php:187 -msgid "Tall Button" -msgstr "" - -#: list.admin.class.php:137 -msgid "Managing Ads Places" -msgstr "" - -#: list.admin.class.php:148 list.admin.class.php:269 -msgid "Add New Place" -msgstr "" - -#: list.admin.class.php:152 list.admin.class.php:273 -msgid "Reset Statistics" -msgstr "" - -#: list.admin.class.php:168 list.admin.class.php:179 -msgid "Place Name" -msgstr "" - -#: list.admin.class.php:169 list.admin.class.php:180 -#: editor.admin.class.php:345 editor.admin.class.php:760 -msgid "Size" -msgstr "" - -#: list.admin.class.php:170 list.admin.class.php:181 list.admin.class.php:230 -#: list.admin.class.php:353 list.admin.class.php:363 list.admin.class.php:431 -#: editor.admin.class.php:754 -msgid "Hits" -msgstr "" - -#: list.admin.class.php:171 list.admin.class.php:182 -msgid "Total Hits" -msgstr "" - -#: list.admin.class.php:172 list.admin.class.php:183 -msgid "Total Ads" -msgstr "" - -#: list.admin.class.php:173 list.admin.class.php:184 list.admin.class.php:355 -#: list.admin.class.php:365 -msgid "Earnings" -msgstr "" - -#: list.admin.class.php:229 list.admin.class.php:430 -msgid "Placement" -msgstr "" - -#: list.admin.class.php:231 list.admin.class.php:354 list.admin.class.php:364 -#: list.admin.class.php:432 editor.admin.class.php:756 -msgid "Clicks" -msgstr "" - -#: list.admin.class.php:232 list.admin.class.php:433 -msgid "Total" -msgstr "" - -#: list.admin.class.php:232 list.admin.class.php:433 -msgid "N/A" -msgstr "" - -#: list.admin.class.php:239 -msgid "Edit Place" -msgstr "" - -#: list.admin.class.php:243 -msgid "Restore this Place from the Trash" -msgstr "" - -#: list.admin.class.php:244 -msgid "Remove this Place permanently" -msgstr "" - -#: list.admin.class.php:249 -msgid "Move this Place to the Trash" -msgstr "" - -#: list.admin.class.php:250 -msgid "View List of Place Ads" -msgstr "" - -#: list.admin.class.php:250 -msgid "View Ads" -msgstr "" - -#: list.admin.class.php:251 -msgid "Create New Ad" -msgstr "" - -#: list.admin.class.php:251 -msgid "New Ad" -msgstr "" - -#: list.admin.class.php:316 -msgid "Managing Items of Ads Place" -msgstr "" - -#: list.admin.class.php:328 list.admin.class.php:463 -msgid "Add New Ad" -msgstr "" - -#: list.admin.class.php:332 list.admin.class.php:467 -msgid "Back to Ads Places Management" -msgstr "" - -#: list.admin.class.php:351 list.admin.class.php:361 -msgid "Advertisement" -msgstr "" - -#: list.admin.class.php:352 list.admin.class.php:362 -#: editor.admin.class.php:752 -msgid "Activity" -msgstr "" - -#: list.admin.class.php:424 -msgid "Yes" -msgstr "" - -#: list.admin.class.php:425 -msgid "No" -msgstr "" - -#: list.admin.class.php:440 -msgid "Edit this Item of Ads Place" -msgstr "" - -#: list.admin.class.php:444 -msgid "Restore this Ad from the Trash" -msgstr "" - -#: list.admin.class.php:445 -msgid "Remove this Ad permanently" -msgstr "" - -#: list.admin.class.php:446 -msgid "Move this item to the Trash" -msgstr "" - -#: admin.class.php:347 -msgid "General Settings" -msgstr "" - -#: admin.class.php:348 -msgid "Auto Inserting Settings" -msgstr "" - -#: admin.class.php:349 -msgid "Google DFP Settings" -msgstr "" - -#: admin.class.php:350 admin.class.php:458 -msgid "Statistics Settings" -msgstr "" - -#: admin.class.php:351 -msgid "Admin Layout" -msgstr "" - -#: admin.class.php:352 -msgid "Plugin Deactivating" -msgstr "" - -#: admin.class.php:354 -msgid "Views per Cycle" -msgstr "" - -#: admin.class.php:354 -msgid "" -"Number of hits of one ad for a full cycle of rotation (maximal activity)." -msgstr "" - -#: admin.class.php:355 -msgid "Display Ad Source in" -msgstr "" - -#: admin.class.php:355 -msgid "Target wintow (tab) for advetisement source." -msgstr "" - -#: admin.class.php:355 -msgid "New Window (Tab)" -msgstr "" - -#: admin.class.php:355 -msgid "Current Window (Tab)" -msgstr "" - -#: admin.class.php:357 -msgid "Ads Place before content" -msgstr "" - -#: admin.class.php:358 -msgid "Allow Ads Place auto inserting before post/page content" -msgstr "" - -#: admin.class.php:359 admin.class.php:362 -msgid "Allow using predefined Ads Place HTML codes (before and after codes)" -msgstr "" - -#: admin.class.php:360 -msgid "Ads Place after content" -msgstr "" - -#: admin.class.php:361 -msgid "Allow Ads Place auto inserting after post/page content" -msgstr "" - -#: admin.class.php:364 -msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" -msgstr "" - -#: admin.class.php:365 -msgid "Google DFP Pub Code" -msgstr "" - -#: admin.class.php:365 -msgid "Your Google DFP Pub code. i.e:" -msgstr "" - -#: admin.class.php:367 -msgid "Allow Bots and Crawlers detection" -msgstr "" - -#: admin.class.php:368 -msgid "Accuracy of Bots and Crawlers Detection" -msgstr "" - -#: admin.class.php:368 -msgid "" -"If bot is detected hits of ads won't be counted. Use with caution! More " -"exact detection requires more server resources." -msgstr "" - -#: admin.class.php:368 -msgid "Inexact detection" -msgstr "" - -#: admin.class.php:368 -msgid "Exact detection" -msgstr "" - -#: admin.class.php:368 -msgid "More exact detection" -msgstr "" - -#: admin.class.php:369 admin.class.php:460 -msgid "Display of Currency" -msgstr "" - -#: admin.class.php:369 admin.class.php:460 -msgid "" -"Define display of currency. Auto - auto detection of currency from blog " -"settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." -msgstr "" - -#: admin.class.php:369 -msgid "Auto" -msgstr "" - -#: admin.class.php:369 -msgid "USD" -msgstr "" - -#: admin.class.php:369 -msgid "EUR" -msgstr "" - -#: admin.class.php:371 -msgid "Ads Places per Page" -msgstr "" - -#: admin.class.php:371 -msgid "" -"Ads Places Management grid pagination. How many Ads Places will be shown on " -"one page of grid." -msgstr "" - -#: admin.class.php:372 -msgid "Ads per Page" -msgstr "" - -#: admin.class.php:372 -msgid "" -"Ads of Ads Place Management grid pagination. How many Ads will be shown on " -"one page of grid." -msgstr "" - -#: admin.class.php:374 -msgid "Delete plugin options during deactivating plugin" -msgstr "" - -#: admin.class.php:375 -msgid "Delete database tables of plugin during deactivating plugin" -msgstr "" - -#: admin.class.php:376 -msgid "Delete custom images folder of plugin during deactivating plugin" -msgstr "" - -#: admin.class.php:382 -msgid "Ads" -msgstr "" - -#: admin.class.php:383 -msgid "Ads List" -msgstr "" - -#: admin.class.php:383 -msgid "Ads Places" -msgstr "" - -#: admin.class.php:385 -msgid "Ad Editor" -msgstr "" - -#: admin.class.php:385 -msgid "New Place" -msgstr "" - -#: admin.class.php:388 -msgid "Ads Zones List" -msgstr "" - -#: admin.class.php:388 -msgid "Ads Zones" -msgstr "" - -#: admin.class.php:390 -msgid "Ads Zone Editor" -msgstr "" - -#: admin.class.php:390 -msgid "New Zone" -msgstr "" - -#: admin.class.php:392 -msgid "Ads Blocks List" -msgstr "" - -#: admin.class.php:392 -msgid "Ads Blocks" -msgstr "" - -#: admin.class.php:394 block.editor.admin.class.php:384 -msgid "Ads Block Editor" -msgstr "" - -#: admin.class.php:394 -msgid "New Block" -msgstr "" - -#: admin.class.php:396 admin.class.php:762 -msgid "Simple Ads Manager Settings" -msgstr "" - -#: admin.class.php:396 -msgid "Settings" -msgstr "" - -#: admin.class.php:404 -msgid "" -"Enter a name and a description of the " -"advertisement. These parameters are optional, because don’t influence " -"anything, but help in the visual identification of the ad (do not forget " -"which is which)." -msgstr "" - -#: admin.class.php:405 -msgid "" -"Ad Code – code can be defined as a combination of the image " -"URL and target page URL, or as HTML code, javascript code, or PHP code (for " -"PHP-code don’t forget to set the checkbox labeled \"This code of ad contains " -"PHP script\"). If you select the first option (image mode) you can keep " -"statistics of clicks and also tools for uploading/selecting the downloaded " -"image banner becomes available to you." -msgstr "" - -#: admin.class.php:406 -msgid "Restrictions of advertisement Showing" -msgstr "" - -#: admin.class.php:407 -msgid "" -"Ad Weight – coefficient of frequency of show of the advertisement " -"for one cycle of advertisements rotation. 0 – ad is inactive, 1 – minimal " -"activity of this advertisement, 10 – maximal activity of this ad." -msgstr "" - -#: admin.class.php:408 -msgid "Restrictions by the type of pages – select restrictions:" -msgstr "" - -#: admin.class.php:410 editor.admin.class.php:915 -msgid "Show ad on all pages of blog" -msgstr "" - -#: admin.class.php:411 -msgid "" -"Show ad only on pages of this type – ad will appear only on the pages of " -"selected types" -msgstr "" - -#: admin.class.php:412 -msgid "" -"Show ad only in certain posts – ad will be shown only on single posts pages " -"with the given IDs (ID items separated by commas, no spaces)" -msgstr "" - -#: admin.class.php:414 -msgid "Additional restrictions" -msgstr "" - -#: admin.class.php:416 -msgid "" -"Show ad only in single posts or categories archives of certain categories – " -"ad will be shown only on single posts pages or category archive pages of the " -"specified categories" -msgstr "" - -#: admin.class.php:417 -msgid "" -"Show ad only in single posts or authors archives of certain authors – ad " -"will be shown only on single posts pages or author archive pages of the " -"specified authors" -msgstr "" - -#: admin.class.php:419 -msgid "" -"Use the schedule for this ad – if necessary, select checkbox " -"labeled “Use the schedule for this ad” and set start and finish dates of ad " -"campaign." -msgstr "" - -#: admin.class.php:420 -msgid "" -"Use limitation by hits – if necessary, select checkbox labeled “Use " -"limitation by hits” and set hits limit." -msgstr "" - -#: admin.class.php:421 -msgid "" -"Use limitation by clicks – if necessary, select checkbox labeled " -"“Use limitation by clicks” and set clicks limit." -msgstr "" - -#: admin.class.php:422 editor.admin.class.php:1152 -msgid "Prices" -msgstr "" - -#: admin.class.php:422 -msgid "" -"Use these parameters to get the statistics of incomes from advertisements " -"placed in your blog. \"Price of ad placement per month\" - parameter used " -"only for calculating statistic of scheduled ads." -msgstr "" - -#: admin.class.php:423 admin.class.php:440 admin.class.php:447 -#: admin.class.php:461 -msgid "Manual" -msgstr "" - -#: admin.class.php:424 admin.class.php:441 admin.class.php:448 -#: admin.class.php:462 admin.class.php:800 -msgid "Support Forum" -msgstr "" - -#: admin.class.php:429 -msgid "" -"Enter a name and a description of the Ads " -"Place. In principle, it is not mandatory parameters, because these " -"parameters don’t influence anything, but experience suggests that after a " -"while all IDs usually will be forgotten and such information may be useful." -msgstr "" - -#: admin.class.php:430 -msgid "" -"Ads Place Size – in this version is only for informational " -"purposes only, but in future I plan to use this option. It is desirable to " -"expose the real size." -msgstr "" - -#: admin.class.php:431 -msgid "" -"Ads Place Patch - it’s an ad that will appear in the event " -"that the logic of basic ads outputing of this Ads Place on the current page " -"will not be able to choose a single basic ad for displaying. For example, if " -"all basic announcements are set to displaying only on archives pages or " -"single pages, in this case the patch ad of Ads Place will be shown on the " -"Home page. Conveniently to use the patch ad of Ads Place where you sell the " -"advertising place for a limited time – after the time expiration of ordered " -"ad will appear patch ad. It may be a banner leading to your page of " -"advertisement publication costs or a banner from AdSense." -msgstr "" - -#: admin.class.php:432 -msgid "Patch can be defined" -msgstr "" - -#: admin.class.php:434 -msgid "as combination of the image URL and target page URL" -msgstr "" - -#: admin.class.php:435 -msgid "as HTML code or javascript code" -msgstr "" - -#: admin.class.php:436 -msgid "" -"as name of Google DoubleClick for Publishers (DFP) block" -msgstr "" - -#: admin.class.php:438 -msgid "" -"If you select the first option (image mode), tools to download/choosing of " -"downloaded image banner become available for you." -msgstr "" - -#: admin.class.php:439 -msgid "" -"Codes – as Ads Place can be inserted into the page code not " -"only as widget, but as a short code or by using function, you can use code " -"“before” and “after” for centering or alignment of Ads Place on the place of " -"inserting or for something else you need. Use HTML tags." -msgstr "" - -#: admin.class.php:453 -msgid "" -"Views per Cycle – the number of impressions an ad for one " -"cycle of rotation, provided that this ad has maximum weight (the activity). " -"In other words, if the number of hits in the series is 1000, an ad with a " -"weight of 10 will be shown in 1000, and the ad with a weight of 3 will be " -"shown 300 times." -msgstr "" - -#: admin.class.php:454 -msgid "" -"Do not set this parameter to a value less than the maximum number of " -"visitors which may simultaneously be on your site – it may violate the logic " -"of rotation." -msgstr "" - -#: admin.class.php:455 -msgid "" -"Not worth it, though it has no special meaning, set this parameter to a " -"value greater than the number of hits your web pages during a month. " -"Optimal, perhaps, is the value to the daily shows website pages." -msgstr "" - -#: admin.class.php:456 -msgid "" -"Auto Inserting Settings - here you can select the Ads " -"Places and allow the display of their ads before and after the content of " -"single post." -msgstr "" - -#: admin.class.php:457 -msgid "" -"Google DFP Settings - if you want to use codes of Google " -"DFP rotator, you must allow it's using and define your pub-code." -msgstr "" - -#: admin.class.php:459 -msgid "Bots and Crawlers detection" -msgstr "" - -#: admin.class.php:459 -msgid "" -"For obtaining of more exact indexes of statistics and incomes it is " -"preferable to exclude data about visits of bots and crawlers from the data " -"about all visits of your blog. If enabled and bot or crawler is detected, " -"hits of ads won't be counted. Select accuracy of detection but use with " -"caution - more exact detection requires more server resources." -msgstr "" - -#: admin.class.php:589 -msgid "Uploading" -msgstr "" - -#: admin.class.php:590 -msgid "Uploaded." -msgstr "" - -#: admin.class.php:591 -msgid "Only JPG, PNG or GIF files are allowed" -msgstr "" - -#: admin.class.php:592 -msgid "File" -msgstr "" - -#: admin.class.php:669 -msgid "There are general options." -msgstr "" - -#: admin.class.php:673 -msgid "" -"Single post/page auto inserting options. Use these parameters for allowing/" -"defining Ads Places which will be automatically inserted before/after post/" -"page content." -msgstr "" - -#: admin.class.php:677 -msgid "Adjust parameters of your Google DFP account." -msgstr "" - -#: admin.class.php:681 -msgid "Adjust parameters of plugin statistics." -msgstr "" - -#: admin.class.php:685 -msgid "This options define layout for Ads Managin Pages." -msgstr "" - -#: admin.class.php:689 -msgid "Are you allow to perform these actions during deactivating plugin?" -msgstr "" - -#: admin.class.php:769 -msgid "Simple Ads Manager Settings Updated." -msgstr "" - -#: admin.class.php:777 -msgid "System Info" -msgstr "" - -#: admin.class.php:781 -msgid "Wordpress Version" -msgstr "" - -#: admin.class.php:782 -msgid "SAM Version" -msgstr "" - -#: admin.class.php:783 -msgid "SAM DB Version" -msgstr "" - -#: admin.class.php:784 -msgid "PHP Version" -msgstr "" - -#: admin.class.php:785 -msgid "MySQL Version" -msgstr "" - -#: admin.class.php:786 -msgid "Memory Limit" -msgstr "" - -#: admin.class.php:790 -msgid "Note! If you have detected a bug, include this data to bug report." -msgstr "" - -#: admin.class.php:795 -msgid "Resources" -msgstr "" - -#: admin.class.php:798 -msgid "Wordpress Plugin Page" -msgstr "" - -#: admin.class.php:799 -msgid "Author Plugin Page" -msgstr "" - -#: admin.class.php:801 -msgid "Author's Blog" -msgstr "" - -#: admin.class.php:806 -msgid "Donations" -msgstr "" - -#: admin.class.php:810 -msgid "" -"If you have found this plugin useful, please consider making a %s to help " -"support future development. Your support will be much appreciated. Thank you!" -msgstr "" - -#: admin.class.php:811 admin.class.php:817 -msgid "Donate Now!" -msgstr "" - -#: admin.class.php:811 -msgid "donation" -msgstr "" - -#: admin.class.php:822 -msgid "" -"Warning! The default value of donation is %s. Don't worry! This is not my " -"appetite, this is default value defined by Payoneer service." -msgstr "" - -#: admin.class.php:822 -msgid " You can change it to any value you want!" -msgstr "" - -#: admin.class.php:835 -msgid "Save Changes" -msgstr "" - -#: editor.admin.class.php:194 -msgid "Horizontal" -msgstr "" - -#: editor.admin.class.php:195 -msgid "Vertical" -msgstr "" - -#: editor.admin.class.php:197 -msgid "Custom width and height" -msgstr "" - -#: editor.admin.class.php:261 editor.admin.class.php:293 -#: editor.admin.class.php:310 editor.admin.class.php:311 -#: editor.admin.class.php:312 editor.admin.class.php:320 -#: editor.admin.class.php:589 editor.admin.class.php:666 -#: editor.admin.class.php:717 editor.admin.class.php:718 -#: editor.admin.class.php:719 zone.editor.admin.class.php:154 -#: zone.editor.admin.class.php:247 zone.editor.admin.class.php:280 -#: block.editor.admin.class.php:171 block.editor.admin.class.php:215 -#: block.editor.admin.class.php:241 -msgid "Undefined" -msgstr "" - -#: editor.admin.class.php:274 -msgid "Ads Place Data Updated." -msgstr "" - -#: editor.admin.class.php:320 -msgid "New Ads Place" -msgstr "" - -#: editor.admin.class.php:320 -msgid "Edit Ads Place" -msgstr "" - -#: editor.admin.class.php:325 editor.admin.class.php:383 -#: editor.admin.class.php:397 editor.admin.class.php:418 -#: editor.admin.class.php:495 editor.admin.class.php:731 -#: editor.admin.class.php:800 editor.admin.class.php:815 -#: editor.admin.class.php:886 editor.admin.class.php:975 -#: editor.admin.class.php:1151 editor.admin.class.php:1181 -#: zone.editor.admin.class.php:285 zone.editor.admin.class.php:335 -#: zone.editor.admin.class.php:349 block.editor.admin.class.php:73 -#: block.editor.admin.class.php:246 block.editor.admin.class.php:296 -#: block.editor.admin.class.php:310 block.editor.admin.class.php:328 -#: block.editor.admin.class.php:354 block.editor.admin.class.php:383 -msgid "Click to toggle" -msgstr "" - -#: editor.admin.class.php:326 editor.admin.class.php:732 -#: zone.editor.admin.class.php:286 block.editor.admin.class.php:247 -msgid "Status" -msgstr "" - -#: editor.admin.class.php:333 -msgid "Back to Places List" -msgstr "" - -#: editor.admin.class.php:339 js/dialog.php:66 -msgid "Ads Place ID" -msgstr "" - -#: editor.admin.class.php:347 editor.admin.class.php:762 -msgid "Width" -msgstr "" - -#: editor.admin.class.php:349 editor.admin.class.php:764 -msgid "Height" -msgstr "" - -#: editor.admin.class.php:353 zone.editor.admin.class.php:305 -#: block.editor.admin.class.php:266 -msgid "Is Active" -msgstr "" - -#: editor.admin.class.php:354 editor.admin.class.php:771 -#: zone.editor.admin.class.php:306 block.editor.admin.class.php:267 -msgid "Is In Trash" -msgstr "" - -#: editor.admin.class.php:361 editor.admin.class.php:778 -#: zone.editor.admin.class.php:313 js/dialog.php:89 js/dialog-zone.php:89 -#: js/dialog-ad.php:89 js/dialog-block.php:79 block.editor.admin.class.php:274 -msgid "Cancel" -msgstr "" - -#: editor.admin.class.php:364 editor.admin.class.php:781 -#: zone.editor.admin.class.php:316 block.editor.admin.class.php:277 -msgid "Save" -msgstr "" - -#: editor.admin.class.php:377 zone.editor.admin.class.php:329 -#: block.editor.admin.class.php:290 -msgid "Name" -msgstr "" - -#: editor.admin.class.php:384 editor.admin.class.php:388 -#: editor.admin.class.php:804 zone.editor.admin.class.php:336 -#: zone.editor.admin.class.php:340 block.editor.admin.class.php:297 -#: block.editor.admin.class.php:301 -msgid "Description" -msgstr "" - -#: editor.admin.class.php:386 -msgid "Enter description of this Ads Place." -msgstr "" - -#: editor.admin.class.php:391 editor.admin.class.php:808 -#: zone.editor.admin.class.php:343 block.editor.admin.class.php:304 -msgid "" -"This description is not used anywhere and is added solely for the " -"convenience of managing advertisements." -msgstr "" - -#: editor.admin.class.php:398 -msgid "Ads Place Size" -msgstr "" - -#: editor.admin.class.php:400 -msgid "Select size of this Ads Place." -msgstr "" - -#: editor.admin.class.php:405 -msgid "Custom Width" -msgstr "" - -#: editor.admin.class.php:409 -msgid "Custom Height" -msgstr "" - -#: editor.admin.class.php:412 -msgid "" -"These values are not used and are added solely for the convenience of " -"advertising management. Will be used in the future..." -msgstr "" - -#: editor.admin.class.php:419 -msgid "Ads Place Patch" -msgstr "" - -#: editor.admin.class.php:421 -msgid "" -"Select type of the code of a patch and fill data entry fields with the " -"appropriate data." -msgstr "" - -#: editor.admin.class.php:423 editor.admin.class.php:427 -msgid "Image" -msgstr "" - -#: editor.admin.class.php:431 -msgid "" -"This image is a patch for advertising space. This may be an image with the " -"text \"Place your ad here\"." -msgstr "" - -#: editor.admin.class.php:434 -msgid "Target" -msgstr "" - -#: editor.admin.class.php:438 -msgid "This is a link to a page where are your suggestions for advertisers." -msgstr "" - -#: editor.admin.class.php:441 editor.admin.class.php:851 -msgid "Image Tools" -msgstr "" - -#: editor.admin.class.php:443 editor.admin.class.php:853 -msgid "Select File" -msgstr "" - -#: editor.admin.class.php:447 editor.admin.class.php:857 -msgid "Apply" -msgstr "" - -#: editor.admin.class.php:448 editor.admin.class.php:858 -msgid "Select file from your blog server." -msgstr "" - -#: editor.admin.class.php:451 editor.admin.class.php:861 -msgid "Upload File" -msgstr "" - -#: editor.admin.class.php:452 editor.admin.class.php:862 -msgid "Upload" -msgstr "" - -#: editor.admin.class.php:455 editor.admin.class.php:865 -msgid "Select and upload file from your local computer." -msgstr "" - -#: editor.admin.class.php:461 -msgid "HTML or Javascript Code" -msgstr "" - -#: editor.admin.class.php:465 -msgid "Patch Code" -msgstr "" - -#: editor.admin.class.php:470 -msgid "" -"This is one-block code of third-party AdServer rotator. Selecting this " -"checkbox prevents displaying contained ads." -msgstr "" - -#: editor.admin.class.php:473 -msgid "" -"This is a HTML-code patch of advertising space. For example: use the code to " -"display AdSense advertisement. " -msgstr "" - -#: editor.admin.class.php:478 -msgid "Google DFP" -msgstr "" - -#: editor.admin.class.php:482 -msgid "DFP Block Name" -msgstr "" - -#: editor.admin.class.php:486 -msgid "This is name of Google DFP block!" -msgstr "" - -#: editor.admin.class.php:489 -msgid "" -"The patch (default advertisement) will be shown that if the logic of the " -"plugin can not show any contained advertisement on the current page of the " -"document." -msgstr "" - -#: editor.admin.class.php:496 -msgid "Codes" -msgstr "" - -#: editor.admin.class.php:498 -msgid "Enter the code to output before and after the codes of Ads Place." -msgstr "" - -#: editor.admin.class.php:500 -msgid "Code Before" -msgstr "" - -#: editor.admin.class.php:504 -msgid "Code After" -msgstr "" - -#: editor.admin.class.php:507 -msgid "" -"You can enter any HTML codes here for the further withdrawal of their before " -"and after the code of Ads Place." -msgstr "" - -#: editor.admin.class.php:600 -msgid "Ad Data Updated." -msgstr "" - -#: editor.admin.class.php:726 -msgid "New advertisement" -msgstr "" - -#: editor.admin.class.php:726 -msgid "Edit advertisement" -msgstr "" - -#: editor.admin.class.php:739 -msgid "Back to Ads List" -msgstr "" - -#: editor.admin.class.php:745 -msgid "Advertisement ID" -msgstr "" - -#: editor.admin.class.php:753 -msgid "Ad is Active" -msgstr "" - -#: editor.admin.class.php:753 -msgid "Ad is Inactive" -msgstr "" - -#: editor.admin.class.php:769 -msgid "Is in Rotation" -msgstr "" - -#: editor.admin.class.php:794 -msgid "Title" -msgstr "" - -#: editor.admin.class.php:801 -msgid "Advertisement Description" -msgstr "" - -#: editor.admin.class.php:816 editor.admin.class.php:876 -msgid "Ad Code" -msgstr "" - -#: editor.admin.class.php:820 -msgid "Image Mode" -msgstr "" - -#: editor.admin.class.php:824 -msgid "Ad Image" -msgstr "" - -#: editor.admin.class.php:828 -msgid "Ad Target" -msgstr "" - -#: editor.admin.class.php:832 -msgid "Ad Alternative Text" -msgstr "" - -#: editor.admin.class.php:837 -msgid "Count clicks for this advertisement" -msgstr "" - -#: editor.admin.class.php:839 -msgid "Use carefully!" -msgstr "" - -#: editor.admin.class.php:839 -msgid "" -"Do not use if the wp-admin folder is password protected. In this case the " -"viewer will be prompted to enter a username and password during ajax " -"request. It's not good." -msgstr "" - -#: editor.admin.class.php:841 -msgid "Add to ad" -msgstr "" - -#: editor.admin.class.php:843 -msgid "Non Selected" -msgstr "" - -#: editor.admin.class.php:844 -msgid "nofollow" -msgstr "" - -#: editor.admin.class.php:845 -msgid "noindex" -msgstr "" - -#: editor.admin.class.php:846 -msgid "nofollow and noindex" -msgstr "" - -#: editor.admin.class.php:872 -msgid "Code Mode" -msgstr "" - -#: editor.admin.class.php:878 -msgid "This code of ad contains PHP script" -msgstr "" - -#: editor.admin.class.php:887 -msgid "Restrictions of advertisements showing" -msgstr "" - -#: editor.admin.class.php:890 -msgid "Ad Weight" -msgstr "" - -#: editor.admin.class.php:897 -msgid "Inactive" -msgstr "" - -#: editor.admin.class.php:898 -msgid "Minimal Activity" -msgstr "" - -#: editor.admin.class.php:899 -msgid "Maximal Activity" -msgstr "" - -#: editor.admin.class.php:909 -msgid "" -"Ad weight - coefficient of frequency of show of the advertisement for one " -"cycle of advertisements rotation." -msgstr "" - -#: editor.admin.class.php:910 -msgid "" -"0 - ad is inactive, 1 - minimal activity of this advertisement, 10 - maximal " -"activity of this ad." -msgstr "" - -#: editor.admin.class.php:919 -msgid "Show ad only on pages of this type" -msgstr "" - -#: editor.admin.class.php:923 -msgid "Home Page (Home or Front Page)" -msgstr "" - -#: editor.admin.class.php:925 -msgid "Singular Pages" -msgstr "" - -#: editor.admin.class.php:928 -msgid "Single Post" -msgstr "" - -#: editor.admin.class.php:930 -msgid "Page" -msgstr "" - -#: editor.admin.class.php:932 -msgid "Custom Post Type" -msgstr "" - -#: editor.admin.class.php:934 -msgid "Attachment" -msgstr "" - -#: editor.admin.class.php:937 -msgid "Search Page" -msgstr "" - -#: editor.admin.class.php:939 -msgid "\"Not found\" Page (HTTP 404: Not Found)" -msgstr "" - -#: editor.admin.class.php:941 -msgid "Archive Pages" -msgstr "" - -#: editor.admin.class.php:944 -msgid "Taxonomy Archive Pages" -msgstr "" - -#: editor.admin.class.php:946 -msgid "Category Archive Pages" -msgstr "" - -#: editor.admin.class.php:948 -msgid "Tag Archive Pages" -msgstr "" - -#: editor.admin.class.php:950 -msgid "Author Archive Pages" -msgstr "" - -#: editor.admin.class.php:952 -msgid "Custom Post Type Archive Pages" -msgstr "" - -#: editor.admin.class.php:954 -msgid "" -"Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " -"daily or time-based archive)" -msgstr "" - -#: editor.admin.class.php:959 -msgid "Show ad only in certain posts/pages" -msgstr "" - -#: editor.admin.class.php:963 editor.admin.class.php:984 -msgid "Posts/Pages IDs (comma separated)" -msgstr "" - -#: editor.admin.class.php:968 -msgid "" -"Use this setting to display an ad only in certain posts/pages. Enter the IDs " -"of posts/pages, separated by commas." -msgstr "" - -#: editor.admin.class.php:976 -msgid "Extended restrictions of advertisements showing" -msgstr "" - -#: editor.admin.class.php:980 -msgid "Do not show ad on certain posts/pages" -msgstr "" - -#: editor.admin.class.php:989 -msgid "" -"Use this setting to not display an ad on certain posts/pages. Enter the IDs " -"of posts/pages, separated by commas." -msgstr "" - -#: editor.admin.class.php:994 -msgid "" -"Show ad only in single posts or categories archives of certain categories" -msgstr "" - -#: editor.admin.class.php:997 editor.admin.class.php:1014 -msgid "Categories (comma separated)" -msgstr "" - -#: editor.admin.class.php:1001 -msgid "" -"Use this setting to display an ad only in single posts or categories " -"archives of certain categories. Enter the names of categories, separated by " -"commas." -msgstr "" - -#: editor.admin.class.php:1005 editor.admin.class.php:1034 -#: editor.admin.class.php:1063 editor.admin.class.php:1092 -msgid "" -"This display logic parameter will be applied only when you use the \"Show ad " -"on all pages of blog\" and \"Show your ad only on the pages of this type\" " -"modes. Otherwise, it will be ignored." -msgstr "" - -#: editor.admin.class.php:1011 -msgid "" -"Do not show ad in single posts or categories archives of certain categories" -msgstr "" - -#: editor.admin.class.php:1018 -msgid "" -"Use this setting to not display an ad in single posts or categories archives " -"of certain categories. Enter the names of categories, separated by commas." -msgstr "" - -#: editor.admin.class.php:1023 -msgid "Show ad only in single posts or authors archives of certain authors" -msgstr "" - -#: editor.admin.class.php:1026 editor.admin.class.php:1043 -msgid "Authors (comma separated)" -msgstr "" - -#: editor.admin.class.php:1030 -msgid "" -"Use this setting to display an ad only in single posts or authors archives " -"of certain authors. Enter the names of authors, separated by commas." -msgstr "" - -#: editor.admin.class.php:1040 -msgid "Do not show ad in single posts or authors archives of certain authors" -msgstr "" - -#: editor.admin.class.php:1047 -msgid "" -"Use this setting to not display an ad in single posts or authors archives of " -"certain authors. Enter the names of authors, separated by commas." -msgstr "" - -#: editor.admin.class.php:1052 -msgid "Show ad only in single posts or tags archives of certain tags" -msgstr "" - -#: editor.admin.class.php:1055 editor.admin.class.php:1072 -msgid "Tags (comma separated)" -msgstr "" - -#: editor.admin.class.php:1059 -msgid "" -"Use this setting to display an ad only in single posts or tags archives of " -"certain tags. Enter the names of tags, separated by commas." -msgstr "" - -#: editor.admin.class.php:1069 -msgid "Do not show ad in single posts or tags archives of certain tags" -msgstr "" - -#: editor.admin.class.php:1076 -msgid "" -"Use this setting to not display an ad in single posts or tags archives of " -"certain tags. Enter the names of tags, separated by commas." -msgstr "" - -#: editor.admin.class.php:1081 -msgid "" -"Show ad only in custom type single posts or custom post type archives of " -"certain custom post types" -msgstr "" - -#: editor.admin.class.php:1084 editor.admin.class.php:1101 -msgid "Custom post types (comma separated)" -msgstr "" - -#: editor.admin.class.php:1088 -msgid "" -"Use this setting to display an ad only in custom type single posts or custom " -"post type archives of certain custom post types. Enter the names of custom " -"post types, separated by commas." -msgstr "" - -#: editor.admin.class.php:1098 -msgid "" -"Do not show ad in custom type single posts or custom post type archives of " -"certain custom post types" -msgstr "" - -#: editor.admin.class.php:1105 -msgid "" -"Use this setting to not display an ad in custom type single posts or custom " -"post type archives of certain custom post types. Enter the names of custom " -"post types, separated by commas." -msgstr "" - -#: editor.admin.class.php:1110 -msgid "Use the schedule for this ad" -msgstr "" - -#: editor.admin.class.php:1113 -msgid "Campaign Start Date" -msgstr "" - -#: editor.admin.class.php:1117 -msgid "Campaign End Date" -msgstr "" - -#: editor.admin.class.php:1121 -msgid "" -"Use these parameters for displaying ad during the certain period of time." -msgstr "" - -#: editor.admin.class.php:1126 -msgid "Use limitation by hits" -msgstr "" - -#: editor.admin.class.php:1129 -msgid "Hits Limit" -msgstr "" - -#: editor.admin.class.php:1133 -msgid "Use this parameter for limiting displaying of ad by hits." -msgstr "" - -#: editor.admin.class.php:1137 -msgid "Use limitation by clicks" -msgstr "" - -#: editor.admin.class.php:1140 -msgid "Clicks Limit" -msgstr "" - -#: editor.admin.class.php:1144 -msgid "Use this parameter for limiting displaying of ad by clicks." -msgstr "" - -#: editor.admin.class.php:1155 -msgid "Price of ad placement per month" -msgstr "" - -#: editor.admin.class.php:1159 -msgid "Tthis parameter used only for scheduled ads." -msgstr "" - -#: editor.admin.class.php:1162 -msgid "Price per Thousand Hits" -msgstr "" - -#: editor.admin.class.php:1166 -msgid "" -"Not only humans visit your blog, bots and crawlers too. In order not to " -"deceive an advertiser, you must enable the detection of bots and crawlers." -msgstr "" - -#: editor.admin.class.php:1169 -msgid "Price per Click" -msgstr "" - -#: editor.admin.class.php:1173 -msgid "" -"To calculate the earnings on clicks, you must enable counting of clicks for " -"that ad." -msgstr "" - -#: editor.admin.class.php:1182 -msgid "Ad Preview" -msgstr "" - -#: zone.editor.admin.class.php:15 -msgid "Default" -msgstr "" - -#: zone.editor.admin.class.php:16 -msgid "None" -msgstr "" - -#: zone.editor.admin.class.php:165 -msgid "Ads Zone Data Updated." -msgstr "" - -#: zone.editor.admin.class.php:280 -msgid "New Ads Zone" -msgstr "" - -#: zone.editor.admin.class.php:280 -msgid "Edit Ads Zone" -msgstr "" - -#: zone.editor.admin.class.php:293 -msgid "Back to Zones List" -msgstr "" - -#: zone.editor.admin.class.php:299 js/dialog-zone.php:66 -msgid "Ads Zone ID" -msgstr "" - -#: zone.editor.admin.class.php:338 -msgid "Enter description of this Ads Zone." -msgstr "" - -#: zone.editor.admin.class.php:350 -msgid "Ads Zone Settings" -msgstr "" - -#: zone.editor.admin.class.php:353 -msgid "Default Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:359 -msgid "" -"Select the Ads Place by default. This Ads Place will be displayed in the " -"event that for the page of a given type the Ads Place value is set to " -"\"Default\"." -msgstr "" - -#: zone.editor.admin.class.php:363 -msgid "Home Page Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:369 -msgid "Default Ads Place for Singular Pages" -msgstr "" - -#: zone.editor.admin.class.php:376 -msgid "Single Post Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:385 -msgid "Default Ads Place for Single Custom Type Post" -msgstr "" - -#: zone.editor.admin.class.php:396 -msgid "Ads Place for Single Post of Custom Type" -msgstr "" - -#: zone.editor.admin.class.php:405 -msgid "Page Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:411 -msgid "Attachment Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:418 -msgid "Search Pages Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:424 -msgid "404 Page Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:430 -msgid "Default Ads Place for Archive Pages" -msgstr "" - -#: zone.editor.admin.class.php:437 -msgid "Default Ads Place for Taxonomies Pages" -msgstr "" - -#: zone.editor.admin.class.php:444 -msgid "Default Ads Place for Category Archive Pages" -msgstr "" - -#: zone.editor.admin.class.php:457 -msgid "Ads Place for Category" -msgstr "" - -#: zone.editor.admin.class.php:473 -msgid "Default Ads Place for Archives of Custom Type Posts" -msgstr "" - -#: zone.editor.admin.class.php:483 -msgid "Ads Place for Custom Type Posts Archive" -msgstr "" - -#: zone.editor.admin.class.php:492 -msgid "Tags Archive Pages Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:499 -msgid "Default Ads Place for Author Archive Pages" -msgstr "" - -#: zone.editor.admin.class.php:508 -msgid "Ads Place for author" -msgstr "" - -#: zone.editor.admin.class.php:517 -msgid "Date Archive Pages Ads Place" -msgstr "" - -#: zone.editor.admin.class.php:524 -msgid "" -"Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " -"are Ads Places by default for the low level pages of relevant pages." -msgstr "" - -#: js/dialog.php:27 -msgid "Insert Ads Place" -msgstr "" - -#: js/dialog.php:41 js/dialog-zone.php:41 js/dialog-ad.php:41 -#: js/dialog-block.php:41 -msgid "Basic Settings" -msgstr "" - -#: js/dialog.php:48 widget.class.php:15 block.editor.admin.class.php:77 -msgid "Ads Place" -msgstr "" - -#: js/dialog.php:69 -msgid "Ads Place Name" -msgstr "" - -#: js/dialog.php:79 js/dialog-zone.php:79 js/dialog-ad.php:79 -msgid "Allow Ads Places predefined codes" -msgstr "" - -#: js/dialog.php:92 js/dialog-zone.php:92 js/dialog-ad.php:92 -#: js/dialog-block.php:82 -msgid "Insert" -msgstr "" - -#: js/dialog-zone.php:27 -msgid "Insert Ads Zone" -msgstr "" - -#: js/dialog-zone.php:48 widget.class.php:149 widget.class.php:154 -#: block.editor.admin.class.php:103 -msgid "Ads Zone" -msgstr "" - -#: js/dialog-zone.php:69 -msgid "Ads Zone Name" -msgstr "" - -#: js/dialog-ad.php:27 -msgid "Insert Single Ad" -msgstr "" - -#: js/dialog-ad.php:48 widget.class.php:288 -msgid "Ad" -msgstr "" - -#: js/dialog-ad.php:66 -msgid "Single Ad ID" -msgstr "" - -#: js/dialog-ad.php:69 -msgid "Single Ad Name" -msgstr "" - -#: js/dialog-block.php:27 -msgid "Insert Ads Block" -msgstr "" - -#: js/dialog-block.php:48 widget.class.php:432 -msgid "Ads Block" -msgstr "" - -#: js/dialog-block.php:66 block.editor.admin.class.php:260 -msgid "Ads Block ID" -msgstr "" - -#: js/dialog-block.php:69 -msgid "Ads Block Name" -msgstr "" - -#: widget.class.php:10 -msgid "Ads Place:" -msgstr "" - -#: widget.class.php:13 -msgid "Ads Place rotator serviced by Simple Ads Manager." -msgstr "" - -#: widget.class.php:101 widget.class.php:240 widget.class.php:379 -#: widget.class.php:516 -msgid "Title:" -msgstr "" - -#: widget.class.php:124 widget.class.php:263 widget.class.php:402 -#: widget.class.php:539 -msgid "Hide widget style." -msgstr "" - -#: widget.class.php:133 widget.class.php:272 widget.class.php:411 -msgid "" -"Allow using previously defined \"before\" and \"after\" codes of Ads Place.." -msgstr "" - -#: widget.class.php:152 -msgid "Ads Zone selector serviced by Simple Ads Manager." -msgstr "" - -#: widget.class.php:291 -msgid "Non-rotating single ad serviced by Simple Ads Manager." -msgstr "" - -#: widget.class.php:293 block.editor.admin.class.php:90 -msgid "Single Ad" -msgstr "" - -#: widget.class.php:427 -msgid "Block" -msgstr "" - -#: widget.class.php:430 -msgid "Ads Block collector serviced by Simple Ads Manager." -msgstr "" - -#: block.editor.admin.class.php:74 -msgid "Item" -msgstr "" - -#: block.editor.admin.class.php:79 block.editor.admin.class.php:92 -#: block.editor.admin.class.php:105 -msgid "Non selected" -msgstr "" - -#: block.editor.admin.class.php:182 -msgid "Ads Block Data Updated." -msgstr "" - -#: block.editor.admin.class.php:241 -msgid "New Ads Block" -msgstr "" - -#: block.editor.admin.class.php:241 -msgid "Edit Ads Block" -msgstr "" - -#: block.editor.admin.class.php:254 -msgid "Back to Blocks List" -msgstr "" - -#: block.editor.admin.class.php:299 block.editor.admin.class.php:386 -msgid "Enter description of this Ads Block." -msgstr "" - -#: block.editor.admin.class.php:311 -msgid "Block Structure" -msgstr "" - -#: block.editor.admin.class.php:313 -msgid "Ads Block Structure Properties." -msgstr "" - -#: block.editor.admin.class.php:315 -msgid "Block Lines" -msgstr "" - -#: block.editor.admin.class.php:319 -msgid "Block Columns" -msgstr "" - -#: block.editor.admin.class.php:322 -msgid "" -"After changing these properties you must save Ads Block settings before " -"using Ads Block Editor." -msgstr "" - -#: block.editor.admin.class.php:329 -msgid "Block Styles" -msgstr "" - -#: block.editor.admin.class.php:331 -msgid "Configure Styles for this Ads Block." -msgstr "" - -#: block.editor.admin.class.php:333 block.editor.admin.class.php:359 -msgid "Margins" -msgstr "" - -#: block.editor.admin.class.php:337 block.editor.admin.class.php:363 -msgid "Padding" -msgstr "" - -#: block.editor.admin.class.php:341 block.editor.admin.class.php:367 -msgid "Background" -msgstr "" - -#: block.editor.admin.class.php:345 block.editor.admin.class.php:371 -msgid "Borders" -msgstr "" - -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 -msgid "Use Stylesheet rules for defining these properties." -msgstr "" - -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 -msgid "For example:" -msgstr "" - -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 -msgid "for background property or" -msgstr "" - -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 -msgid "for border property" -msgstr "" - -#: block.editor.admin.class.php:355 -msgid "Block Items Styles" -msgstr "" - -#: block.editor.admin.class.php:357 -msgid "Configure Styles for this Ads Block Items." -msgstr "" - -#: block.editor.admin.class.php:375 -msgid "Important Note" -msgstr "" - -#: block.editor.admin.class.php:375 -msgid "" -"As the Ads Block is the regular structure, predefined styles of individual " -"items for drawing Ads Block's elements aren't used. Define styles for Ads " -"Block Items here!" -msgstr "" - -#: block.editor.admin.class.php:388 -msgid "Block Editor." -msgstr "" - -#. Plugin Name of the plugin/theme -msgid "Simple Ads Manager" -msgstr "" - -#. Plugin URI of the plugin/theme -msgid "http://www.simplelib.com/?p=480" -msgstr "" - -#. Description of the plugin/theme -msgid "" -"\"Simple Ads Manager\" is easy to use plugin providing a flexible logic of " -"displaying advertisements. Visit SimpleLib blog for more details." -msgstr "" - -#. Author of the plugin/theme -msgid "minimus" -msgstr "" - -#. Author URI of the plugin/theme -msgid "http://blogcoding.ru" -msgstr "" diff --git a/updater.class.php b/updater.class.php index b1fe069..b3d4166 100644 --- a/updater.class.php +++ b/updater.class.php @@ -11,7 +11,35 @@ public function __construct($dbVersion, $versionsData, $options = null) { $this->options = $options; } - private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null) { + private function versionCompare($ver1, $ver2, $arg = '=') { + $version1 = explode('.', $ver1); + $version2 = explode('.', $ver2); + $v1 = (intval($version1[0]) * 1000) + intval($version1[1]) + ((!empty($version1[2])) ? intval($version1[2]) / 100 : 0 ); + $v2 = (intval($version2[0]) * 1000) + intval($version2[1]) + ((!empty($version2[2])) ? intval($version2[2]) / 100 : 0 ); + switch($arg) { + case '=': + $out = $v1 == $v2; + break; + case '<=': + $out = $v1 <= $v2; + break; + case '<': + $out = $v1 < $v2; + break; + case '>': + $out = $v1 > $v2; + break; + case '>=': + $out = $v1 >= $v2; + break; + default: + $out = $v1 == $v2; + break; + } + return $out; + } + + private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null, $lastError = null) { global $wpdb; if(!is_null($eResult)) { @@ -22,7 +50,7 @@ private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null) { 'error_date' => current_time('mysql'), 'table_name' => $rTable, 'error_type' => 1, - 'error_msg' => __('An error occurred during updating process...', SAM_DOMAIN), + 'error_msg' => (empty($lastError)) ? __('An error occurred during updating process...', SAM_DOMAIN) : $lastError, 'error_sql' => $eSql, 'resolved' => 0 ), @@ -36,7 +64,7 @@ private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null) { 'error_date' => current_time('mysql'), 'table_name' => $rTable, 'error_type' => 0, - 'error_msg' => __('Updated...', SAM_DOMAIN), + 'error_msg' => (empty($lastError)) ? __('Updated...', SAM_DOMAIN) : $lastError, 'error_sql' => $eSql, 'resolved' => 1 ), @@ -46,22 +74,153 @@ private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null) { } } - public function update() { + private function getUpdateSql($table, $defTable) { global $wpdb, $charset_collate; + $dbv = $this->dbVersion; + $curTable = array(); + $add = ''; + $modify = ''; + $out = ''; + $change = ''; + + if(self::versionCompare($dbv, '2.0', '<')) { + $charset = str_replace('DEFAULT ', '', $charset_collate); + $change = "CONVERT TO $charset"; + } + + $ct = $wpdb->get_results("DESCRIBE $table;", ARRAY_A); + foreach($ct as $val) { + $curTable[$val['Field']] = array( + 'Type' => $val['Type'], + 'Null' => $val['Null'], + 'Key' => $val['Key'], + 'Default' => $val['Default'], + 'Extra' => $val['Extra'] + ); + } + + foreach($defTable as $key => $val) { + if(empty($curTable[$key])) + $add .= ((empty($add)) ? '' : ', ') + . $key . ' ' . $val['Type'] + . (($val['Null'] == 'NO') ? ' NOT NULL' : '') + . ((empty($val['Default'])) ? '' : ' DEFAULT ' . (($val['Extra'] == 'str') ? "'{$val['Default']}'" : $val['Default'])); + elseif($curTable[$key]['Type'] != $val['Type']) + $modify .= ((empty($modify)) ? '' : ', ') + . 'MODIFY ' . $key . ' ' . $val['Type'] + . (($val['Null'] == 'NO') ? ' NOT NULL' : ''); + } + $add = (!empty($add)) ? "ADD ($add)" : ''; + if(!empty($change) && !empty($add)) $add = ', ' . $add; + if((!empty($add) || !empty($change)) && !empty($modify)) $modify = ', ' . $modify; + + if(!empty($add) || !empty($modify) || !empty($change)) + $out = "ALTER TABLE $table $change $add $modify;"; + + return $out; + } + + private function adsUpdateData($aTable) { + global $wpdb; + $dbVersion = $this->dbVersion; + + if(self::versionCompare($dbVersion, '0.1', '=')) { + $aSqlU = "UPDATE LOW_PRIORITY $aTable sa SET sa.ad_cats = 1, sa.view_type = 0, sa.view_pages = 4 WHERE sa.view_type = 3;"; + $wpdb->query($aSqlU); + } + + if( self::versionCompare($dbVersion, '2.0', '<=') ) { + $aTerms = array(); + $tTable = $wpdb->prefix . "terms"; + $termSql = "SELECT name, slug FROM $tTable;"; + $terms = $wpdb->get_results($termSql, OBJECT_K); + if($terms) { + foreach($terms as $term) { + $aTerms[$term->slug] = $term->name; + } + } + // Categories + $aSql = "SELECT sa.view_cats FROM $aTable sa WHERE sa.view_cats != '' AND sa.view_cats IS NOT NULL GROUP BY sa.view_cats;"; + $rows = $wpdb->get_results($aSql, OBJECT_K); + $numRows = $wpdb->num_rows; + if($rows) { + foreach($rows as $row) { + $slugs = array(); + $cats = explode(',', $row->view_cats); + foreach($cats as $cat) { + $slug = array_search($cat, $aTerms); + if($slug) array_push($slugs, $slug); + } + $aSlugs = implode(',', $slugs); + $wpdb->update($aTable, array('view_cats' => $aSlugs), array('view_cats' => $row->view_cats), '%s', '%s'); + } + } + // XCategories + $aSql = "SELECT sa.x_view_cats FROM $aTable sa WHERE sa.x_view_cats != '' AND sa.x_view_cats IS NOT NULL GROUP BY sa.x_view_cats;"; + $rows = $wpdb->get_results($aSql, OBJECT_K); + $numRows = $wpdb->num_rows; + if($rows) { + foreach($rows as $row) { + $slugs = array(); + $cats = explode(',', $row->x_view_cats); + foreach($cats as $cat) { + $slug = array_search($cat, $aTerms); + if($slug) array_push($slugs, $slug); + } + $aSlugs = implode(',', $slugs); + $wpdb->update($aTable, array('x_view_cats' => $aSlugs), array('x_view_cats' => $row->x_view_cats), '%s', '%s'); + } + } + // Tags + $aSql = "SELECT sa.view_tags FROM $aTable sa WHERE sa.view_tags != '' AND sa.view_tags IS NOT NULL GROUP BY sa.view_tags;"; + $rows = $wpdb->get_results($aSql, OBJECT_K); + $numRows = $wpdb->num_rows; + if($rows) { + foreach($rows as $row) { + $slugs = array(); + $tags = explode(',', $row->view_tags); + foreach($tags as $tag) { + $slug = array_search($tag, $aTerms); + if($slug) array_push($slugs, $slug); + } + $aSlugs = implode(',', $slugs); + $wpdb->update($aTable, array('view_tags' => $aSlugs), array('view_tags' => $row->view_tags), '%s', '%s'); + } + } + // XTags + $aSql = "SELECT sa.x_view_tags FROM $aTable sa WHERE sa.x_view_tags != '' AND sa.x_view_tags IS NOT NULL GROUP BY sa.x_view_tags;"; + $rows = $wpdb->get_results($aSql, OBJECT_K); + $numRows = $wpdb->num_rows; + if($rows) { + foreach($rows as $row) { + $slugs = array(); + $tags = explode(',', $row->x_view_tags); + foreach($tags as $tag) { + $slug = array_search($tag, $aTerms); + if($slug) array_push($slugs, $slug); + } + $aSlugs = implode(',', $slugs); + $wpdb->update($aTable, array('x_view_tags' => $aSlugs), array('x_view_tags' => $row->x_view_tags), '%s', '%s'); + } + } + } + } + + public function update() { + global $wpdb, $charset_collate, $sam_tables_defs; $pTable = $wpdb->prefix . "sam_places"; $aTable = $wpdb->prefix . "sam_ads"; $zTable = $wpdb->prefix . "sam_zones"; $bTable = $wpdb->prefix . "sam_blocks"; $eTable = $wpdb->prefix . "sam_errors"; + $sTable = $wpdb->prefix . "sam_stats"; $options = $this->options; $el = (integer)$options['errorlog']; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); - //$versions = $this->versions; - $dbVersion = $this->dbVersion; //$versions['db']; - $vData = $this->versionsData; + $dbVersion = $this->dbVersion; $dbResult = null; @@ -80,6 +239,7 @@ public function update() { dbDelta($eSql); } + // Place Table if($wpdb->get_var("SHOW TABLES LIKE '$pTable'") != $pTable) { $pSql = "CREATE TABLE $pTable ( id INT(11) NOT NULL AUTO_INCREMENT, @@ -102,24 +262,17 @@ public function update() { ) $charset_collate;"; dbDelta($pSql); } - elseif($dbVersion == '0.1' || $dbVersion == '0.2') { - $pSql = "ALTER TABLE $pTable - CONVERT TO $charset_collate, - ADD COLUMN patch_dfp VARCHAR(255) DEFAULT NULL, - ADD COLUMN patch_adserver TINYINT(1) DEFAULT 0, - ADD COLUMN patch_hits INT(11) DEFAULT 0;"; - $dbResult = $wpdb->query($pSql); - } - elseif($vData['major'] < 2) { - $pSql = "ALTER TABLE $pTable CONVERT TO $charset_collate;"; - $dbResult = $wpdb->query($pSql); + else { + $pSql = self::getUpdateSql($pTable, $sam_tables_defs['places']); + if(!empty($pSql)) $dbResult = $wpdb->query($pSql); } if($el) { - self::errorWrite($eTable, $pTable, $pSql, $dbResult); + self::errorWrite($eTable, $pTable, $pSql, $dbResult, $wpdb->last_error); $dbResult = null; } + // Ads Table if($wpdb->get_var("SHOW TABLES LIKE '$aTable'") != $aTable) { $aSql = "CREATE TABLE $aTable ( id INT(11) NOT NULL AUTO_INCREMENT, @@ -143,29 +296,29 @@ public function update() { ad_users_unreg tinyint(1) DEFAULT 0, ad_users_reg tinyint(1) DEFAULT 0, x_ad_users tinyint(1) DEFAULT NULL, - x_view_users varchar(255) DEFAULT NULL, + x_view_users TEXT DEFAULT NULL, ad_users_adv tinyint(1) DEFAULT 0, view_type INT(11) DEFAULT 1, view_pages SET('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') DEFAULT NULL, - view_id VARCHAR(255) DEFAULT NULL, + view_id TEXT DEFAULT NULL, ad_cats TINYINT(1) DEFAULT 0, - view_cats VARCHAR(255) DEFAULT NULL, + view_cats TEXT DEFAULT NULL, ad_authors TINYINT(1) DEFAULT 0, - view_authors VARCHAR(255) DEFAULT NULL, + view_authors TEXT DEFAULT NULL, ad_tags TINYINT(1) DEFAULT 0, - view_tags VARCHAR(255) DEFAULT NULL, + view_tags TEXT DEFAULT NULL, ad_custom TINYINT(1) DEFAULT 0, - view_custom VARCHAR(255) DEFAULT NULL, + view_custom TEXT DEFAULT NULL, x_id TINYINT(1) DEFAULT 0, - x_view_id VARCHAR(255) DEFAULT NULL, + x_view_id TEXT DEFAULT NULL, x_cats TINYINT(1) DEFAULT 0, - x_view_cats VARCHAR(255) DEFAULT NULL, + x_view_cats TEXT DEFAULT NULL, x_authors TINYINT(1) DEFAULT 0, - x_view_authors VARCHAR(255) DEFAULT NULL, + x_view_authors TEXT DEFAULT NULL, x_tags TINYINT(1) DEFAULT 0, - x_view_tags VARCHAR(255) DEFAULT NULL, + x_view_tags TEXT DEFAULT NULL, x_custom TINYINT(1) DEFAULT 0, - x_view_custom VARCHAR(255) DEFAULT NULL, + x_view_custom TEXT DEFAULT NULL, ad_schedule TINYINT(1) DEFAULT 0, ad_start_date DATE DEFAULT NULL, ad_end_date DATE DEFAULT NULL, @@ -188,310 +341,19 @@ public function update() { ) $charset_collate;"; dbDelta($aSql); } - elseif($dbVersion == '0.1') { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_alt TEXT DEFAULT NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_no TINYINT(1) NOT NULL DEFAULT 0, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN ad_cats TINYINT(1) DEFAULT 0, - ADD COLUMN ad_authors TINYINT(1) DEFAULT 0, - ADD COLUMN view_authors VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_tags TINYINT(1) DEFAULT 0, - ADD COLUMN view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_custom TINYINT(1) DEFAULT 0, - ADD COLUMN view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN limit_hits TINYINT(1) DEFAULT 0, - ADD COLUMN hits_limit INT(11) DEFAULT 0, - ADD COLUMN limit_clicks TINYINT(1) DEFAULT 0, - ADD COLUMN clicks_limit INT(11) DEFAULT 0, - ADD COLUMN cpm DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN cpc DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN per_month DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN x_id TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_id VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_cats TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_cats VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_authors TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_authors VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_tags TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_custom TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - $aSqlU = "UPDATE LOW_PRIORITY $aTable - SET $aTable.ad_cats = 1, - $aTable.view_type = 0, - $aTable.view_pages = 4 - WHERE $aTable.view_type = 3;"; - $wpdb->query($aSqlU); - } - elseif($dbVersion == '0.2' || $dbVersion == '0.3' || $dbVersion == '0.3.1') { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_alt TEXT DEFAULT NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_no TINYINT(1) NOT NULL DEFAULT 0, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN limit_hits TINYINT(1) DEFAULT 0, - ADD COLUMN hits_limit INT(11) DEFAULT 0, - ADD COLUMN limit_clicks TINYINT(1) DEFAULT 0, - ADD COLUMN clicks_limit INT(11) DEFAULT 0, - ADD COLUMN cpm DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN cpc DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN per_month DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN ad_tags TINYINT(1) DEFAULT 0, - ADD COLUMN view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_custom TINYINT(1) DEFAULT 0, - ADD COLUMN view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_id TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_id VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_cats TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_cats VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_authors TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_authors VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_tags TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_custom TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($dbVersion == '0.4' || $dbVersion == '0.5') { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_alt TEXT DEFAULT NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_no TINYINT(1) NOT NULL DEFAULT 0, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN ad_tags TINYINT(1) DEFAULT 0, - ADD COLUMN view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_custom TINYINT(1) DEFAULT 0, - ADD COLUMN view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_id TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_id VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_cats TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_cats VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_authors TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_authors VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_tags TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_custom TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($dbVersion == "0.5.1") { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_alt TEXT DEFAULT NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_no TINYINT(1) NOT NULL DEFAULT 0, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN ad_tags TINYINT(1) DEFAULT 0, - ADD COLUMN view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_custom TINYINT(1) DEFAULT 0, - ADD COLUMN view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_tags TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_custom TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($vData['major'] < 2) { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($vData['major'] == 2 && $vData['minor'] == 0) { - $aSql = "ALTER TABLE $aTable - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($vData['major'] == 2 && $vData['minor'] == 1) { - $aSql = "ALTER TABLE $aTable - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL;"; - $dbResult = $wpdb->query($aSql); + else { + $aSql = self::getUpdateSql($aTable, $sam_tables_defs['ads']); + if(!empty($aSql)) $dbResult = $wpdb->query($aSql); } if($el) { - self::errorWrite($eTable, $aTable, $aSql, $dbResult); + self::errorWrite($eTable, $aTable, $aSql, $dbResult, $wpdb->last_error); $dbResult = null; } - if($vData['major'] < 2 || ($vData['major'] == 2 && $vData['minor'] == 0)) { - $aTerms = array(); - $tTable = $wpdb->prefix . "terms"; - $termSql = "SELECT name, slug FROM $tTable;"; - $terms = $wpdb->get_results($termSql, OBJECT_K); - if($terms) { - foreach($terms as $term) { - $aTerms[$term->slug] = $term->name; - } - } - // Categories - $aSql = "SELECT $aTable.view_cats - FROM $aTable - WHERE $aTable.view_cats != '' AND $aTable.view_cats IS NOT NULL - GROUP BY $aTable.view_cats;"; - $rows = $wpdb->get_results($aSql, OBJECT_K); - $numRows = $wpdb->num_rows; - if($rows) { - foreach($rows as $row) { - $slugs = array(); - $cats = explode(',', $row->view_cats); - foreach($cats as $cat) { - $slug = array_search($cat, $aTerms); - if($slug) array_push($slugs, $slug); - } - $aSlugs = implode(',', $slugs); - $wpdb->update($aTable, array('view_cats' => $aSlugs), array('view_cats' => $row->view_cats), '%s', '%s'); - } - } - // XCategories - $aSql = "SELECT $aTable.x_view_cats - FROM $aTable - WHERE $aTable.x_view_cats != '' AND $aTable.x_view_cats IS NOT NULL - GROUP BY $aTable.x_view_cats;"; - $rows = $wpdb->get_results($aSql, OBJECT_K); - $numRows = $wpdb->num_rows; - if($rows) { - foreach($rows as $row) { - $slugs = array(); - $cats = explode(',', $row->x_view_cats); - foreach($cats as $cat) { - $slug = array_search($cat, $aTerms); - if($slug) array_push($slugs, $slug); - } - $aSlugs = implode(',', $slugs); - $wpdb->update($aTable, array('x_view_cats' => $aSlugs), array('x_view_cats' => $row->x_view_cats), '%s', '%s'); - } - } - // Tags - $aSql = "SELECT $aTable.view_tags - FROM $aTable - WHERE $aTable.view_tags != '' AND $aTable.view_tags IS NOT NULL - GROUP BY $aTable.view_tags;"; - $rows = $wpdb->get_results($aSql, OBJECT_K); - $numRows = $wpdb->num_rows; - if($rows) { - foreach($rows as $row) { - $slugs = array(); - $tags = explode(',', $row->view_tags); - foreach($tags as $tag) { - $slug = array_search($tag, $aTerms); - if($slug) array_push($slugs, $slug); - } - $aSlugs = implode(',', $slugs); - $wpdb->update($aTable, array('view_tags' => $aSlugs), array('view_tags' => $row->view_tags), '%s', '%s'); - } - } - // XTags - $aSql = "SELECT $aTable.x_view_tags - FROM $aTable - WHERE $aTable.x_view_tags != '' AND $aTable.x_view_tags IS NOT NULL - GROUP BY $aTable.x_view_tags;"; - $rows = $wpdb->get_results($aSql, OBJECT_K); - $numRows = $wpdb->num_rows; - if($rows) { - foreach($rows as $row) { - $slugs = array(); - $tags = explode(',', $row->x_view_tags); - foreach($tags as $tag) { - $slug = array_search($tag, $aTerms); - if($slug) array_push($slugs, $slug); - } - $aSlugs = implode(',', $slugs); - $wpdb->update($aTable, array('x_view_tags' => $aSlugs), array('x_view_tags' => $row->x_view_tags), '%s', '%s'); - } - } - } - - if($el) { - self::errorWrite($eTable, $aTable, $aSql, $dbResult); - $dbResult = null; - } + if(is_null($dbResult) || $dbResult !== false) self::adsUpdateData($aTable); + // Zones Table if($wpdb->get_var("SHOW TABLES LIKE '$zTable'") != $zTable) { $zSql = "CREATE TABLE $zTable ( id INT(11) NOT NULL AUTO_INCREMENT, @@ -522,25 +384,17 @@ public function update() { ) $charset_collate;"; dbDelta($zSql); } - elseif(in_array($dbVersion, array('0.1', '0.2', '0.3', '0.3.1', '0.4', '0.5', '0.5.1'))) { - $zSql = "ALTER TABLE $zTable - CONVERT TO $charset_collate, - ADD COLUMN z_ct INT(11) DEFAULT 0, - ADD COLUMN z_cts INT(11) DEFAULT 0, - ADD COLUMN z_single_ct LONGTEXT DEFAULT NULL, - ADD COLUMN z_archive_ct LONGTEXT DEFAULT NULL;"; - $dbResult = $wpdb->query($zSql); - } - elseif($vData['major'] < 2) { - $zSql = "ALTER TABLE $zTable CONVERT TO $charset_collate;"; - $dbResult = $wpdb->query($zSql); + else { + $zSql = self::getUpdateSql($zTable, $sam_tables_defs['zones']); + if(!empty($zSql)) $dbResult = $wpdb->query($zSql); } if($el) { - self::errorWrite($eTable, $zTable, $zSql, $dbResult); + self::errorWrite($eTable, $zTable, $zSql, $dbResult, $wpdb->last_error); $dbResult = null; } + // Blocks Table if($wpdb->get_var("SHOW TABLES LIKE '$bTable'") != $bTable) { $bSql = "CREATE TABLE $bTable ( id INT(11) NOT NULL AUTO_INCREMENT, @@ -562,17 +416,41 @@ public function update() { ) $charset_collate;"; dbDelta($bSql); } - elseif($vData['major'] < 2) { - $bSql = "ALTER TABLE $bTable CONVERT TO $charset_collate;"; - $dbResult = $wpdb->query($bSql); + else { + $bSql = self::getUpdateSql($bTable, $sam_tables_defs['blocks']); + if(!empty($bSql)) $dbResult = $wpdb->query($bSql); + } + + if($el) { + self::errorWrite($eTable, $bTable, $bSql, $dbResult, $wpdb->last_error); + $dbResult = null; + } + + // Statistics Table + if($wpdb->get_var("SHOW TABLES LIKE '$sTable'") != $sTable) { + $sSql = "CREATE TABLE $sTable ( + id int(10) UNSIGNED DEFAULT NULL, + pid int(10) UNSIGNED DEFAULT NULL, + event_time datetime DEFAULT NULL, + event_type tinyint(1) DEFAULT NULL + ) + $charset_collate + COMMENT = 'Simple Ads Manager Statistics';"; + dbDelta($sSql); + } + else { + $sSql = self::getUpdateSql($sTable, $sam_tables_defs['stats']); + if(!empty($sSql)) $dbResult = $wpdb->query($sSql); } - if($el) self::errorWrite($eTable, $pTable, $bSql, $dbResult); + if($el) { + self::errorWrite($eTable, $sTable, $sSql, $dbResult, $wpdb->last_error); + $dbResult = null; + } update_option('sam_db_version', SAM_DB_VERSION); } update_option('sam_version', SAM_VERSION); - //$this->getVersions(true); } } } diff --git a/widget.class.php b/widget.class.php index 04bbe47..b5bc822 100644 --- a/widget.class.php +++ b/widget.class.php @@ -1,18 +1,19 @@ crawler = $this->isCrawler(); $this->aTitle = __('Ads Place:', SAM_DOMAIN); $this->wTable = 'sam_places'; $widget_ops = array( 'classname' => 'simple_ads_manager_widget', 'description' => __('Ads Place rotator serviced by Simple Ads Manager.', SAM_DOMAIN)); $control_ops = array( 'id_base' => 'simple_ads_manager_widget' ); - $this->WP_Widget( 'simple_ads_manager_widget', __('Ads Place', SAM_DOMAIN), $widget_ops, $control_ops ); + parent::__construct( 'simple_ads_manager_widget', __('Ads Place', SAM_DOMAIN), $widget_ops, $control_ops ); } function getSettings() { @@ -20,7 +21,7 @@ function getSettings() { return $options; } - private function isCrawler() { + protected function isCrawler() { $options = $this->getSettings(); $crawler = false; @@ -31,19 +32,19 @@ private function isCrawler() { $_SERVER['HTTP_ACCEPT'] == '' || $_SERVER['HTTP_ACCEPT_ENCODING'] == '' || $_SERVER['HTTP_ACCEPT_LANGUAGE'] == '' || - $_SERVER['HTTP_CONNECTION']=='') $crawler == true; + $_SERVER['HTTP_CONNECTION']=='' || is_admin()) $crawler = true; break; case 'exact': - include_once('browser.php'); - $browser = new Browser(); - $crawler = $browser->isRobot(); + include_once('sam-browser.php'); + $browser = new samBrowser(); + $crawler = $browser->isRobot() || is_admin(); break; case 'more': if(ini_get("browscap")) { $browser = get_browser(null, true); - $crawler = $browser['crawler']; + $crawler = $browser['crawler'] || is_admin(); } break; } @@ -52,25 +53,27 @@ private function isCrawler() { } function widget( $args, $instance ) { - extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']); $adp_id = $instance['adp_id']; $hide_style = $instance['hide_style']; $place_codes = $instance['place_codes']; - - $ad = new SamAdPlace(array('id' => $adp_id), $place_codes, $this->crawler); - $content = $ad->ad; + + if(!is_admin()) { + $ad = new SamAdPlace(array('id' => $adp_id), $place_codes, $this->crawler); + $content = $ad->ad; + } + else $content = ''; if(!empty($content)) { if ( !$hide_style ) { - echo $before_widget; - if ( !empty( $title ) ) echo $before_title . $title . $after_title; + echo $args['before_widget']; + if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; echo $content; - echo $after_widget; + echo $args['after_widget']; } else echo $content; } } - + function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); @@ -79,79 +82,77 @@ function update( $new_instance, $old_instance ) { $instance['place_codes'] = isset($new_instance['place_codes']); return $instance; } - + function form( $instance ) { global $wpdb; $pTable = $wpdb->prefix . $this->wTable; - + $ids = $wpdb->get_results("SELECT $pTable.id, $pTable.name FROM $pTable WHERE $pTable.trash IS FALSE", ARRAY_A); - - $instance = wp_parse_args((array) $instance, + + $instance = wp_parse_args((array) $instance, array( - 'title' => '', - 'adp_id' => '', + 'title' => '', + 'adp_id' => '', 'parse' => false ) ); $title = strip_tags($instance['title']); - $adp_id = $instance['adp_id']; - $hide_style = $instance['hide_style']; - $place_codes = $instance['place_codes']; ?>

        - +

        - -

        +

        - /> 

        - /> 

        - crawler = $this->isCrawler(); $this->aTitle = __('Ads Zone', SAM_DOMAIN).':'; $this->wTable = 'sam_zones'; $widget_ops = array( 'classname' => 'simple_ads_manager_zone_widget', 'description' => __('Ads Zone selector serviced by Simple Ads Manager.', SAM_DOMAIN)); $control_ops = array( 'id_base' => 'simple_ads_manager_zone_widget' ); - $this->WP_Widget( 'simple_ads_manager_zone_widget', __('Ads Zone', SAM_DOMAIN), $widget_ops, $control_ops ); + parent::__construct( 'simple_ads_manager_zone_widget', __('Ads Zone', SAM_DOMAIN), $widget_ops, $control_ops ); } function getSettings() { @@ -170,19 +171,19 @@ private function isCrawler() { $_SERVER['HTTP_ACCEPT'] == '' || $_SERVER['HTTP_ACCEPT_ENCODING'] == '' || $_SERVER['HTTP_ACCEPT_LANGUAGE'] == '' || - $_SERVER['HTTP_CONNECTION']=='') $crawler == true; + $_SERVER['HTTP_CONNECTION']=='' || is_admin()) $crawler = true; break; case 'exact': - include_once('browser.php'); - $browser = new Browser(); - $crawler = $browser->isRobot(); + include_once('sam-browser.php'); + $browser = new samBrowser(); + $crawler = $browser->isRobot() || is_admin(); break; case 'more': if(ini_get("browscap")) { $browser = get_browser(null, true); - $crawler = $browser['crawler']; + $crawler = $browser['crawler'] || is_admin(); } break; } @@ -191,7 +192,6 @@ private function isCrawler() { } function widget( $args, $instance ) { - extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']); $adp_id = $instance['adp_id']; $hide_style = $instance['hide_style']; @@ -201,10 +201,10 @@ function widget( $args, $instance ) { $content = $ad->ad; if(!empty($content)) { if ( !$hide_style ) { - echo $before_widget; - if ( !empty( $title ) ) echo $before_title . $title . $after_title; + echo $args['before_widget']; + if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; echo $content; - echo $after_widget; + echo $args['after_widget']; } else echo $content; } @@ -233,9 +233,6 @@ function form( $instance ) { ) ); $title = strip_tags($instance['title']); - $adp_id = $instance['adp_id']; - $hide_style = $instance['hide_style']; - $place_codes = $instance['place_codes']; ?>

        crawler = $this->isCrawler(); $this->aTitle = __('Ad', SAM_DOMAIN).':'; $this->wTable = 'sam_ads'; $widget_ops = array( 'classname' => 'simple_ads_manager_ad_widget', 'description' => __('Non-rotating single ad serviced by Simple Ads Manager.', SAM_DOMAIN)); $control_ops = array( 'id_base' => 'simple_ads_manager_ad_widget' ); - $this->WP_Widget( 'simple_ads_manager_ad_widget', __('Single Ad', SAM_DOMAIN), $widget_ops, $control_ops ); + parent::__construct( 'simple_ads_manager_ad_widget', __('Single Ad', SAM_DOMAIN), $widget_ops, $control_ops ); } function getSettings() { @@ -309,19 +307,19 @@ private function isCrawler() { $_SERVER['HTTP_ACCEPT'] == '' || $_SERVER['HTTP_ACCEPT_ENCODING'] == '' || $_SERVER['HTTP_ACCEPT_LANGUAGE'] == '' || - $_SERVER['HTTP_CONNECTION']=='') $crawler == true; + $_SERVER['HTTP_CONNECTION']=='' || is_admin()) $crawler = true; break; case 'exact': - include_once('browser.php'); - $browser = new Browser(); - $crawler = $browser->isRobot(); + include_once('sam-browser.php'); + $browser = new samBrowser(); + $crawler = $browser->isRobot() || is_admin(); break; case 'more': if(ini_get("browscap")) { $browser = get_browser(null, true); - $crawler = $browser['crawler']; + $crawler = $browser['crawler'] || is_admin(); } break; } @@ -340,10 +338,10 @@ function widget( $args, $instance ) { $content = $ad->ad; if(!empty($content)) { if ( !$hide_style ) { - echo $before_widget; - if ( !empty( $title ) ) echo $before_title . $title . $after_title; + echo $args['before_widget']; + if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; echo $content; - echo $after_widget; + echo $args['after_widget']; } else echo $content; } @@ -372,9 +370,6 @@ function form( $instance ) { ) ); $title = strip_tags($instance['title']); - $adp_id = $instance['adp_id']; - $hide_style = $instance['hide_style']; - $ad_codes = $instance['ad_codes']; ?>

        crawler = $this->isCrawler(); $this->aTitle = __('Block', SAM_DOMAIN).':'; $this->wTable = 'sam_blocks'; $widget_ops = array( 'classname' => 'simple_ads_manager_block_widget', 'description' => __('Ads Block collector serviced by Simple Ads Manager.', SAM_DOMAIN)); $control_ops = array( 'id_base' => 'simple_ads_manager_block_widget' ); - $this->WP_Widget( 'simple_ads_manager_block_widget', __('Ads Block', SAM_DOMAIN), $widget_ops, $control_ops ); + parent::__construct( 'simple_ads_manager_block_widget', __('Ads Block', SAM_DOMAIN), $widget_ops, $control_ops ); } function getSettings() { @@ -448,19 +444,19 @@ private function isCrawler() { $_SERVER['HTTP_ACCEPT'] == '' || $_SERVER['HTTP_ACCEPT_ENCODING'] == '' || $_SERVER['HTTP_ACCEPT_LANGUAGE'] == '' || - $_SERVER['HTTP_CONNECTION']=='') $crawler == true; + $_SERVER['HTTP_CONNECTION']=='' || is_admin()) $crawler = true; break; case 'exact': - if(!class_exists('Browser')) include_once('browser.php'); - $browser = new Browser(); - $crawler = $browser->isRobot(); + if(!class_exists('samBrowser')) include_once('sam-browser.php'); + $browser = new samBrowser(); + $crawler = $browser->isRobot() || is_admin(); break; case 'more': if(ini_get("browscap")) { $browser = get_browser(null, true); - $crawler = $browser['crawler']; + $crawler = $browser['crawler'] || is_admin(); } break; } @@ -478,10 +474,10 @@ function widget( $args, $instance ) { $content = $block->ad; if(!empty($content)) { if ( !$hide_style ) { - echo $before_widget; - if ( !empty( $title ) ) echo $before_title . $title . $after_title; + echo $args['before_widget']; + if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; echo $content; - echo $after_widget; + echo $args['after_widget']; } else echo $content; } @@ -509,9 +505,6 @@ function form( $instance ) { ) ); $title = strip_tags($instance['title']); - $adp_id = $instance['adp_id']; - $hide_style = $instance['hide_style']; - $ad_codes = $instance['ad_codes']; ?>

        diff --git a/zone.editor.admin.class.php b/zone.editor.admin.class.php index 719ae75..7cbcba2 100644 --- a/zone.editor.admin.class.php +++ b/zone.editor.admin.class.php @@ -33,50 +33,54 @@ private function getCustomPostTypes() { return $post_types; } - private function getTax($type = 'category') { + private function getTaxes($type = 'category') { if(empty($type)) return; + + if($type === 'custom_tax_terms') $wc = "NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format')"; + else $wc = "wtt.taxonomy = '$type'"; global $wpdb; $tTable = $wpdb->prefix . "terms"; $ttTable = $wpdb->prefix . "term_taxonomy"; $sql = "SELECT - $tTable.term_id, - $tTable.name, - $tTable.slug, - $ttTable.taxonomy + wt.term_id, + wt.name, + wt.slug, + wtt.taxonomy FROM - $tTable - INNER JOIN $ttTable - ON $tTable.term_id = $ttTable.term_id + $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id WHERE - $ttTable.taxonomy = '$type' AND $tTable.term_id <> 1;"; + $wc AND wt.term_id <> 1;"; $taxonomies = $wpdb->get_results($sql, ARRAY_A); $output = array(); foreach($taxonomies as $tax) { - array_push($output, array('name' => $tax['name'], 'slug' => $tax['slug'])); + array_push($output, array('name' => $tax['name'], 'slug' => $tax['slug'], 'tax' => $tax['taxonomy'])); } return $output; } private function getAuthors() { global $wpdb; - $uTable = $wpdb->prefix . "users"; - $umTable = $wpdb->prefix . "usermeta"; + $uTable = $wpdb->base_prefix . "users"; + $umTable = $wpdb->base_prefix . "usermeta"; + $userLevel = $wpdb->base_prefix . 'user_level'; $sql = "SELECT - $uTable.id, - $uTable.user_nicename, - $uTable.display_name + wu.id, + wu.user_nicename, + wu.display_name FROM - $uTable - INNER JOIN $umTable - ON $uTable.ID = $umTable.user_id + $uTable wu + INNER JOIN $umTable wum + ON wu.ID = wum.user_id WHERE - $umTable.meta_key = 'wp_user_level' AND - $umTable.meta_value > 1;"; + wum.meta_key = '$userLevel' AND + wum.meta_value > 1;"; $auth = $wpdb->get_results($sql, ARRAY_A); $authors = array(); @@ -91,9 +95,12 @@ public function page() { $pTable = $wpdb->prefix . "sam_places"; $options = $this->settings; - $cats = $this->getTax(); - $authors = $this->getAuthors(); - $customs = $this->getCustomPostTypes(); + $taxes = self::getTaxes('custom_tax_terms'); + $cats = self::getTaxes(); + $authors = self::getAuthors(); + $customs = self::getCustomPostTypes(); + + $uTaxes = array(); $uCats = array(); $uAuthors = array(); $uSingleCT = array(); @@ -112,6 +119,12 @@ public function page() { if(isset($_POST['update_zone'])) { $zoneId = $_POST['zone_id']; + foreach($taxes as $tax) { + if(isset($_POST['z_taxes_'.$tax['slug']])) { + $value = (integer) $_POST['z_taxes_'.$tax['slug']]; + $uTaxes[$tax['slug']] = array('id' => $value, 'tax' => $tax['tax']); + } + } foreach($cats as $cat) { if(isset($_POST['z_cats_'.$cat['slug']])) { $value = (integer) $_POST['z_cats_'.$cat['slug']]; @@ -132,7 +145,6 @@ public function page() { 'z_home' => $_POST['z_home'], 'z_singular' => $_POST['z_singular'], 'z_single' => $_POST['z_single'], - //FIXED 'z_ct' => $_POST['z_ct'], 'z_ct' => (isset($_POST['z_ct']) ? $_POST['z_ct'] : -1), 'z_single_ct' => serialize($uSingleCT), 'z_page' => $_POST['z_page'], @@ -141,20 +153,22 @@ public function page() { 'z_404' => $_POST['z_404'], 'z_archive' => $_POST['z_archive'], 'z_tax' => $_POST['z_tax'], + 'z_taxes' => serialize($uTaxes), 'z_category' => $_POST['z_category'], 'z_cats' => serialize($uCats), 'z_tag' => $_POST['z_tag'], 'z_author' => $_POST['z_author'], 'z_authors' => serialize($uAuthors), - //FIXED 'z_cts' => $_POST['z_cts'], 'z_cts' => (isset($_POST['z_cts']) ? $_POST['z_cts'] : -1), 'z_archive_ct' => serialize($uArchiveCT), 'z_date' => $_POST['z_date'], - //FIXED 'trash' => ($_POST['trash'] === 'true') 'trash' => ($_POST['trash'] === 'true' ? 1 : 0) ); - //FIXED $formatRow = array( '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d'); - $formatRow = array( '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d'); + $formatRow = array( + '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', + '%d', '%d', '%d', '%d', '%s', '%d', '%s', '%d', '%d', '%s', + '%d', '%s', '%d', '%d' + ); if($zoneId === __('Undefined', SAM_DOMAIN)) { $wpdb->insert($zTable, $updateRow); $updated = true; @@ -185,7 +199,8 @@ public function page() { z_search, z_404, z_archive, - z_tax, + z_tax, + z_taxes, z_category, z_cats, z_tag, @@ -200,17 +215,25 @@ public function page() { $pSql = "SELECT id, name FROM $pTable WHERE $pTable.trash IS FALSE;"; $places = $wpdb->get_results($pSql, ARRAY_A); + $sCats = array(); $sAuthors = array(); $sSingleCT = array(); $sArchiveCT = array(); + $sTaxes = array(); if($action !== 'new') { $row = $wpdb->get_row($zSql, ARRAY_A); + $zTaxes = unserialize($row['z_taxes']); $zCats = unserialize($row['z_cats']); $zAuthors = unserialize($row['z_authors']); $zSingleCT = unserialize($row['z_single_ct']); $zArchiveCT = unserialize($row['z_archive_ct']); + + foreach($taxes as $tax) { + $val = (!is_null($zTaxes[$tax['slug']])) ? $zTaxes[$tax['slug']]['id'] : -1; + array_push($sTaxes, array('name' => $tax['name'], 'slug' => $tax['slug'], 'tax' => $tax['tax'], 'val' => $val)); + } foreach($cats as $cat) { $val = (!is_null($zCats[$cat['slug']])) ? $zCats[$cat['slug']] : -1; array_push($sCats, array('name' => $cat['name'], 'slug' => $cat['slug'], 'val' => $val)); @@ -229,10 +252,16 @@ public function page() { else { if($updated) { $row = $wpdb->get_row($zSql, ARRAY_A); + $zTaxes = unserialize($row['z_taxes']); $zCats = unserialize($row['z_cats']); $zAuthors = unserialize($row['z_authors']); $zSingleCT = unserialize($row['z_single_ct']); $zArchiveCT = unserialize($row['z_archive_ct']); + + foreach($taxes as $tax) { + $val = (!is_null($zTaxes[$tax['slug']])) ? $zTaxes[$tax['slug']]['id'] : -1; + array_push($sTaxes, array('name' => $tax['name'], 'slug' => $tax['slug'], 'tax' => $tax['tax'], 'val' => $val)); + } foreach($cats as $cat) { $val = (!is_null($zCats[$cat['slug']])) ? $zCats[$cat['slug']] : -1; array_push($sCats, array('name' => $cat['name'], 'slug' => $cat['slug'], 'val' => $val)); @@ -271,6 +300,7 @@ public function page() { 'z_date' => -1, 'trash' => false ); + foreach($taxes as $tax) array_push($sTaxes, array('name' => $tax['name'], 'slug' => $tax['slug'], 'tax' => $tax['tax'], 'val' => -1)); foreach($cats as $cat) array_push($sCats, array('name' => $cat['name'], 'slug' => $cat['slug'], 'val' => -1)); foreach($authors as $key => $author) array_push($sAuthors, array('id' => $author, 'name' => $key, 'val' => -1)); foreach($customs as $custom) { @@ -461,62 +491,80 @@ public function page() { drawPlacesSelector($places, $row['z_tax'], false); ?>

        -
        -

        - - -

        - 1) { + 1) { + ?> +
        + -
        -

        - - ' name=''> + drawPlacesSelector($places, $tax['val'], false); ?> -

        - +

        +
        - +

        + + +

        + 1) { ?> +
        -

        - - -

        -
        - -

        - - -

        - -
        - + foreach($sCats as $cat) { + ?>

        - - ' name=''> + drawPlacesSelector($places, $cat['val'], false); ?>

        +
        + + +

        + + +

        +
        + +

        + + +

        + +
        + +

        + + +