Popup Builder – Responsive WordPress Pop up - Version 2.0.1

Version Description

Download this release

Release Info

Developer Sygnoos
Plugin Icon 128x128 Popup Builder – Responsive WordPress Pop up
Version 2.0.1
Comparing to
See all releases

Code changes from version 1.1.4 to 2.0.1

classes/PopupInstaller.php ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class PopupInstaller {
3
+ public static function creteTable() {
4
+ global $wpdb;
5
+ $sg_popup_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix ."sg_popup (
6
+ `id` int(11) NOT NULL AUTO_INCREMENT,
7
+ `type` varchar(255) NOT NULL,
8
+ `title` varchar(255) NOT NULL,
9
+ `options` text NOT NULL,
10
+ PRIMARY KEY (id)
11
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
12
+ $sg_popup_image_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix ."sg_image_popup (
13
+ `id` int(11) NOT NULL,
14
+ `url` varchar(255) NOT NULL
15
+ ) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=latin1;";
16
+ $sg_popup_html_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix ."sg_html_popup (
17
+ `id` int(11) NOT NULL,
18
+ `content` text NOT NULL
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
20
+
21
+
22
+ $wpdb->query($sg_popup_base);
23
+ $wpdb->query($sg_popup_image_base);
24
+ $wpdb->query($sg_popup_html_base);
25
+ }
26
+ public static function createTables($bolgs_id) {
27
+ global $wpdb;
28
+ update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
29
+ $sg_popup_net_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$bolgs_id."_sg_popup (
30
+ `id` int(11) NOT NULL AUTO_INCREMENT,
31
+ `type` varchar(255) NOT NULL,
32
+ `title` varchar(255) NOT NULL,
33
+ `options` text NOT NULL,
34
+ PRIMARY KEY (id)
35
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
36
+ $sg_popup_image_net_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$bolgs_id."_sg_image_popup (
37
+ `id` int(11) NOT NULL,
38
+ `url` varchar(255) NOT NULL
39
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
40
+ $sg_popup_html_net_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$bolgs_id."_sg_html_popup (
41
+ `id` int(11) NOT NULL,
42
+ `content` varchar(255) NOT NULL
43
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
44
+
45
+
46
+ $wpdb->query($sg_popup_net_base);
47
+ $wpdb->query($sg_popup_image_net_base);
48
+ $wpdb->query($sg_popup_html_net_base);
49
+ }
50
+
51
+ public static function install() {
52
+ $obj = new self();
53
+
54
+ $obj->creteTable();
55
+ if(is_multisite() ) {
56
+
57
+ $stites = wp_get_sites();
58
+ foreach($stites as $site) {
59
+ $bolgs_id = $site['blog_id'];
60
+ global $wpdb;
61
+ $obj->createTables($bolgs_id);
62
+ }
63
+ }
64
+ }
65
+ public static function uninstallTabele() {
66
+ global $wpdb;
67
+ $delete = "DELETE FROM ".$wpdb->prefix."postmeta WHERE meta_key = 'sg_promotional_popup' ";
68
+ $wpdb->query($delete);
69
+ $popup_table = $wpdb->prefix."sg_popup";
70
+ $popup_sql = "DROP TABLE ". $popup_table;
71
+ $popup_image_table = $wpdb->prefix."sg_image_popup";
72
+ $popup_image_sql = "DROP TABLE ". $popup_image_table;
73
+ $popup_html_table = $wpdb->prefix."sg_html_popup";
74
+ $popup_html_sql = "DROP TABLE ". $popup_html_table;
75
+
76
+ $wpdb->query($popup_sql);
77
+ $wpdb->query($popup_image_sql);
78
+ $wpdb->query($popup_html_sql);
79
+
80
+ }
81
+ public static function uninstallTabeles($bolgs_id) {
82
+ global $wpdb;
83
+ $delete = "DELETE FROM ".$wpdb->prefix.$bolgs_id."_postmeta WHERE meta_key = 'sg_promotional_popup' ";
84
+ $wpdb->query($delete);
85
+ $popup_net_table = $wpdb->prefix.$bolgs_id."_sg_popup";
86
+ $popup_net_sql = "DROP TABLE ". $popup_net_table;
87
+ $popup_image_net_table = $wpdb->prefix.$bolgs_id."_sg_image_popup";
88
+ $popup_image_net_sql = "DROP TABLE ". $popup_image_net_table;
89
+ $popup_html_net_table = $wpdb->prefix.$bolgs_id."_sg_html_popup";
90
+ $popup_html_net_sql = "DROP TABLE ". $popup_html_net_table;
91
+
92
+ $wpdb->query($popup_net_sql);
93
+ $wpdb->query($popup_image_net_sql);
94
+ $wpdb->query($popup_html_net_sql);
95
+
96
+ }
97
+ public static function uninstall() {
98
+ global $wpdb; //required global declaration of WP variable
99
+
100
+ $obj = new self();
101
+
102
+ $obj->uninstallTabele();
103
+ if(is_multisite() ) {
104
+
105
+ $stites = wp_get_sites();
106
+ foreach($stites as $site) {
107
+ $bolgs_id = $site['blog_id'];
108
+ global $wpdb;
109
+ $obj->uninstallTabeles($bolgs_id);
110
+ }
111
+ }
112
+
113
+ }
114
+ public function covertPromotionalTable() {
115
+ global $wpdb;
116
+ $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_promotional_popup", array());
117
+ $popups = $wpdb->get_results($st, ARRAY_A);
118
+ foreach ($popups as $popup) {
119
+ $options = $popup['options'];
120
+ $jsonData = json_decode($options);
121
+ $title = $jsonData->title;
122
+ $type = strtolower($popup['content']);
123
+ $mainsql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
124
+ $resmain = $wpdb->query($mainsql);
125
+ $id = $popup['id'];
126
+ $sgHtmlPopup = $popup['html'];
127
+ $sgImagePopup = $popup['image'];
128
+ $sgIframePopup = $popup['iframe'];
129
+ $sgShortCodePopup = $popup['shortCode'];
130
+ switch ( $popup['content']) {
131
+ case 'iframe':
132
+ $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_iframe_popup (id, url) VALUES (%d,%s)",$id,$sgIframePopup);
133
+ $res = $wpdb->query($sql);
134
+ break;
135
+ case "Image":
136
+ $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_image_popup (id, url) VALUES (%d,%s)",$id,$sgImagePopup);
137
+ $res = $wpdb->query($sql);
138
+ break;
139
+ case "html":
140
+ $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_html_popup (id, content) VALUES (%d,%s)",$id,$sgHtmlPopup);
141
+ $res = $wpdb->query($sql);
142
+ break;
143
+ case "shortCode":
144
+ $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_shortcode_popup (id, url) VALUES (%d,%s)",$id,$sgShortCodePopup);
145
+ $res = $wpdb->query($sql);
146
+ break;
147
+ }
148
+ }
149
+ }
150
+
151
+ public function covertPromotionalTables($bolgs_id) {
152
+ global $wpdb;
153
+ $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix.$bolgs_id."_sg_promotional_popup", array());
154
+ $popups = $wpdb->get_results($st, ARRAY_A);
155
+ foreach ($popups as $popup) {
156
+ $options = $popup['options'];
157
+ $jsonData = json_decode($options);
158
+ $title = $jsonData->title;
159
+ $type = strtolower($popup['content']);
160
+ $mainsqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
161
+ $resmain = $wpdb->query($mainsqlnet);
162
+ $id = $popup['id'];
163
+ $sgHtmlPopup = $popup['html'];
164
+ $sgImagePopup = $popup['image'];
165
+ $sgIframePopup = $popup['iframe'];
166
+ $sgShortCodePopup = $popup['shortCode'];
167
+ switch ( $popup['content']) {
168
+ case 'iframe':
169
+ $sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_iframe_popup (id, url) VALUES (%d,%s)",$id,$sgIframePopup);
170
+ $res = $wpdb->query($sqlnet);
171
+ break;
172
+ case "Image":
173
+ $sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_image_popup (id, url) VALUES (%d,%s)",$id,$sgImagePopup);
174
+ $res = $wpdb->query($sqlnet);
175
+ break;
176
+ case "html":
177
+ $sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_html_popup (id, content) VALUES (%d,%s)",$id,$sgHtmlPopup);
178
+ $res = $wpdb->query($sqlnet);
179
+ break;
180
+ case "shortCode":
181
+ $sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_shortcode_popup (id, url) VALUES (%d,%s)",$id,$sgShortCodePopup);
182
+ $res = $wpdb->query($sqlnet);
183
+ break;
184
+ }
185
+ }
186
+ }
187
+ public static function convert() {
188
+ global $wpdb;
189
+
190
+ $obj = new self();
191
+
192
+ $obj->covertPromotionalTable();
193
+
194
+ if(is_multisite()) {
195
+ $stites = wp_get_sites();
196
+ foreach($stites as $site) {
197
+ $bolgs_id = $site['blog_id'];
198
+ global $wpdb;
199
+
200
+ $obj->covertPromotionalTables($bolgs_id);
201
+ }
202
+ }
203
+ }
204
+ }
classes/SGHtmlPopup.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/SGPopup.php');
3
+
4
+ class SGHtmlPopup extends SGPopup {
5
+ public $content;
6
+
7
+ public function setContent($content) {
8
+ $this->content = $content;
9
+ }
10
+ public function getContent() {
11
+ return $this->content;
12
+ }
13
+ public static function create($data, $obj = null) {
14
+ $obj = new self();
15
+
16
+ $obj->setContent($data['html']);
17
+
18
+ return parent::create($data, $obj);
19
+ }
20
+ public function save($data = array()) {
21
+
22
+ $editMode = $this->getId()?true:false;
23
+
24
+ $res = parent::save($data);
25
+ if (!$res) return false;
26
+
27
+ $sgHtmlPopup = $this->getContent();
28
+
29
+ global $wpdb;
30
+ if ($editMode) {
31
+ $sgHtmlPopup = stripslashes($sgHtmlPopup);
32
+ $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_html_popup SET content=%s WHERE id=%d",$sgHtmlPopup,$this->getId());
33
+ $res = $wpdb->query($sql);
34
+ }
35
+ else {
36
+
37
+ $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_html_popup (id, content) VALUES (%d,%s)",$this->getId(),$sgHtmlPopup);
38
+ $res = $wpdb->query($sql);
39
+ }
40
+ return $res;
41
+ }
42
+
43
+ protected function setCustomOptions($id) {
44
+ global $wpdb;
45
+ $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_html_popup WHERE id = %d",$id);
46
+ $arr = $wpdb->get_row($st,ARRAY_A);
47
+ $this->setContent($arr['content']);
48
+ }
49
+
50
+ protected function getExtraRenderOptions() {
51
+ return array('html'=>$this->getContent());
52
+ }
53
+
54
+ public function render() {
55
+ return parent::render();
56
+ }
57
+ }
classes/SGImagePopup.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/SGPopup.php');
3
+
4
+ class SGImagePopup extends SGPopup {
5
+ private $url;
6
+
7
+ public function setUrl($url) {
8
+ $this->url = $url;
9
+ }
10
+ public function getUrl() {
11
+ return $this->url;
12
+ }
13
+ public static function create($data, $obj = null) {
14
+ $obj = new self();
15
+
16
+ $obj->setUrl($data['image']);
17
+
18
+ parent::create($data, $obj);
19
+ }
20
+
21
+ public function save($data = array()) {
22
+
23
+ $editMode = $this->getId()?true:false;
24
+
25
+ $res = parent::save($data);
26
+ if ($res===false) return false;
27
+
28
+ global $wpdb;
29
+ if ($editMode) {
30
+ $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_image_popup SET url=%s WHERE id=%d",$this->getUrl(),$this->getId());
31
+ $res = $wpdb->query($sql);
32
+ }
33
+ else {
34
+
35
+ $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_image_popup (id, url) VALUES (%d,%s)",$this->getId(),$this->getUrl());
36
+ $res = $wpdb->query($sql);
37
+ }
38
+ return $res;
39
+ }
40
+
41
+ protected function setCustomOptions($id) {
42
+ global $wpdb;
43
+ $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_image_popup WHERE id = %d",$id);
44
+ $arr = $wpdb->get_row($st,ARRAY_A);
45
+ $this->setUrl($arr['url']);
46
+ }
47
+ protected function getExtraRenderOptions() {
48
+ return array('image'=>$this->getUrl());
49
+ }
50
+
51
+ public function render() {
52
+ return parent::render();
53
+ }
54
+ }
classes/SGPopup.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class SGPopup {
4
+ protected $id;
5
+ protected $type;
6
+ protected $title;
7
+ protected $width;
8
+ protected $height;
9
+ protected $delay;
10
+ protected $effectDuration;
11
+ protected $effect;
12
+ protected $initialWidth;
13
+ protected $initialHeight;
14
+ protected $options;
15
+ public static $registeredScripts = false;
16
+
17
+ public function setType($type){
18
+ $this->type = $type;
19
+ }
20
+ public function getType() {
21
+ return $this->type;
22
+ }
23
+ public function setTitle($title){
24
+ $this->title = $title;
25
+ }
26
+ public function getTitle() {
27
+ return $this->title;
28
+ }
29
+ public function setId($id){
30
+ $this->id = $id;
31
+ }
32
+ public function getId() {
33
+ return $this->id;
34
+ }
35
+ public function setWidth($width){
36
+ $this->width = $width;
37
+ }
38
+ public function getWidth() {
39
+ return $this->width;
40
+ }
41
+ public function setHeight($height){
42
+ $this->height = $height;
43
+ }
44
+ public function getHeight() {
45
+ return $this->height;
46
+ }
47
+ public function setDelay($delay){
48
+ $this->delay = $delay;
49
+ }
50
+ public function getDelay() {
51
+ return $this->delay;
52
+ }
53
+ public function setEffectDuration($effectDuration){
54
+ $this->effectDuration = $effectDuration;
55
+ }
56
+ public function getEffectDuration() {
57
+ return $this->effectDuration;
58
+ }
59
+ public function setEffect($effect){
60
+ $this->effect = $effect;
61
+ }
62
+ public function getEffect() {
63
+ return $this->effect;
64
+ }
65
+ public function setInitialWidth($initialWidth){
66
+ $this->initialWidth = $initialWidth;
67
+ }
68
+ public function getInitialWidth() {
69
+ return $this->initialWidth;
70
+ }
71
+ public function setInitialHeight($initialHeight){
72
+ $this->initialHeight = $initialHeight;
73
+ }
74
+ public function getInitialHeight() {
75
+ return $this->initialHeight;
76
+ }
77
+ public function setOptions($options) {
78
+ $this->options = $options;
79
+ }
80
+ public function getOptions() {
81
+ return $this->options;
82
+ }
83
+ public static function findById($id) {
84
+
85
+ global $wpdb;
86
+ $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup WHERE id = %d",$id);
87
+ $arr = $wpdb->get_row($st,ARRAY_A);
88
+ if(!$arr) return false;
89
+ return self::popupObjectFromArray($arr);
90
+
91
+ }
92
+
93
+ abstract protected function setCustomOptions($id);
94
+
95
+ abstract protected function getExtraRenderOptions();
96
+
97
+ private static function popupObjectFromArray($arr, $obj = null) {
98
+
99
+ $jsonData = json_decode($arr['options'], true);
100
+
101
+ $type = notNull($arr['type']);
102
+
103
+ if ($obj===null) {
104
+ $className = "SG".ucfirst(strtolower($type)).'Popup';
105
+ require_once(dirname(__FILE__).'/'.$className.'.php');
106
+ $obj = new $className();
107
+ }
108
+
109
+ $obj->setType(notNull($type));
110
+ $obj->setTitle(notNull($arr['title']));
111
+ if (@$arr['id']) $obj->setId($arr['id']);
112
+ $obj->setWidth(notNull(@$jsonData['width']));
113
+ $obj->setHeight(notNull(@$jsonData['height']));
114
+ $obj->setDelay(notNull(@$jsonData['delay']));
115
+ $obj->setEffectDuration(notNull(@$jsonData['duration']));
116
+ $obj->setEffect(notNull($jsonData['effect']));
117
+ $obj->setInitialWidth(notNull(@$jsonData['initialWidth']));
118
+ $obj->setInitialHeight(notNull(@$jsonData['initialHeight']));
119
+ $obj->setOptions(notNull($arr['options']));
120
+
121
+ if (@$arr['id']) $obj->setCustomOptions($arr['id']);
122
+
123
+ return $obj;
124
+ }
125
+
126
+ public static function create($data, $obj)
127
+ {
128
+ self::popupObjectFromArray($data, $obj);
129
+ return $obj->save();
130
+ }
131
+ public function save($data = array()) {
132
+
133
+ $id = $this->getId();
134
+ $type = $this->getType();
135
+ $title = $this->getTitle();
136
+ $options = $this->getOptions();
137
+
138
+ global $wpdb;
139
+
140
+ if($id == '') {
141
+
142
+ $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
143
+ $res = $wpdb->query($sql);
144
+
145
+
146
+ if ($res) {
147
+ $id = $wpdb->insert_id;
148
+ $this->setId($id);
149
+ }
150
+
151
+ return $res;
152
+
153
+ }
154
+ else {
155
+ $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_popup SET type=%s,title=%s,options=%s WHERE id=%d",$type,$title,$options,$id);
156
+ $wpdb->query($sql);
157
+ if(!$wpdb->show_errors()) {
158
+ $res = 1;
159
+ }
160
+
161
+ return $res;
162
+ }
163
+ }
164
+ public static function findAll($orderBy = null, $limit = null, $offset = null) {
165
+
166
+ global $wpdb;
167
+
168
+ $query = "SELECT * FROM ". $wpdb->prefix ."sg_popup";
169
+
170
+ if ($orderBy) {
171
+ $query .= " ORDER BY ".$orderBy;
172
+ }
173
+
174
+ if ($limit) {
175
+ $query .= " LIMIT ".intval($offset).','.intval($limit);
176
+ }
177
+
178
+ //$st = $wpdb->prepare($query, array());
179
+ $popups = $wpdb->get_results($query, ARRAY_A);
180
+
181
+ $arr = array();
182
+ foreach ($popups as $popup) {
183
+ $arr[] = self::popupObjectFromArray($popup);
184
+ }
185
+
186
+ return $arr;
187
+ }
188
+ public static function delete($id) {
189
+ $pop = self::findById($id);
190
+ $type = $pop->getType();
191
+ $table = 'sg_'.$type.'_Popup';
192
+
193
+ global $wpdb;
194
+ $wpdb->query(
195
+ $wpdb->prepare(
196
+ "DELETE FROM ". $wpdb->prefix ."$table WHERE id = %d"
197
+ ,$id
198
+ )
199
+ );
200
+ $wpdb->query(
201
+ $wpdb->prepare(
202
+ "DELETE FROM ". $wpdb->prefix ."sg_popup WHERE id = %d"
203
+ ,$id
204
+ )
205
+ );
206
+
207
+ $wpdb->query(
208
+ $wpdb->prepare(
209
+ "DELETE FROM ". $wpdb->prefix ."postmeta WHERE meta_value = %d and meta_key = 'wp_sg_popup'"
210
+ ,$id
211
+ )
212
+ );
213
+ }
214
+
215
+ public static function setPopupForPost($post_id, $popupId) {
216
+ update_post_meta($post_id, 'wp_sg_popup' , $popupId);
217
+ }
218
+
219
+
220
+ public function render() {
221
+ $parentOption = array('id'=>$this->getId(),'title'=>$this->getTitle(),'type'=>$this->getType(),'effect'=>$this->getEffect(),'width',$this->getWidth(),'height'=>$this->getHeight(),'delay'=>$this->getDelay(),'duration'=>$this->getEffectDuration(),'initialWidth',$this->getInitialWidth(),'initialHeight'=>$this->getInitialHeight());
222
+ $getexrArray = $this->getExtraRenderOptions();
223
+ $options = json_decode($this->getOptions(),true);
224
+ if(empty($options)) $options = array();
225
+ $sgPopupVars = 'SG_POPUP_DATA['.$this->getId().'] ='.json_encode(array_merge($parentOption, $getexrArray, $options)).';';
226
+
227
+ return $sgPopupVars;
228
+ }
229
+ public static function getTotalRowCount() {
230
+ global $wpdb;
231
+ $res = $wpdb->get_var( "SELECT COUNT(id) FROM ". $wpdb->prefix ."sg_popup" );
232
+ return $res;
233
+ }
234
+ public static function getPagePopupId($page,$popup) {
235
+ global $wpdb;
236
+ $sql = $wpdb->prepare("SELECT meta_value FROM ". $wpdb->prefix ."postmeta WHERE post_id = %d AND meta_key = %s",$page,$popup);
237
+ $row = $wpdb->get_row($sql);
238
+ $id = (int)$row->meta_value;
239
+ return $id;
240
+ }
241
+
242
+ }
243
+
244
+ function notNull($param) {
245
+ return ($param===null?'':$param);
246
+ }
files/main_html_section.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="htmlType">
2
+ <?php
3
+ $content = wp_kses_post($sgPopupDataHtml);
4
+ $editor_id = 'sg_popup_html';
5
+ $settings = array(
6
+ 'teeny' => true,
7
+ 'tinymce' => array(
8
+ 'width' => '100%',
9
+ ),
10
+ 'textarea_rows' => '6',
11
+
12
+ 'editor_css' => '<style> #mceu_27-body{
13
+ width: 100%;
14
+ } </style>',
15
+ 'media_buttons' => true
16
+ );
17
+ wp_editor( $content, $editor_id, $settings );
18
+ ?>
19
+ </div>
files/main_image_section.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <div class="imagetype">
2
+ <h1 class="imageHeadline">Please choose your picture</h1>
3
+ <div class="imageUploderWrapper">
4
+ <input class='sameWidthinputs' id="upload_image" type="text" size="36" name="ad_image" value="<?php echo esc_attr($sgPopupDataImage); ?>" /> <input id="upload_image_button" class="button sameWidthinputs" type="button" value="Select image" />
5
+ </div>
6
+ <div class="ShowSelectedImage">
7
+ <span class="NoImage">(No image selected)</span>
8
+ </div>
9
+ </div>
files/options_html_section.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="sepectialOptons">
2
+ <div id="post-body" class="metabox-holder columns-2">
3
+ <div id="postbox-container-2" class="postbox-container">
4
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
+ <div class="postbox popupBuilder_spetial_postbox sgSameWidthPostBox" style="display: block;">
6
+ <div class="handlediv spectialTitle" title="Click to toggle"><br></div>
7
+ <h3 class="hndle ui-sortable-handle spectialTitle" style="cursor: pointer">
8
+ <span><?php
9
+ global $POPUP_TITLES;
10
+ $popupTypeTitle = $POPUP_TITLES[$popupType];
11
+ echo $popupTypeTitle;?> options
12
+ </span>
13
+ </h3>
14
+ <div class="inside">
15
+ <div class="specialOptionsContent">
16
+ <p>No options</p>
17
+ </div>
18
+ </div>
19
+ </div>
20
+
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
files/options_image_section.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="sepectialOptons">
2
+ <div id="post-body" class="metabox-holder columns-2">
3
+ <div id="postbox-container-2" class="postbox-container">
4
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
+ <div class="postbox popupBuilder_spetial_postbox sgSameWidthPostBox" style="display: block;">
6
+ <div class="handlediv spectialTitle" title="Click to toggle"><br></div>
7
+ <h3 class="hndle ui-sortable-handle spectialTitle" style="cursor: pointer">
8
+ <span><?php
9
+ global $POPUP_TITLES;
10
+ $popupTypeTitle = $POPUP_TITLES[$popupType];
11
+ echo $popupTypeTitle;?> options
12
+ </span>
13
+ </h3>
14
+ <div class="inside">
15
+ <div class="specialOptionsContent">
16
+ <p>No options</p>
17
+ </div>
18
+ </div>
19
+ </div>
20
+
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
files/sg_popup_ajax.php CHANGED
@@ -1,113 +1,23 @@
1
  <?php
2
  // save ajax
3
- add_action('wp_ajax_save_popup', 'sg_save_popup');
4
 
5
- function setOptionvalue($optionsKey)
6
- {
7
- if(isset($_POST[$optionsKey]))
8
- {
9
- if($optionsKey == "sg_popup_html")
10
- {
11
- return wp_kses_post($_POST[$optionsKey]);
12
- }
13
-
14
- return sanitize_text_field($_POST[$optionsKey]);
15
- }
16
- else
17
- {
18
- return "";
19
- }
20
- }
21
-
22
- function sg_save_popup() {
23
- global $wpdb;
24
- $array = array();
25
-
26
- $array['title'] = setOptionvalue('title');
27
- $array['width'] = setOptionvalue('width');
28
- $array['height'] = setOptionvalue('height');
29
- $array['delay'] = (int)setOptionvalue('delay');
30
- $array['duration'] = (int)setOptionvalue('duration');
31
- $array['effect'] = setOptionvalue('effect');
32
- $array['escKey'] = setOptionvalue('escKey');
33
- $array['scale'] = setOptionvalue('scale');
34
- $array['scrolling'] = setOptionvalue('scrolling');
35
- $array['reposition'] = setOptionvalue('reposition');
36
- $array['overlayClose'] = setOptionvalue('overlayClose');
37
- $array['opacity'] = setOptionvalue('opacity');
38
- $array['popupFixed'] = setOptionvalue('popupFixed');
39
- $array['fixedPostion'] = setOptionvalue('fixedPostion');
40
- $array['maxWidth'] = setOptionvalue('maxWidth');
41
- $array['maxHeight'] = setOptionvalue('maxHeight');
42
- $array['initialWidth'] = setOptionvalue('initialWidth');
43
- $array['initialHeight'] = setOptionvalue('initialHeight');
44
- $array['closeButton'] = setOptionvalue('closeButton');
45
- $array['theme'] = setOptionvalue('theme');
46
- $array['onScrolling'] = setOptionvalue('onScrolling');
47
- $array['repeatPopup'] = setOptionvalue('repeatPopup');
48
- $html = stripslashes(setOptionvalue("sg_popup_html"));
49
- $image = setOptionvalue('ad_image');
50
- $iframe = setOptionvalue('iframeLink');
51
- $shortCode = stripslashes(setOptionvalue('shortCode'));
52
- $type = setOptionvalue('content');
53
- $id = setOptionvalue('hidden_popup_number');
54
- $jsonDataArray = json_encode($array);
55
-
56
- $saved = false;
57
-
58
- if($_POST['title'] == "")
59
- {
60
- $errorTitle = "Title cannot be empty";
61
- }
62
- else
63
- {
64
- if($_POST['hidden_popup_number'] == '')
65
- {
66
-
67
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_promotional_popup(content,html,image,iframe,shortCode,options) VALUES (%s,%s,%s,%s,%s,%s)",$type,$html,$image,$iframe,$shortCode,$jsonDataArray);
68
- $wpdb->query($sql);
69
- $id = $wpdb->insert_id;
70
- echo $id;
71
- die();
72
- }
73
- else
74
- {
75
- $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_promotional_popup SET content=%s,html=%s,image=%s,iframe=%s,shortCode=%s,options=%s WHERE id=%d",$type,$html,$image,$iframe,$shortCode,$jsonDataArray,$id);
76
- $wpdb->query($sql);
77
- echo $id;
78
- die();
79
- }
80
- }
81
- echo '0';
82
- }
83
 
84
  /*
85
  * delete ajax opretion
86
- */
87
 
 
88
  function sg_popup_delete() {
 
89
  $id = (int)$_POST['popup_id'];
90
  if (!$id) return;
91
-
92
- global $wpdb;
93
-
94
- $wpdb->query(
95
- $wpdb->prepare(
96
- "DELETE FROM ". $wpdb->prefix ."sg_promotional_popup WHERE id = %d"
97
- ,$id
98
- )
99
- );
100
-
101
- $wpdb->query(
102
- $wpdb->prepare(
103
- "DELETE FROM wp_postmeta WHERE meta_value = %d and meta_key = 'sg_promotional_popup'"
104
- ,$id
105
- )
106
- );
107
  }
108
  add_action('wp_ajax_delete_promotional_popup', 'sg_popup_delete');
109
 
110
- /*
111
- * preview ajax
112
- */
 
 
113
 
1
  <?php
2
  // save ajax
 
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  /*
6
  * delete ajax opretion
 
7
 
8
+ */
9
  function sg_popup_delete() {
10
+
11
  $id = (int)$_POST['popup_id'];
12
  if (!$id) return;
13
+ require_once( SG_APP_POPUP_CLASSES .'/SGPopup.php');
14
+ SGPopup::delete($id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  add_action('wp_ajax_delete_promotional_popup', 'sg_popup_delete');
17
 
18
+ function sg_popup_preview() {
19
+ sgFindPopupData($_POST['postId']);
20
+ die();
21
+ }
22
+ add_action('wp_ajax_get_popup_preview', 'sg_popup_preview');
23
 
files/sg_popup_create.php CHANGED
@@ -1 +1,30 @@
1
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>Add New Popup</h2>
2
+ <div class="popupsWrapper">
3
+ <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=image">
4
+ <div class="popupsDiv imagePopup">
5
+
6
+ </div>
7
+ </a>
8
+ <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=html">
9
+ <div class="popupsDiv htmlPopup">
10
+ </div>
11
+ </a>
12
+ <?php if(SG_POPUP_PRO) { ?>
13
+ <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=iframe">
14
+ <div class="popupsDiv iframePopup">
15
+ </div>
16
+ </a>
17
+ <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=shortcode">
18
+ <div class="popupsDiv shortcodePopup">
19
+ </div>
20
+ </a>
21
+ <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=video">
22
+ <div class="popupsDiv videoPopup">
23
+ </div>
24
+ </a>
25
+ <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=ageRestriction">
26
+ <div class="popupsDiv ageRestriction">
27
+ </div>
28
+ </a>
29
+ <?php } ?>
30
+ </div>
files/sg_popup_create_new.php ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $popupType = @$_GET['type'];
4
+ if (!$popupType) {
5
+ $popupType = 'html';
6
+ }
7
+ if(isset($_GET['id'])) {
8
+ $id = (int)$_GET['id'];
9
+ $popupName = "SG".ucfirst(strtolower($popupType));
10
+ $popupClassName = $popupName."Popup";
11
+ require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
12
+ $result = $popupClassName::findById($id);
13
+
14
+ switch ($popupType) {
15
+ case 'iframe':
16
+ $sgPopupDataIframe = $result->getUrl();
17
+ break;
18
+ case 'video':
19
+ $sgPopupDataVideo = $result->getRealUrl();
20
+ break;
21
+ case 'image':
22
+ $sgPopupDataImage = $result->getUrl();
23
+ break;
24
+ case 'html':
25
+ $sgPopupDataHtml = $result->getContent();
26
+ break;
27
+ case 'shortcode':
28
+ $sgPopupDataShortcode = $result->getShortcode();
29
+ break;
30
+ }
31
+ $title = $result->getTitle();
32
+ $jsonData = json_decode($result->getOptions());
33
+ $sgEscKey = $jsonData->escKey;
34
+ $sgScrolling = $jsonData->scrolling;
35
+ $sgCloseButton = $jsonData->closeButton;
36
+ $sgReposition = $jsonData->reposition;
37
+ $sgOverlayClose = $jsonData->overlayClose;
38
+ $sgOverlayColor = $jsonData->sgOverlayColor;
39
+ $sgContentClick = $jsonData->contentClick;
40
+ $sgOpacity = $jsonData->opacity;
41
+ $sgPopupFixed = $jsonData->popupFixed;
42
+ $sgFixedPostion = $jsonData->fixedPostion;
43
+ $sgOnScrolling = $jsonData->onScrolling;
44
+ $beforeScrolingPrsent = $jsonData->beforeScrolingPrsent;
45
+ $duration = $jsonData->duration;
46
+ $delay = $jsonData->delay;
47
+ $effect = $jsonData->effect;
48
+ $sgInitialWidth = $jsonData->initialWidth;
49
+ $sgInitialHeight = $jsonData->initialHeight;
50
+ $sgWidth = $jsonData->width;
51
+ $sgHeight = $jsonData->height;
52
+ $sgMaxWidth = $jsonData->maxWidth;
53
+ $sgMaxHeight = $jsonData->maxHeight;
54
+ $sgForMobile = $jsonData->forMobile;
55
+ $sgCountryStataus = $jsonData->countryStataus;
56
+ $sgCountryIso = $jsonData->countryIso;
57
+ $sgCountryName = $jsonData->countryName;
58
+ $sgRepeatPopup = $jsonData->repeatPopup;
59
+ $sgCountryAllow = $jsonData->allowCountris;
60
+ $sgDisablePopup = $jsonData->disablePopup;
61
+ $sgPopupClosingTimer = $jsonData->popupClosingTimer;
62
+ $sgAutoClosePopup = $jsonData->autoClosePopup;
63
+ $sgTheme = $jsonData->theme;
64
+ }
65
+
66
+ $colorbox_deafult_values = array('escKey'=> true,'closeButton' => true,'scale'=> true, 'scrolling'=> true,'opacity'=>0.8,'reposition' => true,'width' => false,'height' => false,'initialWidth'=>'300','initialHeight'=>'100','maxWidth'=>false,'maxHeight'=>false,'overlayClose'=>true,'contentClick'=>true,'fixed'=>false,'top'=>false,'right'=>false,'bottom'=>false,'left'=>false,"duration"=>1,"delay"=>0);
67
+ $escKey = ($colorbox_deafult_values['escKey'] == true ? 'checked' : '');
68
+ $closeButton = ($colorbox_deafult_values['closeButton'] == true ? 'checked' : '');
69
+ $scale = ($colorbox_deafult_values['scale'] == true ? 'checked' : '');
70
+ $scrolling = ($colorbox_deafult_values['scale'] == true ? 'checked' : '');
71
+ $width = $colorbox_deafult_values['width'];
72
+ $height = $colorbox_deafult_values['height'];
73
+ $reposition = ($colorbox_deafult_values['reposition'] == true ? 'checked' : '');
74
+ $overlayClose = ($colorbox_deafult_values['overlayClose'] == true ? 'checked' : '');
75
+ $contentClick = ($colorbox_deafult_values['contentClick'] == true ? 'checked' : '');
76
+ $opacityValue = $colorbox_deafult_values['opacity'];
77
+ $top = $colorbox_deafult_values['top'];
78
+ $right = $colorbox_deafult_values['right'];
79
+ $bottom = $colorbox_deafult_values['bottom'];
80
+ $left = $colorbox_deafult_values['left'];
81
+ $initialWidth = $colorbox_deafult_values['initialWidth'];
82
+ $initialHeight = $colorbox_deafult_values['initialHeight'];
83
+ $maxWidth = $colorbox_deafult_values['maxWidth'];
84
+ $maxHeight = $colorbox_deafult_values['maxHeight'];
85
+ $deafultFixed = $colorbox_deafult_values['fixed'];
86
+ $defaultDuration = $colorbox_deafult_values['duration'];
87
+ $defaultDelay = $colorbox_deafult_values['delay'];
88
+
89
+ //seted value
90
+ if(isset($sgEscKey)) {$sgEscKey = ($sgEscKey == '') ? '': 'checked'; } else {$sgEscKey = $escKey;}
91
+ if(isset($sgCloseButton)) {$sgCloseButton = ($sgCloseButton == '') ? '': 'checked'; } else {$sgCloseButton = $closeButton;}
92
+ if(isset($sgScrolling)) {$sgScrolling = ($sgScrolling == '') ? '': 'checked'; } else {$sgScrolling = $scrolling;}
93
+ if(isset($sgReposition)) {$sgReposition = ($sgReposition == '') ? '': 'checked'; } else {$sgReposition = $reposition;}
94
+ if(isset($sgOverlayClose)) {$sgOverlayClose = ($sgOverlayClose == '') ? '': 'checked'; } else {$sgOverlayClose = $overlayClose;}
95
+ if(isset($sgContentClick)) {$sgContentClick = ($sgContentClick == '') ? '': 'checked'; } else {$sgContentClick = $contentClick;}
96
+ if(isset($sgPopupFixed)) {$sgPopupFixed = ($sgPopupFixed == '') ? '': 'checked'; } else {$sgPopupFixed = $deafultFixed;}
97
+ if(isset($sgOnScrolling)) {$sgOnScrolling = ($sgOnScrolling == '') ? '': 'checked'; }
98
+ if(isset($sgForMobile)) {$sgForMobile = ($sgForMobile == '') ? '': 'checked'; }
99
+ if(isset($sgRepeatPopup)) {$sgRepeatPopup = ($sgRepeatPopup == '') ? '': 'checked'; }else{$sgRepeatPopup = '';} //$sgCountryStataus
100
+ if(isset($sgCountryStataus)) {$sgCountryStataus = ($sgCountryStataus== '') ? '': 'checked'; }else{$sgCountryStataus = '';}
101
+ if(isset($sgDisablePopup)) {$sgDisablePopup = ($sgDisablePopup== '') ? '': 'checked'; }else{$sgDisablePopup = '';}
102
+ if(isset($sgAutoClosePopup)) {$sgAutoClosePopup = ($sgAutoClosePopup== '') ? '': 'checked'; }else{$sgAutoClosePopup = '';}
103
+ if(!isset($sgOpacity )) {$sgOpacity = $opacityValue;}
104
+ if(!isset($sgWidth )) {$sgWidth = $width;}
105
+ if(!isset($sgHeight )) {$sgHeight = $height;}
106
+ if(!isset($sgInitialWidth )) {$sgInitialWidth = $initialWidth;}
107
+ if(!isset($sgInitialHeight)) {$sgInitialHeight = $initialHeight;}
108
+ if(!isset($sgMaxWidth)) {$sgMaxWidth = $maxWidth;}
109
+ if(!isset($sgMaxWidth)) {$sgMaxHeight = $maxHeight;}
110
+ if(!isset($duration)) {$duration = $defaultDuration;}
111
+ if(!isset($delay)) {$delay = $defaultDelay;}
112
+ if(!isset($sgPopupDataIframe)) {$sgPopupDataIframe = 'http://';}
113
+ if(!isset($sgPopupDataHtml)) {$sgPopupDataHtml = '';}
114
+ if(!isset($sgPopupDataImage)) {$sgPopupDataImage = '';}
115
+
116
+
117
+ //select basa value or deafult value
118
+ $sg_popup_effects = array("No effect"=>"No Effect","flip"=>"flip","shake"=>"shake","wobble"=>"wobble","swing"=>"swing","flash"=>"flash","bounce"=>"bounce","pulse"=>"pulse","rubberBand"=>"rubberBand","tada"=>"tada","fadeIn"=>"fadeIn");
119
+ $sg_popup_theme = array("colorbox1.css","colorbox2.css","colorbox3.css","colorbox4.css","colorbox5.css");
120
+ function creaeSelect($options,$name,$selecteOption)
121
+ {
122
+ $selected ='';
123
+ $str = "";
124
+ $checked = "";
125
+ if($name == 'theme') {
126
+
127
+ $popup_style_name = 'popup_theme_name';
128
+ $firstOption = array_shift($options);
129
+ $i = 1;
130
+ foreach($options as $key){
131
+ if($key == $selecteOption) {
132
+ $checked = "checked";
133
+ }
134
+
135
+ else {
136
+ $checked ='';
137
+ }
138
+ $i++;
139
+ $str .= "<input type='radio' name=\"$name\" value=\"$key\" $checked class='popup_theme_name' sgPoupNumber=".$i.">";
140
+
141
+ }
142
+ if ($checked == ''){
143
+ $checked = "checked";
144
+ }
145
+ $str = "<input type='radio' name=\"$name\" value=\"".$firstOption."\" $checked class='popup_theme_name' sgPoupNumber='1'>".$str;
146
+ return $str;
147
+ }
148
+ else {
149
+ @$popup_style_name = ($popup_style_name) ? $popup_style_name : '';
150
+ $str .= "<select name=$name id='sameWidthinputs' class=$popup_style_name >";
151
+ foreach($options as $key=>$option) {
152
+ if($key == $selecteOption) {
153
+ $selected = "selected";
154
+ }
155
+ else {
156
+ $selected ='';
157
+ }
158
+ $str .= "<option value='".$key."' ".$selected." >$option</potion>";
159
+ }
160
+
161
+ $str .="</select>" ;
162
+ return $str;
163
+
164
+ }
165
+
166
+ } ?>
167
+
168
+ <?php
169
+ if(isset($_GET['saved']) && $_GET['saved']==1)
170
+ {
171
+ echo '<div id="defaultMessage" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
172
+ }
173
+ ?>
174
+ <form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php" id="add-form">
175
+ <input type="hidden" name="action" value="save_popup">
176
+ <div class="crudWrapper">
177
+ <div class="cereateTitleWrapper">
178
+ <div class="Sg_title_crud">
179
+ <?php if(isset($id))
180
+ { ?>
181
+ <h2>Edit popup</h2>
182
+
183
+ <?php }
184
+ else { ?>
185
+ <h2>Create new popup</h2>
186
+ <?php } ?>
187
+ </div>
188
+ <div class="buttonWrapper">
189
+ <p class="submit">
190
+ <?php
191
+ if(!SG_POPUP_PRO) { ?>
192
+ <input class="crudToPro" type="button" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"><div class="clear"></div>
193
+ <?php } ?>
194
+ <input type="submit" id="promotionalSaveButton" class="button-primary" value="<?php _e('Save Changes') ?>" style='<?php echo $cssClass;?>' />
195
+ <img id="createAjaxLoader" src="<?php echo plugins_url('img/wpspin_light.gif', dirname(__FILE__).'../');?>" style="display: none">
196
+ </p>
197
+ </div>
198
+ </div>
199
+ <div class="clear"></div>
200
+ <div class="generalWrapper">
201
+ <div id="titlediv">
202
+ <div id="titlewrap">
203
+ <input style="margin-top: 5px;" type="text" name="title" size="30" value="<?php echo esc_attr(@$title)?>" id="title" spellcheck="true" autocomplete="off" required = "required" placeholder='Enter title here'>
204
+ </div>
205
+ </div>
206
+ <div id="leftMainDiv">
207
+ <div id="general">
208
+ <div id="post-body" class="metabox-holder columns-2">
209
+ <div id="postbox-container-2" class="postbox-container">
210
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
211
+ <div class="postbox popupBuilder_general_postbox sgSameWidthPostBox" style="display: block;">
212
+ <div class="handlediv generalTitle" title="Click to toggle"><br></div>
213
+ <h3 class="hndle ui-sortable-handle generalTitle" style="cursor: pointer"><span>General</span></h3>
214
+ <div class="generalContent sgSameWidthPostBox">
215
+ <?php require_once("main_".$popupType."_section.php");?>
216
+ <input type="hidden" name="type" value="<?php echo $popupType;?>">
217
+ <span class="createDescribe" id="themeSPan">Popup theme:</span>
218
+ <?php echo creaeSelect($sg_popup_theme,'theme',esc_html(@$sgTheme));?><div class="theme1" id="displayNone"></div><div class="theme2" id="displayNone"></div><div class="theme3" id="displayNone" ></div><div class="theme4" id="displayNone" ></div><div class="theme5" id="displayNone"></div>
219
+ </div>
220
+ </div>
221
+
222
+ </div>
223
+ </div>
224
+ </div>
225
+ </div>
226
+ <div id="effect">
227
+ <div id="post-body" class="metabox-holder columns-2">
228
+ <div id="postbox-container-2" class="postbox-container">
229
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
230
+ <div class="postbox popupBuilder_effect_postbox sgSameWidthPostBox" style="display: block;">
231
+ <div class="handlediv effectTitle" title="Click to toggle"><br></div>
232
+ <h3 class="hndle ui-sortable-handle effectTitle" style="cursor: pointer"><span>Effects</span></h3>
233
+ <div class="effectsContent">
234
+ <span class="createDescribe">Effect type:</span>
235
+ <?php echo creaeSelect($sg_popup_effects,'effect',esc_html(@$effect));?>
236
+ <div class="effectWrapper"><div id="effectShow" ></div></div>
237
+
238
+ <span class="createDescribe">Effect duration:</span>
239
+ <input class='sameWidthinputs' type="text" name="duration" value="<?php echo esc_attr($duration); ?>" pattern = "\d+" title="It's must be number" /><span class="dashicons dashicons-info contentClick infoImageDuration sameImageStyle"></span><span class="infoDuration samefontStyle">Specify how long the popup appearance animation should take (in sec).</span></br>
240
+
241
+ <span class="createDescribe">Initial delay:</span>
242
+ <input class='sameWidthinputs' type="text" name="delay" value="<?php echo esc_attr($delay);?>" pattern = "\d+" title="It's must be number"/><span class="dashicons dashicons-info contentClick infoImageDelay sameImageStyle"></span><span class="infoDelay samefontStyle">Specify how long the popup appearance should be delayed after loading the page (in sec).</span></br>
243
+ </div>
244
+ </div>
245
+
246
+ </div>
247
+ </div>
248
+ </div>
249
+ </div>
250
+
251
+
252
+ <?php require_once("options_".$popupType."_section.php");?>
253
+ </div>
254
+ <div id="rightMaindiv">
255
+ <div id="rightMain">
256
+ <div id="dimentions">
257
+ <div id="post-body" class="metabox-holder columns-2">
258
+ <div id="postbox-container-2" class="postbox-container">
259
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
260
+ <div class="postbox popupBuilder_dimention_postbox sgSameWidthPostBox" style="display: block;">
261
+ <div class="handlediv dimentionsTitle" title="Click to toggle"><br></div>
262
+ <h3 class="hndle ui-sortable-handle dimentionsTitle" style="cursor: pointer"><span>Dimensions</span></h3>
263
+ <div class="dimensionsContent">
264
+ <span class="createDescribe">Width:</span>
265
+ <input class='sameWidthinputs' type="text" name="width" value="<?php echo esc_attr($sgWidth); ?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
266
+ <span class="createDescribe">Height:</span>
267
+ <input class='sameWidthinputs' type="text" name="height" value="<?php echo esc_attr($sgHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
268
+ <span class="createDescribe">Max width:</span>
269
+ <input class='sameWidthinputs' type="text" name="maxWidth" value="<?php echo esc_attr($sgMaxWidth);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
270
+ <span class="createDescribe">Max height:</span>
271
+ <input class='sameWidthinputs' type="text" name="maxHeight" value="<?php echo esc_attr(@$sgMaxHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
272
+ <span class="createDescribe">Initial width:</span>
273
+ <input class='sameWidthinputs' type="text" name="initialWidth" value="<?php echo esc_attr($sgInitialWidth);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
274
+ <span class="createDescribe">Initial height:</span>
275
+ <input class='sameWidthinputs' type="text" name="initialHeight" value="<?php echo esc_attr($sgInitialHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
276
+ </div>
277
+ </div>
278
+
279
+ </div>
280
+ </div>
281
+ </div>
282
+ </div>
283
+ <div id="options">
284
+ <div id="post-body" class="metabox-holder columns-2">
285
+ <div id="postbox-container-2" class="postbox-container">
286
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
287
+ <div class="postbox popupBuilder_options_postbox sgSameWidthPostBox" style="display: block;">
288
+ <div class="handlediv optionsTitle" title="Click to toggle"><br></div>
289
+ <h3 class="hndle ui-sortable-handle optionsTitle" style="cursor: pointer"><span>Options</span></h3>
290
+ <div class="optionsContent">
291
+ <span class="createDescribe">Dismiss on &quot;esc&quot; key:</span><input class='sameWidthinputs' type="checkbox" name="escKey" <?php echo $sgEscKey;?>/>
292
+ <span class="dashicons dashicons-info escKeyImg sameImageStyle"></span><span class="infoEscKey samefontStyle">The popup will be dismissed when user presses on 'esc' key.</span></br>
293
+
294
+ <span class="createDescribe" id="createDescribeClose">Show &quot;close&quot; button:</span><input class='sameWidthinputs' type="checkbox" name="closeButton" <?php echo $sgCloseButton;?> />
295
+ <span class="dashicons dashicons-info CloseImg sameImageStyle"></span><span class="infoCloseButton samefontStyle">The popup will contain 'close' button.</span><br>
296
+
297
+ <span class="createDescribe">Enable content scrolling:</span><input class='sameWidthinputs' type="checkbox" name="scrolling" <?php echo $sgScrolling;?> />
298
+ <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If the containt is larger then the specified dimentions, then the content will be scrollable.</span><br>
299
+
300
+ <span class="createDescribe">Enable responsiveness:</span><input class='sameWidthinputs' type="checkbox" name="reposition" <?php echo $sgReposition;?> />
301
+ <span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
302
+
303
+ <span class="createDescribe">Dissmiss on overlay click:</span><input class='sameWidthinputs' type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
304
+ <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoOverlayClose samefontStyle">The popup will be dismissed when user clicks beyond of the popup area.</span><br>
305
+
306
+ <span class="createDescribe">Dissmiss on content click:</span><input class='sameWidthinputs' type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
307
+ <span class="dashicons dashicons-info contentClick sameImageStyle"></span><span class="infoContentClick samefontStyle">The popup will be dismissed when user clicks inside popup area.</span><br>
308
+
309
+ <span class="createDescribe">Change overlay color:</span><div id="colorPiccer"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgOverlayColor" value="<?php echo esc_attr(@$sgOverlayColor); ?>" /></div><br>
310
+
311
+ <span class="createDescribe" id="createDescribeOpacitcy">Background overlay opacity:</span><div class="slider-wrapper">
312
+ <input type="text" class="js-decimal" value="<?php echo esc_attr($sgOpacity);?>" rel="<?php echo esc_attr($sgOpacity);?>" name="opacity"/>
313
+ <div id="js-display-decimal" class="display-box"></div>
314
+ </div><br>
315
+
316
+ <span class="createDescribe" id="createDescribeFixed">Popup location:</span><input class='sameWidthinputs' type="checkbox" name="popupFixed" id="popupFixed" <?php echo $sgPopupFixed;?> /><br>
317
+ <div class="popopFixeds">
318
+ <span class="forFixWrapperStyle" >&nbsp;</span>
319
+ <div class="fixedWrapper" >
320
+ <div class="fixedPositionStyle" id="fixedPosition1" data-sgvalue="1"></div>
321
+ <div id="fixedPosition2" data-sgvalue="2"></div>
322
+ <div class="fixedPositionStyle" id="fixedPosition3" data-sgvalue="3"></div>
323
+ <div id="fixedPosition4" data-sgvalue="4"></div>
324
+ <div class="fixedPositionStyle" id="fixedPosition5" data-sgvalue="5"></div>
325
+ <div id="fixedPosition6" data-sgvalue="6"></div>
326
+ <div class="fixedPositionStyle" id="fixedPosition7" data-sgvalue="7"></div>
327
+ <div id="fixedPosition8" data-sgvalue="8"></div>
328
+ <div class="fixedPositionStyle" id="fixedPosition9" data-sgvalue="9"></div>
329
+ </div>
330
+ </div>
331
+ <input type="hidden" name="fixedPostion" class="fixedPostion" value="<?php echo esc_attr(@$sgFixedPostion);?>">
332
+ </div>
333
+ </div>
334
+
335
+ </div>
336
+ </div>
337
+ </div>
338
+ </div>
339
+ <?php
340
+ if (SG_POPUP_PRO) {
341
+ require_once("options_pro_section.php");
342
+ }
343
+ ?>
344
+ </div>
345
+ </div>
346
+ <div class="clear"></div>
347
+ <input type="hidden" class="button-primary" value="<?php echo esc_attr(@$id);?>" name="hidden_popup_number" />
348
+ </div>
349
+ </div>
350
+ </form>
files/sg_popup_main.php CHANGED
@@ -1,28 +1,22 @@
1
  <?php
2
- global $wpdb;
3
-
4
  $pagenum = isset($_GET['pn']) ? (int) $_GET['pn'] : 1;
5
 
6
  $limit = SG_APP_POPUP_TABLE_LIMIT;//;
7
  $offset = ($pagenum - 1) * $limit;
8
-
9
- $total = $wpdb->get_var( "SELECT COUNT(id) FROM ". $wpdb->prefix ."sg_promotional_popup" );
10
  $num_of_pages = ceil( esc_html($total) / $limit );
11
  if ($pagenum>$num_of_pages || $pagenum < 1) {
12
  $offset = 0;
13
  $pagenum = 1;
14
  }
15
-
16
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_promotional_popup ORDER BY id DESC LIMIT %d,%d", $offset, $limit);
17
- $entries = $wpdb->get_results($st);
18
  ?>
19
  <div class="wrap">
20
  <div class="headersWrapper">
21
- <h1>Popups</h1>
22
- <div class="creteLinkWrapper">
23
-
24
- <a id='linkCreate' href='<?php echo admin_url();?>admin.php?page=create-popup'>Create new</a>
25
- </div>
26
  <?php
27
  if(!SG_POPUP_PRO) { ?>
28
  <input type="button" class="mainUpdateToPro" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')">
@@ -49,23 +43,16 @@
49
  <tbody>
50
  <?php if($entries) { ?>
51
  <?php
52
- $count = 1;
53
- $class = '';
54
- foreach( $entries as $entry ) {
55
- $class = ( $count % 2 == 0 ) ? ' class="alternate"' : '';
56
- $jsonData = json_decode($entry->options, true);
57
- $title = $jsonData['title'];
58
- ?>
59
- <tr <?php echo $class; ?>>
60
- <td><?php echo esc_html($entry->id); ?></td>
61
- <td><?php echo esc_html($title); ?></td>
62
- <td><?php echo esc_html($entry->content); ?></td>
63
- <td><a href='<?php echo admin_url();?>admin.php?page=create-popup&id=<?php echo esc_html($entry->id);?>'>Edit</a><a href="#" sg-app-popup-id = "<?php echo esc_html($entry->id);?>" class='sgDeleteLink'>Delete</a></td>
64
  </tr>
65
- <?php
66
- $count++;
67
- }
68
- ?>
69
  <?php } else { ?>
70
  <tr>
71
  <td colspan="2">No popups</td>
1
  <?php
2
+
3
+ //Pagination::getLimit();
4
  $pagenum = isset($_GET['pn']) ? (int) $_GET['pn'] : 1;
5
 
6
  $limit = SG_APP_POPUP_TABLE_LIMIT;//;
7
  $offset = ($pagenum - 1) * $limit;
8
+ $total = SGPopup::getTotalRowCount();
 
9
  $num_of_pages = ceil( esc_html($total) / $limit );
10
  if ($pagenum>$num_of_pages || $pagenum < 1) {
11
  $offset = 0;
12
  $pagenum = 1;
13
  }
14
+ $orderBy = 'id DESC';
15
+ $entries = SGPopup::findAll($orderBy,$limit,$offset);
 
16
  ?>
17
  <div class="wrap">
18
  <div class="headersWrapper">
19
+ <h2>Popups <a href="<?php echo admin_url();?>admin.php?page=create-popup" class="add-new-h2">Add New</a></h2>
 
 
 
 
20
  <?php
21
  if(!SG_POPUP_PRO) { ?>
22
  <input type="button" class="mainUpdateToPro" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')">
43
  <tbody>
44
  <?php if($entries) { ?>
45
  <?php
46
+ foreach( $entries as $entry ) { ?>
47
+ <tr>
48
+ <td><?php echo esc_html($entry->getId()); ?></td>
49
+ <td><?php echo esc_html($entry->getTitle()); ?></td>
50
+ <td><?php echo esc_html($entry->getType()); ?></td>
51
+ <td><a href='<?php echo admin_url();?>admin.php?page=edit-popup&id=<?php echo esc_html($entry->getId());?>&type=<?php echo esc_html($entry->getType());?>'>Edit</a><a href="#" sg-app-popup-id = "<?php echo esc_html($entry->getId());?>" class='sgDeleteLink'>Delete</a></td>
 
 
 
 
 
 
52
  </tr>
53
+ <?php }
54
+ ?>
55
+
 
56
  <?php } else { ?>
57
  <tr>
58
  <td colspan="2">No popups</td>
files/sg_popup_media_buuton.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function dh_popup_media_button() {
3
+ global $pagenow, $typenow, $wp_version;
4
+
5
+ $button_title = __('Insert popup');
6
+ $output = '';
7
+
8
+ // Show button only in post and page edit screens
9
+ if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && $typenow != 'download' ) {
10
+ /* check current WP version */
11
+ $img = '<span class="dashicons dashicons-welcome-widgets-menus" id="dh-popup-media-button" style="padding: 3px 2px 0px 0px"></span>';
12
+ $output = '<a href="#TB_inline?width=600&height=550&inlineId=sg-popup-thickbox" class="thickbox button" title="' . $button_title . '" style="padding-left: .4em;">' . $img . $button_title . '</a>';
13
+ }
14
+
15
+ echo $output;
16
+ }
17
+ add_action( 'media_buttons', 'dh_popup_media_button', 11);
18
+
19
+ function dh_popup_media_button_thickboxs() {
20
+ global $pagenow, $typenow, $post;
21
+
22
+ // Only run in post/page creation and edit screens
23
+ if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && $typenow != 'download' ) { ?>
24
+
25
+ <script type="text/javascript">
26
+ jQuery(document).ready(function ($) {
27
+ $('#dh-ptp-popup-insert').on('click', function () {
28
+ var id = $('#sg_popup_id').val();
29
+
30
+ // Return early if no download is selected
31
+ if ('' === id) {
32
+ alert('Select your popup');
33
+ return;
34
+ }
35
+ selectionText = (tinyMCE.activeEditor.selection.getContent()) ? tinyMCE.activeEditor.selection.getContent() : 'Popup';
36
+ window.send_to_editor('[sg_popup id="' + id + '"]'+selectionText+"[/sg_popup]");
37
+
38
+ // Tracking
39
+ jQuery.ajax({
40
+ type: "POST",
41
+ url: "<?php echo admin_url('admin-ajax.php'); ?>",
42
+ data: {
43
+ action: "dh_ptp_tracking_deploy",
44
+ id: id
45
+ }
46
+ });
47
+ });
48
+ });
49
+ </script>
50
+
51
+ <div id="sg-popup-thickbox" style="display: none;" class="popupShortDiv">
52
+ <div class="wrap" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">
53
+ <p><?php _e('Insert the shortcode for showing a Popup.'); ?></p>
54
+ <div>
55
+ <select id="sg_popup_id">
56
+ <option value=""><?php _e('Please select...'); ?></option>
57
+ <?php
58
+ global $wpdb;
59
+ $proposedTypes = array();
60
+ $orderBy = 'id DESC';
61
+ $allPopups = SGPopup::findAll($orderBy);
62
+ foreach($allPopups as $allPopup) { ?>
63
+ <option value="<?=$allPopup->getId()?>"><?php echo $allPopup->getTitle();?><?php echo " - ".$allPopup->getType();?></option>;
64
+ <?php } ?>
65
+ </select>
66
+ </div>
67
+ <p class="submit">
68
+ <input type="button" id="dh-ptp-popup-insert" class="button-primary dashicons-welcome-widgets-menus" value="<?php _e('Insert'); ?>"/>
69
+ <a id="sg_popup_cancel" class="button-secondary" onclick="tb_remove();" title="<?php _e('Cancel'); ?>"><?php _e('Cancel', PTP_LOC); ?></a>
70
+ </p>
71
+ </div>
72
+ </div>
73
+ <?php
74
+ }
75
+ }
76
+ add_action( 'admin_footer', 'dh_popup_media_button_thickboxs' );
files/sg_popup_page_selection.php CHANGED
@@ -1,74 +1,76 @@
1
- <?php
2
- function sg_popup_meta()
3
- {
4
- $screens = array( 'post', 'page' );
5
- foreach ( $screens as $screen )
6
- {
7
- add_meta_box( 'prfx_meta', __( 'Select Popup', 'prfx-textdomain' ), 'sg_popup_callback', $screen, 'normal' );
8
- }
9
- }
10
- add_action( 'add_meta_boxes', 'sg_popup_meta' );
11
-
12
- /**
13
- * Outputs the content of the meta box
14
- */
15
- function sg_popup_callback( $post )
16
- {
17
- wp_nonce_field( basename( __FILE__ ), 'prfx_nonce' );
18
- $prfx_stored_meta = get_post_meta( $post->ID );
19
- ?>
20
- <p class="previewParagaraph">
21
- <?php
22
- global $wpdb;
23
- $proposedTypes = array();
24
- $proposedTypes = $wpdb->get_results("SELECT * FROM ". $wpdb->prefix ."sg_promotional_popup ORDER BY id DESC");
25
- function creaeSelect($options,$name,$selecteOption)
26
- {
27
- $selected ='';
28
- $str = "";
29
- $str .= "<select class='choosePopupType promotionalPopupSelect' name=$name>";
30
- $str .= "<option>Not selected</potion>";
31
- foreach($options as $option)
32
- {
33
- if($option->options)
34
- {
35
- $jsonData = json_decode($option->options);
36
- $title = $jsonData->title;
37
- $id = $option->id;
38
- if($selecteOption == $id)
39
- {
40
- $selected = "selected";
41
- }
42
- else
43
- {
44
- $selected ='';
45
- }
46
- $str .= "<option value='".$id."' disable='".$id."' ".$selected." >$title</potion>";
47
- }
48
- }
49
- $str .="</select>" ;
50
- return $str;
51
- }
52
- global $post;
53
- $page = (int)$post->ID;
54
- $popup = "sg_promotional_popup";
55
- $sql = $wpdb->prepare("SELECT meta_value FROM ". $wpdb->prefix ."postmeta WHERE post_id = %d AND meta_key =%s",$page,$popup);
56
- $row = $wpdb->get_row($sql);
57
- $type = (int)$row->meta_value;
58
- $prepare = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_promotional_popup WHERE id = %d ",$type);
59
- $pageSelectionData = $wpdb->get_row($prepare);
60
- echo creaeSelect($proposedTypes,'sg_promotional_popup',$type);
61
- $SG_APP_POPUP_URL = SG_APP_POPUP_URL;
62
- ?>
63
- </p>
64
- <input type="button" value="Preview" class="previewbutton" id="previewbuttonStyle" disabled="disabled" /><img src="<?php echo plugins_url('img/wpspin_light.gif', dirname(__FILE__).'../');?>" id="gifLoader" style="display: none;">
65
- <input type="hidden" value="<?php echo $page;?>" id="post_id">
66
- <input type="hidden" value="<?php echo $SG_APP_POPUP_URL;?>" id="SG_APP_POPUP_URL">
67
- <?php
68
- }
69
- function slelectPopupSaved($post_id) {
70
- update_post_meta($post_id, 'sg_promotional_popup' , $_POST['sg_promotional_popup']);
71
- }
72
- add_action('save_post','slelectPopupSaved');
73
-
74
-
 
 
1
+ <?php
2
+ function sg_popup_meta()
3
+ {
4
+ $screens = array( 'post', 'page' );
5
+ foreach ( $screens as $screen )
6
+ {
7
+ add_meta_box( 'prfx_meta', __( 'Select popup on page load', 'prfx-textdomain' ), 'sg_popup_callback', $screen, 'normal' );
8
+ }
9
+ }
10
+ add_action( 'add_meta_boxes', 'sg_popup_meta' );
11
+
12
+ /**
13
+ * Outputs the content of the meta box
14
+ */
15
+ function sg_popup_callback($post) {
16
+ wp_nonce_field( basename( __FILE__ ), 'prfx_nonce' );
17
+ $prfx_stored_meta = get_post_meta( $post->ID );
18
+ ?>
19
+ <p class="previewParagaraph">
20
+ <?php
21
+ global $wpdb;
22
+ $proposedTypes = array();
23
+ $orderBy = 'id DESC';
24
+ $proposedTypes = SGPopup::findAll($orderBy);
25
+ function createSelect($options,$name,$selecteOption) {
26
+ $selected ='';
27
+ $str = "";
28
+ $str .= "<select class='choosePopupType promotionalPopupSelect' name=$name>";
29
+ $str .= "<option value=''>Not selected</potion>";
30
+ foreach($options as $option)
31
+ {
32
+ if($option)
33
+ {
34
+ $title = $option->getTitle();
35
+ $type = $option->getType();
36
+ $id = $option->getId();
37
+ if($selecteOption == $id)
38
+ {
39
+ $selected = "selected";
40
+ }
41
+ else
42
+ {
43
+ $selected ='';
44
+ }
45
+ $str .= "<option value='".$id."' disable='".$id."' ".$selected." >$title - $type</potion>";
46
+ }
47
+ }
48
+ $str .="</select>" ;
49
+ return $str;
50
+ }
51
+ global $post;
52
+ $page = (int)$post->ID;
53
+ $popup = "sg_promotional_popup";
54
+ $popupId = SGPopup::getPagePopupId($page,$popup);
55
+ echo createSelect($proposedTypes,'sg_promotional_popup',$popupId);
56
+ $SG_APP_POPUP_URL = SG_APP_POPUP_URL;
57
+ ?>
58
+ </p>
59
+
60
+ <input type="hidden" value="<?php echo $SG_APP_POPUP_URL;?>" id="SG_APP_POPUP_URL">
61
+ <?php
62
+ }
63
+
64
+ function selectPopupSaved($post_id) {
65
+ if($_POST['sg_promotional_popup'] == '') {
66
+ delete_post_meta($post_id, 'sg_promotional_popup');
67
+ return false;
68
+ }
69
+ else {
70
+ update_post_meta($post_id, 'sg_promotional_popup' , $_POST['sg_promotional_popup']);
71
+ }
72
+
73
+
74
+ }
75
+
76
+ add_action('save_post','selectPopupSaved');
files/sg_popup_savePopupFrom.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('admin_post_save_popup', 'savePopupFrom');
3
+
4
+ function setOptionvalue($optionsKey) {
5
+
6
+ if(isset($_POST[$optionsKey]))
7
+ {
8
+ if($optionsKey == "sg_popup_html")
9
+ {
10
+ return wp_kses_post($_POST[$optionsKey]);
11
+ }
12
+
13
+ return sanitize_text_field($_POST[$optionsKey]);
14
+ }
15
+ else
16
+ {
17
+ return "";
18
+ }
19
+ }
20
+
21
+ function savePopupFrom() {
22
+
23
+ global $wpdb;
24
+ $array = array();
25
+
26
+ $array['width'] = setOptionvalue('width');
27
+ $array['height'] = setOptionvalue('height');
28
+ $array['delay'] = (int)setOptionvalue('delay');
29
+ $array['duration'] = (int)setOptionvalue('duration');
30
+ $array['effect'] = setOptionvalue('effect');
31
+ $array['escKey'] = setOptionvalue('escKey');
32
+ $array['scrolling'] = setOptionvalue('scrolling');
33
+ $array['reposition'] = setOptionvalue('reposition');
34
+ $array['overlayClose'] = setOptionvalue('overlayClose');
35
+ $array['sgOverlayColor'] = setOptionvalue('sgOverlayColor');
36
+ $array['contentClick'] = setOptionvalue('contentClick');
37
+ $array['opacity'] = setOptionvalue('opacity');
38
+ $array['popupFixed'] = setOptionvalue('popupFixed');
39
+ $array['fixedPostion'] = setOptionvalue('fixedPostion');
40
+ $array['maxWidth'] = setOptionvalue('maxWidth');
41
+ $array['maxHeight'] = setOptionvalue('maxHeight');
42
+ $array['initialWidth'] = setOptionvalue('initialWidth');
43
+ $array['initialHeight'] = setOptionvalue('initialHeight');
44
+ $array['closeButton'] = setOptionvalue('closeButton');
45
+ $array['theme'] = setOptionvalue('theme');
46
+ $array['onScrolling'] = setOptionvalue('onScrolling');
47
+ $array['beforeScrolingPrsent'] = setOptionvalue('beforeScrolingPrsent');
48
+ $array['forMobile'] = setOptionvalue('forMobile');
49
+ $array['repeatPopup'] = setOptionvalue('repeatPopup');
50
+ $array['countryStataus'] = setOptionvalue('countryStataus');
51
+ $array['countryIso'] = setOptionvalue('countryIso');
52
+ $array['countryName'] = setOptionvalue('countryName');
53
+ $array['allowCountris'] = setOptionvalue('allowCountris');
54
+ $array['autoClosePopup'] = setOptionvalue('autoClosePopup');
55
+ $array['popupClosingTimer'] = setOptionvalue('popupClosingTimer');
56
+ $array['disablePopup'] = setOptionvalue('disablePopup');
57
+ $array['autoClosePopup'] = setOptionvalue('autoClosePopup');
58
+ $array['popupClosingTimer'] = setOptionvalue('popupClosingTimer');
59
+ $array['yesButtonLabel'] = setOptionvalue('yesButtonLabel');
60
+ $array['noButtonLabel'] = setOptionvalue('noButtonLabel');
61
+
62
+ $html = stripslashes(setOptionvalue("sg_popup_html"));
63
+ $ageRestriction = setOptionvalue('sg_ageRestriction');
64
+ $image = setOptionvalue('ad_image');
65
+ $iframe = setOptionvalue('iframe');
66
+ $video = setOptionvalue('video');
67
+ $shortCode = stripslashes(setOptionvalue('shortCode'));
68
+ $type = setOptionvalue('type');
69
+ $title = setOptionvalue('title');
70
+ $id = setOptionvalue('hidden_popup_number');
71
+ $jsonDataArray = json_encode($array);
72
+ $data = array('id'=>$id,'title'=>$title,'type'=>$type,'image'=>$image,'html'=>$html,'iframe'=>$iframe,'video'=>$video,'shortcode'=>$shortCode,'ageRestriction'=>$ageRestriction,'options'=>$jsonDataArray);
73
+ $popupName = "SG".ucfirst(strtolower($_POST['type']));
74
+ $popupClassName = $popupName."Popup";
75
+
76
+ require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
77
+
78
+ if($id == "") {
79
+ global $wpdb;
80
+ $popupClassName::create($data);
81
+ $lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
82
+ wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=".$lastId."&type=$type&saved=1");
83
+ exit();
84
+ }
85
+ else {
86
+
87
+
88
+ $popup = SGPopup::findById($id);
89
+ $popup->setTitle($title);
90
+ $popup->setId($id);
91
+ $popup->setType($type);
92
+ $popup->setOptions($jsonDataArray);
93
+ switch ($popupName) {
94
+ case 'SGImage':
95
+ $popup->setUrl($image);
96
+ break;
97
+ case 'SGIframe':
98
+ $popup->setUrl($iframe);
99
+ break;
100
+ case 'SGVideo':
101
+ $popup->setUrl($video);
102
+ $popup->setRealUrl($video);
103
+ break;
104
+ case 'SGHtml':
105
+ $popup->setContent($html);
106
+ break;
107
+ case 'SGShortcode':
108
+ $popup->setShortcode($shortCode);
109
+ break;
110
+
111
+ }
112
+ $popup->save();
113
+ wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=$id&type=$type&saved=1");
114
+ exit();
115
+ }
116
+ }
img/HTML-Button.png ADDED
Binary file
img/Images-Button.png ADDED
Binary file
img/ShortcodePopup.png ADDED
Binary file
img/VideoPopup.png ADDED
Binary file
img/iframePopup.png ADDED
Binary file
javascript/bootstrap-tagsinput.js ADDED
@@ -0,0 +1,617 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ "use strict";
3
+
4
+ var defaultOptions = {
5
+ tagClass: function(item) {
6
+ return 'label label-info';
7
+ },
8
+ itemValue: function(item) {
9
+ return item ? item.toString() : item;
10
+ },
11
+ itemText: function(item) {
12
+ return this.itemValue(item);
13
+ },
14
+ freeInput: true,
15
+ addOnBlur: true,
16
+ maxTags: undefined,
17
+ maxChars: undefined,
18
+ confirmKeys: [13, 44],
19
+ onTagExists: function(item, $tag) {
20
+ $tag.hide().fadeIn();
21
+ },
22
+ trimValue: false,
23
+ allowDuplicates: false
24
+ };
25
+
26
+ /**
27
+ * Constructor function
28
+ */
29
+ function TagsInput(element, options) {
30
+ this.itemsArray = [];
31
+
32
+ this.$element = $(element);
33
+ this.$element.hide();
34
+
35
+ this.isSelect = (element.tagName === 'SELECT');
36
+ this.multiple = (this.isSelect && element.hasAttribute('multiple'));
37
+ this.objectItems = options && options.itemValue;
38
+ this.placeholderText = element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : '';
39
+ this.inputSize = Math.max(1, this.placeholderText.length);
40
+
41
+ this.$container = $('<div class="bootstrap-tagsinput"></div>');
42
+ this.$input = $('<input type="text" placeholder="' + this.placeholderText + '"/>').appendTo(this.$container);
43
+
44
+ this.$element.after(this.$container);
45
+
46
+ var inputWidth = (this.inputSize < 3 ? 3 : this.inputSize) + "em";
47
+ this.$input.get(0).style.cssText = "width: " + inputWidth + " !important;";
48
+ this.build(options);
49
+ }
50
+
51
+ TagsInput.prototype = {
52
+ constructor: TagsInput,
53
+
54
+ /**
55
+ * Adds the given item as a new tag. Pass true to dontPushVal to prevent
56
+ * updating the elements val()
57
+ */
58
+ add: function(item, dontPushVal) {
59
+ var self = this;
60
+
61
+ if (self.options.maxTags && self.itemsArray.length >= self.options.maxTags)
62
+ return;
63
+
64
+ // Ignore falsey values, except false
65
+ if (item !== false && !item)
66
+ return;
67
+
68
+ // Trim value
69
+ if (typeof item === "string" && self.options.trimValue) {
70
+ item = $.trim(item);
71
+ }
72
+
73
+ // Throw an error when trying to add an object while the itemValue option was not set
74
+ if (typeof item === "object" && !self.objectItems)
75
+ throw("Can't add objects when itemValue option is not set");
76
+
77
+ // Ignore strings only containg whitespace
78
+ if (item.toString().match(/^\s*$/))
79
+ return;
80
+
81
+ // If SELECT but not multiple, remove current tag
82
+ if (self.isSelect && !self.multiple && self.itemsArray.length > 0)
83
+ self.remove(self.itemsArray[0]);
84
+
85
+ if (typeof item === "string" && this.$element[0].tagName === 'INPUT') {
86
+ var items = item.split(',');
87
+ if (items.length > 1) {
88
+ for (var i = 0; i < items.length; i++) {
89
+ this.add(items[i], true);
90
+ }
91
+
92
+ if (!dontPushVal)
93
+ self.pushVal();
94
+ return;
95
+ }
96
+ }
97
+
98
+ var itemValue = self.options.itemValue(item),
99
+ itemText = self.options.itemText(item),
100
+ tagClass = self.options.tagClass(item);
101
+
102
+ // Ignore items allready added
103
+ var existing = $.grep(self.itemsArray, function(item) { return self.options.itemValue(item) === itemValue; } )[0];
104
+ if (existing && !self.options.allowDuplicates) {
105
+ // Invoke onTagExists
106
+ if (self.options.onTagExists) {
107
+ var $existingTag = $(".tag", self.$container).filter(function() { return $(this).data("item") === existing; });
108
+ self.options.onTagExists(item, $existingTag);
109
+ }
110
+ return;
111
+ }
112
+
113
+ // if length greater than limit
114
+ if (self.items().toString().length + item.length + 1 > self.options.maxInputLength)
115
+ return;
116
+
117
+ // raise beforeItemAdd arg
118
+ var beforeItemAddEvent = $.Event('beforeItemAdd', { item: item, cancel: false });
119
+ self.$element.trigger(beforeItemAddEvent);
120
+ if (beforeItemAddEvent.cancel)
121
+ return;
122
+
123
+ // register item in internal array and map
124
+ self.itemsArray.push(item);
125
+
126
+ // add a tag element
127
+ var $tag = $('<span class="tag ' + htmlEncode(tagClass) + '">' + htmlEncode(itemText) + '<span data-role="remove"></span></span>');
128
+ $tag.data('item', item);
129
+ self.findInputWrapper().before($tag);
130
+ $tag.after(' ');
131
+
132
+ // add <option /> if item represents a value not present in one of the <select />'s options
133
+ if (self.isSelect && !$('option[value="' + encodeURIComponent(itemValue) + '"]',self.$element)[0]) {
134
+ var $option = $('<option selected>' + htmlEncode(itemText) + '</option>');
135
+ $option.data('item', item);
136
+ $option.attr('value', itemValue);
137
+ self.$element.append($option);
138
+ }
139
+
140
+ if (!dontPushVal)
141
+ self.pushVal();
142
+
143
+ // Add class when reached maxTags
144
+ if (self.options.maxTags === self.itemsArray.length || self.items().toString().length === self.options.maxInputLength)
145
+ self.$container.addClass('bootstrap-tagsinput-max');
146
+
147
+ self.$element.trigger($.Event('itemAdded', { item: item }));
148
+ },
149
+
150
+ /**
151
+ * Removes the given item. Pass true to dontPushVal to prevent updating the
152
+ * elements val()
153
+ */
154
+ remove: function(item, dontPushVal) {
155
+ var self = this;
156
+
157
+ if (self.objectItems) {
158
+ if (typeof item === "object")
159
+ item = $.grep(self.itemsArray, function(other) { return self.options.itemValue(other) == self.options.itemValue(item); } );
160
+ else
161
+ item = $.grep(self.itemsArray, function(other) { return self.options.itemValue(other) == item; } );
162
+
163
+ item = item[item.length-1];
164
+ }
165
+
166
+ if (item) {
167
+ var beforeItemRemoveEvent = $.Event('beforeItemRemove', { item: item, cancel: false });
168
+ self.$element.trigger(beforeItemRemoveEvent);
169
+ if (beforeItemRemoveEvent.cancel)
170
+ return;
171
+
172
+ $('.tag', self.$container).filter(function() { return $(this).data('item') === item; }).remove();
173
+ $('option', self.$element).filter(function() { return $(this).data('item') === item; }).remove();
174
+ if($.inArray(item, self.itemsArray) !== -1)
175
+ self.itemsArray.splice($.inArray(item, self.itemsArray), 1);
176
+ }
177
+
178
+ if (!dontPushVal)
179
+ self.pushVal();
180
+
181
+ // Remove class when reached maxTags
182
+ if (self.options.maxTags > self.itemsArray.length)
183
+ self.$container.removeClass('bootstrap-tagsinput-max');
184
+
185
+ self.$element.trigger($.Event('itemRemoved', { item: item }));
186
+ },
187
+
188
+ /**
189
+ * Removes all items
190
+ */
191
+ removeAll: function() {
192
+ var self = this;
193
+
194
+ $('.tag', self.$container).remove();
195
+ $('option', self.$element).remove();
196
+
197
+ while(self.itemsArray.length > 0)
198
+ self.itemsArray.pop();
199
+
200
+ self.pushVal();
201
+ },
202
+
203
+ /**
204
+ * Refreshes the tags so they match the text/value of their corresponding
205
+ * item.
206
+ */
207
+ refresh: function() {
208
+ var self = this;
209
+ $('.tag', self.$container).each(function() {
210
+ var $tag = $(this),
211
+ item = $tag.data('item'),
212
+ itemValue = self.options.itemValue(item),
213
+ itemText = self.options.itemText(item),
214
+ tagClass = self.options.tagClass(item);
215
+
216
+ // Update tag's class and inner text
217
+ $tag.attr('class', null);
218
+ $tag.addClass('tag ' + htmlEncode(tagClass));
219
+ $tag.contents().filter(function() {
220
+ return this.nodeType == 3;
221
+ })[0].nodeValue = htmlEncode(itemText);
222
+
223
+ if (self.isSelect) {
224
+ var option = $('option', self.$element).filter(function() { return $(this).data('item') === item; });
225
+ option.attr('value', itemValue);
226
+ }
227
+ });
228
+ },
229
+
230
+ /**
231
+ * Returns the items added as tags
232
+ */
233
+ items: function() {
234
+ return this.itemsArray;
235
+ },
236
+
237
+ /**
238
+ * Assembly value by retrieving the value of each item, and set it on the
239
+ * element.
240
+ */
241
+ pushVal: function() {
242
+ var self = this,
243
+ val = $.map(self.items(), function(item) {
244
+ return self.options.itemValue(item).toString();
245
+ });
246
+
247
+ self.$element.val(val, true).trigger('change');
248
+ },
249
+
250
+ /**
251
+ * Initializes the tags input behaviour on the element
252
+ */
253
+ build: function(options) {
254
+ var self = this;
255
+
256
+ self.options = $.extend({}, defaultOptions, options);
257
+ // When itemValue is set, freeInput should always be false
258
+ if (self.objectItems)
259
+ self.options.freeInput = false;
260
+
261
+ makeOptionItemFunction(self.options, 'itemValue');
262
+ makeOptionItemFunction(self.options, 'itemText');
263
+ makeOptionFunction(self.options, 'tagClass');
264
+
265
+ // Typeahead Bootstrap version 2.3.2
266
+ if (self.options.typeahead) {
267
+ var typeahead = self.options.typeahead || {};
268
+
269
+ makeOptionFunction(typeahead, 'source');
270
+
271
+ self.$input.typeahead($.extend({}, typeahead, {
272
+ source: function (query, process) {
273
+ function processItems(items) {
274
+ var texts = [];
275
+
276
+ for (var i = 0; i < items.length; i++) {
277
+ var text = self.options.itemText(items[i]);
278
+ map[text] = items[i];
279
+ texts.push(text);
280
+ }
281
+ process(texts);
282
+ }
283
+
284
+ this.map = {};
285
+ var map = this.map,
286
+ data = typeahead.source(query);
287
+
288
+ if ($.isFunction(data.success)) {
289
+ // support for Angular callbacks
290
+ data.success(processItems);
291
+ } else if ($.isFunction(data.then)) {
292
+ // support for Angular promises
293
+ data.then(processItems);
294
+ } else {
295
+ // support for functions and jquery promises
296
+ $.when(data)
297
+ .then(processItems);
298
+ }
299
+ },
300
+ updater: function (text) {
301
+ self.add(this.map[text]);
302
+ },
303
+ matcher: function (text) {
304
+ return (text.toLowerCase().indexOf(this.query.trim().toLowerCase()) !== -1);
305
+ },
306
+ sorter: function (texts) {
307
+ return texts.sort();
308
+ },
309
+ highlighter: function (text) {
310
+ var regex = new RegExp( '(' + this.query + ')', 'gi' );
311
+ return text.replace( regex, "<strong>$1</strong>" );
312
+ }
313
+ }));
314
+ }
315
+
316
+ // typeahead.js
317
+ if (self.options.typeaheadjs) {
318
+ var typeaheadjs = self.options.typeaheadjs || {};
319
+
320
+ self.$input.typeahead(null, typeaheadjs).on('typeahead:selected', $.proxy(function (obj, datum) {
321
+ if (typeaheadjs.valueKey)
322
+ self.add(datum[typeaheadjs.valueKey]);
323
+ else
324
+ self.add(datum);
325
+ self.$input.typeahead('val', '');
326
+ }, self));
327
+ }
328
+
329
+ self.$container.on('click', $.proxy(function(event) {
330
+ if (! self.$element.attr('disabled')) {
331
+ self.$input.removeAttr('disabled');
332
+ }
333
+ self.$input.focus();
334
+ }, self));
335
+
336
+ if (self.options.addOnBlur && self.options.freeInput) {
337
+ self.$input.on('focusout', $.proxy(function(event) {
338
+ // HACK: only process on focusout when no typeahead opened, to
339
+ // avoid adding the typeahead text as tag
340
+ if ($('.typeahead, .twitter-typeahead', self.$container).length === 0) {
341
+ self.add(self.$input.val());
342
+ self.$input.val('');
343
+ }
344
+ }, self));
345
+ }
346
+
347
+
348
+ self.$container.on('keydown', 'input', $.proxy(function(event) {
349
+ var $input = $(event.target),
350
+ $inputWrapper = self.findInputWrapper();
351
+
352
+ if (self.$element.attr('disabled')) {
353
+ self.$input.attr('disabled', 'disabled');
354
+ return;
355
+ }
356
+
357
+ switch (event.which) {
358
+ // BACKSPACE
359
+ case 8:
360
+ if (doGetCaretPosition($input[0]) === 0) {
361
+ var prev = $inputWrapper.prev();
362
+ if (prev) {
363
+ self.remove(prev.data('item'));
364
+ }
365
+ }
366
+ break;
367
+
368
+ // DELETE
369
+ case 46:
370
+ if (doGetCaretPosition($input[0]) === 0) {
371
+ var next = $inputWrapper.next();
372
+ if (next) {
373
+ self.remove(next.data('item'));
374
+ }
375
+ }
376
+ break;
377
+
378
+ // LEFT ARROW
379
+ case 37:
380
+ // Try to move the input before the previous tag
381
+ var $prevTag = $inputWrapper.prev();
382
+ if ($input.val().length === 0 && $prevTag[0]) {
383
+ $prevTag.before($inputWrapper);
384
+ $input.focus();
385
+ }
386
+ break;
387
+ // RIGHT ARROW
388
+ case 39:
389
+ // Try to move the input after the next tag
390
+ var $nextTag = $inputWrapper.next();
391
+ if ($input.val().length === 0 && $nextTag[0]) {
392
+ $nextTag.after($inputWrapper);
393
+ $input.focus();
394
+ }
395
+ break;
396
+ default:
397
+ // ignore
398
+ }
399
+
400
+ // Reset internal input's size
401
+ var textLength = $input.val().length,
402
+ wordSpace = Math.ceil(textLength / 5),
403
+ size = textLength + wordSpace + 1;
404
+ $input.attr('size', Math.max(this.inputSize, $input.val().length));
405
+ }, self));
406
+
407
+ self.$container.on('keypress', 'input', $.proxy(function(event) {
408
+ var $input = $(event.target);
409
+
410
+ if (self.$element.attr('disabled')) {
411
+ self.$input.attr('disabled', 'disabled');
412
+ return;
413
+ }
414
+
415
+ var text = $input.val(),
416
+ maxLengthReached = self.options.maxChars && text.length >= self.options.maxChars;
417
+ if (self.options.freeInput && (keyCombinationInList(event, self.options.confirmKeys) || maxLengthReached)) {
418
+ self.add(maxLengthReached ? text.substr(0, self.options.maxChars) : text);
419
+ $input.val('');
420
+ event.preventDefault();
421
+ }
422
+
423
+ // Reset internal input's size
424
+ var textLength = $input.val().length,
425
+ wordSpace = Math.ceil(textLength / 5),
426
+ size = textLength + wordSpace + 1;
427
+ $input.attr('size', Math.max(this.inputSize, $input.val().length));
428
+ }, self));
429
+
430
+ // Remove icon clicked
431
+ self.$container.on('click', '[data-role=remove]', $.proxy(function(event) {
432
+ if (self.$element.attr('disabled')) {
433
+ return;
434
+ }
435
+ self.remove($(event.target).closest('.tag').data('item'));
436
+ }, self));
437
+
438
+ // Only add existing value as tags when using strings as tags
439
+ if (self.options.itemValue === defaultOptions.itemValue) {
440
+ if (self.$element[0].tagName === 'INPUT') {
441
+ self.add(self.$element.val());
442
+ } else {
443
+ $('option', self.$element).each(function() {
444
+ self.add($(this).attr('value'), true);
445
+ });
446
+ }
447
+ }
448
+ },
449
+
450
+ /**
451
+ * Removes all tagsinput behaviour and unregsiter all event handlers
452
+ */
453
+ destroy: function() {
454
+ var self = this;
455
+
456
+ // Unbind events
457
+ self.$container.off('keypress', 'input');
458
+ self.$container.off('click', '[role=remove]');
459
+
460
+ self.$container.remove();
461
+ self.$element.removeData('tagsinput');
462
+ self.$element.show();
463
+ },
464
+
465
+ /**
466
+ * Sets focus on the tagsinput
467
+ */
468
+ focus: function() {
469
+ this.$input.focus();
470
+ },
471
+
472
+ /**
473
+ * Returns the internal input element
474
+ */
475
+ input: function() {
476
+ return this.$input;
477
+ },
478
+
479
+ /**
480
+ * Returns the element which is wrapped around the internal input. This
481
+ * is normally the $container, but typeahead.js moves the $input element.
482
+ */
483
+ findInputWrapper: function() {
484
+ var elt = this.$input[0],
485
+ container = this.$container[0];
486
+ while(elt && elt.parentNode !== container)
487
+ elt = elt.parentNode;
488
+
489
+ return $(elt);
490
+ }
491
+ };
492
+
493
+ /**
494
+ * Register JQuery plugin
495
+ */
496
+ $.fn.tagsinput = function(arg1, arg2) {
497
+ var results = [];
498
+
499
+ this.each(function() {
500
+ var tagsinput = $(this).data('tagsinput');
501
+ // Initialize a new tags input
502
+ if (!tagsinput) {
503
+ tagsinput = new TagsInput(this, arg1);
504
+ $(this).data('tagsinput', tagsinput);
505
+ results.push(tagsinput);
506
+
507
+ if (this.tagName === 'SELECT') {
508
+ $('option', $(this)).attr('selected', 'selected');
509
+ }
510
+
511
+ // Init tags from $(this).val()
512
+ $(this).val($(this).val());
513
+ } else if (!arg1 && !arg2) {
514
+ // tagsinput already exists
515
+ // no function, trying to init
516
+ results.push(tagsinput);
517
+ } else if(tagsinput[arg1] !== undefined) {
518
+ // Invoke function on existing tags input
519
+ var retVal = tagsinput[arg1](arg2);
520
+ if (retVal !== undefined)
521
+ results.push(retVal);
522
+ }
523
+ });
524
+
525
+ if ( typeof arg1 == 'string') {
526
+ // Return the results from the invoked function calls
527
+ return results.length > 1 ? results : results[0];
528
+ } else {
529
+ return results;
530
+ }
531
+ };
532
+
533
+ $.fn.tagsinput.Constructor = TagsInput;
534
+
535
+ /**
536
+ * Most options support both a string or number as well as a function as
537
+ * option value. This function makes sure that the option with the given
538
+ * key in the given options is wrapped in a function
539
+ */
540
+ function makeOptionItemFunction(options, key) {
541
+ if (typeof options[key] !== 'function') {
542
+ var propertyName = options[key];
543
+ options[key] = function(item) { return item[propertyName]; };
544
+ }
545
+ }
546
+ function makeOptionFunction(options, key) {
547
+ if (typeof options[key] !== 'function') {
548
+ var value = options[key];
549
+ options[key] = function() { return value; };
550
+ }
551
+ }
552
+ /**
553
+ * HtmlEncodes the given value
554
+ */
555
+ var htmlEncodeContainer = $('<div />');
556
+ function htmlEncode(value) {
557
+ if (value) {
558
+ return htmlEncodeContainer.text(value).html();
559
+ } else {
560
+ return '';
561
+ }
562
+ }
563
+
564
+ /**
565
+ * Returns the position of the caret in the given input field
566
+ * http://flightschool.acylt.com/devnotes/caret-position-woes/
567
+ */
568
+ function doGetCaretPosition(oField) {
569
+ var iCaretPos = 0;
570
+ if (document.selection) {
571
+ oField.focus ();
572
+ var oSel = document.selection.createRange();
573
+ oSel.moveStart ('character', -oField.value.length);
574
+ iCaretPos = oSel.text.length;
575
+ } else if (oField.selectionStart || oField.selectionStart == '0') {
576
+ iCaretPos = oField.selectionStart;
577
+ }
578
+ return (iCaretPos);
579
+ }
580
+
581
+ /**
582
+ * Returns boolean indicates whether user has pressed an expected key combination.
583
+ * @param object keyPressEvent: JavaScript event object, refer
584
+ * http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
585
+ * @param object lookupList: expected key combinations, as in:
586
+ * [13, {which: 188, shiftKey: true}]
587
+ */
588
+ function keyCombinationInList(keyPressEvent, lookupList) {
589
+ var found = false;
590
+ $.each(lookupList, function (index, keyCombination) {
591
+ if (typeof (keyCombination) === 'number' && keyPressEvent.which === keyCombination) {
592
+ found = true;
593
+ return false;
594
+ }
595
+
596
+ if (keyPressEvent.which === keyCombination.which) {
597
+ var alt = !keyCombination.hasOwnProperty('altKey') || keyPressEvent.altKey === keyCombination.altKey,
598
+ shift = !keyCombination.hasOwnProperty('shiftKey') || keyPressEvent.shiftKey === keyCombination.shiftKey,
599
+ ctrl = !keyCombination.hasOwnProperty('ctrlKey') || keyPressEvent.ctrlKey === keyCombination.ctrlKey;
600
+ if (alt && shift && ctrl) {
601
+ found = true;
602
+ return false;
603
+ }
604
+ }
605
+ });
606
+
607
+ return found;
608
+ }
609
+
610
+ /**
611
+ * Initialize tagsinput behaviour on inputs and selects which have
612
+ * data-role=tagsinput
613
+ */
614
+ $(function() {
615
+ $("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput();
616
+ });
617
+ })(window.jQuery);
javascript/jquery.colorbox-min.js CHANGED
@@ -1,1104 +1 @@
1
- /*!
2
- Colorbox 1.6.0
3
- license: MIT
4
- http://www.jacklmoore.com/colorbox
5
- */
6
- (function ($, document, window) {
7
- var
8
- // Default settings object.
9
- // See http://jacklmoore.com/colorbox for details.
10
- defaults = {
11
- // data sources
12
- html: false,
13
- photo: false,
14
- iframe: false,
15
- inline: false,
16
-
17
- // behavior and appearance
18
- transition: "elastic",
19
- speed: 300,
20
- fadeOut: 300,
21
- width: false,
22
- initialWidth: "600",
23
- innerWidth: false,
24
- maxWidth: false,
25
- height: false,
26
- initialHeight: "450",
27
- innerHeight: false,
28
- maxHeight: false,
29
- scalePhotos: true,
30
- scrolling: true,
31
- opacity: 0.9,
32
- preloading: true,
33
- className: false,
34
- overlayClose: true,
35
- escKey: true,
36
- arrowKey: true,
37
- top: false,
38
- bottom: false,
39
- left: false,
40
- right: false,
41
- fixed: false,
42
- data: undefined,
43
- closeButton: true,
44
- fastIframe: true,
45
- open: false,
46
- reposition: true,
47
- loop: true,
48
- slideshow: false,
49
- slideshowAuto: true,
50
- slideshowSpeed: 2500,
51
- slideshowStart: "start slideshow",
52
- slideshowStop: "stop slideshow",
53
- photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,
54
-
55
- // alternate image paths for high-res displays
56
- retinaImage: false,
57
- retinaUrl: false,
58
- retinaSuffix: '@2x.$1',
59
-
60
- // internationalization
61
- current: "image {current} of {total}",
62
- previous: "previous",
63
- next: "next",
64
- close: "close",
65
- xhrError: "This content failed to load.",
66
- imgError: "This image failed to load.",
67
-
68
- // accessbility
69
- returnFocus: true,
70
- trapFocus: true,
71
-
72
- // callbacks
73
- onOpen: false,
74
- onLoad: false,
75
- onComplete: false,
76
- onCleanup: false,
77
- onClosed: false,
78
-
79
- rel: function() {
80
- return this.rel;
81
- },
82
- href: function() {
83
- // using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container')
84
- return $(this).attr('href');
85
- },
86
- title: function() {
87
- return this.title;
88
- },
89
- createImg: function() {
90
- var img = new Image();
91
- var attrs = $(this).data('cbox-img-attrs');
92
-
93
- if (typeof attrs === 'object') {
94
- $.each(attrs, function(key, val){
95
- img[key] = val;
96
- });
97
- }
98
-
99
- return img;
100
- },
101
- createIframe: function() {
102
- var iframe = document.createElement('iframe');
103
- var attrs = $(this).data('cbox-iframe-attrs');
104
-
105
- if (typeof attrs === 'object') {
106
- $.each(attrs, function(key, val){
107
- iframe[key] = val;
108
- });
109
- }
110
-
111
- if ('frameBorder' in iframe) {
112
- iframe.frameBorder = 0;
113
- }
114
- if ('allowTransparency' in iframe) {
115
- iframe.allowTransparency = "true";
116
- }
117
- iframe.name = (new Date()).getTime(); // give the iframe a unique name to prevent caching
118
- iframe.allowFullScreen = true;
119
-
120
- return iframe;
121
- }
122
- },
123
-
124
- // Abstracting the HTML and event identifiers for easy rebranding
125
- colorbox = 'colorbox',
126
- prefix = 'cbox',
127
- boxElement = prefix + 'Element',
128
-
129
- // Events
130
- event_open = prefix + '_open',
131
- event_load = prefix + '_load',
132
- event_complete = prefix + '_complete',
133
- event_cleanup = prefix + '_cleanup',
134
- event_closed = prefix + '_closed',
135
- event_purge = prefix + '_purge',
136
-
137
- // Cached jQuery Object Variables
138
- $overlay,
139
- $box,
140
- $wrap,
141
- $content,
142
- $topBorder,
143
- $leftBorder,
144
- $rightBorder,
145
- $bottomBorder,
146
- $related,
147
- $window,
148
- $loaded,
149
- $loadingBay,
150
- $loadingOverlay,
151
- $title,
152
- $current,
153
- $slideshow,
154
- $next,
155
- $prev,
156
- $close,
157
- $groupControls,
158
- $events = $('<a/>'), // $({}) would be prefered, but there is an issue with jQuery 1.4.2
159
-
160
- // Variables for cached values or use across multiple functions
161
- settings,
162
- interfaceHeight,
163
- interfaceWidth,
164
- loadedHeight,
165
- loadedWidth,
166
- index,
167
- photo,
168
- open,
169
- active,
170
- closing,
171
- loadingTimer,
172
- publicMethod,
173
- div = "div",
174
- requests = 0,
175
- previousCSS = {},
176
- init;
177
-
178
- // ****************
179
- // HELPER FUNCTIONS
180
- // ****************
181
-
182
- // Convenience function for creating new jQuery objects
183
- function $tag(tag, id, css) {
184
- var element = document.createElement(tag);
185
-
186
- if (id) {
187
- element.id = prefix + id;
188
- }
189
-
190
- if (css) {
191
- element.style.cssText = css;
192
- }
193
-
194
- return $(element);
195
- }
196
-
197
- // Get the window height using innerHeight when available to avoid an issue with iOS
198
- // http://bugs.jquery.com/ticket/6724
199
- function winheight() {
200
- return window.innerHeight ? window.innerHeight : $(window).height();
201
- }
202
-
203
- function Settings(element, options) {
204
- if (options !== Object(options)) {
205
- options = {};
206
- }
207
-
208
- this.cache = {};
209
- this.el = element;
210
-
211
- this.value = function(key) {
212
- var dataAttr;
213
-
214
- if (this.cache[key] === undefined) {
215
- dataAttr = $(this.el).attr('data-cbox-'+key);
216
-
217
- if (dataAttr !== undefined) {
218
- this.cache[key] = dataAttr;
219
- } else if (options[key] !== undefined) {
220
- this.cache[key] = options[key];
221
- } else if (defaults[key] !== undefined) {
222
- this.cache[key] = defaults[key];
223
- }
224
- }
225
-
226
- return this.cache[key];
227
- };
228
-
229
- this.get = function(key) {
230
- var value = this.value(key);
231
- return $.isFunction(value) ? value.call(this.el, this) : value;
232
- };
233
- }
234
-
235
- // Determine the next and previous members in a group.
236
- function getIndex(increment) {
237
- var
238
- max = $related.length,
239
- newIndex = (index + increment) % max;
240
-
241
- return (newIndex < 0) ? max + newIndex : newIndex;
242
- }
243
-
244
- // Convert '%' and 'px' values to integers
245
- function setSize(size, dimension) {
246
- return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
247
- }
248
-
249
- // Checks an href to see if it is a photo.
250
- // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
251
- function isImage(settings, url) {
252
- return settings.get('photo') || settings.get('photoRegex').test(url);
253
- }
254
-
255
- function retinaUrl(settings, url) {
256
- return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url;
257
- }
258
-
259
- function trapFocus(e) {
260
- if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) {
261
- e.stopPropagation();
262
- $box.focus();
263
- }
264
- }
265
-
266
- function setClass(str) {
267
- if (setClass.str !== str) {
268
- $box.add($overlay).removeClass(setClass.str).addClass(str);
269
- setClass.str = str;
270
- }
271
- }
272
-
273
- function getRelated(rel) {
274
- index = 0;
275
-
276
- if (rel && rel !== false && rel !== 'nofollow') {
277
- $related = $('.' + boxElement).filter(function () {
278
- var options = $.data(this, colorbox);
279
- var settings = new Settings(this, options);
280
- return (settings.get('rel') === rel);
281
- });
282
- index = $related.index(settings.el);
283
-
284
- // Check direct calls to Colorbox.
285
- if (index === -1) {
286
- $related = $related.add(settings.el);
287
- index = $related.length - 1;
288
- }
289
- } else {
290
- $related = $(settings.el);
291
- }
292
- }
293
-
294
- function trigger(event) {
295
- // for external use
296
- $(document).trigger(event);
297
- // for internal use
298
- $events.triggerHandler(event);
299
- }
300
-
301
- var slideshow = (function(){
302
- var active,
303
- className = prefix + "Slideshow_",
304
- click = "click." + prefix,
305
- timeOut;
306
-
307
- function clear () {
308
- clearTimeout(timeOut);
309
- }
310
-
311
- function set() {
312
- if (settings.get('loop') || $related[index + 1]) {
313
- clear();
314
- timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed'));
315
- }
316
- }
317
-
318
- function start() {
319
- $slideshow
320
- .html(settings.get('slideshowStop'))
321
- .unbind(click)
322
- .one(click, stop);
323
-
324
- $events
325
- .bind(event_complete, set)
326
- .bind(event_load, clear);
327
-
328
- $box.removeClass(className + "off").addClass(className + "on");
329
- }
330
-
331
- function stop() {
332
- clear();
333
-
334
- $events
335
- .unbind(event_complete, set)
336
- .unbind(event_load, clear);
337
-
338
- $slideshow
339
- .html(settings.get('slideshowStart'))
340
- .unbind(click)
341
- .one(click, function () {
342
- publicMethod.next();
343
- start();
344
- });
345
-
346
- $box.removeClass(className + "on").addClass(className + "off");
347
- }
348
-
349
- function reset() {
350
- active = false;
351
- $slideshow.hide();
352
- clear();
353
- $events
354
- .unbind(event_complete, set)
355
- .unbind(event_load, clear);
356
- $box.removeClass(className + "off " + className + "on");
357
- }
358
-
359
- return function(){
360
- if (active) {
361
- if (!settings.get('slideshow')) {
362
- $events.unbind(event_cleanup, reset);
363
- reset();
364
- }
365
- } else {
366
- if (settings.get('slideshow') && $related[1]) {
367
- active = true;
368
- $events.one(event_cleanup, reset);
369
- if (settings.get('slideshowAuto')) {
370
- start();
371
- } else {
372
- stop();
373
- }
374
- $slideshow.show();
375
- }
376
- }
377
- };
378
-
379
- }());
380
-
381
-
382
- function launch(element) {
383
- var options;
384
-
385
- if (!closing) {
386
-
387
- options = $(element).data(colorbox);
388
-
389
- settings = new Settings(element, options);
390
-
391
- getRelated(settings.get('rel'));
392
-
393
- if (!open) {
394
- open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
395
-
396
- setClass(settings.get('className'));
397
-
398
- // Show colorbox so the sizes can be calculated in older versions of jQuery
399
- $box.css({visibility:'hidden', display:'block', opacity:''});
400
-
401
- $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden');
402
- $content.css({width:'', height:''}).append($loaded);
403
-
404
- // Cache values needed for size calculations
405
- interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
406
- interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
407
- loadedHeight = $loaded.outerHeight(true);
408
- loadedWidth = $loaded.outerWidth(true);
409
-
410
- // Opens inital empty Colorbox prior to content being loaded.
411
- var initialWidth = setSize(settings.get('initialWidth'), 'x');
412
- var initialHeight = setSize(settings.get('initialHeight'), 'y');
413
- var maxWidth = settings.get('maxWidth');
414
- var maxHeight = settings.get('maxHeight');
415
-
416
- settings.w = (maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth;
417
- settings.h = (maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight;
418
-
419
- $loaded.css({width:'', height:settings.h});
420
- publicMethod.position();
421
-
422
- trigger(event_open);
423
- settings.get('onOpen');
424
-
425
- $groupControls.add($title).hide();
426
-
427
- $box.focus();
428
-
429
- if (settings.get('trapFocus')) {
430
- // Confine focus to the modal
431
- // Uses event capturing that is not supported in IE8-
432
- if (document.addEventListener) {
433
-
434
- document.addEventListener('focus', trapFocus, true);
435
-
436
- $events.one(event_closed, function () {
437
- document.removeEventListener('focus', trapFocus, true);
438
- });
439
- }
440
- }
441
-
442
- // Return focus on closing
443
- if (settings.get('returnFocus')) {
444
- $events.one(event_closed, function () {
445
- $(settings.el).focus();
446
- });
447
- }
448
- }
449
-
450
- var opacity = parseFloat(settings.get('opacity'));
451
- $overlay.css({
452
- opacity: opacity === opacity ? opacity : '',
453
- cursor: settings.get('overlayClose') ? 'pointer' : '',
454
- visibility: 'visible'
455
- }).show();
456
-
457
- if (settings.get('closeButton')) {
458
- $close.html(settings.get('close')).appendTo($content);
459
- } else {
460
- $close.appendTo('<div/>'); // replace with .detach() when dropping jQuery < 1.4
461
- }
462
-
463
- load();
464
- }
465
- }
466
-
467
- // Colorbox's markup needs to be added to the DOM prior to being called
468
- // so that the browser will go ahead and load the CSS background images.
469
- function appendHTML() {
470
- if (!$box) {
471
- init = false;
472
- $window = $(window);
473
- $box = $tag(div).attr({
474
- id: colorbox,
475
- 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
476
- role: 'dialog',
477
- tabindex: '-1'
478
- }).hide();
479
- $overlay = $tag(div, "Overlay").hide();
480
- $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
481
- $wrap = $tag(div, "Wrapper");
482
- $content = $tag(div, "Content").append(
483
- $title = $tag(div, "Title"),
484
- $current = $tag(div, "Current"),
485
- $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
486
- $next = $('<button type="button"/>').attr({id:prefix+'Next'}),
487
- $slideshow = $tag('button', "Slideshow"),
488
- $loadingOverlay
489
- );
490
-
491
- $close = $('<button type="button"/>').attr({id:prefix+'Close'});
492
-
493
- $wrap.append( // The 3x3 Grid that makes up Colorbox
494
- $tag(div).append(
495
- $tag(div, "TopLeft"),
496
- $topBorder = $tag(div, "TopCenter"),
497
- $tag(div, "TopRight")
498
- ),
499
- $tag(div, false, 'clear:left').append(
500
- $leftBorder = $tag(div, "MiddleLeft"),
501
- $content,
502
- $rightBorder = $tag(div, "MiddleRight")
503
- ),
504
- $tag(div, false, 'clear:left').append(
505
- $tag(div, "BottomLeft"),
506
- $bottomBorder = $tag(div, "BottomCenter"),
507
- $tag(div, "BottomRight")
508
- )
509
- ).find('div div').css({'float': 'left'});
510
-
511
- $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
512
-
513
- $groupControls = $next.add($prev).add($current).add($slideshow);
514
- }
515
- if (document.body && !$box.parent().length) {
516
- $(document.body).append($overlay, $box.append($wrap, $loadingBay));
517
- }
518
- }
519
-
520
- // Add Colorbox's event bindings
521
- function addBindings() {
522
- function clickHandler(e) {
523
- // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
524
- // See: http://jacklmoore.com/notes/click-events/
525
- if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
526
- e.preventDefault();
527
- launch(this);
528
- }
529
- }
530
-
531
- if ($box) {
532
- if (!init) {
533
- init = true;
534
-
535
- // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
536
- $next.click(function () {
537
- publicMethod.next();
538
- });
539
- $prev.click(function () {
540
- publicMethod.prev();
541
- });
542
- $close.click(function () {
543
- publicMethod.close();
544
- });
545
- $overlay.click(function () {
546
- if (settings.get('overlayClose')) {
547
- publicMethod.close();
548
- }
549
- });
550
-
551
- // Key Bindings
552
- $(document).bind('keydown.' + prefix, function (e) {
553
- var key = e.keyCode;
554
- if (open && settings.get('escKey') && key === 27) {
555
- e.preventDefault();
556
- publicMethod.close();
557
- }
558
- if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
559
- if (key === 37) {
560
- e.preventDefault();
561
- $prev.click();
562
- } else if (key === 39) {
563
- e.preventDefault();
564
- $next.click();
565
- }
566
- }
567
- });
568
-
569
- if ($.isFunction($.fn.on)) {
570
- // For jQuery 1.7+
571
- $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
572
- } else {
573
- // For jQuery 1.3.x -> 1.6.x
574
- // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
575
- // This is not here for jQuery 1.9, it's here for legacy users.
576
- $('.'+boxElement).live('click.'+prefix, clickHandler);
577
- }
578
- }
579
- return true;
580
- }
581
- return false;
582
- }
583
-
584
- // Don't do anything if Colorbox already exists.
585
- if ($[colorbox]) {
586
- return;
587
- }
588
-
589
- // Append the HTML when the DOM loads
590
- $(appendHTML);
591
-
592
-
593
- // ****************
594
- // PUBLIC FUNCTIONS
595
- // Usage format: $.colorbox.close();
596
- // Usage from within an iframe: parent.jQuery.colorbox.close();
597
- // ****************
598
-
599
- publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
600
- var settings;
601
- var $obj = this;
602
-
603
- options = options || {};
604
-
605
- if ($.isFunction($obj)) { // assume a call to $.colorbox
606
- $obj = $('<a/>');
607
- options.open = true;
608
- }
609
-
610
- if (!$obj[0]) { // colorbox being applied to empty collection
611
- return $obj;
612
- }
613
-
614
- appendHTML();
615
-
616
- if (addBindings()) {
617
-
618
- if (callback) {
619
- options.onComplete = callback;
620
- }
621
-
622
- $obj.each(function () {
623
- var old = $.data(this, colorbox) || {};
624
- $.data(this, colorbox, $.extend(old, options));
625
- }).addClass(boxElement);
626
-
627
- settings = new Settings($obj[0], options);
628
-
629
- if (settings.get('open')) {
630
- launch($obj[0]);
631
- }
632
- }
633
-
634
- return $obj;
635
- };
636
-
637
- publicMethod.position = function (speed, loadedCallback) {
638
- var
639
- css,
640
- top = 0,
641
- left = 0,
642
- offset = $box.offset(),
643
- scrollTop,
644
- scrollLeft;
645
-
646
- $window.unbind('resize.' + prefix);
647
-
648
- // remove the modal so that it doesn't influence the document width/height
649
- $box.css({top: -9e4, left: -9e4});
650
-
651
- scrollTop = $window.scrollTop();
652
- scrollLeft = $window.scrollLeft();
653
-
654
- if (settings.get('fixed')) {
655
- offset.top -= scrollTop;
656
- offset.left -= scrollLeft;
657
- $box.css({position: 'fixed'});
658
- } else {
659
- top = scrollTop;
660
- left = scrollLeft;
661
- $box.css({position: 'absolute'});
662
- }
663
-
664
- // keeps the top and left positions within the browser's viewport.
665
- if (settings.get('right') !== false) {
666
- left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.get('right'), 'x'), 0);
667
- } else if (settings.get('left') !== false) {
668
- left += setSize(settings.get('left'), 'x');
669
- } else {
670
- left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
671
- }
672
-
673
- if (settings.get('bottom') !== false) {
674
- top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0);
675
- } else if (settings.get('top') !== false) {
676
- top += setSize(settings.get('top'), 'y');
677
- } else {
678
- top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
679
- }
680
-
681
- $box.css({top: offset.top, left: offset.left, visibility:'visible'});
682
-
683
- // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
684
- // but it has to be shrank down around the size of div#colorbox when it's done. If not,
685
- // it can invoke an obscure IE bug when using iframes.
686
- $wrap[0].style.width = $wrap[0].style.height = "9999px";
687
-
688
- function modalDimensions() {
689
- $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
690
- $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
691
- }
692
-
693
- css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
694
-
695
- // setting the speed to 0 if the content hasn't changed size or position
696
- if (speed) {
697
- var tempSpeed = 0;
698
- $.each(css, function(i){
699
- if (css[i] !== previousCSS[i]) {
700
- tempSpeed = speed;
701
- return;
702
- }
703
- });
704
- speed = tempSpeed;
705
- }
706
-
707
- previousCSS = css;
708
-
709
- if (!speed) {
710
- $box.css(css);
711
- }
712
-
713
- $box.dequeue().animate(css, {
714
- duration: speed || 0,
715
- complete: function () {
716
- modalDimensions();
717
-
718
- active = false;
719
-
720
- // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
721
- $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
722
- $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
723
-
724
- if (settings.get('reposition')) {
725
- setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
726
- $window.bind('resize.' + prefix, publicMethod.position);
727
- }, 1);
728
- }
729
-
730
- if ($.isFunction(loadedCallback)) {
731
- loadedCallback();
732
- }
733
- },
734
- step: modalDimensions
735
- });
736
- };
737
-
738
- publicMethod.resize = function (options) {
739
- var scrolltop;
740
-
741
- if (open) {
742
- options = options || {};
743
-
744
- if (options.width) {
745
- settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
746
- }
747
-
748
- if (options.innerWidth) {
749
- settings.w = setSize(options.innerWidth, 'x');
750
- }
751
-
752
- $loaded.css({width: settings.w});
753
-
754
- if (options.height) {
755
- settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
756
- }
757
-
758
- if (options.innerHeight) {
759
- settings.h = setSize(options.innerHeight, 'y');
760
- }
761
-
762
- if (!options.innerHeight && !options.height) {
763
- scrolltop = $loaded.scrollTop();
764
- $loaded.css({height: "auto"});
765
- settings.h = $loaded.height();
766
- }
767
-
768
- $loaded.css({height: settings.h});
769
-
770
- if(scrolltop) {
771
- $loaded.scrollTop(scrolltop);
772
- }
773
-
774
- publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed'));
775
- }
776
- };
777
-
778
- publicMethod.prep = function (object) {
779
- if (!open) {
780
- return;
781
- }
782
-
783
- var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed');
784
-
785
- $loaded.remove();
786
-
787
- $loaded = $tag(div, 'LoadedContent').append(object);
788
-
789
- function getWidth() {
790
- settings.w = settings.w || $loaded.width();
791
- settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
792
- return settings.w;
793
- }
794
- function getHeight() {
795
- settings.h = settings.h || $loaded.height();
796
- settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
797
- return settings.h;
798
- }
799
-
800
- $loaded.hide()
801
- .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
802
- .css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'})
803
- .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
804
- .prependTo($content);
805
-
806
- $loadingBay.hide();
807
-
808
- // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
809
-
810
- $(photo).css({'float': 'none'});
811
-
812
- setClass(settings.get('className'));
813
-
814
- callback = function () {
815
- var total = $related.length,
816
- iframe,
817
- complete;
818
-
819
- if (!open) {
820
- return;
821
- }
822
-
823
- function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2
824
- if ($.support.opacity === false) {
825
- $box[0].style.removeAttribute('filter');
826
- }
827
- }
828
-
829
- complete = function () {
830
- clearTimeout(loadingTimer);
831
- $loadingOverlay.hide();
832
- trigger(event_complete);
833
- settings.get('onComplete');
834
- };
835
-
836
-
837
- $title.html(settings.get('title')).show();
838
- $loaded.show();
839
-
840
- if (total > 1) { // handle grouping
841
- if (typeof settings.get('current') === "string") {
842
- $current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show();
843
- }
844
-
845
- $next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next'));
846
- $prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous'));
847
-
848
- slideshow();
849
-
850
- // Preloads images within a rel group
851
- if (settings.get('preloading')) {
852
- $.each([getIndex(-1), getIndex(1)], function(){
853
- var img,
854
- i = $related[this],
855
- settings = new Settings(i, $.data(i, colorbox)),
856
- src = settings.get('href');
857
-
858
- if (src && isImage(settings, src)) {
859
- src = retinaUrl(settings, src);
860
- img = document.createElement('img');
861
- img.src = src;
862
- }
863
- });
864
- }
865
- } else {
866
- $groupControls.hide();
867
- }
868
-
869
- if (settings.get('iframe')) {
870
-
871
- iframe = settings.get('createIframe');
872
-
873
- if (!settings.get('scrolling')) {
874
- iframe.scrolling = "no";
875
- }
876
-
877
- $(iframe)
878
- .attr({
879
- src: settings.get('href'),
880
- 'class': prefix + 'Iframe'
881
- })
882
- .one('load', complete)
883
- .appendTo($loaded);
884
-
885
- $events.one(event_purge, function () {
886
- iframe.src = "//about:blank";
887
- });
888
-
889
- if (settings.get('fastIframe')) {
890
- $(iframe).trigger('load');
891
- }
892
- } else {
893
- complete();
894
- }
895
-
896
- if (settings.get('transition') === 'fade') {
897
- $box.fadeTo(speed, 1, removeFilter);
898
- } else {
899
- removeFilter();
900
- }
901
- };
902
-
903
- if (settings.get('transition') === 'fade') {
904
- $box.fadeTo(speed, 0, function () {
905
- publicMethod.position(0, callback);
906
- });
907
- } else {
908
- publicMethod.position(speed, callback);
909
- }
910
- };
911
-
912
- function load () {
913
- var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
914
-
915
- active = true;
916
-
917
- photo = false;
918
-
919
- trigger(event_purge);
920
- trigger(event_load);
921
- settings.get('onLoad');
922
-
923
- settings.h = settings.get('height') ?
924
- setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight :
925
- settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y');
926
-
927
- settings.w = settings.get('width') ?
928
- setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth :
929
- settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x');
930
-
931
- // Sets the minimum dimensions for use in image scaling
932
- settings.mw = settings.w;
933
- settings.mh = settings.h;
934
-
935
- // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
936
- // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
937
- if (settings.get('maxWidth')) {
938
- settings.mw = setSize(settings.get('maxWidth'), 'x') - loadedWidth - interfaceWidth;
939
- settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
940
- }
941
- if (settings.get('maxHeight')) {
942
- settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight;
943
- settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
944
- }
945
-
946
- href = settings.get('href');
947
-
948
- loadingTimer = setTimeout(function () {
949
- $loadingOverlay.show();
950
- }, 100);
951
-
952
- if (settings.get('inline')) {
953
- var $target = $(href);
954
- // Inserts an empty placeholder where inline content is being pulled from.
955
- // An event is bound to put inline content back when Colorbox closes or loads new content.
956
- $inline = $('<div>').hide().insertBefore($target);
957
-
958
- $events.one(event_purge, function () {
959
- $inline.replaceWith($target);
960
- });
961
-
962
- prep($target);
963
- } else if (settings.get('iframe')) {
964
- // IFrame element won't be added to the DOM until it is ready to be displayed,
965
- // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
966
- prep(" ");
967
- } else if (settings.get('html')) {
968
- prep(settings.get('html'));
969
- } else if (isImage(settings, href)) {
970
-
971
- href = retinaUrl(settings, href);
972
-
973
- photo = settings.get('createImg');
974
-
975
- $(photo)
976
- .addClass(prefix + 'Photo')
977
- .bind('error',function () {
978
- prep($tag(div, 'Error').html(settings.get('imgError')));
979
- })
980
- .one('load', function () {
981
- if (request !== requests) {
982
- return;
983
- }
984
-
985
- // A small pause because some browsers will occassionaly report a
986
- // img.width and img.height of zero immediately after the img.onload fires
987
- setTimeout(function(){
988
- var percent;
989
-
990
- if (settings.get('retinaImage') && window.devicePixelRatio > 1) {
991
- photo.height = photo.height / window.devicePixelRatio;
992
- photo.width = photo.width / window.devicePixelRatio;
993
- }
994
-
995
- if (settings.get('scalePhotos')) {
996
- setResize = function () {
997
- photo.height -= photo.height * percent;
998
- photo.width -= photo.width * percent;
999
- };
1000
- if (settings.mw && photo.width > settings.mw) {
1001
- percent = (photo.width - settings.mw) / photo.width;
1002
- setResize();
1003
- }
1004
- if (settings.mh && photo.height > settings.mh) {
1005
- percent = (photo.height - settings.mh) / photo.height;
1006
- setResize();
1007
- }
1008
- }
1009
-
1010
- if (settings.h) {
1011
- photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
1012
- }
1013
-
1014
- if ($related[1] && (settings.get('loop') || $related[index + 1])) {
1015
- photo.style.cursor = 'pointer';
1016
- photo.onclick = function () {
1017
- publicMethod.next();
1018
- };
1019
- }
1020
-
1021
- photo.style.width = photo.width + 'px';
1022
- photo.style.height = photo.height + 'px';
1023
- prep(photo);
1024
- }, 1);
1025
- });
1026
-
1027
- photo.src = href;
1028
-
1029
- } else if (href) {
1030
- $loadingBay.load(href, settings.get('data'), function (data, status) {
1031
- if (request === requests) {
1032
- prep(status === 'error' ? $tag(div, 'Error').html(settings.get('xhrError')) : $(this).contents());
1033
- }
1034
- });
1035
- }
1036
- }
1037
-
1038
- // Navigates to the next page/image in a set.
1039
- publicMethod.next = function () {
1040
- if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) {
1041
- index = getIndex(1);
1042
- launch($related[index]);
1043
- }
1044
- };
1045
-
1046
- publicMethod.prev = function () {
1047
- if (!active && $related[1] && (settings.get('loop') || index)) {
1048
- index = getIndex(-1);
1049
- launch($related[index]);
1050
- }
1051
- };
1052
-
1053
- // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
1054
- publicMethod.close = function () {
1055
- if (open && !closing) {
1056
-
1057
- closing = true;
1058
- open = false;
1059
- trigger(event_cleanup);
1060
- settings.get('onCleanup');
1061
- $window.unbind('.' + prefix);
1062
- $overlay.fadeTo(settings.get('fadeOut') || 0, 0);
1063
-
1064
- $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
1065
- $box.hide();
1066
- $overlay.hide();
1067
- trigger(event_purge);
1068
- $loaded.remove();
1069
-
1070
- setTimeout(function () {
1071
- closing = false;
1072
- trigger(event_closed);
1073
- settings.get('onClosed');
1074
- }, 1);
1075
- });
1076
- }
1077
- };
1078
-
1079
- // Removes changes Colorbox made to the document, but does not remove the plugin.
1080
- publicMethod.remove = function () {
1081
- if (!$box) { return; }
1082
-
1083
- $box.stop();
1084
- $[colorbox].close();
1085
- $box.stop(false, true).remove();
1086
- $overlay.remove();
1087
- closing = false;
1088
- $box = null;
1089
- $('.' + boxElement)
1090
- .removeData(colorbox)
1091
- .removeClass(boxElement);
1092
-
1093
- $(document).unbind('click.'+prefix).unbind('keydown.'+prefix);
1094
- };
1095
-
1096
- // A method for fetching the current element Colorbox is referencing.
1097
- // returns a jQuery object.
1098
- publicMethod.element = function () {
1099
- return $(settings.el);
1100
- };
1101
-
1102
- publicMethod.settings = defaults;
1103
-
1104
- }(jQuery, document, window));
1
+ /*!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/jquery.cookie.js CHANGED
@@ -1,117 +1,117 @@
1
- /*!
2
- * jQuery Cookie Plugin v1.4.0
3
- * https://github.com/carhartl/jquery-cookie
4
- *
5
- * Copyright 2013 Klaus Hartl
6
- * Released under the MIT license
7
- */
8
- (function (factory) {
9
- if (typeof define === 'function' && define.amd) {
10
- // AMD. Register as anonymous module.
11
- define(['jquery'], factory);
12
- } else {
13
- // Browser globals.
14
- factory(jQuery);
15
- }
16
- }(function ($) {
17
-
18
- var pluses = /\+/g;
19
-
20
- function encode(s) {
21
- return config.raw ? s : encodeURIComponent(s);
22
- }
23
-
24
- function decode(s) {
25
- return config.raw ? s : decodeURIComponent(s);
26
- }
27
-
28
- function stringifyCookieValue(value) {
29
- return encode(config.json ? JSON.stringify(value) : String(value));
30
- }
31
-
32
- function parseCookieValue(s) {
33
- if (s.indexOf('"') === 0) {
34
- // This is a quoted cookie as according to RFC2068, unescape...
35
- s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
36
- }
37
-
38
- try {
39
- // Replace server-side written pluses with spaces.
40
- // If we can't decode the cookie, ignore it, it's unusable.
41
- s = decodeURIComponent(s.replace(pluses, ' '));
42
- } catch(e) {
43
- return;
44
- }
45
-
46
- try {
47
- // If we can't parse the cookie, ignore it, it's unusable.
48
- return config.json ? JSON.parse(s) : s;
49
- } catch(e) {}
50
- }
51
-
52
- function read(s, converter) {
53
- var value = config.raw ? s : parseCookieValue(s);
54
- return $.isFunction(converter) ? converter(value) : value;
55
- }
56
-
57
- var config = $.cookie = function (key, value, options) {
58
-
59
- // Write
60
- if (value !== undefined && !$.isFunction(value)) {
61
- options = $.extend({}, config.defaults, options);
62
-
63
- if (typeof options.expires === 'number') {
64
- var days = options.expires, t = options.expires = new Date();
65
- t.setDate(t.getDate() + days);
66
- }
67
-
68
- return (document.cookie = [
69
- encode(key), '=', stringifyCookieValue(value),
70
- options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
71
- options.path ? '; path=' + options.path : '',
72
- options.domain ? '; domain=' + options.domain : '',
73
- options.secure ? '; secure' : ''
74
- ].join(''));
75
- }
76
-
77
- // Read
78
-
79
- var result = key ? undefined : {};
80
-
81
- // To prevent the for loop in the first place assign an empty array
82
- // in case there are no cookies at all. Also prevents odd result when
83
- // calling $.cookie().
84
- var cookies = document.cookie ? document.cookie.split('; ') : [];
85
-
86
- for (var i = 0, l = cookies.length; i < l; i++) {
87
- var parts = cookies[i].split('=');
88
- var name = decode(parts.shift());
89
- var cookie = parts.join('=');
90
-
91
- if (key && key === name) {
92
- // If second argument (value) is a function it's a converter...
93
- result = read(cookie, value);
94
- break;
95
- }
96
-
97
- // Prevent storing a cookie that we couldn't decode.
98
- if (!key && (cookie = read(cookie)) !== undefined) {
99
- result[name] = cookie;
100
- }
101
- }
102
-
103
- return result;
104
- };
105
-
106
- config.defaults = {};
107
-
108
- $.removeCookie = function (key, options) {
109
- if ($.cookie(key) !== undefined) {
110
- // Must not alter options, thus extending a fresh object...
111
- $.cookie(key, '', $.extend({}, options, { expires: -1 }));
112
- return true;
113
- }
114
- return false;
115
- };
116
-
117
- }));
1
+ /*!
2
+ * jQuery Cookie Plugin v1.4.0
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD. Register as anonymous module.
11
+ define(['jquery'], factory);
12
+ } else {
13
+ // Browser globals.
14
+ factory(jQuery);
15
+ }
16
+ }(function ($) {
17
+
18
+ var pluses = /\+/g;
19
+
20
+ function encode(s) {
21
+ return config.raw ? s : encodeURIComponent(s);
22
+ }
23
+
24
+ function decode(s) {
25
+ return config.raw ? s : decodeURIComponent(s);
26
+ }
27
+
28
+ function stringifyCookieValue(value) {
29
+ return encode(config.json ? JSON.stringify(value) : String(value));
30
+ }
31
+
32
+ function parseCookieValue(s) {
33
+ if (s.indexOf('"') === 0) {
34
+ // This is a quoted cookie as according to RFC2068, unescape...
35
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
36
+ }
37
+
38
+ try {
39
+ // Replace server-side written pluses with spaces.
40
+ // If we can't decode the cookie, ignore it, it's unusable.
41
+ s = decodeURIComponent(s.replace(pluses, ' '));
42
+ } catch(e) {
43
+ return;
44
+ }
45
+
46
+ try {
47
+ // If we can't parse the cookie, ignore it, it's unusable.
48
+ return config.json ? JSON.parse(s) : s;
49
+ } catch(e) {}
50
+ }
51
+
52
+ function read(s, converter) {
53
+ var value = config.raw ? s : parseCookieValue(s);
54
+ return $.isFunction(converter) ? converter(value) : value;
55
+ }
56
+
57
+ var config = $.cookie = function (key, value, options) {
58
+
59
+ // Write
60
+ if (value !== undefined && !$.isFunction(value)) {
61
+ options = $.extend({}, config.defaults, options);
62
+
63
+ if (typeof options.expires === 'number') {
64
+ var days = options.expires, t = options.expires = new Date();
65
+ t.setDate(t.getDate() + days);
66
+ }
67
+
68
+ return (document.cookie = [
69
+ encode(key), '=', stringifyCookieValue(value),
70
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
71
+ options.path ? '; path=' + options.path : '',
72
+ options.domain ? '; domain=' + options.domain : '',
73
+ options.secure ? '; secure' : ''
74
+ ].join(''));
75
+ }
76
+
77
+ // Read
78
+
79
+ var result = key ? undefined : {};
80
+
81
+ // To prevent the for loop in the first place assign an empty array
82
+ // in case there are no cookies at all. Also prevents odd result when
83
+ // calling $.cookie().
84
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
85
+
86
+ for (var i = 0, l = cookies.length; i < l; i++) {
87
+ var parts = cookies[i].split('=');
88
+ var name = decode(parts.shift());
89
+ var cookie = parts.join('=');
90
+
91
+ if (key && key === name) {
92
+ // If second argument (value) is a function it's a converter...
93
+ result = read(cookie, value);
94
+ break;
95
+ }
96
+
97
+ // Prevent storing a cookie that we couldn't decode.
98
+ if (!key && (cookie = read(cookie)) !== undefined) {
99
+ result[name] = cookie;
100
+ }
101
+ }
102
+
103
+ return result;
104
+ };
105
+
106
+ config.defaults = {};
107
+
108
+ $.removeCookie = function (key, options) {
109
+ if ($.cookie(key) !== undefined) {
110
+ // Must not alter options, thus extending a fresh object...
111
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
112
+ return true;
113
+ }
114
+ return false;
115
+ };
116
+
117
+ }));
javascript/sg_colorpicker.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ jQuery(document).ready(function($){
2
+ jQuery('.sgOverlayColor').wpColorPicker();
3
+ });
javascript/sg_popup_backend.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function($){
2
  var custom_uploader;
3
  $('#upload_image_button').click(function(e)
4
  e.preventDefault();
5
  //If the uploader object has already been created, reopen the dialog
6
  if (custom_uploader)
7
  custom_uploader.open();
8
  return;
9
  }
10
  //Extend the wp.media object
11
  custom_uploader = wp.media.frames.file_frame = wp.media({
12
  titleFF: 'Choose Image',
13
  button: {
14
  text: 'Choose Image'
15
  },
16
  multiple: false
17
  });
18
  //When a file is selected, grab the URL and set it as the text field's value
19
  custom_uploader.on('select', function() {
20
  attachment = custom_uploader.state().get('selection').first().toJSON();
21
  $('#upload_image').val(attachment.url);
22
  });
23
  //Open the uploader dialog
24
  custom_uploader.open();
25
  });
26
  }
27
  var currentAttrValue = jQuery(this).attr('href');
28
  // Show/Hide Tabs
29
  jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
30
  // Change/remove current tab to active
31
  jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
32
  e.preventDefault();
33
  });
 
34
  var custom_uploader;
35
  $('#upload_image_button').click(function(e)
36
  e.preventDefault();
37
  //If the uploader object has already been created, reopen the dialog
38
  if (custom_uploader)
39
  custom_uploader.open();
40
  return;
41
  }
42
  //Extend the wp.media object
43
  custom_uploader = wp.media.frames.file_frame = wp.media({
44
  titleFF: 'Choose Image',
45
  button: {
46
  text: 'Choose Image'
47
  },
48
  multiple: false
49
  });
50
  //When a file is selected, grab the URL and set it as the text field's value
51
  custom_uploader.on('select', function() {
52
  attachment = custom_uploader.state().get('selection').first().toJSON();
53
  $('#upload_image').val(attachment.url);
54
  });
55
  //Open the uploader dialog
56
  custom_uploader.open();
57
  });
58
  var currentAttrValue = jQuery(this).attr('href');
59
  // Show/Hide Tabs
60
  jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
61
  // Change/remove current tab to active
62
  jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
63
  e.preventDefault();
64
  });
 
1
  var custom_uploader;
2
  $('#upload_image_button').click(function(e)
3
  e.preventDefault();
4
  //If the uploader object has already been created, reopen the dialog
5
  if (custom_uploader)
6
  custom_uploader.open();
7
  return;
8
  }
9
  //Extend the wp.media object
10
  custom_uploader = wp.media.frames.file_frame = wp.media({
11
  titleFF: 'Choose Image',
12
  button: {
13
  text: 'Choose Image'
14
  },
15
  multiple: false
16
  });
17
  //When a file is selected, grab the URL and set it as the text field's value
18
  custom_uploader.on('select', function() {
19
  attachment = custom_uploader.state().get('selection').first().toJSON();
20
  $('#upload_image').val(attachment.url);
21
  });
22
  //Open the uploader dialog
23
  custom_uploader.open();
24
  });
25
  }
26
  var currentAttrValue = jQuery(this).attr('href');
27
  // Show/Hide Tabs
28
  jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
29
  // Change/remove current tab to active
30
  jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
31
  e.preventDefault();
32
  });
33
+ jQuery(document).ready(function($){
34
  var custom_uploader;
35
  $('#upload_image_button').click(function(e)
36
  e.preventDefault();
37
  //If the uploader object has already been created, reopen the dialog
38
  if (custom_uploader)
39
  custom_uploader.open();
40
  return;
41
  }
42
  //Extend the wp.media object
43
  custom_uploader = wp.media.frames.file_frame = wp.media({
44
  titleFF: 'Choose Image',
45
  button: {
46
  text: 'Choose Image'
47
  },
48
  multiple: false
49
  });
50
  //When a file is selected, grab the URL and set it as the text field's value
51
  custom_uploader.on('select', function() {
52
  attachment = custom_uploader.state().get('selection').first().toJSON();
53
  $('#upload_image').val(attachment.url);
54
  });
55
  //Open the uploader dialog
56
  custom_uploader.open();
57
  });
58
  var currentAttrValue = jQuery(this).attr('href');
59
  // Show/Hide Tabs
60
  jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
61
  // Change/remove current tab to active
62
  jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
63
  e.preventDefault();
64
  });
javascript/sg_popup_frontend.js CHANGED
@@ -1 +1,228 @@
1
- var sg_prmomotional_title = SG_POPUP_VARS['title'];
2
  if(sg_prmomotional_popupFixed == true)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  if(sg_prmomotional_popupFixed == true)
2
+ jQuery( document ).ready(function( $ ) {
3
+ jQuery('[id=sg_colorbox_theme2-css]').remove();
4
+ jQuery('[id=sg_colorbox_theme3-css]').remove();
5
+ jQuery('[id=sg_colorbox_theme4-css]').remove();
6
+ jQuery('[id=sg_colorbox_theme5-css]').remove();
7
+ });
8
+ jQuery(".sg-show-popup").bind('click',function() {
9
+ var sgPopupID = jQuery(this).attr("sgpopupid");
10
+ showPopup(sgPopupID,false);
11
+ });
12
+
13
+ function optionConvertBool(optionName) {
14
+ returnValue = (optionName) ? true : false;
15
+ return returnValue;
16
+ }
17
+
18
+ function canOpenPopup(id, openOnce, onLoad) {
19
+ if (!onLoad) return true;
20
+
21
+ if(typeof(sgPopup) !== 'undefined') {
22
+
23
+ return sgPopup.canOpenOnce(id);
24
+ }
25
+
26
+
27
+ return true;
28
+ }
29
+
30
+ function showPopup(id, onLoad) {
31
+ var data = SG_POPUP_DATA[id];
32
+
33
+ var openOnce = optionConvertBool(data['repeatPopup']);;
34
+
35
+ if (!canOpenPopup(data['id'], openOnce, onLoad)) return;
36
+
37
+ popupColorboxUrl = SG_APP_POPUP_URL+'/style/sgcolorbox/'+data['theme'];
38
+ jQuery('[id=sg_colorbox_theme-css]').remove();
39
+ head = document.getElementsByTagName('head')[0];
40
+ link = document.createElement('link')
41
+ link.type = "text/css";
42
+ link.id = "sg_colorbox_theme-css";
43
+ link.rel = "stylesheet"
44
+ link.href = popupColorboxUrl;
45
+ document.getElementsByTagName('head')[0].appendChild(link);
46
+ var img = document.createElement('img');
47
+ img.onerror = function(){
48
+ showColorboxWithOptions();
49
+ }
50
+ img.src = popupColorboxUrl;
51
+ function showColorboxWithOptions() {
52
+
53
+ setTimeout(function() {
54
+
55
+ sg_popup_popupFixed = optionConvertBool(data['popupFixed']);
56
+ sg_popup_overlayClose = optionConvertBool(data['overlayClose']);
57
+ sg_popup_contentClick = optionConvertBool(data['contentClick']);
58
+ sg_popup_reposition = optionConvertBool(data['reposition']);
59
+ sg_popup_scrolling = optionConvertBool(data['scrolling']);
60
+ sg_popup_escKey = optionConvertBool(data['escKey']);
61
+ sg_popup_closeButton = optionConvertBool(data['closeButton']);
62
+ sg_popup_forMobile = optionConvertBool(data['forMobile']);
63
+ sg_popup_cantClose = optionConvertBool(data['disablePopup']);
64
+ sg_popup_autoClosePopup = optionConvertBool(data['autoClosePopup']);
65
+ popupClosingTimer = data['popupClosingTimer'];
66
+
67
+ if(sg_popup_cantClose) {
68
+ sgPopup.cantPopupClose();
69
+ }
70
+ sg_popup_popupPosition = data['fixedPostion'];
71
+ sg_popup_html = (data['html'] == '') ? '&nbsp;' : data['html'];
72
+ sg_popup_image = data['image'];
73
+ sg_popup_iframe_url = data['iframe'];
74
+ sg_popup_shortCode = data['shortCode'];
75
+ sg_popup_video = data['video'];
76
+ sg_popup_overlayColor = data['sgOverlayColor'];
77
+ sg_popup_width = data['width'];
78
+ sg_popup_height = data['height'];
79
+
80
+ sg_popup_html = (sg_popup_html) ? sg_popup_html: false;
81
+ sg_popup_iframe = (sg_popup_iframe_url) ? true: false;
82
+ sg_popup_video = (sg_popup_video) ? sg_popup_video : false;
83
+ sg_popup_image = (sg_popup_image) ? sg_popup_image : false;
84
+ sg_popup_photo = (sg_popup_image) ? true : false;
85
+ sg_popup_shortCode = (sg_popup_shortCode) ? sg_popup_shortCode : false;
86
+ if(sg_popup_shortCode && sg_popup_html == false) {
87
+ sg_popup_html = sg_popup_shortCode;
88
+ }
89
+ if(sg_popup_iframe_url) {
90
+ sg_popup_image = sg_popup_iframe_url;
91
+ }
92
+ if(sg_popup_video) {
93
+ if(sg_popup_width == '') sg_popup_width = '50%';
94
+ if(sg_popup_height == '') sg_popup_height = '50%';
95
+ sg_popup_iframe = true;
96
+ sg_popup_image = sg_popup_video;
97
+ }
98
+
99
+ sg_popup_id = data['id'];
100
+
101
+ if(sg_popup_popupFixed == true) {
102
+ if(sg_popup_popupPosition == 1) {
103
+ popupPositionTop = "3%";
104
+ popupPositionBottom = false;
105
+ popupPositionLeft = "0%";
106
+ popupPositionRight = false;
107
+ sgfixedPositonTop = 0;
108
+ sgfixedPsotonleft = 0;
109
+ }
110
+
111
+ if(sg_popup_popupPosition == 3) {
112
+ popupPositionTop = "3%";
113
+ popupPositionBottom = false;
114
+ popupPositionLeft = false;
115
+ popupPositionRight = "0%";
116
+ sgfixedPositonTop = 0;
117
+ sgfixedPsotonleft = 90;
118
+ }
119
+ if(sg_popup_popupPosition == 5) {
120
+ sg_popup_popupFixed = true;
121
+ popupPositionTop = false;
122
+ popupPositionBottom = false;
123
+ popupPositionLeft = false;
124
+ popupPositionRight = false;
125
+ sgfixedPositonTop = 50;
126
+ sgfixedPsotonleft = 50;
127
+ }
128
+ if(sg_popup_popupPosition == 7) {
129
+ popupPositionTop = false;
130
+ popupPositionBottom = "0%";
131
+ popupPositionLeft = "0%";
132
+ popupPositionRight = false;
133
+ sgfixedPositonTop = 90;
134
+ sgfixedPsotonleft = 0;
135
+
136
+ }
137
+ if(sg_popup_popupPosition == 9) {
138
+ popupPositionTop = false;
139
+ popupPositionBottom = "0%";
140
+ popupPositionLeft = false;
141
+ popupPositionRight = "0%";
142
+ sgfixedPositonTop = 90;
143
+ sgfixedPsotonleft = 90;
144
+ }
145
+ }
146
+ else {
147
+ popupPositionTop = false;
148
+ popupPositionBottom = false;
149
+ popupPositionLeft = false;
150
+ popupPositionRight = false;
151
+ sgfixedPositonTop = 50;
152
+ sgfixedPsotonleft = 50;
153
+ }
154
+ if(sg_popup_forMobile) {
155
+ var userDivce = sgPopup.forMobile();
156
+ }
157
+ else {
158
+ userDivce = false;
159
+ }
160
+ if(sg_popup_autoClosePopup) {
161
+ sgPopup.cantPopupClose();
162
+ setTimeout(autoClosePopup, popupClosingTimer*1000);
163
+ function autoClosePopup() {
164
+ sg_prmomotional_overlayClose = true;
165
+ jQuery.sgcolorbox.close();
166
+
167
+ }
168
+ }
169
+ if(userDivce) return;
170
+
171
+ jQuery.sgcolorbox({
172
+ width: sg_popup_width,
173
+ height: sg_popup_height,
174
+ onOpen:function() {
175
+ jQuery('#sgcolorbox').removeAttr('style');
176
+ jQuery('#sgcolorbox').removeAttr('left');
177
+ jQuery('#sgcolorbox').css('top',''+sgfixedPositonTop+'%');
178
+ jQuery('#sgcolorbox').css('left',''+sgfixedPsotonleft+'%');
179
+ jQuery('#sgcolorbox').css('animation-duration', data['duration']+"s");
180
+ jQuery('#sgcolorbox').css('-webkit-animation-duration', data['duration']+"s");
181
+ jQuery("#sgcolorbox").removeAttr("class");
182
+ jQuery("#sgcolorbox").addClass('animated '+data['effect']+'');
183
+ jQuery("#sgcboxOverlay").addClass("sgcboxOverlayBg");
184
+ jQuery("#sgcboxOverlay").removeAttr('style');
185
+ if(sg_popup_overlayColor) {
186
+ jQuery("#sgcboxOverlay").css({'background' : 'none', 'background-color' : sg_popup_overlayColor});
187
+ }
188
+
189
+ },
190
+ onLoad: function(){
191
+
192
+ },
193
+ onComplete: function(){
194
+
195
+ },
196
+ html: sg_popup_html,
197
+ photo: sg_popup_photo,
198
+ iframe: sg_popup_iframe,
199
+ href: sg_popup_image,
200
+ opacity: data['opacity'],
201
+ escKey: sg_popup_escKey,
202
+ closeButton: sg_popup_closeButton,
203
+ fixed: sg_popup_popupFixed,
204
+ top: popupPositionTop,
205
+ bottom: popupPositionBottom,
206
+ left: popupPositionLeft,
207
+ right: popupPositionRight,
208
+ scrolling: sg_popup_scrolling,
209
+ reposition: sg_popup_reposition,
210
+ overlayClose: sg_popup_overlayClose,
211
+ maxWidth: data['maxWidth'],
212
+ maxHeight: data['maxHeight'],
213
+ initialWidth: data['initialWidth'],
214
+ initialHeight: data['initialHeight']
215
+ });
216
+
217
+ if(data['id'] && onLoad==true && openOnce != '') {
218
+ jQuery.cookie("sgPopupNumbers",data['id'], { expires: 7});
219
+ }
220
+
221
+ if(sg_popup_contentClick) {
222
+ jQuery('#sgcolorbox').bind('click',function() {
223
+ jQuery.sgcolorbox.close();
224
+ });
225
+ }
226
+
227
+ },data['delay']*1000);
228
+ }
229
+ }
javascript/sg_popup_javascript.php CHANGED
@@ -7,36 +7,42 @@ function sg_set_admin_url($hook) {
7
  }
8
 
9
  function sg_popup_admin_scripts($hook) {
10
- if ('popup-builder_page_create-popup' == $hook) {
 
 
11
  wp_enqueue_media();
12
-
13
  wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
14
- wp_register_script('sg_popup_rangeslider', SG_APP_POPUP_URL . '/javascript/sg_popup_rangeslider.js', array('jquery'));
15
- wp_enqueue_script('sg_popup_rangeslider');
16
  wp_enqueue_script('jquery');
17
  wp_enqueue_script('javascript');
 
18
  }
19
  else if('toplevel_page_PopupBuilder' == $hook){
20
  wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
21
  wp_enqueue_script('javascript');
22
  wp_enqueue_script('jquery');
23
  }
 
 
 
 
 
 
 
24
  }
25
  add_action('admin_enqueue_scripts', 'sg_set_admin_url');
26
  add_action('admin_enqueue_scripts', 'sg_popup_admin_scripts');
27
 
28
  function sg_popup_scripts($hook) {
29
- if ($hook != 'post.php' && $hook != 'post-new.php') {
30
  return;
31
  }
 
32
  wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
33
  wp_register_script('colorbox', SG_APP_POPUP_URL . '/javascript/jquery.colorbox-min.js', array('jquery'));
34
-
35
- if (SG_POPUP_PRO) {
36
- wp_register_script('sgpropopup', SG_APP_POPUP_URL . '/javascript/sg_popup_pro.js');
37
- wp_enqueue_script('sgpropopup');
38
  }
39
-
40
  wp_enqueue_script('jquery');
41
  wp_enqueue_script('colorbox');
42
  wp_enqueue_script('javascript');
7
  }
8
 
9
  function sg_popup_admin_scripts($hook) {
10
+
11
+ if ( 'popup-builder_page_edit-popup' == $hook || 'popup-builder_page_create-popup' == $hook ) {
12
+
13
  wp_enqueue_media();
 
14
  wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
 
 
15
  wp_enqueue_script('jquery');
16
  wp_enqueue_script('javascript');
17
+
18
  }
19
  else if('toplevel_page_PopupBuilder' == $hook){
20
  wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
21
  wp_enqueue_script('javascript');
22
  wp_enqueue_script('jquery');
23
  }
24
+ if('popup-builder_page_edit-popup' == $hook) {
25
+ wp_register_script('sg_popup_rangeslider', SG_APP_POPUP_URL . '/javascript/sg_popup_rangeslider.js', array('jquery'));
26
+ wp_register_script('sg_popup_tagsinput', SG_APP_POPUP_URL . '/javascript/bootstrap-tagsinput.js', array('jquery'));
27
+ wp_enqueue_script('sg_popup_rangeslider');
28
+ wp_enqueue_script('sg_popup_tagsinput');
29
+ wp_enqueue_script('jquery');
30
+ }
31
  }
32
  add_action('admin_enqueue_scripts', 'sg_set_admin_url');
33
  add_action('admin_enqueue_scripts', 'sg_popup_admin_scripts');
34
 
35
  function sg_popup_scripts($hook) {
36
+ if ($hook != 'post.php') {
37
  return;
38
  }
39
+ wp_enqueue_media();
40
  wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
41
  wp_register_script('colorbox', SG_APP_POPUP_URL . '/javascript/jquery.colorbox-min.js', array('jquery'));
42
+ if(SG_POPUP_PRO) {
43
+ wp_register_script('proo', SG_APP_POPUP_URL . '/javascript/sg_popup_pro.js');
44
+ wp_enqueue_script('proo');
 
45
  }
 
46
  wp_enqueue_script('jquery');
47
  wp_enqueue_script('colorbox');
48
  wp_enqueue_script('javascript');
javascript/sg_popup_pro.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function sgPopup() {
2
+
3
+ }
4
+ sgPopup.canOpenOnce = function(id) {
5
+ if (jQuery.cookie('sgPopupNumbers') != 'undefined' && jQuery.cookie('sgPopupNumbers') == id) {
6
+ return false;
7
+ }
8
+ else {
9
+ return true
10
+ }
11
+ }
12
+ sgPopup.cantPopupClose = function() {
13
+ sg_popup_escKey = false;
14
+ sg_popup_closeButton = false;
15
+ sg_popup_overlayClose = false;
16
+ sg_popup_contentClick = false;
17
+ }
18
+ sgPopup.forMobile = function() {
19
+ return jQuery.browser.device = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
20
+ }
21
+ sgPopup.onScrolling = function(popupId) {
22
+ var scrollStatus = false;
23
+ jQuery(window).on('scroll', function(){
24
+ var scrollTop = jQuery(window).scrollTop();
25
+ var docHeight = jQuery(document).height();
26
+ var winHeight = jQuery(window).height();
27
+ var scrollPercent = (scrollTop) / (docHeight - winHeight);
28
+ var scrollPercentRounded = Math.round(scrollPercent*100);
29
+ if(beforeScrolingPrsent < scrollPercentRounded) {
30
+ if(scrollStatus == false) {
31
+ showPopup(popupId,true);
32
+ scrollStatus = true;
33
+ }
34
+ }
35
+ });
36
+ }
37
+ sgPopup.autoClosePopup = function(popupId,sg_promotional_popupClosingTimer) {
38
+ showPopup(popupId,true);
39
+
40
+ }
41
+
42
+ /*sgPopup.cantPopupClose();
43
+ setTimeout(autoClosePopup, sg_promotional_popupClosingTimer*1000);
44
+ function autoClosePopup() {
45
+ sg_prmomotional_overlayClose = true;
46
+ colorboxExecute();
47
+ }*/
popup-builder.php CHANGED
@@ -1,305 +1,169 @@
1
- <?php
2
- /**
3
- * Plugin Name: Popup Builder
4
- * Plugin URI: http://sygnoos.com
5
- * Description: Create powerful popups for promotion. Manage popup dimensions, effects, themes and more.
6
- * Version: 1.1.4
7
- * Author: Sygnoos
8
- * Author URI: http://www.sygnoos.com
9
- * License: GPLv2
10
- */
11
-
12
- //create some difine Pats
13
- define("SG_APP_POPUP_PATH", dirname(__FILE__));
14
- define('SG_APP_POPUP_URL', plugins_url('', __FILE__));
15
- define('SG_APP_POPUP_ADMIN_URL', admin_url());
16
- define('SG_APP_POPUP_FILE', plugin_basename(__FILE__));
17
- define('SG_APP_POPUP_FILES', SG_APP_POPUP_PATH . '/files');
18
- define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
19
- define('SG_APP_POPUP_TABLE_LIMIT', 10 );
20
- define('SG_POPUP_PRO', 0);
21
- define('SG_POPUP_PRO_URL', 'http://sygnoos.com/wordpress-popup/');
22
-
23
- require_once( SG_APP_POPUP_PATH .'/style/sg_popup_style.php' ); //include our css file
24
- require_once( SG_APP_POPUP_JS .'/sg_popup_javascript.php' ); //include our js file
25
- require_once( SG_APP_POPUP_FILES .'/sg_popup_page_selection.php' ); // include here in page button for select popup every page
26
-
27
-
28
- register_activation_hook(__FILE__, 'sg_popup_activate');
29
- register_uninstall_hook(__FILE__, 'sg_popup_POD_deactivate');
30
- add_action( 'wpmu_new_blog', 'wporg_wpmu_new_blog', 10, 6 );
31
-
32
- function wporg_wpmu_new_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
33
- global $wpdb;
34
- $bolgs_id = $blog_id;
35
- createTables($bolgs_id);
36
- }
37
-
38
- function sg_popup_activate($network_wide) {
39
- global $wpdb;
40
- creteTable();
41
- if(is_multisite() ) {
42
-
43
- $stites = wp_get_sites();
44
- foreach($stites as $site) {
45
- $bolgs_id = $site['blog_id'];
46
- global $wpdb;
47
- createTables($bolgs_id);
48
- }
49
- }
50
- }
51
- function creteTable() {
52
- global $wpdb;
53
-
54
- $sg_popup_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix ."sg_promotional_popup (
55
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
56
- `content` varchar(255) NOT NULL,
57
- `html` text NOT NULL,
58
- `image` varchar(255) NOT NULL,
59
- `iframe` varchar(255) NOT NULL,
60
- `shortCode` varchar(255) NOT NULL,
61
- `options` text NOT NULL,
62
- PRIMARY KEY (`id`)
63
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
64
- $wpdb->query($sg_popup_base);
65
- }
66
- function createTables($bolgs_id) {
67
- global $wpdb;
68
- $sg_popup_net_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$bolgs_id."_sg_promotional_popup (
69
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
70
- `content` varchar(255) NOT NULL,
71
- `html` text NOT NULL,
72
- `image` varchar(255) NOT NULL,
73
- `iframe` varchar(255) NOT NULL,
74
- `shortCode` varchar(255) NOT NULL,
75
- `options` text NOT NULL,
76
- PRIMARY KEY (`id`)
77
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
78
- $wpdb->query($sg_popup_net_base);
79
- }
80
-
81
- function sg_popup_POD_deactivate(){
82
- global $wpdb; //required global declaration of WP variable
83
- $delete = "DELETE FROM ".$wpdb->prefix."postmeta WHERE meta_key = 'sg_promotional_popup' ";
84
- $wpdb->query($delete);
85
- $table_name = $wpdb->prefix."sg_promotional_popup";
86
- $sql = "DROP TABLE ". $table_name;
87
- $wpdb->query($sql);
88
- if(is_multisite() ) {
89
-
90
- $stites = wp_get_sites();
91
- foreach($stites as $site) {
92
- $bolgs_id = $site['blog_id'];
93
- $table_name = $wpdb->prefix.$bolgs_id."_sg_promotional_popup";
94
- $sql = "DROP TABLE ". $table_name;
95
- $wpdb->query($sql);
96
- $delete = "DELETE FROM ".$wpdb->prefix.$bolgs_id."_postmeta WHERE meta_key = 'sg_promotional_popup' ";
97
- $wpdb->query($delete);
98
- }
99
- }
100
-
101
- }
102
-
103
-
104
- //create action huk for create menu and subMenu in the admin menu
105
-
106
- add_action("admin_menu","addMenu");
107
- function addMenu()
108
- {
109
- add_menu_page("Popup Builder", "Popup Builder", "manage_options","PopupBuilder","sgPopupMenu","dashicons-welcome-widgets-menus");
110
- add_submenu_page("PopupBuilder", "Popups", "Popups", 'manage_options', "PopupBuilder", "sgPopupMenu");
111
- add_submenu_page("PopupBuilder", "Edit popup", "Create new", 'manage_options', "create-popup", "createPopup");
112
- }
113
-
114
- function sgPopupMenu()
115
- {
116
- require_once( SG_APP_POPUP_FILES . '/sg_popup_main.php');
117
- }
118
-
119
- function createPopup()
120
- {
121
- require_once( SG_APP_POPUP_FILES . '/sg_popup_create.php'); // here is inculde file in the first sub menu
122
- }
123
-
124
- function getPopupDetails($page , $popup) {
125
- global $wpdb;
126
- global $post;
127
-
128
- $sql = $wpdb->prepare("SELECT meta_value FROM ". $wpdb->prefix ."postmeta WHERE post_id = %d AND meta_key =%s",$page,$popup);
129
- $row = $wpdb->get_row($sql);
130
- $type = (int)$row->meta_value;
131
- $result = $wpdb->get_row('SELECT * FROM '. $wpdb->prefix .'sg_promotional_popup WHERE id='.$type.'');
132
- return $result;
133
- }
134
-
135
- function sg_popup_dataAdmin() {
136
- global $wpdb;
137
- global $post;
138
- $page = get_queried_object_id();
139
- $popup = "sg_promotional_popup";
140
-
141
- $result = getPopupDetails($page,$popup);
142
-
143
- $jsonData = json_decode($result->options);
144
- $type = esc_html($result->content);
145
- $id = esc_html($result->id);
146
- $repeatPopup = esc_html($jsonData->repeatPopup);
147
-
148
- if(!canViewPopup($id, $repeatPopup)) return;
149
-
150
- if(SG_POPUP_PRO ){
151
- include_once( SG_APP_POPUP_FILES . '/sg_popup_params_pro.php');
152
- $shortCode=PopupPro::shortcode($result->shortCode);
153
- }
154
- else{
155
- $shortCode = 1;
156
- }
157
-
158
- $html = json_encode(wp_kses_post(array("html" => $result->html)));
159
-
160
- $iframe = wp_kses_post($result->iframe);
161
- $image = esc_html($result->image);
162
- $title = esc_html($jsonData->title);
163
- $effect = esc_html($jsonData->effect);
164
- $theme = esc_html($jsonData->theme);
165
- $duration = esc_html($jsonData->duration);
166
- $delay = esc_html($jsonData->delay);
167
- $width = esc_html($jsonData->width);
168
- $height = esc_html($jsonData->height);
169
- $escKey = esc_html($jsonData->escKey);
170
- $closeButton = esc_html($jsonData->closeButton);
171
- $popupFixed = esc_html($jsonData->popupFixed);
172
- $fixedPostion = esc_html($jsonData->fixedPostion);
173
- $onScrolling = esc_html($jsonData->onScrolling); // its on scrooling event
174
- $scrolling = esc_html($jsonData->scrolling); // its abot popup scrolling
175
- $reposition = esc_html($jsonData->reposition);
176
- $overlayClose = esc_html($jsonData->overlayClose);
177
- $opacity = esc_html($jsonData->opacity);
178
- $maxWidth = esc_html($jsonData->maxWidth);
179
- $maxHeight = esc_html($jsonData->maxHeight);
180
- $initialWidth = esc_html($jsonData->initialWidth);
181
- $initialHeight = esc_html($jsonData->initialHeight);
182
-
183
- echo "<script type=\"text/javascript\">
184
-
185
- var SG_POPUP_VARS = {
186
- title:'$title',
187
- id:'$id',
188
- html: ".$html.",
189
- shortCode: '$shortCode',
190
- iframe: '$iframe',
191
- image:'$image',
192
- type:'$type',
193
- effect:'$effect',
194
- width:'$width',
195
- height:'$height',
196
- delay:'$delay',
197
- duration:'$duration',
198
- escKey:'$escKey',
199
- closeButton: '$closeButton',
200
- popupPostion: '$fixedPostion',
201
- popupFixed:'$popupFixed',
202
- scrolling: '$scrolling',
203
- onScrolling:'$onScrolling',
204
- repeatPopup:'$repeatPopup',
205
- reposition:'$reposition',
206
- overlayClose:'$overlayClose',
207
- opacity:'$opacity',
208
- maxWidth:'$maxWidth',
209
- maxHeight: '$maxHeight',
210
- initialWidth:'$initialWidth',
211
- initialHeight:'$initialHeight',
212
- siteUrl: '".plugins_url('', __FILE__)."',
213
- };
214
- </script>";
215
- echo '<style type="text/css">
216
- *{
217
- -webkit-animation-duration:'.$duration.'s !important;
218
- animation-duration:'.$duration.'s !important;
219
- }
220
- </style>';
221
-
222
- }
223
-
224
- if (SG_POPUP_PRO) {
225
- @include_once( SG_APP_POPUP_FILES . '/sg_popup_pro.php');
226
- }
227
- else {
228
- function canViewPopup($id, $repeatPopup)
229
- {
230
- return true;
231
- }
232
- }
233
-
234
- function sg_popup_enqueueScript()
235
- {
236
- global $wpdb;
237
- global $post;
238
- $page = get_queried_object_id();
239
- $popup = "sg_promotional_popup";
240
-
241
- $result = getPopupDetails($page,$popup); /// query functions result
242
-
243
- $jsonData = json_decode($result->options);
244
- $id = esc_html($result->id);
245
- $repeatPopup = esc_html($jsonData->repeatPopup);
246
- $theme = esc_html($jsonData->theme);
247
- $row = $wpdb->get_row($sql);
248
- if($id){
249
-
250
- if(canViewPopup($id,$repeatPopup)) {
251
- wp_register_script('js', SG_APP_POPUP_URL . '/javascript/jquery.colorbox-min.js', array('jquery'));
252
- wp_enqueue_script('jquery');
253
- wp_register_style('styl', SG_APP_POPUP_URL . "/style/sgcolorbox/$theme");
254
- wp_enqueue_style('styl');
255
- wp_enqueue_script('js');
256
-
257
- add_action( 'wp_head', 'sg_popup_dataAdmin');
258
-
259
- function frontendFunction() {
260
- wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_frontend.js', array('jquery'));
261
- wp_enqueue_script('jquery');
262
- wp_enqueue_script('javascript');
263
- wp_register_script('cookie', SG_APP_POPUP_URL . '/javascript/jquery.cookie.js', array('jquery'));
264
- wp_enqueue_script('cookie');
265
- }
266
- add_action( 'wp_head', 'frontendFunction' );
267
- if (SG_POPUP_PRO) {
268
- function frontendPro(){
269
- wp_register_script('pro', SG_APP_POPUP_URL . '/javascript/sg_popup_pro.js', array('jquery'));
270
- wp_enqueue_script('pro');
271
- wp_enqueue_script('jquery');
272
- }
273
-
274
- add_action( 'wp_head', 'frontendPro' );
275
- }
276
- wp_register_style('cssStyl', SG_APP_POPUP_URL . "/style/animate.css");
277
- wp_enqueue_style('cssStyl');
278
- }
279
- }
280
- }
281
-
282
- add_action('wp','sg_popup_enqueueScript');
283
-
284
- add_action('wp_ajax_get_popup_preview', 'sg_popup_getresults');
285
- function sg_popup_getresults(){
286
- global $wpdb;
287
- $page = (int)$_POST['postId'];
288
- $result = $wpdb->get_row('SELECT * FROM '. $wpdb->prefix .'sg_promotional_popup WHERE id='.$page, ARRAY_A ); //query for get all information about popup
289
- foreach($result as $key=>$results)
290
- {
291
- if($key == 'html')
292
- {
293
- $result[$key] = wp_kses_post($results);
294
- }
295
- else
296
- {
297
- $result[$key] = sanitize_text_field($results);
298
- }
299
- }
300
- $result['sg_promotional_site_url'] = plugins_url('', __FILE__);
301
- echo json_encode($result);
302
- exit();
303
- }
304
-
305
- require_once( SG_APP_POPUP_FILES . '/sg_popup_ajax.php');
1
+ <?php
2
+ /**
3
+ * Plugin Name: Popup Builder
4
+ * Plugin URI: http://sygnoos.com
5
+ * Description: Create and manage powerful promotion popups for your WordPress blog or website. It's completely free and all features are available.
6
+ * Version: 2.0.1
7
+ * Author: Sygnoos
8
+ * Author URI: http://www.sygnoos.com
9
+ * License: GPLv2
10
+ */
11
+
12
+ //create some difine Pats
13
+ define("SG_APP_POPUP_PATH", dirname(__FILE__));
14
+ define('SG_APP_POPUP_URL', plugins_url('', __FILE__));
15
+ define('SG_APP_POPUP_ADMIN_URL', admin_url());
16
+ define('SG_APP_POPUP_FILE', plugin_basename(__FILE__));
17
+ define('SG_APP_POPUP_FILES', SG_APP_POPUP_PATH . '/files');
18
+ define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
19
+ define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
20
+ define('SG_APP_POPUP_TABLE_LIMIT', 20 );
21
+ define('SG_POPUP_VERSION', 2.0);
22
+ define('SG_POPUP_PRO', 0);
23
+ define('SG_POPUP_PRO_URL', 'http://sygnoos.com/wordpress-popup/');
24
+
25
+ $POPUP_TITLES = array(
26
+ 'image' => 'Image',
27
+ 'html' => 'HTML',
28
+ 'iframe' => 'Iframe',
29
+ 'video' => 'Video',
30
+ 'shortcode' => 'Shortcode',
31
+ 'ageRestriction' => 'Age Restriction'
32
+ );
33
+
34
+ require_once( SG_APP_POPUP_CLASSES .'/SGPopup.php');
35
+ require_once( SG_APP_POPUP_CLASSES .'/PopupInstaller.php'); //cretae tables
36
+ if(SG_POPUP_PRO) require_once( SG_APP_POPUP_CLASSES .'/PopupProInstaller.php'); //uninstall tables
37
+ require_once( SG_APP_POPUP_PATH .'/style/sg_popup_style.php' ); //include our css file
38
+ require_once( SG_APP_POPUP_JS .'/sg_popup_javascript.php' ); //include our js file
39
+ require_once( SG_APP_POPUP_FILES .'/sg_popup_page_selection.php' ); // include here in page button for select popup every page
40
+
41
+ register_activation_hook(__FILE__, 'sg_popup_activate');
42
+ register_uninstall_hook(__FILE__, 'sg_popup_deactivate');
43
+ //register_deactivation_hook(__FILE__, 'sg_popup_deactivate');
44
+
45
+
46
+ add_action('wpmu_new_blog', 'wporg_wpmu_new_blogPopup', 10, 6 );
47
+
48
+ function wporg_wpmu_new_blogPopup() {
49
+ PopupInstaller::install();
50
+ if(SG_POPUP_PRO) PopupProInstaller::install();
51
+ }
52
+ function sg_popup_activate() {
53
+ update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
54
+ PopupInstaller::install();
55
+ if(SG_POPUP_PRO) PopupProInstaller::install();
56
+ }
57
+
58
+ function sg_popup_deactivate() {
59
+ delete_option('SG_POPUP_VERSION');
60
+ PopupInstaller::uninstall();
61
+ if(SG_POPUP_PRO) PopupProInstaller::uninstall();
62
+ }
63
+
64
+
65
+ add_action("admin_menu","sgAddMenu");
66
+ function sgAddMenu() {
67
+ add_menu_page("Popup Builder", "Popup Builder", "manage_options","PopupBuilder","sgPopupMenu","dashicons-welcome-widgets-menus");
68
+ add_submenu_page("PopupBuilder", "All Popups", "All Popups", 'manage_options', "PopupBuilder", "sgPopupMenu");
69
+ add_submenu_page("PopupBuilder", "Add New", "Add New", 'manage_options', "create-popup", "sgCreatePopup");
70
+ add_submenu_page("PopupBuilder", "Edit Popup", "Edit Popup", 'manage_options', "edit-popup", "sgEditPopup");
71
+ }
72
+
73
+ function sgPopupMenu() {
74
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_main.php');
75
+ }
76
+
77
+ function sgCreatePopup() {
78
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_create.php'); // here is inculde file in the first sub menu
79
+ }
80
+
81
+ function sgEditPopup() {
82
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_create_new.php');
83
+ }
84
+
85
+ function sgRegisterScripts() {
86
+ SGPopup::$registeredScripts = true;
87
+ wp_register_style('sg_animate', SG_APP_POPUP_URL . '/style/animate.css');
88
+ wp_enqueue_style('sg_animate');
89
+ wp_register_script('sg_popup_frontend', SG_APP_POPUP_URL . '/javascript/sg_popup_frontend.js', array('jquery'));
90
+ wp_enqueue_script('sg_popup_frontend');
91
+ wp_enqueue_script('jquery');
92
+ wp_register_script('sg_cookie', SG_APP_POPUP_URL . '/javascript/jquery.cookie.js', array('jquery'));
93
+ wp_enqueue_script('sg_cookie');
94
+ wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.colorbox-min.js', array('jquery'), '5.0');
95
+ wp_enqueue_script('sg_colorbox');
96
+ if(SG_POPUP_PRO) {
97
+ echo "<script type='text/javascript' src = ".SG_APP_POPUP_URL."/javascript/sg_popup_pro.js?ver=4.2.3'></script>";
98
+ }
99
+ echo "<script type='text/javascript'>SG_POPUP_DATA = [];SG_APP_POPUP_URL = '".SG_APP_POPUP_URL."';</script>";
100
+ }
101
+
102
+ function sgRenderPopupScript($id) {
103
+ if (SGPopup::$registeredScripts==false) sgRegisterScripts();
104
+ wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox1.css");
105
+ wp_register_style('sg_colorbox_theme2', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox2.css");
106
+ wp_register_style('sg_colorbox_theme3', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox3.css");
107
+ wp_register_style('sg_colorbox_theme4', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox4.css");
108
+ wp_register_style('sg_colorbox_theme5', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox5.css", array(), '5.0');
109
+ wp_enqueue_style('sg_colorbox_theme');
110
+ wp_enqueue_style('sg_colorbox_theme2');
111
+ wp_enqueue_style('sg_colorbox_theme3');
112
+ wp_enqueue_style('sg_colorbox_theme4');
113
+ wp_enqueue_style('sg_colorbox_theme5');
114
+ sgFindPopupData($id);
115
+ }
116
+
117
+ function sgFindPopupData($id) {
118
+ $obj = SGPopup::findById($id);
119
+ if(!empty($obj)) $content = $obj->render();
120
+ echo "<script type='text/javascript'>";
121
+ echo $content;
122
+ echo "</script>";
123
+ }
124
+
125
+ function sgShowShortCode($args, $content) {
126
+ $obj = SGPopup::findById($args['id']);
127
+ wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/".@$options['theme']."");
128
+ wp_enqueue_style('sg_colorbox_theme');
129
+ if(!$obj) return $content;
130
+ sgRenderPopupScript($args['id']);
131
+ return "<a href='javascript:void(0)' class='sg-show-popup' sgpopupid=".$args['id'].">".$content."</a>";
132
+ }
133
+ add_shortCode('sg_popup', 'sgShowShortCode');
134
+
135
+ function sgOnloadPopup() {
136
+ $page = get_queried_object_id ();
137
+ $popup = "sg_promotional_popup";
138
+ $popupId = SGPopup::getPagePopupId($page,$popup);
139
+ if(!$popupId) return;
140
+ sgRenderPopupScript($popupId);
141
+ echo "<script>window.onload = function() {
142
+ sgOnScrolling = (SG_POPUP_DATA [$popupId]['onScrolling']) ? SG_POPUP_DATA [$popupId]['onScrolling']: ''; ;
143
+ beforeScrolingPrsent = (SG_POPUP_DATA [$popupId]['onScrolling']) ? SG_POPUP_DATA [$popupId]['beforeScrolingPrsent']: '';
144
+ autoClosePopup = (SG_POPUP_DATA [$popupId]['autoClosePopup']) ? SG_POPUP_DATA [$popupId]['autoClosePopup']: '';
145
+ popupClosingTimer = (SG_POPUP_DATA [$popupId]['popupClosingTimer']) ? SG_POPUP_DATA [$popupId]['popupClosingTimer']: '';
146
+ if(sgOnScrolling) {
147
+ sgPopup.onScrolling($popupId);
148
+ }
149
+ else {
150
+ showPopup($popupId,true);
151
+ }
152
+ }
153
+ </script>";
154
+
155
+ }
156
+ add_action('wp_head','sgOnloadPopup');
157
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_media_buuton.php');
158
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_savePopupFrom.php'); // saving form data
159
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_ajax.php');
160
+
161
+ function sg_popup_plugin_loaded() {
162
+ $versionPopup = get_option('SG_POPUP_VERSION');
163
+ if(!$versionPopup || $versionPopup < SG_POPUP_VERSION ) {
164
+ update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
165
+ PopupInstaller::install();
166
+ PopupInstaller::convert();
167
+ }
168
+ }
169
+ add_action( 'plugins_loaded', 'sg_popup_plugin_loaded' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Plugin Name: Popup Builder
3
  Contributors: Sygnoos
4
  Donate link: http://sygnoos.com/wordpress-popup/
5
- Tags: popup,popup promote,promotional popup,popup ads, popup advertising, popup box, popup form, popup message, popup window, popups, wordpress popup, simple popup, modal window, responsive popup, fancybox, fancy popup, lightbox, automatic popup, custom popup,popup message, youtube popup, video popup, iframe popup, vimeo popup, popup contact form, dialog box, fancy box popup, wordpress popup plugin
6
  Requires at least: 3.8
7
- Tested up to: 4.2.3
8
- Stable tag: 1.1.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -17,17 +17,19 @@ Create powerful popups for promotion. Manage popup dimensions, effects, themes a
17
 
18
  Create and manage powerful promotion popups for your WordPress blog or website. Powerful, and yet, easy to use popup plugin that will help you to grab your visitor's attention to introduce him offers, discounts or other kind of promotional notices.
19
 
 
 
20
  Popups are a good marketing tool, they're impressively high converting. A web page with a popup typically sees more conversions than the same page without a popup. More important, a page with a well designed and thoughtfully implemented popup converts better than one with an ugly popup. With Popup Builder plugin you can customize the popup according to your needs.
21
 
22
  **Features:**
23
 
24
  * Create and manage as many popups as you want
25
- * Choose whether to show html popup or a single image
26
  * Customize the look and feel of the popup
27
  * Set custom animation effects
28
  * Customize popup animation effect
29
  * Choose between several popup themes
30
  * Set popup location on the screen
 
31
  * Responsive popup
32
  * Network/Multisite popup
33
 
@@ -35,8 +37,12 @@ Popups are a good marketing tool, they're impressively high converting. A web pa
35
 
36
  * Create iframe popup - you can set the URL you want to load within an iframe and the popup will load that iframe
37
  * Create popup from shortcodes of other plugins - very useful when you want to load another plugin inside your popup
 
38
  * Show popup only when user is scrolling - sometimes you don't want to show the popup right away, it's a good idea to set this option so the popup will be shown to the visitor only when he scrolls
39
  * Show popup once per visitor - useful when you don't want to show the popup to the same visitor more than once
 
 
 
40
 
41
  <a href="http://sygnoos.com/wordpress-popup/" target="_blank">Get Popup Builder PRO package</a>
42
  <div>
@@ -68,13 +74,24 @@ Go to the Popup Builder settings and set your desired options.
68
 
69
  == Screenshots ==
70
 
71
- 1. Admin Panel
72
- 2. List of popups
73
- 3. Setting a popup inside a page
74
- 4. Showing a popup
 
 
 
75
 
76
  == Changelog ==
77
 
 
 
 
 
 
 
 
 
78
  * Version 1.1.4
79
 
80
  Bug fixed with single quotes string/html popup.
@@ -98,4 +115,29 @@ Go to the Popup Builder settings and set your desired options.
98
 
99
  Bug fixes
100
 
101
- * Initial upload 1.0.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  Plugin Name: Popup Builder
3
  Contributors: Sygnoos
4
  Donate link: http://sygnoos.com/wordpress-popup/
5
+ Tags: popup,popup promote,promotional popup,popup ads, popup advertising, popup box, popup form, popup message, popup window, popups, wordpress popup, simple popup, modal window, responsive popup, fancybox, fancy popup, lightbox, automatic popup, custom popup,popup message, youtube popup, video popup, iframe popup, vimeo popup, popup contact form, dialog box, fancy box popup, wordpress popup plugin, lightbox popup, popup builder, wordpress popup builder
6
  Requires at least: 3.8
7
+ Tested up to: 4.2.4
8
+ Stable tag: 2.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
17
 
18
  Create and manage powerful promotion popups for your WordPress blog or website. Powerful, and yet, easy to use popup plugin that will help you to grab your visitor's attention to introduce him offers, discounts or other kind of promotional notices.
19
 
20
+ https://www.youtube.com/watch?v=3ZwRKPhHMzY
21
+
22
  Popups are a good marketing tool, they're impressively high converting. A web page with a popup typically sees more conversions than the same page without a popup. More important, a page with a well designed and thoughtfully implemented popup converts better than one with an ugly popup. With Popup Builder plugin you can customize the popup according to your needs.
23
 
24
  **Features:**
25
 
26
  * Create and manage as many popups as you want
 
27
  * Customize the look and feel of the popup
28
  * Set custom animation effects
29
  * Customize popup animation effect
30
  * Choose between several popup themes
31
  * Set popup location on the screen
32
+ * Customize popup overlay color and opacity
33
  * Responsive popup
34
  * Network/Multisite popup
35
 
37
 
38
  * Create iframe popup - you can set the URL you want to load within an iframe and the popup will load that iframe
39
  * Create popup from shortcodes of other plugins - very useful when you want to load another plugin inside your popup
40
+ * Create video popup - embed YouTube and Vimeo videos inside your popup.
41
  * Show popup only when user is scrolling - sometimes you don't want to show the popup right away, it's a good idea to set this option so the popup will be shown to the visitor only when he scrolls
42
  * Show popup once per visitor - useful when you don't want to show the popup to the same visitor more than once
43
+ * Don't show popup on mobile devices - after activating this option, popup won't be shown in mobile devices.
44
+ * Disable popup closing - after activating this option, user won't be able to close the popup in any possible way.
45
+ * Auto close popup after X seconds - useful when activated together with the previous option, you can disable manual popup closing but close it after certain time.
46
 
47
  <a href="http://sygnoos.com/wordpress-popup/" target="_blank">Get Popup Builder PRO package</a>
48
  <div>
74
 
75
  == Screenshots ==
76
 
77
+ 1. List of popups screen
78
+ 2. Add new popup screen
79
+ 3. Edit popup screen
80
+ 4. Advanced options (PRO options) metabox screen
81
+ 5. Include popup into the page screen
82
+ 6. Insert shortcode popup screen
83
+ 7. Final result
84
 
85
  == Changelog ==
86
 
87
+ * Version 2.0.1
88
+
89
+ Bug fixed.
90
+
91
+ * Version 2.0
92
+
93
+ Major release of Popup Builder v.2.0
94
+
95
  * Version 1.1.4
96
 
97
  Bug fixed with single quotes string/html popup.
115
 
116
  Bug fixes
117
 
118
+ * Initial upload 1.0.0
119
+
120
+ == Frequently Asked Questions ==
121
+ **How many popups can I create?**
122
+
123
+ You can create as many popups as you want, there is no limit either on the Free or the PRO version.
124
+
125
+ **Can I have more than one popup on the same page?**
126
+
127
+ You can have as many popups as you want on the same page, but you can only set one popup to be opened on page load, the others must be set to open on click.
128
+
129
+ **How can I set a popup to open automatically?**
130
+
131
+ After creating your popup, go to the desired page or post and you will see a meta box below the content editor, with the following title: "Select popup on page load". Select the popup you want to set and then update the page. You are done! After you go to that page/post the popup will get opened automatically.
132
+
133
+ **Can I put a popup to show after clicking something?**
134
+
135
+ Yes. There is an "Insert popup" button which will insert the popup shortcode over any element (text, image, button, etc.) you want. Just select the element, click on the button, choose a popup and you are done!
136
+
137
+ **Why should I buy the PRO package?**
138
+
139
+ The Free version of Popup Builder gives you anything you need for creating unlimited fully functional popups and insert them wherever you want. Our PRO package gives you the ability to create more specific popups, like iframe, video or shortcode popups. Also, advanced options will be available for you to disbale popup closing, disable popup for mobile devices, show the popup only once, and many other features. So if you need these advanced popups and functionalities, get Popup Builder PRO <a href="http://sygnoos.com/wordpress-popup/">here</a>.
140
+
141
+ **Something is not working. What do I do?**
142
+
143
+ Contact us! Depending on your server configuration something may go wrong, please don't hesitate on contacting us, we are here to help you! Our support email is: wp-popup@sygnoos.com
style/bootstrap-tagsinput.css ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .bootstrap-tagsinput {
2
+ background-color: #fff;
3
+ display: inline-block;
4
+ padding: 4px 0px;
5
+ margin-bottom: 10px;
6
+ color: #555;
7
+ vertical-align: middle;
8
+ border-radius: 4px;
9
+ max-width: 100%;
10
+ line-height: 22px;
11
+ cursor: text;
12
+ }
13
+ .bootstrap-tagsinput input {
14
+ border: none;
15
+ box-shadow: none;
16
+ outline: none;
17
+ background-color: transparent;
18
+ padding: 0;
19
+ margin: 0;
20
+ width: auto !important;
21
+ max-width: inherit;
22
+ }
23
+ .bootstrap-tagsinput input:focus {
24
+ border: none;
25
+ box-shadow: none;
26
+ }
27
+ .bootstrap-tagsinput .tag {
28
+ margin-right: 2px;
29
+ color: white;
30
+ margin-bottom: 2px;
31
+ }
32
+ .bootstrap-tagsinput .tag [data-role="remove"] {
33
+ margin-left: 8px;
34
+ cursor: pointer;
35
+ }
36
+ .bootstrap-tagsinput .tag [data-role="remove"]:after {
37
+ content: "x";
38
+ padding: 0px 2px;
39
+ }
40
+ .bootstrap-tagsinput .tag [data-role="remove"]:hover {
41
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
42
+ }
43
+ .bootstrap-tagsinput .tag [data-role="remove"]:hover:active {
44
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
45
+ }
style/sg_popup_style.css CHANGED
@@ -1,682 +1,750 @@
1
- /******* coomon *******/
2
- #displayNone {
3
- display: none;
4
- }
5
- #defaultMessage{
6
- margin-left: 0px;
7
- margin-right: 30px;
8
- }
9
- .samefontStyle {
10
- color: #3879D9;
11
- font: 14px Arial;
12
- padding-left: 3px;
13
- border: 1px solid #ccc;
14
- position: absolute;
15
- min-width: 20px;
16
- min-height: 13px;
17
- display: none;
18
- margin-top: 7px;
19
- margin-left: 12px;
20
- box-shadow: 0px 0px 2px #ccc;
21
- padding: 5px;
22
- z-index: 9999;
23
- background-color: white;
24
- }
25
- .errorInfo {
26
- display: none;
27
- margin-left: 11px;
28
- }
29
-
30
- .validateError {
31
- color: red;
32
- display: none;
33
- margin-left: 8px;
34
- position: absolute;
35
- padding-left: 3px;
36
- border: 1px solid #ccc;
37
- min-width: 20px;
38
- min-height: 13px;
39
- margin-top: 7px;
40
- margin-left: 12px;
41
- box-shadow: 0px 0px 2px #ccc;
42
- padding: 5px;
43
- z-index: 9999;
44
- background-color: white;
45
- }
46
- [class = sameWidthinputs ] {
47
- width: 44%;
48
- min-width: 165px;
49
- }
50
- .createDescribe{
51
- font: 13px "Open Sans", sans-serif;
52
- color: black;
53
- }
54
- .createDescribe + span{
55
- color: #3879D9;
56
- font: 14px Arial;
57
- padding-left: 12px;
58
- }
59
- .h2Background{
60
- background-color: #FAFAFA;
61
- display: inline-block;
62
- height: 50px;
63
- width: 100%;
64
- border-bottom: 1px solid #ccc;
65
- position: relative;
66
- }
67
- .h2Background h2{
68
- margin: 18px;
69
- display: inline-block;
70
- }
71
- #dimentionsTitle > img,#optionsTitle > img,#effectsTitle > img,#generalTitle > img {
72
- position: absolute;
73
- left: 90%;
74
- top: 9%;
75
- transform: rotate(-180deg);
76
-
77
- }
78
- .rightArrow{
79
- transform: rotate(0deg);
80
- }
81
- .turnArrow{
82
- transform: rotate(-180deg);
83
- }
84
-
85
- .dimensionsContent, .generalContent, .effectsContent, .optionsContent {
86
- padding: 10px 20px;
87
- }
88
-
89
-
90
- .clear{
91
- clear: both;
92
- }
93
- /******* coomon end *******/
94
- /******* admin page ******/
95
- .headersWrapper {
96
- width: 100%;
97
- height: 90px;
98
- position: relative;
99
- }
100
- .mainUpdateToPro {
101
- position: absolute;
102
- right: 0px;
103
- top: 0px;
104
- top: 0px;
105
- background-color: #D54E21;
106
- border: 1px solid #D54E21;
107
- color: white;
108
- cursor: pointer;
109
- }
110
- .crudToPro {
111
- float: right;
112
- margin-top: 7px;
113
- background-color: #D54E21;
114
- border: 1px solid #D54E21;
115
- color: white;
116
- cursor: pointer;
117
- margin-right: 2.5%;
118
- }
119
-
120
- .effectsContent .samefontStyle{
121
- max-width: 131px;
122
-
123
- }
124
- .sgDeleteLink{
125
- margin-left: 10px;
126
- }
127
-
128
- #promotionalSaveButton:before{
129
- clear: both;
130
- }
131
-
132
- #promotionalSaveButton{
133
- float: right;
134
- margin-right: 2.5%;
135
- }
136
- #linkCreate {
137
- text-decoration: none;
138
- display: block;
139
- cursor: pointer;
140
- font: 13px Arial;
141
- }
142
- #linkCreate :hover{
143
- display: block;
144
- }
145
- .creteLinkWrapper{
146
- display: inline-block;
147
- margin-bottom: 17px;
148
- margin-top: 10px;
149
- background-color: #E0E0E0;
150
- }
151
- .creteLinkWrapper a{
152
- display: block;
153
- padding: 6px;
154
- }
155
- .creteLinkWrapper a:hover{
156
- background-color: #46ADD0;
157
- color: white;
158
- cursor: pointer;
159
- }
160
-
161
-
162
- #disine tr:nth-child(even){
163
- background-color: #F9F9F9;
164
- }
165
- #previewbuttonStyle {
166
- margin-right: 5px;
167
- background: #00a0d2;
168
- border-color: #0073aa;
169
- color: #fff;
170
- text-decoration: none;
171
- display: inline-block;
172
- font-size: 13px;
173
- line-height: 26px;
174
- height: 28px;
175
- margin: 0;
176
- padding: 0 10px 1px;
177
- cursor: pointer;
178
- border-width: 1px;
179
- border-style: solid;
180
- -webkit-appearance: none;
181
- border-radius: 3px;
182
- white-space: nowrap;
183
- }
184
- .previewParagaraph{
185
- display: inline-block;
186
- }
187
-
188
- span.phpErrorStyle{
189
- display: inline-block;
190
- margin-left: 5px;
191
- font: 18px Arial Sans-serif;
192
- color: red;
193
- }
194
-
195
- #successMessage {
196
- width: 97%;
197
- height: 37px;
198
- border-left: 5px solid #7AD03A;
199
- background-color: #FFFFFF;
200
- }
201
- #gifLoader {
202
- margin-left: 5px;
203
- }
204
- /******* admin page end ******/
205
- /******* general ******/
206
- #createAjaxLoader {
207
- float: right;
208
- margin-right: 11px;
209
- margin-top: 7px;
210
- }
211
- .generalMenu {
212
- width: 98%;
213
- height: 39px;
214
- }
215
- .contentType {
216
-
217
- margin: 10px auto;
218
- }
219
-
220
-
221
- .contentTypeMain{
222
- border-right: 1px solid #ccc;
223
- border-bottom: 1px solid #ccc;
224
- border-left: 1px solid #ccc;
225
- width: 94.1%;
226
- min-height: 262px;
227
- padding-right: 20px;
228
- padding-bottom: 30px;
229
- margin-bottom: 26px;
230
- }
231
-
232
- .generalMenu > ul li {
233
- display: block;
234
- font: 14px Arial;
235
- color: black;
236
- float: left;
237
- width: 49.5%;
238
- display: block;
239
- padding: 11px 0px;
240
- text-align: center;
241
- border: 1px solid #ccc;
242
- cursor: pointer;
243
-
244
- }
245
- .imagetype{
246
- padding-bottom: 5px;
247
- min-height: 140px;
248
- }
249
- /*tab css*/
250
- .tabWrapper{
251
- background-color: #F1F1F1;
252
- margin-top: 12px;
253
- }
254
-
255
- /*----- Tabs -----*/
256
- .tabs {
257
- width:100%;
258
- display:inline-block;
259
- }
260
-
261
- /*----- Tab Links -----*/
262
- /* Clearfix */
263
- .tab-links:after {
264
- display:block;
265
- clear:both;
266
- content:'';
267
- }
268
-
269
- .tab-links li {
270
- margin:0px 5px;
271
- float:left;
272
- list-style:none;
273
- }
274
-
275
- .tab-links a {
276
- padding:9px 15px;
277
- display:inline-block;
278
- border-radius:3px 3px 0px 0px;
279
- background:#7FB5DA;
280
- font-size:13px;
281
- font-weight:600;
282
- color:#4c4c4c;
283
- text-decoration: none;
284
- transition:all linear 0.15s;
285
- }
286
-
287
- .tab-links a:hover {
288
- background:#a7cce5;
289
- text-decoration:none;
290
- }
291
-
292
- li.active a, li.active a:hover {
293
- background:#fff;
294
- color:#4c4c4c;
295
- }
296
-
297
- /*----- Content of Tabs -----*/
298
- .tab-content {
299
- min-height: 275px;
300
- margin-top: -12px;
301
- padding:15px;
302
- border-radius:3px;
303
- box-shadow: 0px 0px 3px rgba(0,0,0,0.15);
304
- background:#fff;
305
- }
306
-
307
- .tab {
308
- display:none;
309
- }
310
-
311
- .tab.active {
312
- display:block;
313
- }
314
- input[id="upload_image_button"]{
315
- width: 37%;
316
- }
317
- #upload_image {
318
- width: 61%;
319
- }
320
- .imageUploderWrapper{
321
- margin: 0 auto;
322
- width: 82%;
323
- }
324
- .ShowSelectedImage {
325
- width: 222px;
326
- height: 127px;
327
- background-color: #F8F8F8;
328
- margin: 14px auto;
329
- background-size: contain;
330
- background-position: center center;
331
- background-repeat: no-repeat;
332
- }
333
- .NoImage {
334
- display: block;
335
- font: 13px Arial;
336
- margin: 0 auto;
337
- text-align: center;
338
- padding-top: 56px;
339
- }
340
- .imageHeadline{
341
- margin-top: 27px;
342
- margin-bottom: 41px;
343
- text-align: center;
344
- font: 16px arial;
345
- }
346
- .choosePopupType{
347
- margin-top: -3px;
348
- margin-left: 20px;
349
- }
350
- .htmlType .wp-editor-tabs {
351
- float: right;
352
- margin-right: 6%;
353
- }
354
- .htmlType #insert-media-button {
355
- position: relative;
356
- top:3px;
357
- }
358
- .iframetype h1 {
359
- text-align: center;
360
- padding-bottom: 34px;
361
- font: 16px arial;
362
- }
363
- .iframeContent{
364
- width: 48%;
365
- margin: 28px auto;
366
- }
367
- [name=iframeLink],[name=shortCode]{
368
- width: 100%;
369
- }
370
- /*its dive picturs*/
371
- .theme1,.theme2,.theme3,.theme4,.theme5{
372
- border: 0px solid red;
373
- width: 240px;
374
- height: 130px;
375
- margin-top: 1px;
376
- margin-left: 6%;
377
- display: block;
378
- position: absolute;
379
- z-index: 9999999999999999;
380
- }
381
- input[name="theme"]{
382
- margin-left: 14px;
383
-
384
- }
385
- .theme1{
386
- background-image: url(../img/theme1.jpg);
387
- background-size: 240px 130px;
388
- }
389
- .theme2{
390
- background-image: url(../img/theme2.jpg);
391
-
392
- }
393
- .theme3{
394
- background-image: url(../img/theme3.jpg);
395
- }
396
- .theme4{
397
- background-image: url(../img/theme4.jpg);
398
- background-size: 240px 130px;
399
- }
400
- .theme5{
401
- background-image: url(../img/theme5.jpg);
402
- background-size: 240px 130px;
403
- }
404
-
405
- /******* general end ******/
406
- /******* Effects ******/
407
- .effects {
408
- margin-top: 14px;
409
- background-color: white;
410
- margin-left: 3px;
411
- }
412
- .effects span img{
413
- margin-left: 3px;
414
- }
415
- .effectsContent {
416
- padding-left: 20px;
417
-
418
- }
419
- .effectsContent .sameWidthinputs{
420
- margin-right: 25px;
421
- }
422
- .theme input {
423
- margin-top: 13px;
424
- }
425
- #themeSPan{
426
- margin-top: 24px;
427
- }
428
- /*effects*/
429
- .effects span{
430
- margin-top: 13px;
431
- }
432
- .effects select{
433
- margin-bottom: 10px;
434
- }
435
- .crudWrapper .createDescribe {
436
- display: inline-block;
437
- margin: 8px auto;
438
- width: 151px;
439
- }
440
- .crudWrapper .general .createDescribe {
441
- display: inline-block;
442
- margin: 8px auto;
443
- width: 62px;
444
- }
445
- .sameWidthinputsTitle {
446
- width: 60.0%;
447
- }
448
- #themeSPan {
449
- width: 119px;
450
- }
451
-
452
-
453
- #sameWidthinputs{
454
- width: 44%;
455
- min-width: 165px;
456
- }
457
- #effectShow {
458
- display: none;
459
- width: 150px;
460
- height: 150px;
461
- margin-left: 5px;
462
- background-image: url(../img/theme4.jpg);
463
- background-size: 150px 150px;
464
- position: absolute;
465
- top: -46px;
466
- left: 72%;
467
- z-index: 9999;
468
- }
469
- .effectWrapper{
470
- position: relative;
471
-
472
- }
473
- /******* Effects end******/
474
- /******* dimensions ******/
475
-
476
- .dimensions {
477
- width: 100%;
478
- background-color: white;
479
- margin-right: 2.1%;
480
- box-sizing: border-box;
481
- }
482
- /******* dimensions end******/
483
-
484
- /******* options ******/
485
-
486
- .options{
487
- margin-top: 13px;
488
- }
489
- .optionsContent .createDescribe {
490
- width: 241px;
491
- }
492
- .optionsContent .sameWidthinputs {
493
- margin-right: 20px;
494
- }
495
- .optionsContent{
496
- background-color: white;
497
- position: relative;
498
- padding: 10px 20px 0px 20px;
499
- }
500
-
501
- .range-bar {
502
- background-color: #a9acb1;
503
- border-radius: 15px;
504
- display: block;
505
- height: 4px;
506
- position: relative;
507
- width: 100%;
508
-
509
- }
510
-
511
- .range-quantity {
512
- background-color: #017afd;
513
- border-radius: 15px;
514
- display: block;
515
- height: 100%;
516
- width: 0;
517
- }
518
-
519
- .range-handle {
520
- background-color: #fff;
521
- border-radius: 100%;
522
- cursor: move;
523
- height: 20px;
524
- left: 0;
525
- top: -10px;
526
- position: absolute;
527
- width: 20px;
528
-
529
- -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
530
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
531
- }
532
-
533
- .range-min,
534
- .range-max {
535
-
536
- height: 20px;
537
- padding-top: 4px;
538
- position: absolute;
539
- text-align: center;
540
- top: -9px;
541
- display: none;
542
- }
543
- .slider-wrapper {
544
-
545
- position: relative;
546
- width: 150px;
547
- display: inline-block;
548
- }
549
-
550
- .vertical-wrapper {
551
- height: 200px;
552
- width: auto;
553
- }
554
- .display-box {
555
- background-color: #f7fcff;
556
- border-radius: 5px;
557
- font-size: 0.8em;
558
- height: 23px;
559
- right: -41px;
560
- padding-top: 2px;
561
- position: absolute;
562
- text-align: center;
563
- top: -10px;
564
- width: 35px;
565
-
566
- -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
567
- box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
568
- }
569
-
570
- .fixedWrapper {
571
- max-width: 248px;
572
- width: 40%;
573
- height: 191px;
574
- display: none;
575
-
576
- }
577
- .forFixWrapperStyle {
578
- width: 241px;
579
- display: inline-block;
580
- }
581
- .fixedPositionStyle {
582
- width: 31.85%;
583
- height: 53px;
584
-
585
- float: left;
586
- cursor: pointer;
587
- }
588
- #fixedPosition2, #fixedPosition4 , #fixedPosition8,#fixedPosition6{
589
- float: left;
590
- width: 31.85%;
591
- height: 53px;
592
- background-color: rgb(241,241,241);
593
-
594
- }
595
- #fixedPosition1{
596
- border: 1px solid #ccc;
597
-
598
- }
599
-
600
- #fixedPosition2{
601
- border-bottom: 1px solid #ccc;
602
- border-top: 1px solid #ccc;
603
- }
604
- #fixedPosition3{
605
- border: 1px solid #ccc;
606
- }
607
- #fixedPosition6{
608
- border-left: 1px solid #ccc;
609
- border-right: 1px solid #ccc;
610
- }
611
- #fixedPosition9{
612
- border-left: 1px solid #ccc;
613
- border-bottom: 1px solid #ccc;
614
- border-right: 1px solid #ccc;
615
- border-top: 1px solid #ccc;
616
- }
617
- #fixedPosition8{
618
- border-left: 1px solid #ccc;
619
- border-bottom: 1px solid #ccc;
620
- border-top: 1px solid #ccc;
621
- }
622
- #fixedPosition7{
623
- border-top: 1px solid #ccc;
624
- border-left: 1px solid #ccc;
625
- border-bottom: 1px solid #ccc;
626
- }
627
-
628
- #fixedPosition4{
629
- border-right: 1px solid #ccc;
630
- border-left: 1px solid #ccc;
631
- }
632
-
633
-
634
- /******* options end ******/
635
-
636
- /*style main*/
637
- .general {
638
- background-color: white;
639
- margin-left: 3px;
640
- margin-top: 5px;
641
- }
642
- .generalContent{
643
- padding-right: 20px;
644
- padding-left: 20px;
645
- }
646
- .Sg_title_crud{
647
- float: left;
648
- display: inline-block;
649
- }
650
- .cereateTitleWrapper{
651
- position: relative;
652
- margin-bottom: 32px;
653
- }
654
- #leftMainDiv{
655
- width: 48%;
656
- width: 48%;
657
- float: left;
658
- overflow: hidden;
659
- margin-right: 18px;
660
- display: block;
661
- }
662
- #rightMaindiv{
663
- width:48%;
664
- display: inline-block;
665
- overflow: hidden;
666
- padding-top: 5px;
667
- }
668
- /
669
- /*meduia queris*/
670
-
671
- @media(max-width: 1042px) {
672
- #leftMainDiv{
673
- width: 97.5%;
674
- margin: 0px auto;
675
- }
676
- #rightMaindiv{
677
- width: 97.5%;
678
- margin: 0px auto;
679
- }
680
- }
681
- /*style css*/
682
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*new styles*/
2
+ #wpwrap {
3
+ overflow: hidden;
4
+ margin-right: 1px;
5
+ }
6
+ #general .postbox-container,#effect .postbox-container, #dimentions .postbox-container,#options .postbox-container,#sepectialOptons .postbox-container,#proOptions .postbox-container{
7
+ width: 100%;
8
+ }
9
+ .headersWrapper h2{
10
+ padding-top: 0px;
11
+ }
12
+ h3.hndle .ui-sortable-handle .generalTitle {
13
+ cursor: pointer;
14
+ }
15
+ .createPopupLink {
16
+ cursor: pointer;
17
+ }
18
+ .hedlinePadding {
19
+ padding: 18px 0px;
20
+ }
21
+ /*ned new styyle*/
22
+
23
+ /******* coomon *******/
24
+ .generalWrapper {
25
+ margin-right: 2.5%;
26
+ }
27
+ .sameImageStyle {
28
+ color: #3879D9;
29
+ padding-top: 7px;
30
+ }
31
+ .improveOptionsstyle {
32
+ margin-left: 0px;
33
+ }
34
+ .advancedOptionsContent .sameImageStyle {
35
+ margin-left: 16px;
36
+ }
37
+ #displayNone {
38
+ display: none;
39
+ }
40
+ #defaultMessage{
41
+ margin-left: 0px;
42
+ margin-right: 30px;
43
+ }
44
+ .samefontStyle {
45
+ color: #3879D9;
46
+ font: 14px Arial;
47
+ padding-left: 3px;
48
+ width: 200px;
49
+ position: fixed;
50
+ border: 1px solid #ccc;
51
+ position: absolute;
52
+ min-width: 20px;
53
+ min-height: 13px;
54
+ display: none;
55
+ margin-top: 7px;
56
+ margin-left: 12px;
57
+ box-shadow: 0px 0px 2px #ccc;
58
+ padding: 5px;
59
+ z-index: 99999999999999999999999999;
60
+ background-color: white;
61
+ }
62
+ .errorInfo {
63
+ display: none;
64
+ margin-left: 11px;
65
+ }
66
+
67
+ .validateError {
68
+ color: red;
69
+ display: none;
70
+ margin-left: 8px;
71
+ position: absolute;
72
+ padding-left: 3px;
73
+ border: 1px solid #ccc;
74
+ min-width: 20px;
75
+ min-height: 13px;
76
+ margin-top: 7px;
77
+ margin-left: 12px;
78
+ box-shadow: 0px 0px 2px #ccc;
79
+ padding: 5px;
80
+ z-index: 9999;
81
+ background-color: white;
82
+ }
83
+ [class = sameWidthinputs ] {
84
+ width: 44%;
85
+ min-width: 165px;
86
+ }
87
+ .createDescribe{
88
+ font: 13px "Open Sans", sans-serif;
89
+ color: black;
90
+ }
91
+ .createDescribe + span{
92
+ color: #3879D9;
93
+ font: 14px Arial;
94
+ padding-left: 12px;
95
+ }
96
+ .h2Background{
97
+ background-color: #FAFAFA;
98
+ display: inline-block;
99
+ height: 50px;
100
+ width: 100%;
101
+ border-bottom: 1px solid #ccc;
102
+ position: relative;
103
+ }
104
+ .h2Background h2{
105
+ margin: 18px;
106
+ display: inline-block;
107
+ }
108
+
109
+ .rightArrow{
110
+ transform: rotate(0deg);
111
+ }
112
+ .turnArrow{
113
+ transform: rotate(-180deg);
114
+ }
115
+
116
+ .dimensionsContent, .generalContent, .effectsContent, .optionsContent, .advancedOptionsContent {
117
+ padding: 10px 20px;
118
+ }
119
+
120
+ #titlewrap {
121
+ }
122
+ .clear{
123
+ clear: both;
124
+ }
125
+ /******* coomon end *******/
126
+ /******* admin page ******/
127
+
128
+ .headersWrapper {
129
+ width: 100%;
130
+ position: relative;
131
+ }
132
+ .mainUpdateToPro {
133
+ position: absolute;
134
+ right: 0px;
135
+ top: 0px;
136
+ top: 0px;
137
+ background-color: #D54E21;
138
+ border: 1px solid #D54E21;
139
+ color: white;
140
+ cursor: pointer;
141
+ }
142
+ .crudToPro {
143
+ float: right;
144
+ margin-top: 7px;
145
+ background-color: #D54E21;
146
+ border: 1px solid #D54E21;
147
+ color: white;
148
+ cursor: pointer;
149
+ margin-right: 2.5%;
150
+ }
151
+
152
+ .sgDeleteLink{
153
+ margin-left: 10px;
154
+ }
155
+
156
+ #promotionalSaveButton{
157
+ float: right;
158
+ margin-right: 2.5%;
159
+ }
160
+ .improve-icon {
161
+ padding-right: 2px;
162
+ padding-top: 3px;
163
+ }
164
+ .creteLinkWrapper{
165
+ display: inline-block;
166
+ margin-bottom: 17px;
167
+ margin-top: 10px;
168
+ background-color: #E0E0E0;
169
+ }
170
+ .creteLinkWrapper a{
171
+ display: block;
172
+ padding: 6px;
173
+ }
174
+
175
+ #disine tr:nth-child(even){
176
+ background-color: #F9F9F9;
177
+ }
178
+ #previewbuttonStyle {
179
+ margin-right: 5px;
180
+ background: #00a0d2;
181
+ border-color: #0073aa;
182
+ color: #fff;
183
+ text-decoration: none;
184
+ display: inline-block;
185
+ font-size: 13px;
186
+ line-height: 26px;
187
+ height: 28px;
188
+ margin: 0;
189
+ padding: 0 10px 1px;
190
+ cursor: pointer;
191
+ border-width: 1px;
192
+ border-style: solid;
193
+ -webkit-appearance: none;
194
+ border-radius: 3px;
195
+ white-space: nowrap;
196
+ }
197
+ .previewParagaraph{
198
+ display: inline-block;
199
+ }
200
+
201
+ span.phpErrorStyle{
202
+ display: inline-block;
203
+ margin-left: 5px;
204
+ font: 18px Arial Sans-serif;
205
+ color: red;
206
+ }
207
+
208
+ #successMessage {
209
+ width: 97%;
210
+ height: 37px;
211
+ border-left: 5px solid #7AD03A;
212
+ background-color: #FFFFFF;
213
+ }
214
+ #gifLoader {
215
+ margin-left: 5px;
216
+ }
217
+ .popupsWrapper {
218
+ margin: 26px 0px 0px 0px;
219
+ }
220
+ /******* admin page end ******/
221
+ /****** admin Create page ****/
222
+
223
+ .popupsDiv {
224
+ width: 200px;
225
+ height: 150px;
226
+ border: 1px solid #CCCCCC;
227
+ float: left;
228
+ margin-right: 10px;
229
+ margin-bottom: 10px;
230
+ background-color: #DEDEDE;
231
+ background-size: 100%;
232
+ transition: all .1s ease-in-out;
233
+ }
234
+ .popupsDiv:hover {
235
+ background-color: #CDCDCD;
236
+ transform: scale(1.05);
237
+ }
238
+ .htmlPopup {
239
+ background-image: url(../img/HTML-Button.png);
240
+ }
241
+ .imagePopup {
242
+ background-image: url(../img/Images-Button.png);
243
+ }
244
+ .iframePopup {
245
+ background-image: url(../img/iframePopup.png);
246
+ }
247
+ .shortcodePopup {
248
+ background-image: url(../img/ShortcodePopup.png);
249
+ }
250
+ .videoPopup {
251
+ background-image: url(../img/VideoPopup.png);
252
+ }
253
+ /****** end create page *****/
254
+ /******* general ******/
255
+ #createAjaxLoader {
256
+ float: right;
257
+ margin-right: 11px;
258
+ margin-top: 7px;
259
+ }
260
+ .generalMenu {
261
+ width: 98%;
262
+ height: 39px;
263
+ }
264
+ .contentType {
265
+
266
+ margin: 10px auto;
267
+ }
268
+ .optionsH1 {
269
+ font: 16px Arial,sans-serif;
270
+ text-align: center;
271
+ }
272
+ .sgOptionsContent {
273
+ width: 48%;
274
+ margin: 0 auto;
275
+ display: block;
276
+ }
277
+ .optinonsInput {
278
+ width: 100%;
279
+ }
280
+ .htmlType {
281
+ margin: 15px 0 0 0;
282
+ }
283
+ .contentTypeMain{
284
+ border-right: 1px solid #ccc;
285
+ border-bottom: 1px solid #ccc;
286
+ border-left: 1px solid #ccc;
287
+ width: 94.1%;
288
+ min-height: 262px;
289
+ padding-right: 20px;
290
+ padding-bottom: 30px;
291
+ margin-bottom: 26px;
292
+ }
293
+
294
+ .generalMenu > ul li {
295
+ display: block;
296
+ font: 14px Arial;
297
+ color: black;
298
+ float: left;
299
+ width: 49.5%;
300
+ display: block;
301
+ padding: 11px 0px;
302
+ text-align: center;
303
+ border: 1px solid #ccc;
304
+ cursor: pointer;
305
+
306
+ }
307
+ .imagetype{
308
+ padding-bottom: 5px;
309
+ min-height: 140px;
310
+ }
311
+ /*tab css*/
312
+ .tabWrapper{
313
+ background-color: #F1F1F1;
314
+ margin-top: 12px;
315
+ }
316
+
317
+ /*----- Tabs -----*/
318
+
319
+ /*----- Tab Links -----*/
320
+ /* Clearfix */
321
+
322
+
323
+
324
+
325
+ /*----- Content of Tabs -----*/
326
+
327
+
328
+ input[id="upload_image_button"]{
329
+ width: 37%;
330
+ }
331
+ #upload_image {
332
+ width: 61%;
333
+ }
334
+ .imageUploderWrapper{
335
+ margin: 0 auto;
336
+ width: 82%;
337
+ }
338
+ .ShowSelectedImage {
339
+ width: 222px;
340
+ height: 127px;
341
+ background-color: #F8F8F8;
342
+ margin: 14px auto;
343
+ background-size: contain;
344
+ background-position: center center;
345
+ background-repeat: no-repeat;
346
+ }
347
+ .NoImage {
348
+ display: block;
349
+ font: 13px Arial;
350
+ margin: 0 auto;
351
+ text-align: center;
352
+ padding-top: 56px;
353
+ }
354
+ .imageHeadline{
355
+ margin-top: 27px;
356
+ margin-bottom: 41px;
357
+ text-align: center;
358
+ font: 16px arial;
359
+ }
360
+ .choosePopupType{
361
+ margin-top: -3px;
362
+ margin-left: 20px;
363
+ }
364
+ frametype h1 {
365
+ text-align: center;
366
+ padding-bottom: 34px;
367
+ font: 16px arial;
368
+ }
369
+ .iframeContent{
370
+ width: 48%;
371
+ margin: 28px auto;
372
+ }
373
+ [name=iframeLink],[name=shortCode]{
374
+ width: 100%;
375
+ }
376
+ /*its dive picturs*/
377
+ .theme1,.theme2,.theme3,.theme4,.theme5{
378
+ border: 0px solid red;
379
+ width: 240px;
380
+ height: 130px;
381
+ margin-top: 1px;
382
+ margin-left: 15%;
383
+ display: block;
384
+ position: absolute;
385
+ z-index: 9999999999999999;
386
+ }
387
+ input[name="theme"]{
388
+ margin-left: 14px;
389
+
390
+ }
391
+ .theme1{
392
+ background-image: url(../img/theme1.jpg);
393
+ background-size: 240px 130px;
394
+ }
395
+ .theme2{
396
+ background-image: url(../img/theme2.jpg);
397
+
398
+ }
399
+ .theme3{
400
+ background-image: url(../img/theme3.jpg);
401
+ }
402
+ .theme4{
403
+ background-image: url(../img/theme4.jpg);
404
+ background-size: 240px 130px;
405
+ }
406
+ .theme5{
407
+ background-image: url(../img/theme5.jpg);
408
+ background-size: 240px 130px;
409
+ }
410
+
411
+ /******* general end ******/
412
+ /******* Effects ******/
413
+ .effects {
414
+ margin-top: 14px;
415
+ background-color: white;
416
+ margin-left: 3px;
417
+ }
418
+ .effects span img{
419
+ margin-left: 3px;
420
+ }
421
+ .effectsContent {
422
+ padding-left: 20px;
423
+
424
+ }
425
+ .effectsContent .sameWidthinputs{
426
+ margin-right: 25px;
427
+ }
428
+ .theme input {
429
+ margin-top: 13px;
430
+ }
431
+ #themeSPan{
432
+ margin-top: 32px;
433
+ }
434
+ #themeSPan.createDescribe {
435
+ margin-top: 10px;
436
+ }
437
+ /*effects*/
438
+ .effects span{
439
+ margin-top: 13px;
440
+ }
441
+ .effects select{
442
+ margin-bottom: 10px;
443
+ }
444
+ .crudWrapper .createDescribe {
445
+ display: inline-block;
446
+ margin: 8px auto;
447
+ width: 151px;
448
+ }
449
+ .crudWrapper .general .createDescribe {
450
+ display: inline-block;
451
+ margin: 8px auto;
452
+ width: 62px;
453
+ }
454
+ .sameWidthinputsTitle {
455
+ width: 60.0%;
456
+ }
457
+ #themeSPan {
458
+ width: 138px;
459
+ margin-top: 0px;
460
+ }
461
+
462
+
463
+ #sameWidthinputs{
464
+ width: 44%;
465
+ min-width: 165px;
466
+ }
467
+ #effectShow {
468
+ display: none;
469
+ width: 150px;
470
+ height: 150px;
471
+ margin-left: 5px;
472
+ background-image: url(../img/theme4.jpg);
473
+ background-size: 150px 150px;
474
+ position: absolute;
475
+ top: -46px;
476
+ left: 72%;
477
+ z-index: 9999;
478
+ }
479
+ .effectWrapper{
480
+ position: relative;
481
+
482
+ }
483
+ /******* Effects end******/
484
+ /******* dimensions ******/
485
+
486
+ .dimensions {
487
+ width: 100%;
488
+ background-color: white;
489
+ margin-right: 2.1%;
490
+ box-sizing: border-box;
491
+ }
492
+ /******* dimensions end******/
493
+
494
+ /******* options ******/
495
+
496
+ .options{
497
+ margin-top: 13px;
498
+ }
499
+ .optionsContent .createDescribe, .advancedOptionsContent .createDescribe {
500
+ width: 241px;
501
+ }
502
+ .optionsContent .sameWidthinputs {
503
+ margin-right: 20px;
504
+ }
505
+ .optionsContent ,.advancedOptionsContent, .specialOptionsContent {
506
+ background-color: white;
507
+ position: relative;
508
+ padding: 10px 20px 10px 20px;
509
+ }
510
+ .bootstrap-tagsinput .tag {
511
+ background-color: #5BC0DE;
512
+ padding: 0 3px 2px 3px;
513
+ }
514
+ .bootstrap-tagsinput > span {
515
+ display: inline-block;
516
+ }
517
+ .optionsCountry {
518
+ margin-left: -1px;
519
+ }
520
+ .autoClosePopupContent {
521
+ width: 100%;
522
+ display: none;
523
+ }
524
+ .popupTimer {
525
+ width: 30px;
526
+ }
527
+ .optionStyle {
528
+ font: 13px Arial, sans-serif;
529
+ padding-left: 2px;
530
+ display: inline-block;
531
+ margin-bottom: 8px;
532
+ }
533
+ .range-bar {
534
+ background-color: #a9acb1;
535
+ border-radius: 15px;
536
+ display: block;
537
+ height: 4px;
538
+ position: relative;
539
+ width: 100%;
540
+
541
+ }
542
+
543
+ .range-quantity {
544
+ background-color: #017afd;
545
+ border-radius: 15px;
546
+ display: block;
547
+ height: 100%;
548
+ width: 0;
549
+ }
550
+
551
+ .range-handle {
552
+ background-color: #fff;
553
+ border-radius: 100%;
554
+ cursor: move;
555
+ height: 20px;
556
+ left: 0;
557
+ top: -10px;
558
+ position: absolute;
559
+ width: 20px;
560
+
561
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
562
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
563
+ }
564
+
565
+ .range-min,
566
+ .range-max {
567
+
568
+ height: 20px;
569
+ padding-top: 4px;
570
+ position: absolute;
571
+ text-align: center;
572
+ top: -9px;
573
+ display: none;
574
+ }
575
+ .slider-wrapper {
576
+
577
+ position: relative;
578
+ width: 150px;
579
+ display: inline-block;
580
+ }
581
+
582
+ .vertical-wrapper {
583
+ height: 200px;
584
+ width: auto;
585
+ }
586
+ .display-box {
587
+ background-color: #f7fcff;
588
+ border-radius: 5px;
589
+ font-size: 0.8em;
590
+ height: 23px;
591
+ right: -41px;
592
+ box-sizing: border-box;
593
+ padding-top: 6px;
594
+ position: absolute;
595
+ text-align: center;
596
+ top: -10px;
597
+ width: 35px;
598
+
599
+ -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
600
+ box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
601
+ }
602
+ #colorPiccer {
603
+ display: inline-block;
604
+ }
605
+ #colorPiccer > .wp-picker-container .wp-color-result {
606
+ top:12px;
607
+ }
608
+ .wp-picker-open+.wp-picker-input-wrap {
609
+ float: right;
610
+ margin-top: 12px;
611
+ }
612
+ .countrisConfigDiv {
613
+ width: 100%;
614
+ max-height: 150px;
615
+ display: none;
616
+ }
617
+ .scrollingContent {
618
+ width: 100%;
619
+ display: none;
620
+ }
621
+ .beforeScrolingPrsent {
622
+ width: 30px;
623
+ }
624
+ .scrollPresentSpan {
625
+ padding-left: 4px;
626
+ }
627
+ .countrisConfigDivCountris {
628
+ display: inline-block;
629
+ width: 239px;
630
+ }
631
+ .autoCloseTimeContent {
632
+ display: none;
633
+ width: 100%;
634
+ }
635
+ .popupClosingTimer {
636
+ width: 37px;
637
+ }
638
+ .fixedWrapper {
639
+ max-width: 248px;
640
+ width: 40%;
641
+ height: 191px;
642
+ display: inline-block;
643
+ }
644
+ .popopFixeds {
645
+ width: 100%;
646
+ display: none;
647
+ }
648
+ .forFixWrapperStyle {
649
+ width: 241px;
650
+ display: inline-block;
651
+ }
652
+ .fixedPositionStyle {
653
+ width: 31.85%;
654
+ height: 53px;
655
+
656
+ float: left;
657
+ cursor: pointer;
658
+ }
659
+ #fixedPosition2, #fixedPosition4 , #fixedPosition8,#fixedPosition6{
660
+ float: left;
661
+ width: 31.85%;
662
+ height: 53px;
663
+ background-color: rgb(241,241,241);
664
+
665
+ }
666
+ #fixedPosition1{
667
+ border: 1px solid #ccc;
668
+
669
+ }
670
+
671
+ #fixedPosition2{
672
+ border-bottom: 1px solid #ccc;
673
+ border-top: 1px solid #ccc;
674
+ }
675
+ #fixedPosition3{
676
+ border: 1px solid #ccc;
677
+ }
678
+ #fixedPosition6{
679
+ border-left: 1px solid #ccc;
680
+ border-right: 1px solid #ccc;
681
+ }
682
+ #fixedPosition9{
683
+ border-left: 1px solid #ccc;
684
+ border-bottom: 1px solid #ccc;
685
+ border-right: 1px solid #ccc;
686
+ border-top: 1px solid #ccc;
687
+ }
688
+ #fixedPosition8{
689
+ border-left: 1px solid #ccc;
690
+ border-bottom: 1px solid #ccc;
691
+ border-top: 1px solid #ccc;
692
+ }
693
+ #fixedPosition7{
694
+ border-top: 1px solid #ccc;
695
+ border-left: 1px solid #ccc;
696
+ border-bottom: 1px solid #ccc;
697
+ }
698
+
699
+ #fixedPosition4{
700
+ border-right: 1px solid #ccc;
701
+ border-left: 1px solid #ccc;
702
+ }
703
+
704
+
705
+ /******* options end ******/
706
+
707
+ /*style main*/
708
+ .general {
709
+ background-color: white;
710
+ margin-left: 3px;
711
+ margin-top: 5px;
712
+ }
713
+ .generalContent{
714
+ padding-right: 20px;
715
+ padding-left: 20px;
716
+ }
717
+ .Sg_title_crud{
718
+ float: left;
719
+ display: inline-block;
720
+ }
721
+ .cereateTitleWrapper{
722
+ position: relative;
723
+ }
724
+ #leftMainDiv{
725
+ width: 48.5%;
726
+ float: left;
727
+ margin-right: 1.5%;
728
+ display: block;
729
+ }
730
+ #rightMaindiv{
731
+ width: 50%;
732
+ display: inline-block;
733
+ float: right;
734
+ }
735
+ /
736
+ /*meduia queris*/
737
+
738
+ @media(max-width: 1042px) {
739
+ #leftMainDiv #poststuff{
740
+ width: 97.5%;
741
+ margin: 0px auto;
742
+ background-color: red;
743
+ }
744
+ #rightMaindiv #poststuff{
745
+ width: 97.5%;
746
+ margin: 0px auto;
747
+ }
748
+ }
749
+ /*style css*/
750
+
style/sg_popup_style.php CHANGED
@@ -1 +1,33 @@
1
- <?php
2
  return;
3
  }
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  return;
2
  }
3
 
4
+ <?php
5
+ function sg_popup_admin_style($hook) {
6
+ if ('toplevel_page_PopupBuilder' != $hook && 'popup-builder_page_create-popup' != $hook && 'popup-builder_page_edit-popup' != $hook && 'popup-builder_page_sgPopupMenu' != $hook) {
7
+ return;
8
+ }
9
+ wp_register_style('sg_popup_style', SG_APP_POPUP_URL . '/style/sg_popup_style.css', false, '1.0.0');
10
+ wp_enqueue_style('sg_popup_style');
11
+ wp_register_style('sg_popup_animate', SG_APP_POPUP_URL . '/style/animate.css');
12
+ wp_enqueue_style('sg_popup_animate');
13
+
14
+ }
15
+ add_action('admin_enqueue_scripts', 'sg_popup_admin_style');
16
+
17
+ function sg_popup_style($hook) {
18
+ if ('admin.php' != $hook && 'post.php' != $hook) {
19
+ return;
20
+ }
21
+ wp_register_style('sg_popup_animate', SG_APP_POPUP_URL . '/style/animate.css');
22
+ wp_enqueue_style('sg_popup_animate');
23
+
24
+ wp_register_style('sg_popup_style', SG_APP_POPUP_URL . '/style/sg_popup_style.css', false, '1.0.0');
25
+ wp_enqueue_style('sg_popup_style');
26
+ }
27
+
28
+ add_action('admin_enqueue_scripts', 'sg_popup_style');
29
+ add_action( 'admin_enqueue_scripts', 'mw_enqueue_color_picker' );
30
+ function mw_enqueue_color_picker( $hook_suffix ) {
31
+ if('popup-builder_page_edit-popup' != $hook_suffix) {
32
+ return;
33
+ }
34
+ wp_enqueue_style( 'wp-color-picker' );
35
+ wp_enqueue_script( 'my-script-handle', plugins_url('javascript/sg_colorpicker.js',dirname(__FILE__)), array( 'wp-color-picker' ) );
36
+ }
style/sgcolorbox/colorbox1.css CHANGED
@@ -1,70 +1 @@
1
- /*
2
- Colorbox Core Style:
3
- The following CSS is consistent between example themes and should not be altered.
4
- */
5
- #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
- #cboxWrapper {max-width:none;}
7
- #cboxOverlay{position:fixed; width:100%; height:100%;}
8
- #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
- #cboxContent{position:relative;}
10
- #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11
- #cboxTitle{margin:0;}
12
- #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13
- #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14
- .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15
- .cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16
- #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17
-
18
- /*
19
- User Style:
20
- Change the following styles to modify the appearance of Colorbox. They are
21
- ordered & tabbed in a way that represents the nesting of the generated HTML.
22
- */
23
- #cboxOverlay{background:url(../../img/colorbox1/overlay.png) repeat 0 0; opacity: 0.9; filter: alpha(opacity = 90);}
24
- #colorbox{outline:0;}
25
- #cboxTopLeft{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -101px 0;}
26
- #cboxTopRight{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -130px 0;}
27
- #cboxBottomLeft{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -101px -29px;}
28
- #cboxBottomRight{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -130px -29px;}
29
- #cboxMiddleLeft{width:21px; background:url(../../img/colorbox1/controls.png) left top repeat-y;}
30
- #cboxMiddleRight{width:21px; background:url(../../img/colorbox1/controls.png) right top repeat-y;}
31
- #cboxTopCenter{height:21px; background:url(../../img/colorbox1/border.png) 0 0 repeat-x;}
32
- #cboxBottomCenter{height:21px; background:url(../../img/colorbox1/border.png) 0 -29px repeat-x;}
33
- #cboxContent{background:#fff; overflow:hidden;}
34
- .cboxIframe{background:#fff;}
35
- #cboxError{padding:50px; border:1px solid #ccc;}
36
- #cboxLoadedContent{margin-bottom:28px;}
37
- #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
38
- #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
39
- #cboxLoadingOverlay{background:url(../../img/colorbox1/loading_background.png) no-repeat center center;}
40
- #cboxLoadingGraphic{background:url(../../img/colorbox1/loading.gif) no-repeat center center;}
41
-
42
- /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
43
- #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
44
-
45
- /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
46
- #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
47
-
48
- #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
49
- #cboxPrevious{position:absolute; bottom:0; left:0; background:url(../../img/colorbox1/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
50
- #cboxPrevious:hover{background-position:-75px -25px;}
51
- #cboxNext{position:absolute; bottom:0; left:27px; background:url(../../img/colorbox1/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
52
- #cboxNext:hover{background-position:-50px -25px;}
53
- #cboxClose{position:absolute; bottom:0; right:0; background:url(../../img/colorbox1/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
54
- #cboxClose:hover{background-position:-25px -25px;}
55
-
56
- /*
57
- The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
58
- when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
59
- See: http://jacklmoore.com/notes/ie-transparency-problems/
60
- */
61
- .cboxIE #cboxTopLeft,
62
- .cboxIE #cboxTopCenter,
63
- .cboxIE #cboxTopRight,
64
- .cboxIE #cboxBottomLeft,
65
- .cboxIE #cboxBottomCenter,
66
- .cboxIE #cboxBottomRight,
67
- .cboxIE #cboxMiddleLeft,
68
- .cboxIE #cboxMiddleRight {
69
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
70
- }
71
  Colorbox Core Style:
72
  The following CSS is consistent between example themes and should not be altered.
73
  User Style:
74
  Change the following styles to modify the appearance of Colorbox. They are
75
  ordered & tabbed in a way that represents the nesting of the generated HTML.
76
  #sgcboxTopLeft{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -101px 0;}
77
  #sgcboxTopRight{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -130px 0;}
78
  #sgcboxBottomLeft{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -101px -29px;}
79
  #sgcboxBottomRight{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -130px -29px;}
80
  #sgcboxMiddleLeft{width:21px; background:url(../../img/colorbox1/controls.png) left top repeat-y;}
81
  #sgcboxMiddleRight{width:21px; background:url(../../img/colorbox1/controls.png) right top repeat-y;}
82
  #sgcboxTopCenter{height:21px; background:url(../../img/colorbox1/border.png) 0 0 repeat-x;}
83
  #sgcboxBottomCenter{height:21px; background:url(../../img/colorbox1/border.png) 0 -29px repeat-x;}
84
  #sgcboxContent{background:#fff; overflow:hidden;}
85
  .sgcboxIframe{background:#fff;}
86
  #sgcboxError{padding:50px; border:1px solid #ccc;}
87
  #sgcboxLoadedContent{margin-bottom:28px;}
88
  #sgcboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
89
  #sgcboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
90
  #sgcboxLoadingOverlay{background:url(../../img/colorbox1/loading_background.png) no-repeat center center;}
91
  #sgcboxLoadingGraphic{background:url(../../img/colorbox1/loading.gif) no-repeat center center;}
92
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
93
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
94
 
95
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
96
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
97
  #sgcboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
98
  #sgcboxPrevious{position:absolute; bottom:0; left:0; background:url(../../img/colorbox1/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
99
  #sgcboxPrevious:hover{background-position:-75px -25px;}
100
  #sgcboxNext{position:absolute; bottom:0; left:27px; background:url(../../img/colorbox1/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
101
  #sgcboxNext:hover{background-position:-50px -25px;}
102
  #sgcboxClose{position:absolute; bottom:0; right:0; background:url(../../img/colorbox1/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
103
  #sgcboxClose:hover{background-position:-25px -25px;}
104
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
105
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
106
  See: http://jacklmoore.com/notes/ie-transparency-problems/
107
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
1
+ /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  Colorbox Core Style:
3
  The following CSS is consistent between example themes and should not be altered.
4
  User Style:
5
  Change the following styles to modify the appearance of Colorbox. They are
6
  ordered & tabbed in a way that represents the nesting of the generated HTML.
7
  #sgcboxTopLeft{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -101px 0;}
8
  #sgcboxTopRight{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -130px 0;}
9
  #sgcboxBottomLeft{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -101px -29px;}
10
  #sgcboxBottomRight{width:21px; height:21px; background:url(../../img/colorbox1/controls.png) no-repeat -130px -29px;}
11
  #sgcboxMiddleLeft{width:21px; background:url(../../img/colorbox1/controls.png) left top repeat-y;}
12
  #sgcboxMiddleRight{width:21px; background:url(../../img/colorbox1/controls.png) right top repeat-y;}
13
  #sgcboxTopCenter{height:21px; background:url(../../img/colorbox1/border.png) 0 0 repeat-x;}
14
  #sgcboxBottomCenter{height:21px; background:url(../../img/colorbox1/border.png) 0 -29px repeat-x;}
15
  #sgcboxContent{background:#fff; overflow:hidden;}
16
  .sgcboxIframe{background:#fff;}
17
  #sgcboxError{padding:50px; border:1px solid #ccc;}
18
  #sgcboxLoadedContent{margin-bottom:28px;}
19
  #sgcboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
20
  #sgcboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
21
  #sgcboxLoadingOverlay{background:url(../../img/colorbox1/loading_background.png) no-repeat center center;}
22
  #sgcboxLoadingGraphic{background:url(../../img/colorbox1/loading.gif) no-repeat center center;}
23
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
24
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
25
 
26
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
27
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
28
  #sgcboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
29
  #sgcboxPrevious{position:absolute; bottom:0; left:0; background:url(../../img/colorbox1/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
30
  #sgcboxPrevious:hover{background-position:-75px -25px;}
31
  #sgcboxNext{position:absolute; bottom:0; left:27px; background:url(../../img/colorbox1/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
32
  #sgcboxNext:hover{background-position:-50px -25px;}
33
  #sgcboxClose{position:absolute; bottom:0; right:0; background:url(../../img/colorbox1/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
34
  #sgcboxClose:hover{background-position:-25px -25px;}
35
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
36
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
37
  See: http://jacklmoore.com/notes/ie-transparency-problems/
38
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
style/sgcolorbox/colorbox2.css CHANGED
@@ -1,50 +1 @@
1
- /*
2
- Colorbox Core Style:
3
- The following CSS is consistent between example themes and should not be altered.
4
- */
5
- #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
- #cboxWrapper {max-width:none;}
7
- #cboxOverlay{position:fixed; width:100%; height:100%;}
8
- #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
- #cboxContent{position:relative;}
10
- #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11
- #cboxTitle{margin:0;}
12
- #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13
- #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14
- .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15
- .cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16
- #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17
-
18
- /*
19
- User Style:
20
- Change the following styles to modify the appearance of Colorbox. They are
21
- ordered & tabbed in a way that represents the nesting of the generated HTML.
22
- */
23
- #cboxOverlay{background:#fff; opacity: 0.9; filter: alpha(opacity = 90);}
24
- #colorbox{outline:0;}
25
- #cboxContent{margin-top:32px; overflow:visible; background:#000;}
26
- .cboxIframe{background:#fff;}
27
- #cboxError{padding:50px; border:1px solid #ccc;}
28
- #cboxLoadedContent{background:#000; padding:1px;}
29
- #cboxLoadingGraphic{background:url(../../img/colorbox2/loading.gif) no-repeat center center;}
30
- #cboxLoadingOverlay{background:#000;}
31
- #cboxTitle{position:absolute; top:-22px; left:0; color:#000;}
32
- #cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
33
-
34
- /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
35
- #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(../../img/colorbox2/controls.png) no-repeat 0 0;}
36
-
37
- /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
38
- #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
39
-
40
- #cboxPrevious{background-position:0px 0px; right:44px;}
41
- #cboxPrevious:hover{background-position:0px -25px;}
42
- #cboxNext{background-position:-25px 0px; right:22px;}
43
- #cboxNext:hover{background-position:-25px -25px;}
44
- #cboxClose{background-position:-50px 0px; right:0;}
45
- #cboxClose:hover{background-position:-50px -25px;}
46
- .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
47
- .cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}
48
- .cboxSlideshow_on #cboxSlideshow:hover{background-position:-100px -25px;}
49
- .cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;}
50
- .cboxSlideshow_off #cboxSlideshow:hover{background-position:-75px -25px;}
51
  Colorbox Core Style:
52
  The following CSS is consistent between example themes and should not be altered.
53
  User Style:
54
  Change the following styles to modify the appearance of Colorbox. They are
55
  ordered & tabbed in a way that represents the nesting of the generated HTML.
56
  #sgcboxContent{margin-top:32px; overflow:visible; background:#000;}
57
  .sgcboxIframe{background:#fff;}
58
  #sgcboxError{padding:50px; border:1px solid #ccc;}
59
  #sgcboxLoadedContent{background:#000; padding:1px;}
60
  #sgcboxLoadingGraphic{background:url(../../img/colorbox2/loading.gif) no-repeat center center;}
61
  #sgcboxLoadingOverlay{background:#000;}
62
  #sgcboxTitle{position:absolute; top:-22px; left:0; color:#000;}
63
  #sgcboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
64
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
65
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(../../img/colorbox2/controls.png) no-repeat 0 0;}
66
 
67
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
68
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
69
  #sgcboxPrevious{background-position:0px 0px; right:44px;}
70
  #sgcboxPrevious:hover{background-position:0px -25px;}
71
  #sgcboxNext{background-position:-25px 0px; right:22px;}
72
  #sgcboxNext:hover{background-position:-25px -25px;}
73
  #sgcboxClose{background-position:-50px 0px; right:0;}
74
  #sgcboxClose:hover{background-position:-50px -25px;}
75
  .sgcboxSlideshow_on #sgcboxPrevious, .sgcboxSlideshow_off #sgcboxPrevious{right:66px;}
76
  .sgcboxSlideshow_on #sgcboxSlideshow{background-position:-75px -25px; right:44px;}
77
  .sgcboxSlideshow_on #sgcboxSlideshow:hover{background-position:-100px -25px;}
78
  .sgcboxSlideshow_off #sgcboxSlideshow{background-position:-100px 0px; right:44px;}
79
  .sgcboxSlideshow_off #sgcboxSlideshow:hover{background-position:-75px -25px;}
1
+ /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  Colorbox Core Style:
3
  The following CSS is consistent between example themes and should not be altered.
4
  User Style:
5
  Change the following styles to modify the appearance of Colorbox. They are
6
  ordered & tabbed in a way that represents the nesting of the generated HTML.
7
  #sgcboxContent{margin-top:32px; overflow:visible; background:#000;}
8
  .sgcboxIframe{background:#fff;}
9
  #sgcboxError{padding:50px; border:1px solid #ccc;}
10
  #sgcboxLoadedContent{background:#000; padding:1px;}
11
  #sgcboxLoadingGraphic{background:url(../../img/colorbox2/loading.gif) no-repeat center center;}
12
  #sgcboxLoadingOverlay{background:#000;}
13
  #sgcboxTitle{position:absolute; top:-22px; left:0; color:#000;}
14
  #sgcboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
15
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
16
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(../../img/colorbox2/controls.png) no-repeat 0 0;}
17
 
18
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
19
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
20
  #sgcboxPrevious{background-position:0px 0px; right:44px;}
21
  #sgcboxPrevious:hover{background-position:0px -25px;}
22
  #sgcboxNext{background-position:-25px 0px; right:22px;}
23
  #sgcboxNext:hover{background-position:-25px -25px;}
24
  #sgcboxClose{background-position:-50px 0px; right:0;}
25
  #sgcboxClose:hover{background-position:-50px -25px;}
26
  .sgcboxSlideshow_on #sgcboxPrevious, .sgcboxSlideshow_off #sgcboxPrevious{right:66px;}
27
  .sgcboxSlideshow_on #sgcboxSlideshow{background-position:-75px -25px; right:44px;}
28
  .sgcboxSlideshow_on #sgcboxSlideshow:hover{background-position:-100px -25px;}
29
  .sgcboxSlideshow_off #sgcboxSlideshow{background-position:-100px 0px; right:44px;}
30
  .sgcboxSlideshow_off #sgcboxSlideshow:hover{background-position:-75px -25px;}
style/sgcolorbox/colorbox3.css CHANGED
@@ -1,45 +1 @@
1
- /*
2
- Colorbox Core Style:
3
- The following CSS is consistent between example themes and should not be altered.
4
- */
5
- #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
- #cboxWrapper {max-width:none;}
7
- #cboxOverlay{position:fixed; width:100%; height:100%;}
8
- #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
- #cboxContent{position:relative;}
10
- #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11
- #cboxTitle{margin:0;}
12
- #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13
- #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14
- .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15
- .cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16
- #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17
-
18
- /*
19
- User Style:
20
- Change the following styles to modify the appearance of Colorbox. They are
21
- ordered & tabbed in a way that represents the nesting of the generated HTML.
22
- */
23
- #cboxOverlay{background:#000; opacity: 0.9; filter: alpha(opacity = 90);}
24
- #colorbox{outline:0;}
25
- #cboxContent{margin-top:20px;background:#000;}
26
- .cboxIframe{background:#fff;}
27
- #cboxError{padding:50px; border:1px solid #ccc;}
28
- #cboxLoadedContent{border:5px solid #000; background:#fff;}
29
- #cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
30
- #cboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;}
31
- #cboxLoadingGraphic{background:url(../../img/colorbox3/loading.gif) no-repeat center center;}
32
-
33
- /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
34
- #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
35
-
36
- /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
37
- #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
38
-
39
- #cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
40
- #cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(../../img/colorbox3/controls.png) no-repeat top left; width:28px; height:65px; text-indent:-9999px;}
41
- #cboxPrevious:hover{background-position:bottom left;}
42
- #cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(../../img/colorbox3/controls.png) no-repeat top right; width:28px; height:65px; text-indent:-9999px;}
43
- #cboxNext:hover{background-position:bottom right;}
44
- #cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(../../img/colorbox3/controls.png) no-repeat top center; width:38px; height:19px; text-indent:-9999px;}
45
- #cboxClose:hover{background-position:bottom center;}
46
  Colorbox Core Style:
47
  The following CSS is consistent between example themes and should not be altered.
48
  User Style:
49
  Change the following styles to modify the appearance of Colorbox. They are
50
  ordered & tabbed in a way that represents the nesting of the generated HTML.
51
  #sgcboxContent{margin-top:20px;background:#000;}
52
  .sgcboxIframe{background:#fff;}
53
  #sgcboxError{padding:50px; border:1px solid #ccc;}
54
  #sgcboxLoadedContent{border:5px solid #000; background:#fff;}
55
  #sgcboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
56
  #sgcboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;}
57
  #sgcboxLoadingGraphic{background:url(../../img/colorbox3/loading.gif) no-repeat center center;}
58
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
59
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
60
 
61
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
62
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
63
 
64
  #sgcboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
65
  #sgcboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(../../img/colorbox3/controls.png) no-repeat top left; width:28px; height:65px; text-indent:-9999px;}
66
  #sgcboxPrevious:hover{background-position:bottom left;}
67
  #sgcboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(../../img/colorbox3/controls.png) no-repeat top right; width:28px; height:65px; text-indent:-9999px;}
68
  #sgcboxNext:hover{background-position:bottom right;}
69
  #sgcboxClose{position:absolute; top:5px; right:5px; display:block; background:url(../../img/colorbox3/controls.png) no-repeat top center; width:38px; height:19px; text-indent:-9999px;}
70
  #sgcboxClose:hover{background-position:bottom center;}
1
+ /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  Colorbox Core Style:
3
  The following CSS is consistent between example themes and should not be altered.
4
  User Style:
5
  Change the following styles to modify the appearance of Colorbox. They are
6
  ordered & tabbed in a way that represents the nesting of the generated HTML.
7
  #sgcboxContent{margin-top:20px;background:#000;}
8
  .sgcboxIframe{background:#fff;}
9
  #sgcboxError{padding:50px; border:1px solid #ccc;}
10
  #sgcboxLoadedContent{border:5px solid #000; background:#fff;}
11
  #sgcboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
12
  #sgcboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;}
13
  #sgcboxLoadingGraphic{background:url(../../img/colorbox3/loading.gif) no-repeat center center;}
14
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
15
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
16
 
17
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
18
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
19
 
20
  #sgcboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
21
  #sgcboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(../../img/colorbox3/controls.png) no-repeat top left; width:28px; height:65px; text-indent:-9999px;}
22
  #sgcboxPrevious:hover{background-position:bottom left;}
23
  #sgcboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(../../img/colorbox3/controls.png) no-repeat top right; width:28px; height:65px; text-indent:-9999px;}
24
  #sgcboxNext:hover{background-position:bottom right;}
25
  #sgcboxClose{position:absolute; top:5px; right:5px; display:block; background:url(../../img/colorbox3/controls.png) no-repeat top center; width:38px; height:19px; text-indent:-9999px;}
26
  #sgcboxClose:hover{background-position:bottom center;}
style/sgcolorbox/colorbox4.css CHANGED
@@ -1,66 +1 @@
1
- /*
2
- Colorbox Core Style:
3
- The following CSS is consistent between example themes and should not be altered.
4
- */
5
- #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
- #cboxWrapper {max-width:none;}
7
- #cboxOverlay{position:fixed; width:100%; height:100%;}
8
- #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
- #cboxContent{position:relative;}
10
- #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11
- #cboxTitle{margin:0;}
12
- #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13
- #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14
- .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15
- .cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16
- #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17
-
18
- /*
19
- User Style:
20
- Change the following styles to modify the appearance of Colorbox. They are
21
- ordered & tabbed in a way that represents the nesting of the generated HTML.
22
- */
23
- #cboxOverlay{background:#fff; opacity: 0.9; filter: alpha(opacity = 90);}
24
- #colorbox{outline:0;}
25
- #cboxTopLeft{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat 0 0;}
26
- #cboxTopCenter{height:25px; background:url(../../img/colorbox4/border1.png) repeat-x 0 -50px;}
27
- #cboxTopRight{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat -25px 0;}
28
- #cboxBottomLeft{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat 0 -25px;}
29
- #cboxBottomCenter{height:25px; background:url(../../img/colorbox4/border1.png) repeat-x 0 -75px;}
30
- #cboxBottomRight{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat -25px -25px;}
31
- #cboxMiddleLeft{width:25px; background:url(../../img/colorbox4/border2.png) repeat-y 0 0;}
32
- #cboxMiddleRight{width:25px; background:url(../../img/colorbox4/border2.png) repeat-y -25px 0;}
33
- #cboxContent{background:#fff; overflow:hidden;}
34
- .cboxIframe{background:#fff;}
35
- #cboxError{padding:50px; border:1px solid #ccc;}
36
- #cboxLoadedContent{margin-bottom:20px;}
37
- #cboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;}
38
- #cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
39
- #cboxLoadingOverlay{background:#fff url(../../img/colorbox4/loading.gif) no-repeat 5px 5px;}
40
-
41
- /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
42
- #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
43
-
44
- /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
45
- #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
46
-
47
- #cboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
48
- #cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
49
- #cboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
50
- #cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
51
-
52
- /*
53
- The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
54
- when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
55
- See: http://jacklmoore.com/notes/ie-transparency-problems/
56
- */
57
- .cboxIE #cboxTopLeft,
58
- .cboxIE #cboxTopCenter,
59
- .cboxIE #cboxTopRight,
60
- .cboxIE #cboxBottomLeft,
61
- .cboxIE #cboxBottomCenter,
62
- .cboxIE #cboxBottomRight,
63
- .cboxIE #cboxMiddleLeft,
64
- .cboxIE #cboxMiddleRight {
65
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
66
- }
67
  Colorbox Core Style:
68
  The following CSS is consistent between example themes and should not be altered.
69
  User Style:
70
  Change the following styles to modify the appearance of Colorbox. They are
71
  ordered & tabbed in a way that represents the nesting of the generated HTML.
72
  #sgcboxTopLeft{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat 0 0;}
73
  #sgcboxTopCenter{height:25px; background:url(../../img/colorbox4/border1.png) repeat-x 0 -50px;}
74
  #sgcboxTopRight{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat -25px 0;}
75
  #sgcboxBottomLeft{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat 0 -25px;}
76
  #sgcboxBottomCenter{height:25px; background:url(../../img/colorbox4/border1.png) repeat-x 0 -75px;}
77
  #sgcboxBottomRight{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat -25px -25px;}
78
  #sgcboxMiddleLeft{width:25px; background:url(../../img/colorbox4/border2.png) repeat-y 0 0;}
79
  #sgcboxMiddleRight{width:25px; background:url(../../img/colorbox4/border2.png) repeat-y -25px 0;}
80
  #sgcboxContent{background:#fff; overflow:hidden;}
81
  .sgcboxIframe{background:#fff;}
82
  #sgcboxError{padding:50px; border:1px solid #ccc;}
83
  #sgcboxLoadedContent{margin-bottom:20px;}
84
  #sgcboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;}
85
  #sgcboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
86
  #sgcboxLoadingOverlay{background:#fff url(../../img/colorbox4/loading.gif) no-repeat 5px 5px;}
87
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
88
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
89
 
90
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
91
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
92
  #sgcboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
93
  #sgcboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
94
  #sgcboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
95
  #sgcboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
96
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
97
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
98
  See: http://jacklmoore.com/notes/ie-transparency-problems/
99
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
1
+ /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  Colorbox Core Style:
3
  The following CSS is consistent between example themes and should not be altered.
4
  User Style:
5
  Change the following styles to modify the appearance of Colorbox. They are
6
  ordered & tabbed in a way that represents the nesting of the generated HTML.
7
  #sgcboxTopLeft{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat 0 0;}
8
  #sgcboxTopCenter{height:25px; background:url(../../img/colorbox4/border1.png) repeat-x 0 -50px;}
9
  #sgcboxTopRight{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat -25px 0;}
10
  #sgcboxBottomLeft{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat 0 -25px;}
11
  #sgcboxBottomCenter{height:25px; background:url(../../img/colorbox4/border1.png) repeat-x 0 -75px;}
12
  #sgcboxBottomRight{width:25px; height:25px; background:url(../../img/colorbox4/border1.png) no-repeat -25px -25px;}
13
  #sgcboxMiddleLeft{width:25px; background:url(../../img/colorbox4/border2.png) repeat-y 0 0;}
14
  #sgcboxMiddleRight{width:25px; background:url(../../img/colorbox4/border2.png) repeat-y -25px 0;}
15
  #sgcboxContent{background:#fff; overflow:hidden;}
16
  .sgcboxIframe{background:#fff;}
17
  #sgcboxError{padding:50px; border:1px solid #ccc;}
18
  #sgcboxLoadedContent{margin-bottom:20px;}
19
  #sgcboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;}
20
  #sgcboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
21
  #sgcboxLoadingOverlay{background:#fff url(../../img/colorbox4/loading.gif) no-repeat 5px 5px;}
22
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
23
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
24
 
25
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
26
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
27
  #sgcboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
28
  #sgcboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
29
  #sgcboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
30
  #sgcboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
31
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
32
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
33
  See: http://jacklmoore.com/notes/ie-transparency-problems/
34
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
style/sgcolorbox/colorbox5.css CHANGED
@@ -1,59 +1 @@
1
- /*
2
- Colorbox Core Style:
3
- The following CSS is consistent between example themes and should not be altered.
4
- */
5
- #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
- #cboxWrapper {max-width:none;}
7
- #cboxOverlay{position:fixed; width:100%; height:100%;}
8
- #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
- #cboxContent{position:relative;}
10
- #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11
- #cboxTitle{margin:0;}
12
- #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13
- #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14
- .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15
- .cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16
- #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17
-
18
-
19
- /*
20
- User Style:
21
- Change the following styles to modify the appearance of Colorbox. They are
22
- ordered & tabbed in a way that represents the nesting of the generated HTML.
23
- */
24
- #cboxOverlay{background:#000; opacity: 0.9; filter: alpha(opacity = 90);}
25
- #colorbox{outline:0;}
26
- #cboxTopLeft{width:14px; height:14px; background:url(../../img/colorbox5/controls.png) no-repeat 0 0;}
27
- #cboxTopCenter{height:14px; background:url(../../img/colorbox5/border.png) repeat-x top left;}
28
- #cboxTopRight{width:14px; height:14px; background:url(../../img/colorbox5/controls.png) no-repeat -36px 0;}
29
- #cboxBottomLeft{width:14px; height:43px; background:url(../../img/colorbox5/controls.png) no-repeat 0 -32px;}
30
- #cboxBottomCenter{height:43px; background:url(../../img/colorbox5/border.png) repeat-x bottom left;}
31
- #cboxBottomRight{width:14px; height:43px; background:url(../../img/colorbox5/controls.png) no-repeat -36px -32px;}
32
- #cboxMiddleLeft{width:14px; background:url(../../img/colorbox5/controls.png) repeat-y -175px 0;}
33
- #cboxMiddleRight{width:14px; background:url(../../img/colorbox5/controls.png) repeat-y -211px 0;}
34
- #cboxContent{background:#fff; overflow:visible;}
35
- .cboxIframe{background:#fff;}
36
- #cboxError{padding:50px; border:1px solid #ccc;}
37
- #cboxLoadedContent{margin-bottom:5px;}
38
- #cboxLoadingOverlay{background:url(../../img/colorbox5/loading_background.png) no-repeat center center;}
39
- #cboxLoadingGraphic{background:url(../../img/colorbox5/loading.gif) no-repeat center center;}
40
- #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
41
- #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
42
-
43
- /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
44
- #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; position:absolute; bottom:-29px; background:url(../../img/colorbox5/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
45
-
46
- /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
47
- #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
48
-
49
- #cboxPrevious{left:0px; background-position: -51px -25px;}
50
- #cboxPrevious:hover{background-position:-51px 0px;}
51
- #cboxNext{left:27px; background-position:-75px -25px;}
52
- #cboxNext:hover{background-position:-75px 0px;}
53
- #cboxClose{right:0; background-position:-100px -25px;}
54
- #cboxClose:hover{background-position:-100px 0px;}
55
-
56
- .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;}
57
- .cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;}
58
- .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
59
- .cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;}
60
  Colorbox Core Style:
61
  The following CSS is consistent between example themes and should not be altered.
62
  User Style:
63
  Change the following styles to modify the appearance of Colorbox. They are
64
  ordered & tabbed in a way that represents the nesting of the generated HTML.
65
  #sgcboxTopLeft{width:14px; height:14px; background:url(../../img/colorbox5/controls.png) no-repeat 0 0;}
66
  #sgcboxTopCenter{height:14px; background:url(../../img/colorbox5/border.png) repeat-x top left;}
67
  #sgcboxTopRight{width:14px; height:14px; background:url(../../img/colorbox5/controls.png) no-repeat -36px 0;}
68
  #sgcboxBottomLeft{width:14px; height:43px; background:url(../../img/colorbox5/controls.png) no-repeat 0 -32px;}
69
  #sgcboxBottomCenter{height:43px; background:url(../../img/colorbox5/border.png) repeat-x bottom left;}
70
  #sgcboxBottomRight{width:14px; height:43px; background:url(../../img/colorbox5/controls.png) no-repeat -36px -32px;}
71
  #sgcboxMiddleLeft{width:14px; background:url(../../img/colorbox5/controls.png) repeat-y -175px 0;}
72
  #sgcboxMiddleRight{width:14px; background:url(../../img/colorbox5/controls.png) repeat-y -211px 0;}
73
  #sgcboxContent{background:#fff; overflow:visible;}
74
  .sgcboxIframe{background:#fff;}
75
  #sgcboxError{padding:50px; border:1px solid #ccc;}
76
  #sgcboxLoadedContent{margin-bottom:5px;}
77
  #sgcboxLoadingOverlay{background:url(../../img/colorbox5/loading_background.png) no-repeat center center;}
78
  #sgcboxLoadingGraphic{background:url(../../img/colorbox5/loading.gif) no-repeat center center;}
79
  #sgcboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
80
  #sgcboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
81
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
82
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; position:absolute; bottom:-29px; background:url(../../img/colorbox5/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
83
 
84
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
85
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
86
  #sgcboxPrevious{left:0px; background-position: -51px -25px;}
87
  #sgcboxPrevious:hover{background-position:-51px 0px;}
88
  #sgcboxNext{left:27px; background-position:-75px -25px;}
89
  #sgcboxNext:hover{background-position:-75px 0px;}
90
  #sgcboxClose{right:0; background-position:-100px -25px;}
91
  #sgcboxClose:hover{background-position:-100px 0px;}
92
  .sgcboxSlideshow_on #sgcboxSlideshow{background-position:-125px 0px; right:27px;}
93
  .sgcboxSlideshow_on #sgcboxSlideshow:hover{background-position:-150px 0px;}
94
  .sgcboxSlideshow_off #sgcboxSlideshow{background-position:-150px -25px; right:27px;}
95
  .sgcboxSlideshow_off #sgcboxSlideshow:hover{background-position:-125px 0px;}
1
+ /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  Colorbox Core Style:
3
  The following CSS is consistent between example themes and should not be altered.
4
  User Style:
5
  Change the following styles to modify the appearance of Colorbox. They are
6
  ordered & tabbed in a way that represents the nesting of the generated HTML.
7
  #sgcboxTopLeft{width:14px; height:14px; background:url(../../img/colorbox5/controls.png) no-repeat 0 0;}
8
  #sgcboxTopCenter{height:14px; background:url(../../img/colorbox5/border.png) repeat-x top left;}
9
  #sgcboxTopRight{width:14px; height:14px; background:url(../../img/colorbox5/controls.png) no-repeat -36px 0;}
10
  #sgcboxBottomLeft{width:14px; height:43px; background:url(../../img/colorbox5/controls.png) no-repeat 0 -32px;}
11
  #sgcboxBottomCenter{height:43px; background:url(../../img/colorbox5/border.png) repeat-x bottom left;}
12
  #sgcboxBottomRight{width:14px; height:43px; background:url(../../img/colorbox5/controls.png) no-repeat -36px -32px;}
13
  #sgcboxMiddleLeft{width:14px; background:url(../../img/colorbox5/controls.png) repeat-y -175px 0;}
14
  #sgcboxMiddleRight{width:14px; background:url(../../img/colorbox5/controls.png) repeat-y -211px 0;}
15
  #sgcboxContent{background:#fff; overflow:visible;}
16
  .sgcboxIframe{background:#fff;}
17
  #sgcboxError{padding:50px; border:1px solid #ccc;}
18
  #sgcboxLoadedContent{margin-bottom:5px;}
19
  #sgcboxLoadingOverlay{background:url(../../img/colorbox5/loading_background.png) no-repeat center center;}
20
  #sgcboxLoadingGraphic{background:url(../../img/colorbox5/loading.gif) no-repeat center center;}
21
  #sgcboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
22
  #sgcboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
23
  /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
24
  #sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow, #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; position:absolute; bottom:-29px; background:url(../../img/colorbox5/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
25
 
26
  /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
27
  #sgcboxPrevious:active, #sgcboxNext:active, #sgcboxSlideshow:active, #sgcboxClose:active {outline:0;}
28
  #sgcboxPrevious{left:0px; background-position: -51px -25px;}
29
  #sgcboxPrevious:hover{background-position:-51px 0px;}
30
  #sgcboxNext{left:27px; background-position:-75px -25px;}
31
  #sgcboxNext:hover{background-position:-75px 0px;}
32
  #sgcboxClose{right:0; background-position:-100px -25px;}
33
  #sgcboxClose:hover{background-position:-100px 0px;}
34
  .sgcboxSlideshow_on #sgcboxSlideshow{background-position:-125px 0px; right:27px;}
35
  .sgcboxSlideshow_on #sgcboxSlideshow:hover{background-position:-150px 0px;}
36
  .sgcboxSlideshow_off #sgcboxSlideshow{background-position:-150px -25px; right:27px;}
37
  .sgcboxSlideshow_off #sgcboxSlideshow:hover{background-position:-125px 0px;}