WPFront Notification Bar - Version 1.4

Version Description

  • Display on Scroll option added.
  • Date filters added.
Download this release

Release Info

Developer syammohanm
Plugin Icon 128x128 WPFront Notification Bar
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

Files changed (25) hide show
  1. classes/base/class-wpfront-base.php +6 -3
  2. classes/class-wpfront-notification-bar-options.php +16 -1
  3. classes/class-wpfront-notification-bar.php +26 -2
  4. css/options.css +5 -0
  5. jquery-plugins/jquery-ui/smoothness/images/animated-overlay.gif +0 -0
  6. jquery-plugins/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  7. jquery-plugins/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  8. jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  9. jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  10. jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  11. jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  12. jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  13. jquery-plugins/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  14. jquery-plugins/jquery-ui/smoothness/images/ui-icons_222222_256x240.png +0 -0
  15. jquery-plugins/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  16. jquery-plugins/jquery-ui/smoothness/images/ui-icons_454545_256x240.png +0 -0
  17. jquery-plugins/jquery-ui/smoothness/images/ui-icons_888888_256x240.png +0 -0
  18. jquery-plugins/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  19. jquery-plugins/jquery-ui/smoothness/jquery-ui-1.10.4.custom.min.css +7 -0
  20. js/wpfront-notification-bar.js +39 -10
  21. languages/wpfront-notification-bar.mo +0 -0
  22. languages/wpfront-notification-bar.po +87 -46
  23. readme.txt +12 -2
  24. templates/options-template.php +38 -2
  25. wpfront-notification-bar.php +1 -1
classes/base/class-wpfront-base.php CHANGED
@@ -176,6 +176,8 @@ if (!class_exists('WPFront_Base')) {
176
  <a href="http://wordpress.org/support/view/plugin-reviews/' . $this->plugin_slug . '" target="_blank">' . $this->__('Write Review') . '</a>
177
  |
178
  <a href="mailto:syam@wpfront.com">' . $this->__('Contact Me (syam@wpfront.com)') . '</a>
 
 
179
  ';
180
  echo '</form>';
181
  echo '</div>';
@@ -196,13 +198,14 @@ if (!class_exists('WPFront_Base')) {
196
  }
197
  }
198
 
199
- public function pluginURL(){
200
  return $this->pluginURLRoot;
201
  }
202
-
203
- public function pluginDIR(){
204
  return $this->pluginDIRRoot;
205
  }
 
206
  }
207
 
208
  }
176
  <a href="http://wordpress.org/support/view/plugin-reviews/' . $this->plugin_slug . '" target="_blank">' . $this->__('Write Review') . '</a>
177
  |
178
  <a href="mailto:syam@wpfront.com">' . $this->__('Contact Me (syam@wpfront.com)') . '</a>
179
+ |
180
+ <a href="http://wpfront.com/donate/" target="_blank">' . $this->__('Buy me a Beer or Coffee') . '</a>
181
  ';
182
  echo '</form>';
183
  echo '</div>';
198
  }
199
  }
200
 
201
+ public function pluginURL() {
202
  return $this->pluginURLRoot;
203
  }
204
+
205
+ public function pluginDIR() {
206
  return $this->pluginDIRRoot;
207
  }
208
+
209
  }
210
 
211
  }
classes/class-wpfront-notification-bar-options.php CHANGED
@@ -75,6 +75,10 @@ if (!class_exists('WPFront_Notification_Bar_Options')) {
75
  $this->addOption('close_button_color_x', 'string', '#000000', array($this, 'validate_color'));
76
  $this->addOption('display_roles', 'int', '1', array($this, 'validate_display_roles'))->__('Display for User Roles');
77
  $this->addOption('include_roles', 'string', array(), array($this, 'validate_include_roles'));
 
 
 
 
78
  }
79
 
80
  //validation function
@@ -127,10 +131,21 @@ if (!class_exists('WPFront_Notification_Bar_Options')) {
127
 
128
  protected function validate_include_roles($arg) {
129
  $obj = json_decode($arg);
130
- if(!is_array($obj))
131
  return array();
132
  return $obj;
133
  }
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  }
136
 
75
  $this->addOption('close_button_color_x', 'string', '#000000', array($this, 'validate_color'));
76
  $this->addOption('display_roles', 'int', '1', array($this, 'validate_display_roles'))->__('Display for User Roles');
77
  $this->addOption('include_roles', 'string', array(), array($this, 'validate_include_roles'));
78
+ $this->addOption('display_scroll', 'bit', false)->__('Display on Scroll');
79
+ $this->addOption('display_scroll_offset', 'int', '100', array($this, 'validate_zero_positive'))->__('Scroll Offset');
80
+ $this->addOption('start_date', 'string', '', array($this, 'validate_date_range'))->__('Start Date');
81
+ $this->addOption('end_date', 'string', '', array($this, 'validate_date_range'))->__('End Date');
82
  }
83
 
84
  //validation function
131
 
132
  protected function validate_include_roles($arg) {
133
  $obj = json_decode($arg);
134
+ if (!is_array($obj))
135
  return array();
136
  return $obj;
137
  }
138
+
139
+ protected function validate_date_range($arg) {
140
+ if(trim($arg) == '')
141
+ return NULL;
142
+
143
+ if (($timestamp = strtotime($arg)) === false) {
144
+ return NULL;
145
+ }
146
+
147
+ return $timestamp;
148
+ }
149
 
150
  }
151
 
classes/class-wpfront-notification-bar.php CHANGED
@@ -36,7 +36,7 @@ if (!class_exists('WPFront_Notification_Bar')) {
36
  class WPFront_Notification_Bar extends WPFront_Base {
37
 
38
  //Constants
39
- const VERSION = '1.3';
40
  const OPTIONS_GROUP_NAME = 'wpfront-notification-bar-options-group';
41
  const OPTION_NAME = 'wpfront-notification-bar-options';
42
  const PLUGIN_SLUG = 'wpfront-notification-bar';
@@ -101,8 +101,10 @@ if (!class_exists('WPFront_Notification_Bar')) {
101
  public function enqueue_options_scripts() {
102
  $this->enqueue_scripts();
103
 
 
 
104
  $jsRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/js/';
105
- wp_enqueue_script('jquery.eyecon.colorpicker', $jsRoot . 'colorpicker.js', array('jquery'), self::VERSION);
106
 
107
  $jsRoot = $this->pluginURLRoot . 'jquery-plugins/';
108
  wp_enqueue_script('json2', $jsRoot . 'json2.min.js', array('jquery'), self::VERSION);
@@ -114,6 +116,9 @@ if (!class_exists('WPFront_Notification_Bar')) {
114
  //options page styles
115
  public function enqueue_options_styles() {
116
  $this->enqueue_styles();
 
 
 
117
 
118
  $styleRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/css/';
119
  wp_enqueue_style('jquery.eyecon.colorpicker.colorpicker', $styleRoot . 'colorpicker.css', array(), self::VERSION);
@@ -156,6 +161,8 @@ if (!class_exists('WPFront_Notification_Bar')) {
156
  'keep_closed' => $this->options->keep_closed(),
157
  'keep_closed_for' => $this->options->keep_closed_for(),
158
  'position_offset' => $this->options->position_offset(),
 
 
159
  )) . ');';
160
  echo '</script>';
161
  }
@@ -202,6 +209,23 @@ if (!class_exists('WPFront_Notification_Bar')) {
202
  if (is_admin())
203
  return TRUE;
204
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  switch ($this->options->display_roles()) {
206
  case 1:
207
  break;
36
  class WPFront_Notification_Bar extends WPFront_Base {
37
 
38
  //Constants
39
+ const VERSION = '1.4';
40
  const OPTIONS_GROUP_NAME = 'wpfront-notification-bar-options-group';
41
  const OPTION_NAME = 'wpfront-notification-bar-options';
42
  const PLUGIN_SLUG = 'wpfront-notification-bar';
101
  public function enqueue_options_scripts() {
102
  $this->enqueue_scripts();
103
 
104
+ wp_enqueue_script('jquery-ui-datepicker', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js', array('jquery'), '1.8.16');
105
+
106
  $jsRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/js/';
107
+ wp_enqueue_script('jquery.eyecon.colorpicker', $jsRoot . 'colorpicker.js', array('jquery', 'jquery-ui-datepicker'), self::VERSION);
108
 
109
  $jsRoot = $this->pluginURLRoot . 'jquery-plugins/';
110
  wp_enqueue_script('json2', $jsRoot . 'json2.min.js', array('jquery'), self::VERSION);
116
  //options page styles
117
  public function enqueue_options_styles() {
118
  $this->enqueue_styles();
119
+
120
+ $styleRoot = $this->pluginURLRoot . 'jquery-plugins/jquery-ui/smoothness/';
121
+ wp_enqueue_style('jquery.ui.smoothness.datepicker', $styleRoot . 'jquery-ui-1.10.4.custom.min.css', array(), self::VERSION);
122
 
123
  $styleRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/css/';
124
  wp_enqueue_style('jquery.eyecon.colorpicker.colorpicker', $styleRoot . 'colorpicker.css', array(), self::VERSION);
161
  'keep_closed' => $this->options->keep_closed(),
162
  'keep_closed_for' => $this->options->keep_closed_for(),
163
  'position_offset' => $this->options->position_offset(),
164
+ 'display_scroll' => $this->options->display_scroll(),
165
+ 'display_scroll_offset' => $this->options->display_scroll_offset(),
166
  )) . ');';
167
  echo '</script>';
168
  }
209
  if (is_admin())
210
  return TRUE;
211
 
212
+ $today = current_time('mysql');
213
+ $today = strtotime($today);
214
+ $today = date('Y-m-d', $today);
215
+ $today = strtotime($today);
216
+
217
+ $start_date = $this->options->start_date();
218
+ if ($start_date != NULL) {
219
+ if ($start_date > $today)
220
+ return FALSE;
221
+ }
222
+
223
+ $end_date = $this->options->end_date();
224
+ if ($end_date != NULL) {
225
+ if ($end_date < $today)
226
+ return FALSE;
227
+ }
228
+
229
  switch ($this->options->display_roles()) {
230
  case 1:
231
  break;
css/options.css CHANGED
@@ -12,6 +12,11 @@
12
  width: 40px;
13
  }
14
 
 
 
 
 
 
15
  #wpfront-notification-bar-options textArea
16
  {
17
  width: 70%;
12
  width: 40px;
13
  }
14
 
15
+ #wpfront-notification-bar-options input.date
16
+ {
17
+ width: 100px;
18
+ }
19
+
20
  #wpfront-notification-bar-options textArea
21
  {
22
  width: 70%;
jquery-plugins/jquery-ui/smoothness/images/animated-overlay.gif ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-icons_222222_256x240.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-icons_454545_256x240.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-icons_888888_256x240.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
jquery-plugins/jquery-ui/smoothness/jquery-ui-1.10.4.custom.min.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.4 - 2014-03-12
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.datepicker.css, jquery.ui.theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
js/wpfront-notification-bar.js CHANGED
@@ -54,13 +54,23 @@
54
 
55
  //function to set bar height based on options
56
  var closed = false;
 
57
  function setHeight(height, callback, userclosed) {
58
  callback = callback || $.noop;
 
 
 
 
59
  if (height == 0) {
60
  if (closed)
61
  return;
62
  closed = true;
63
  }
 
 
 
 
 
64
 
65
  var fn = callback;
66
  callback = function() {
@@ -85,9 +95,9 @@
85
 
86
  //set animation
87
  if (data.animate_delay > 0) {
88
- bar.animate({"height": height + "px"}, data.animate_delay * 1000, "swing", callback);
89
  if (data.fixed_position)
90
- spacer.animate({"height": height + "px"}, data.animate_delay * 1000);
91
  }
92
  else {
93
  bar.height(height);
@@ -124,15 +134,34 @@
124
  }
125
  }
126
 
127
- //set open after seconds and auto close seconds.
128
- setTimeout(function() {
129
- setHeight(height, function() {
130
- if (data.auto_close_after > 0) {
131
- setTimeout(function() {
132
- setHeight(0, null, true);
133
- }, data.auto_close_after * 1000);
 
 
 
 
 
 
 
134
  }
135
  });
136
- }, data.display_after * 1000);
 
 
 
 
 
 
 
 
 
 
 
 
137
  };
138
  })();
54
 
55
  //function to set bar height based on options
56
  var closed = false;
57
+ var user_closed = false;
58
  function setHeight(height, callback, userclosed) {
59
  callback = callback || $.noop;
60
+
61
+ if (userclosed)
62
+ user_closed = true;
63
+
64
  if (height == 0) {
65
  if (closed)
66
  return;
67
  closed = true;
68
  }
69
+ else {
70
+ if (!closed)
71
+ return;
72
+ closed = false;
73
+ }
74
 
75
  var fn = callback;
76
  callback = function() {
95
 
96
  //set animation
97
  if (data.animate_delay > 0) {
98
+ bar.stop().animate({"height": height + "px"}, data.animate_delay * 1000, "swing", callback);
99
  if (data.fixed_position)
100
+ spacer.stop().animate({"height": height + "px"}, data.animate_delay * 1000);
101
  }
102
  else {
103
  bar.height(height);
134
  }
135
  }
136
 
137
+ closed = true;
138
+
139
+ if (data.display_scroll) {
140
+ setHeight(0);
141
+
142
+ $(window).scroll(function() {
143
+ if (user_closed)
144
+ return;
145
+
146
+ if ($(this).scrollTop() > data.display_scroll_offset) {
147
+ setHeight(height);
148
+ }
149
+ else {
150
+ setHeight(0);
151
  }
152
  });
153
+ }
154
+ else {
155
+ //set open after seconds and auto close seconds.
156
+ setTimeout(function() {
157
+ setHeight(height, function() {
158
+ if (data.auto_close_after > 0) {
159
+ setTimeout(function() {
160
+ setHeight(0, null, true);
161
+ }, data.auto_close_after * 1000);
162
+ }
163
+ });
164
+ }, data.display_after * 1000);
165
+ }
166
  };
167
  })();
languages/wpfront-notification-bar.mo CHANGED
Binary file
languages/wpfront-notification-bar.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
- "POT-Creation-Date: 2014-03-03 17:59-0700\n"
5
- "PO-Revision-Date: 2014-03-03 17:59-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
@@ -143,7 +143,11 @@ msgstr "Write Review"
143
  msgid "Contact Me (syam@wpfront.com)"
144
  msgstr "Contact Me (syam@wpfront.com)"
145
 
146
- #: ../classes/base/class-wpfront-base.php:195
 
 
 
 
147
  msgid "Save Changes"
148
  msgstr "Save Changes"
149
 
@@ -269,6 +273,22 @@ msgstr "Close Button Color"
269
  msgid "Display for User Roles"
270
  msgstr "Display for User Roles"
271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  #: ../classes/class-wpfront-notification-bar.php:62
273
  msgid "WPFront Notification Bar"
274
  msgstr "WPFront Notification Bar"
@@ -277,16 +297,16 @@ msgstr "WPFront Notification Bar"
277
  msgid "Notification Bar"
278
  msgstr "Notification Bar"
279
 
280
- #: ../classes/class-wpfront-notification-bar.php:169
281
- #: ../classes/class-wpfront-notification-bar.php:173
282
  msgid "[Page]"
283
  msgstr "[Page]"
284
 
285
- #: ../classes/class-wpfront-notification-bar.php:169
286
  msgid "Home"
287
  msgstr "Home"
288
 
289
- #: ../classes/class-wpfront-notification-bar.php:178
290
  msgid "[Post]"
291
  msgstr "[Post]"
292
 
@@ -310,15 +330,24 @@ msgstr "Bottom"
310
  msgid "[Sticky Bar, bar will stay at position regardless of scrolling.]"
311
  msgstr "[Sticky Bar, bar will stay at position regardless of scrolling.]"
312
 
313
- #: ../templates/options-template.php:68 ../templates/options-template.php:76
 
 
 
 
 
314
  msgid "px"
315
  msgstr "px"
316
 
317
- #: ../templates/options-template.php:68
 
 
 
 
318
  msgid "Set 0px to auto fit contents."
319
  msgstr "Set 0px to auto fit contents."
320
 
321
- #: ../templates/options-template.php:76
322
  msgid ""
323
  "(Top bar only) If you find the bar overlapping, try increasing this value. "
324
  "(eg. WordPress 3.8 Twenty Fourteen theme, set 48px)"
@@ -326,40 +355,48 @@ msgstr ""
326
  "(Top bar only) If you find the bar overlapping, try increasing this value. "
327
  "(eg. WordPress 3.8 Twenty Fourteen theme, set 48px)"
328
 
329
- #: ../templates/options-template.php:84 ../templates/options-template.php:92
330
- #: ../templates/options-template.php:108
331
  msgid "second(s)"
332
  msgstr "second(s)"
333
 
334
- #: ../templates/options-template.php:84
335
- msgid "Set 0 second(s) to display immediately."
336
- msgstr "Set 0 second(s) to display immediately."
 
 
 
 
337
 
338
- #: ../templates/options-template.php:92
339
  msgid "Set 0 second(s) for no animation."
340
  msgstr "Set 0 second(s) for no animation."
341
 
342
- #: ../templates/options-template.php:100
343
  msgid "[Displays a close button at the top right corner of the bar.]"
344
  msgstr "[Displays a close button at the top right corner of the bar.]"
345
 
346
- #: ../templates/options-template.php:108
347
- msgid "Set 0 second(s) to disable auto close."
348
- msgstr "Set 0 second(s) to disable auto close."
349
-
350
  #: ../templates/options-template.php:124
 
 
 
 
 
 
 
 
351
  msgid "A reopen button will be displayed after the bar is closed."
352
  msgstr "A reopen button will be displayed after the bar is closed."
353
 
354
- #: ../templates/options-template.php:132
355
  msgid "Once closed, bar will display closed on other pages."
356
  msgstr "Once closed, bar will display closed on other pages."
357
 
358
- #: ../templates/options-template.php:140
359
  msgid "day(s)"
360
  msgstr "day(s)"
361
 
362
- #: ../templates/options-template.php:140
363
  msgid ""
364
  "Bar will be kept closed for the number of days specified from last closed "
365
  "date."
@@ -367,91 +404,95 @@ msgstr ""
367
  "Bar will be kept closed for the number of days specified from last closed "
368
  "date."
369
 
370
- #: ../templates/options-template.php:145
371
  msgid "Content"
372
  msgstr "Content"
373
 
374
- #: ../templates/options-template.php:154
375
  msgid "[HTML tags are allowed. e.g. Add <br /> for break.]"
376
  msgstr "[HTML tags are allowed. e.g. Add <br /> for break.]"
377
 
378
- #: ../templates/options-template.php:162
379
  msgid "[Displays a button next to the message.]"
380
  msgstr "[Displays a button next to the message.]"
381
 
382
- #: ../templates/options-template.php:207
383
  msgid "Filter"
384
  msgstr "Filter"
385
 
386
- #: ../templates/options-template.php:216
 
 
 
 
387
  msgid "All pages."
388
  msgstr "All pages."
389
 
390
- #: ../templates/options-template.php:221
391
  msgid "Only in landing page."
392
  msgstr "Only in landing page."
393
 
394
- #: ../templates/options-template.php:221
395
  msgid "[The first page they visit on your website.]"
396
  msgstr "[The first page they visit on your website.]"
397
 
398
- #: ../templates/options-template.php:226
399
  msgid "Include in following pages"
400
  msgstr "Include in following pages"
401
 
402
- #: ../templates/options-template.php:244
403
  msgid "Exclude in following pages"
404
  msgstr "Exclude in following pages"
405
 
406
- #: ../templates/options-template.php:269
407
  msgid "All users."
408
  msgstr "All users."
409
 
410
- #: ../templates/options-template.php:274
411
  msgid "All logged in users."
412
  msgstr "All logged in users."
413
 
414
- #: ../templates/options-template.php:279
415
  msgid "Guest users. [Non-logged in users]"
416
  msgstr "Guest users. [Non-logged in users]"
417
 
418
- #: ../templates/options-template.php:284
419
  msgid "For following user roles"
420
  msgstr "For following user roles"
421
 
422
- #: ../templates/options-template.php:301
423
  msgid "[No Role]"
424
  msgstr "[No Role]"
425
 
426
- #: ../templates/options-template.php:305
427
  msgid "[Guest]"
428
  msgstr "[Guest]"
429
 
430
- #: ../templates/options-template.php:312
431
  msgid "Color"
432
  msgstr "Color"
433
 
434
- #: ../templates/options-template.php:316
435
  msgid "Bar Color"
436
  msgstr "Bar Color"
437
 
438
- #: ../templates/options-template.php:327 ../templates/options-template.php:352
439
  msgid "[Select two different colors to create a gradient.]"
440
  msgstr "[Select two different colors to create a gradient.]"
441
 
442
- #: ../templates/options-template.php:341
443
  msgid "Button Color"
444
  msgstr "Button Color"
445
 
446
- #: ../templates/options-template.php:390
447
  msgid "[Normal, Hover, X]"
448
  msgstr "[Normal, Hover, X]"
449
 
450
- #: ../templates/options-template.php:395
451
  msgid "CSS"
452
  msgstr "CSS"
453
 
454
- #: ../templates/options-template.php:411
455
  msgid "Plugin Ideas"
456
  msgstr "Plugin Ideas"
457
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
+ "POT-Creation-Date: 2014-03-12 17:05-0700\n"
5
+ "PO-Revision-Date: 2014-03-12 17:05-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
143
  msgid "Contact Me (syam@wpfront.com)"
144
  msgstr "Contact Me (syam@wpfront.com)"
145
 
146
+ #: ../classes/base/class-wpfront-base.php:180
147
+ msgid "Buy me a Beer or Coffee"
148
+ msgstr "Buy me a Beer or Coffee"
149
+
150
+ #: ../classes/base/class-wpfront-base.php:197
151
  msgid "Save Changes"
152
  msgstr "Save Changes"
153
 
273
  msgid "Display for User Roles"
274
  msgstr "Display for User Roles"
275
 
276
+ #: ../classes/class-wpfront-notification-bar-options.php:78
277
+ msgid "Display on Scroll"
278
+ msgstr "Display on Scroll"
279
+
280
+ #: ../classes/class-wpfront-notification-bar-options.php:79
281
+ msgid "Scroll Offset"
282
+ msgstr "Scroll Offset"
283
+
284
+ #: ../classes/class-wpfront-notification-bar-options.php:80
285
+ msgid "Start Date"
286
+ msgstr "Start Date"
287
+
288
+ #: ../classes/class-wpfront-notification-bar-options.php:81
289
+ msgid "End Date"
290
+ msgstr "End Date"
291
+
292
  #: ../classes/class-wpfront-notification-bar.php:62
293
  msgid "WPFront Notification Bar"
294
  msgstr "WPFront Notification Bar"
297
  msgid "Notification Bar"
298
  msgstr "Notification Bar"
299
 
300
+ #: ../classes/class-wpfront-notification-bar.php:176
301
+ #: ../classes/class-wpfront-notification-bar.php:180
302
  msgid "[Page]"
303
  msgstr "[Page]"
304
 
305
+ #: ../classes/class-wpfront-notification-bar.php:176
306
  msgid "Home"
307
  msgstr "Home"
308
 
309
+ #: ../classes/class-wpfront-notification-bar.php:185
310
  msgid "[Post]"
311
  msgstr "[Post]"
312
 
330
  msgid "[Sticky Bar, bar will stay at position regardless of scrolling.]"
331
  msgstr "[Sticky Bar, bar will stay at position regardless of scrolling.]"
332
 
333
+ #: ../templates/options-template.php:68
334
+ msgid "[Displays the bar on window scroll.]"
335
+ msgstr "[Displays the bar on window scroll.]"
336
+
337
+ #: ../templates/options-template.php:76 ../templates/options-template.php:84
338
+ #: ../templates/options-template.php:92
339
  msgid "px"
340
  msgstr "px"
341
 
342
+ #: ../templates/options-template.php:76
343
+ msgid "Number of pixels to be scrolled before the bar appears."
344
+ msgstr "Number of pixels to be scrolled before the bar appears."
345
+
346
+ #: ../templates/options-template.php:84
347
  msgid "Set 0px to auto fit contents."
348
  msgstr "Set 0px to auto fit contents."
349
 
350
+ #: ../templates/options-template.php:92
351
  msgid ""
352
  "(Top bar only) If you find the bar overlapping, try increasing this value. "
353
  "(eg. WordPress 3.8 Twenty Fourteen theme, set 48px)"
355
  "(Top bar only) If you find the bar overlapping, try increasing this value. "
356
  "(eg. WordPress 3.8 Twenty Fourteen theme, set 48px)"
357
 
358
+ #: ../templates/options-template.php:100 ../templates/options-template.php:108
359
+ #: ../templates/options-template.php:124
360
  msgid "second(s)"
361
  msgstr "second(s)"
362
 
363
+ #: ../templates/options-template.php:100
364
+ msgid ""
365
+ "Set 0 second(s) to display immediately. Do not work in \"Display on Scroll\" "
366
+ "mode."
367
+ msgstr ""
368
+ "Set 0 second(s) to display immediately. Do not work in \"Display on Scroll\" "
369
+ "mode."
370
 
371
+ #: ../templates/options-template.php:108
372
  msgid "Set 0 second(s) for no animation."
373
  msgstr "Set 0 second(s) for no animation."
374
 
375
+ #: ../templates/options-template.php:116
376
  msgid "[Displays a close button at the top right corner of the bar.]"
377
  msgstr "[Displays a close button at the top right corner of the bar.]"
378
 
 
 
 
 
379
  #: ../templates/options-template.php:124
380
+ msgid ""
381
+ "Set 0 second(s) to disable auto close. Do not work in \"Display on Scroll\" "
382
+ "mode."
383
+ msgstr ""
384
+ "Set 0 second(s) to disable auto close. Do not work in \"Display on Scroll\" "
385
+ "mode."
386
+
387
+ #: ../templates/options-template.php:140
388
  msgid "A reopen button will be displayed after the bar is closed."
389
  msgstr "A reopen button will be displayed after the bar is closed."
390
 
391
+ #: ../templates/options-template.php:148
392
  msgid "Once closed, bar will display closed on other pages."
393
  msgstr "Once closed, bar will display closed on other pages."
394
 
395
+ #: ../templates/options-template.php:156
396
  msgid "day(s)"
397
  msgstr "day(s)"
398
 
399
+ #: ../templates/options-template.php:156
400
  msgid ""
401
  "Bar will be kept closed for the number of days specified from last closed "
402
  "date."
404
  "Bar will be kept closed for the number of days specified from last closed "
405
  "date."
406
 
407
+ #: ../templates/options-template.php:161
408
  msgid "Content"
409
  msgstr "Content"
410
 
411
+ #: ../templates/options-template.php:170
412
  msgid "[HTML tags are allowed. e.g. Add <br /> for break.]"
413
  msgstr "[HTML tags are allowed. e.g. Add <br /> for break.]"
414
 
415
+ #: ../templates/options-template.php:178
416
  msgid "[Displays a button next to the message.]"
417
  msgstr "[Displays a button next to the message.]"
418
 
419
+ #: ../templates/options-template.php:223
420
  msgid "Filter"
421
  msgstr "Filter"
422
 
423
+ #: ../templates/options-template.php:230 ../templates/options-template.php:238
424
+ msgid "[YYYY-MM-DD]"
425
+ msgstr "[YYYY-MM-DD]"
426
+
427
+ #: ../templates/options-template.php:248
428
  msgid "All pages."
429
  msgstr "All pages."
430
 
431
+ #: ../templates/options-template.php:253
432
  msgid "Only in landing page."
433
  msgstr "Only in landing page."
434
 
435
+ #: ../templates/options-template.php:253
436
  msgid "[The first page they visit on your website.]"
437
  msgstr "[The first page they visit on your website.]"
438
 
439
+ #: ../templates/options-template.php:258
440
  msgid "Include in following pages"
441
  msgstr "Include in following pages"
442
 
443
+ #: ../templates/options-template.php:278
444
  msgid "Exclude in following pages"
445
  msgstr "Exclude in following pages"
446
 
447
+ #: ../templates/options-template.php:305
448
  msgid "All users."
449
  msgstr "All users."
450
 
451
+ #: ../templates/options-template.php:310
452
  msgid "All logged in users."
453
  msgstr "All logged in users."
454
 
455
+ #: ../templates/options-template.php:315
456
  msgid "Guest users. [Non-logged in users]"
457
  msgstr "Guest users. [Non-logged in users]"
458
 
459
+ #: ../templates/options-template.php:320
460
  msgid "For following user roles"
461
  msgstr "For following user roles"
462
 
463
+ #: ../templates/options-template.php:340
464
  msgid "[No Role]"
465
  msgstr "[No Role]"
466
 
467
+ #: ../templates/options-template.php:346
468
  msgid "[Guest]"
469
  msgstr "[Guest]"
470
 
471
+ #: ../templates/options-template.php:354
472
  msgid "Color"
473
  msgstr "Color"
474
 
475
+ #: ../templates/options-template.php:358
476
  msgid "Bar Color"
477
  msgstr "Bar Color"
478
 
479
+ #: ../templates/options-template.php:369 ../templates/options-template.php:394
480
  msgid "[Select two different colors to create a gradient.]"
481
  msgstr "[Select two different colors to create a gradient.]"
482
 
483
+ #: ../templates/options-template.php:383
484
  msgid "Button Color"
485
  msgstr "Button Color"
486
 
487
+ #: ../templates/options-template.php:432
488
  msgid "[Normal, Hover, X]"
489
  msgstr "[Normal, Hover, X]"
490
 
491
+ #: ../templates/options-template.php:437
492
  msgid "CSS"
493
  msgstr "CSS"
494
 
495
+ #: ../templates/options-template.php:453
496
  msgid "Plugin Ideas"
497
  msgstr "Plugin Ideas"
498
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: syammohanm
3
  Donate link: http://wpfront.com/donate/
4
  Tags: notification bar, wordpress notification bar, top bar, bottom bar, notification, bar, quick bar, fixed bar, sticky bar, message bar, message, floating bar, notice, sticky header, special offer, discount offer, offer, important, attention bar, highlight bar, popup bar, hellobar, heads up, heads up bar, headsup, headsupbar, popup, Toolbar
5
  Requires at least: 3.0
6
- Tested up to: 3.8.1
7
- Stable tag: 1.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -18,6 +18,7 @@ Want to display a notification about a promotion or a news? WPFront Notification
18
  * Button will **open a URL** or **execute JavaScript**.
19
  * **Position** the bar on **top** or **bottom**.
20
  * Can be **fixed at position** (Sticky Bar).
 
21
  * Set **any height** you want.
22
  * Set the number of **seconds before** the **bar appears**.
23
  * Display a **close button** for the visitor.
@@ -26,6 +27,7 @@ Want to display a notification about a promotion or a news? WPFront Notification
26
  * Display a **Reopen Button**.
27
  * **Select the pages/posts** you want to display the notification.
28
  * **Select the user roles** you want to display the notification.
 
29
 
30
  Visit [WPFront Notification Bar Ideas](http://wpfront.com/notification-bar-plugin-ideas/) page for some useful functionalities.
31
 
@@ -65,6 +67,10 @@ The new version(1.3) allows you to filter the bar based on user roles. In this c
65
 
66
  == Changelog ==
67
 
 
 
 
 
68
  = 1.3 =
69
  * User roles filter added.
70
  * New menu structure.
@@ -93,6 +99,10 @@ The new version(1.3) allows you to filter the bar based on user roles. In this c
93
 
94
  == Upgrade Notice ==
95
 
 
 
 
 
96
  = 1.3 =
97
  * Now you can filter by user roles.
98
 
3
  Donate link: http://wpfront.com/donate/
4
  Tags: notification bar, wordpress notification bar, top bar, bottom bar, notification, bar, quick bar, fixed bar, sticky bar, message bar, message, floating bar, notice, sticky header, special offer, discount offer, offer, important, attention bar, highlight bar, popup bar, hellobar, heads up, heads up bar, headsup, headsupbar, popup, Toolbar
5
  Requires at least: 3.0
6
+ Tested up to: 3.9
7
+ Stable tag: 1.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
18
  * Button will **open a URL** or **execute JavaScript**.
19
  * **Position** the bar on **top** or **bottom**.
20
  * Can be **fixed at position** (Sticky Bar).
21
+ * **Display on Scroll** option.
22
  * Set **any height** you want.
23
  * Set the number of **seconds before** the **bar appears**.
24
  * Display a **close button** for the visitor.
27
  * Display a **Reopen Button**.
28
  * **Select the pages/posts** you want to display the notification.
29
  * **Select the user roles** you want to display the notification.
30
+ * Set **Start** and **End dates**.
31
 
32
  Visit [WPFront Notification Bar Ideas](http://wpfront.com/notification-bar-plugin-ideas/) page for some useful functionalities.
33
 
67
 
68
  == Changelog ==
69
 
70
+ = 1.4 =
71
+ * Display on Scroll option added.
72
+ * Date filters added.
73
+
74
  = 1.3 =
75
  * User roles filter added.
76
  * New menu structure.
99
 
100
  == Upgrade Notice ==
101
 
102
+ = 1.4 =
103
+ * Now you can set it to display on scroll.
104
+ * Date filters available now.
105
+
106
  = 1.3 =
107
  * Now you can filter by user roles.
108
 
templates/options-template.php CHANGED
@@ -60,6 +60,22 @@
60
  <input type="checkbox" name="<?php echo $this->options->fixed_position_name(); ?>" <?php echo $this->options->fixed_position() ? 'checked' : ''; ?> />&#160;<span class="description"><?php echo $this->__('[Sticky Bar, bar will stay at position regardless of scrolling.]'); ?></span>
61
  </td>
62
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  <tr>
64
  <th scope="row">
65
  <?php echo $this->options->height_label(); ?>
@@ -81,7 +97,7 @@
81
  <?php echo $this->options->display_after_label(); ?>
82
  </th>
83
  <td>
84
- <input class="seconds" name="<?php echo $this->options->display_after_name(); ?>" value="<?php echo $this->options->display_after(); ?>" />&#160;<?php echo $this->__('second(s)'); ?>&#160;<span class="description">[<?php echo $this->__('Set 0 second(s) to display immediately.'); ?>]</span>
85
  </td>
86
  </tr>
87
  <tr>
@@ -105,7 +121,7 @@
105
  <?php echo $this->options->auto_close_after_label(); ?>
106
  </th>
107
  <td>
108
- <input class="seconds" name="<?php echo $this->options->auto_close_after_name(); ?>" value="<?php echo $this->options->auto_close_after(); ?>" />&#160;<?php echo $this->__('second(s)'); ?>&#160;<span class="description">[<?php echo $this->__('Set 0 second(s) to disable auto close.'); ?>]</span>
109
  </td>
110
  </tr>
111
  <tr>
@@ -206,6 +222,22 @@
206
 
207
  <h3><?php echo $this->__('Filter'); ?></h3>
208
  <table class="form-table">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  <tr>
210
  <th scope="row">
211
  <?php echo $this->options->display_pages_label(); ?>
@@ -462,6 +494,10 @@
462
  });
463
  div.children(":first").val(JSON.stringify(values));
464
  });
 
 
 
 
465
 
466
  })(jQuery);
467
  </script>
60
  <input type="checkbox" name="<?php echo $this->options->fixed_position_name(); ?>" <?php echo $this->options->fixed_position() ? 'checked' : ''; ?> />&#160;<span class="description"><?php echo $this->__('[Sticky Bar, bar will stay at position regardless of scrolling.]'); ?></span>
61
  </td>
62
  </tr>
63
+ <tr>
64
+ <th scope="row">
65
+ <?php echo $this->options->display_scroll_label(); ?>
66
+ </th>
67
+ <td>
68
+ <input type="checkbox" name="<?php echo $this->options->display_scroll_name(); ?>" <?php echo $this->options->display_scroll() ? 'checked' : ''; ?> />&#160;<span class="description"><?php echo $this->__('[Displays the bar on window scroll.]'); ?></span>
69
+ </td>
70
+ </tr>
71
+ <tr>
72
+ <th scope="row">
73
+ <?php echo $this->options->display_scroll_offset_label(); ?>
74
+ </th>
75
+ <td>
76
+ <input class="seconds" name="<?php echo $this->options->display_scroll_offset_name(); ?>" value="<?php echo $this->options->display_scroll_offset(); ?>" />&#160;<?php echo $this->__('px'); ?>&#160;<span class="description">[<?php echo $this->__('Number of pixels to be scrolled before the bar appears.'); ?>]</span>
77
+ </td>
78
+ </tr>
79
  <tr>
80
  <th scope="row">
81
  <?php echo $this->options->height_label(); ?>
97
  <?php echo $this->options->display_after_label(); ?>
98
  </th>
99
  <td>
100
+ <input class="seconds" name="<?php echo $this->options->display_after_name(); ?>" value="<?php echo $this->options->display_after(); ?>" />&#160;<?php echo $this->__('second(s)'); ?>&#160;<span class="description">[<?php echo $this->__('Set 0 second(s) to display immediately. Do not work in "Display on Scroll" mode.'); ?>]</span>
101
  </td>
102
  </tr>
103
  <tr>
121
  <?php echo $this->options->auto_close_after_label(); ?>
122
  </th>
123
  <td>
124
+ <input class="seconds" name="<?php echo $this->options->auto_close_after_name(); ?>" value="<?php echo $this->options->auto_close_after(); ?>" />&#160;<?php echo $this->__('second(s)'); ?>&#160;<span class="description">[<?php echo $this->__('Set 0 second(s) to disable auto close. Do not work in "Display on Scroll" mode.'); ?>]</span>
125
  </td>
126
  </tr>
127
  <tr>
222
 
223
  <h3><?php echo $this->__('Filter'); ?></h3>
224
  <table class="form-table">
225
+ <tr>
226
+ <th scope="row">
227
+ <?php echo $this->options->start_date_label(); ?>
228
+ </th>
229
+ <td>
230
+ <input class="date" name="<?php echo $this->options->start_date_name(); ?>" value="<?php echo $this->options->start_date() == NULL ? '' : date('Y-m-d', $this->options->start_date()); ?>" />&#160;<span class="description"><?php echo $this->__('[YYYY-MM-DD]'); ?></span>
231
+ </td>
232
+ </tr>
233
+ <tr>
234
+ <th scope="row">
235
+ <?php echo $this->options->end_date_label(); ?>
236
+ </th>
237
+ <td>
238
+ <input class="date" name="<?php echo $this->options->end_date_name(); ?>" value="<?php echo $this->options->end_date() == NULL ? '' : date('Y-m-d', $this->options->end_date()); ?>" />&#160;<span class="description"><?php echo $this->__('[YYYY-MM-DD]'); ?></span>
239
+ </td>
240
+ </tr>
241
  <tr>
242
  <th scope="row">
243
  <?php echo $this->options->display_pages_label(); ?>
494
  });
495
  div.children(":first").val(JSON.stringify(values));
496
  });
497
+
498
+ $('#wpfront-notification-bar-options input.date').datepicker({
499
+ 'dateFormat' : 'yy-mm-dd'
500
+ });
501
 
502
  })(jQuery);
503
  </script>
wpfront-notification-bar.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WPFront Notification Bar
4
  * Plugin URI: http://wpfront.com/notification-bar-plugin/
5
  * Description: Easily lets you create a bar on top or bottom to display a notification.
6
- * Version: 1.3
7
  * Author: Syam Mohan
8
  * Author URI: http://wpfront.com
9
  * License: GPL v3
3
  * Plugin Name: WPFront Notification Bar
4
  * Plugin URI: http://wpfront.com/notification-bar-plugin/
5
  * Description: Easily lets you create a bar on top or bottom to display a notification.
6
+ * Version: 1.4
7
  * Author: Syam Mohan
8
  * Author URI: http://wpfront.com
9
  * License: GPL v3