WPFront Scroll Top - Version 1.3

Version Description

  • Auto hide
  • Hide on wp-admin
  • Hide on iframes
  • Pages/posts filter
Download this release

Release Info

Developer syammohanm
Plugin Icon 128x128 WPFront Scroll Top
Version 1.3
Comparing to
See all releases

Code changes from version 1.2 to 1.3

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-scroll-top-options.php CHANGED
@@ -45,11 +45,15 @@ if (!class_exists('WPFront_Scroll_Top_Options')) {
45
  $this->addOption('button_opacity', 'int', 80, array($this, 'validate_range_0_100'))->__('Button Opacity');
46
  $this->addOption('button_fade_duration', 'int', 200, array($this, 'validate_zero_positive'))->__('Button Fade Duration');
47
  $this->addOption('scroll_duration', 'int', 400, array($this, 'validate_zero_positive'))->__('Scroll Duration');
 
 
48
  $this->addOption('hide_small_device', 'bit', FALSE)->__('Hide on Small Devices');
49
  $this->addOption('small_device_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Device Max Width');
50
  $this->addOption('hide_small_window', 'bit', FALSE)->__('Hide on Small Window');
51
  $this->addOption('small_window_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Window Max Width');
52
  $this->addOption('button_style', 'string', 'image', array($this, 'validate_button_style'))->__('Button Style');
 
 
53
 
54
  $this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->__('Location');
55
  $this->addOption('marginX', 'int', 20)->__('Margin X');
@@ -60,6 +64,10 @@ if (!class_exists('WPFront_Scroll_Top_Options')) {
60
  $this->addOption('text_button_background_color', 'string', '#000000', array($this, 'validate_color'))->__('Background Color');
61
  $this->addOption('text_button_css', 'string', '')->__('Custom CSS');
62
 
 
 
 
 
63
  $this->addOption('image', 'string', '1.png');
64
  $this->addOption('custom_url', 'string', '');
65
  }
@@ -101,6 +109,18 @@ if (!class_exists('WPFront_Scroll_Top_Options')) {
101
  return $arg;
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  }
105
 
106
  }
45
  $this->addOption('button_opacity', 'int', 80, array($this, 'validate_range_0_100'))->__('Button Opacity');
46
  $this->addOption('button_fade_duration', 'int', 200, array($this, 'validate_zero_positive'))->__('Button Fade Duration');
47
  $this->addOption('scroll_duration', 'int', 400, array($this, 'validate_zero_positive'))->__('Scroll Duration');
48
+ $this->addOption('auto_hide', 'bit', FALSE)->__('Auto Hide');
49
+ $this->addOption('auto_hide_after', 'float', 2, array($this, 'validate_zero_positive'))->__('Auto Hide After');
50
  $this->addOption('hide_small_device', 'bit', FALSE)->__('Hide on Small Devices');
51
  $this->addOption('small_device_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Device Max Width');
52
  $this->addOption('hide_small_window', 'bit', FALSE)->__('Hide on Small Window');
53
  $this->addOption('small_window_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Window Max Width');
54
  $this->addOption('button_style', 'string', 'image', array($this, 'validate_button_style'))->__('Button Style');
55
+ $this->addOption('hide_wpadmin', 'bit', FALSE)->__('Hide on WP-ADMIN');
56
+ $this->addOption('hide_iframe', 'bit', FALSE)->__('Hide on iframes');
57
 
58
  $this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->__('Location');
59
  $this->addOption('marginX', 'int', 20)->__('Margin X');
64
  $this->addOption('text_button_background_color', 'string', '#000000', array($this, 'validate_color'))->__('Background Color');
65
  $this->addOption('text_button_css', 'string', '')->__('Custom CSS');
66
 
67
+ $this->addOption('display_pages', 'int', '1', array($this, 'validate_display_pages'))->__('Display on Pages');
68
+ $this->addOption('include_pages', 'string', '');
69
+ $this->addOption('exclude_pages', 'string', '');
70
+
71
  $this->addOption('image', 'string', '1.png');
72
  $this->addOption('custom_url', 'string', '');
73
  }
109
  return $arg;
110
  }
111
 
112
+ protected function validate_display_pages($arg) {
113
+ if ($arg < 1) {
114
+ return 1;
115
+ }
116
+
117
+ if ($arg > 3) {
118
+ return 3;
119
+ }
120
+
121
+ return $arg;
122
+ }
123
+
124
  }
125
 
126
  }
classes/class-wpfront-scroll-top.php CHANGED
@@ -36,7 +36,7 @@ if (!class_exists('WPFront_Scroll_Top')) {
36
  class WPFront_Scroll_Top extends WPFront_Base {
37
 
38
  //Constants
39
- const VERSION = '1.2';
40
  const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
41
  const OPTION_NAME = 'wpfront-scroll-top-options';
42
  const PLUGIN_SLUG = 'wpfront-scroll-top';
@@ -143,6 +143,9 @@ if (!class_exists('WPFront_Scroll_Top')) {
143
  'location' => $this->options->location(),
144
  'marginX' => $this->options->marginX(),
145
  'marginY' => $this->options->marginY(),
 
 
 
146
  )) . ');';
147
  echo '</script>';
148
  }
@@ -151,7 +154,64 @@ if (!class_exists('WPFront_Scroll_Top')) {
151
  }
152
 
153
  private function enabled() {
154
- return $this->options->enabled();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  }
156
 
157
  private function image() {
@@ -160,6 +220,29 @@ if (!class_exists('WPFront_Scroll_Top')) {
160
  return $this->iconsURL . $this->options->image();
161
  }
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  }
164
 
165
  }
36
  class WPFront_Scroll_Top extends WPFront_Base {
37
 
38
  //Constants
39
+ const VERSION = '1.3';
40
  const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
41
  const OPTION_NAME = 'wpfront-scroll-top-options';
42
  const PLUGIN_SLUG = 'wpfront-scroll-top';
143
  'location' => $this->options->location(),
144
  'marginX' => $this->options->marginX(),
145
  'marginY' => $this->options->marginY(),
146
+ 'hide_iframe' => $this->options->hide_iframe(),
147
+ 'auto_hide' => $this->options->auto_hide(),
148
+ 'auto_hide_after' => $this->options->auto_hide_after(),
149
  )) . ');';
150
  echo '</script>';
151
  }
154
  }
155
 
156
  private function enabled() {
157
+ if (!$this->options->enabled())
158
+ return FALSE;
159
+
160
+ if ($this->options->hide_wpadmin() && is_admin())
161
+ return FALSE;
162
+
163
+ if(!$this->filter_pages())
164
+ return FALSE;
165
+
166
+ return TRUE;
167
+ }
168
+
169
+ private function filter_pages() {
170
+ if(is_admin())
171
+ return TRUE;
172
+
173
+ switch ($this->options->display_pages()) {
174
+ case 1:
175
+ return TRUE;
176
+ case 2:
177
+ case 3:
178
+ global $post;
179
+ $ID = FALSE;
180
+ $type = FALSE;
181
+ if (is_home()) {
182
+ $ID = 'home';
183
+ $type = 1;
184
+ } elseif (is_singular()) {
185
+ $post_type = get_post_type();
186
+ if ($post_type == 'page') {
187
+ $ID = $post->ID;
188
+ $type = 1;
189
+ } elseif ($post_type == 'post') {
190
+ $ID = $post->ID;
191
+ $type = 2;
192
+ }
193
+ }
194
+ if ($this->options->display_pages() == 2) {
195
+ if ($ID !== FALSE && $type !== FALSE) {
196
+ if (strpos($this->options->include_pages(), $type . '.' . $ID) === FALSE)
197
+ return FALSE;
198
+ else
199
+ return TRUE;
200
+ }
201
+ return FALSE;
202
+ }
203
+ if ($this->options->display_pages() == 3) {
204
+ if ($ID !== FALSE && $type !== FALSE) {
205
+ if (strpos($this->options->exclude_pages(), $type . '.' . $ID) === FALSE)
206
+ return TRUE;
207
+ else
208
+ return FALSE;
209
+ }
210
+ return TRUE;
211
+ }
212
+ }
213
+
214
+ return TRUE;
215
  }
216
 
217
  private function image() {
220
  return $this->iconsURL . $this->options->image();
221
  }
222
 
223
+ protected function get_filter_objects() {
224
+ $objects = array();
225
+
226
+ $objects['1.home'] = $this->__('[Page]') . ' ' . $this->__('Home');
227
+
228
+ $pages = get_pages();
229
+ foreach ($pages as $page) {
230
+ $objects['1.' . $page->ID] = $this->__('[Page]') . ' ' . $page->post_title;
231
+ }
232
+
233
+ $posts = get_posts();
234
+ foreach ($posts as $post) {
235
+ $objects['2.' . $post->ID] = $this->__('[Post]') . ' ' . $post->post_title;
236
+ }
237
+
238
+ // $categories = get_categories();
239
+ // foreach ($categories as $category) {
240
+ // $objects['3.' . $category->cat_ID] = $this->__('[Category]') . ' ' . $category->cat_name;
241
+ // }
242
+
243
+ return $objects;
244
+ }
245
+
246
  }
247
 
248
  }
css/options.css CHANGED
@@ -50,4 +50,27 @@
50
  vertical-align: middle;
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
50
  vertical-align: middle;
51
  }
52
 
53
+ #wpfront-scroll-top-options table.form-table div.pages-selection
54
+ {
55
+ width: 70%;
56
+ height: 150px;
57
+ background-color: #fff;
58
+ overflow: auto;
59
+
60
+ border: 1px solid #dfdfdf;
61
+ -moz-border-radius: 4px;
62
+ -khtml-border-radius: 4px;
63
+ -webkit-border-radius: 4px;
64
+ border-radius: 4px;
65
+ }
66
+
67
+ #wpfront-scroll-top-options table.form-table div.page-div
68
+ {
69
+ float: left;
70
+ width: 250px;
71
+ padding: 2px;
72
+ white-space: nowrap;
73
+ overflow: hidden;
74
+ }
75
+
76
 
js/wpfront-scroll-top.js CHANGED
@@ -47,29 +47,54 @@
47
  data.button_height += "px";
48
  container.children("img").css({"width": data.button_width, "height": data.button_height});
49
 
 
 
 
 
 
50
  var mouse_over = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  $(window).scroll(function() {
52
  if ($(this).scrollTop() > data.scroll_offset) {
53
  container.stop().css("opacity", 1).show();
54
- if (!mouse_over)
55
  container.css("opacity", data.button_opacity);
56
- } else {
57
- if (container.is(":visible")) {
58
- container.stop().fadeTo(data.button_fade_duration, 0, function() {
59
- container.hide();
60
- mouse_over = false;
61
- });
62
  }
 
 
63
  }
64
  });
65
 
66
  container
67
  .hover(function() {
 
68
  mouse_over = true;
69
  $(this).css("opacity", 1);
70
  }, function() {
71
  $(this).css("opacity", data.button_opacity);
72
  mouse_over = false;
 
73
  })
74
  .click(function() {
75
  $("html, body").animate({scrollTop: 0}, data.scroll_duration);
47
  data.button_height += "px";
48
  container.children("img").css({"width": data.button_width, "height": data.button_height});
49
 
50
+ if (data.hide_iframe) {
51
+ if ($(window).attr("self") !== $(window).attr("top"))
52
+ return;
53
+ }
54
+
55
  var mouse_over = false;
56
+ var hideEventID = 0;
57
+
58
+ var fnHide = function() {
59
+ clearTimeout(hideEventID);
60
+ if (container.is(":visible")) {
61
+ container.stop().fadeTo(data.button_fade_duration, 0, function() {
62
+ container.hide();
63
+ mouse_over = false;
64
+ });
65
+ }
66
+ };
67
+
68
+ var fnHideEvent = function() {
69
+ clearTimeout(hideEventID);
70
+ hideEventID = setTimeout(function() {
71
+ fnHide();
72
+ }, data.auto_hide_after * 1000);
73
+ };
74
+
75
  $(window).scroll(function() {
76
  if ($(this).scrollTop() > data.scroll_offset) {
77
  container.stop().css("opacity", 1).show();
78
+ if (!mouse_over) {
79
  container.css("opacity", data.button_opacity);
80
+ if (data.auto_hide) {
81
+ fnHideEvent();
82
+ }
 
 
 
83
  }
84
+ } else {
85
+ fnHide();
86
  }
87
  });
88
 
89
  container
90
  .hover(function() {
91
+ clearTimeout(hideEventID);
92
  mouse_over = true;
93
  $(this).css("opacity", 1);
94
  }, function() {
95
  $(this).css("opacity", data.button_opacity);
96
  mouse_over = false;
97
+ fnHideEvent();
98
  })
99
  .click(function() {
100
  $("html, body").animate({scrollTop: 0}, data.scroll_duration);
languages/wpfront-scroll-top.mo CHANGED
Binary file
languages/wpfront-scroll-top.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
- "POT-Creation-Date: 2014-03-02 10:49-0700\n"
5
- "PO-Revision-Date: 2014-03-02 10:49-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
 
@@ -168,55 +172,75 @@ msgid "Scroll Duration"
168
  msgstr "Scroll Duration"
169
 
170
  #: ../classes/class-wpfront-scroll-top-options.php:48
 
 
 
 
 
 
 
 
171
  msgid "Hide on Small Devices"
172
  msgstr "Hide on Small Devices"
173
 
174
- #: ../classes/class-wpfront-scroll-top-options.php:49
175
  msgid "Small Device Max Width"
176
  msgstr "Small Device Max Width"
177
 
178
- #: ../classes/class-wpfront-scroll-top-options.php:50
179
  msgid "Hide on Small Window"
180
  msgstr "Hide on Small Window"
181
 
182
- #: ../classes/class-wpfront-scroll-top-options.php:51
183
  msgid "Small Window Max Width"
184
  msgstr "Small Window Max Width"
185
 
186
- #: ../classes/class-wpfront-scroll-top-options.php:52
187
  msgid "Button Style"
188
  msgstr "Button Style"
189
 
190
- #: ../classes/class-wpfront-scroll-top-options.php:54
191
- #: ../templates/options-template.php:183
 
 
 
 
 
 
 
 
192
  msgid "Location"
193
  msgstr "Location"
194
 
195
- #: ../classes/class-wpfront-scroll-top-options.php:55
196
  msgid "Margin X"
197
  msgstr "Margin X"
198
 
199
- #: ../classes/class-wpfront-scroll-top-options.php:56
200
  msgid "Margin Y"
201
  msgstr "Margin Y"
202
 
203
- #: ../classes/class-wpfront-scroll-top-options.php:58
204
- #: ../templates/options-template.php:135
205
  msgid "Text"
206
  msgstr "Text"
207
 
208
- #: ../classes/class-wpfront-scroll-top-options.php:59
209
  msgid "Text Color"
210
  msgstr "Text Color"
211
 
212
- #: ../classes/class-wpfront-scroll-top-options.php:60
213
  msgid "Background Color"
214
  msgstr "Background Color"
215
 
216
- #: ../classes/class-wpfront-scroll-top-options.php:61
217
  msgid "Custom CSS"
218
  msgstr "Custom CSS"
219
 
 
 
 
 
220
  #: ../classes/class-wpfront-scroll-top.php:63
221
  msgid "WPFront Scroll Top"
222
  msgstr "WPFront Scroll Top"
@@ -225,6 +249,19 @@ msgstr "WPFront Scroll Top"
225
  msgid "Scroll Top"
226
  msgstr "Scroll Top"
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  #: ../templates/options-template.php:32
229
  msgid "WPFront Scroll Top Settings"
230
  msgstr "WPFront Scroll Top Settings"
@@ -253,51 +290,81 @@ msgstr "[Button fade duration in milliseconds.]"
253
  msgid "[Window scroll duration in milliseconds.]"
254
  msgstr "[Window scroll duration in milliseconds.]"
255
 
256
- #: ../templates/options-template.php:97
 
 
 
 
 
 
257
  msgid "[Button will be hidden on small devices when the width matches.]"
258
  msgstr "[Button will be hidden on small devices when the width matches.]"
259
 
260
- #: ../templates/options-template.php:106
261
  msgid "[Button will be hidden on devices with lesser or equal width.]"
262
  msgstr "[Button will be hidden on devices with lesser or equal width.]"
263
 
264
- #: ../templates/options-template.php:115
265
  msgid "[Button will be hidden on broswer window when the width matches.]"
266
  msgstr "[Button will be hidden on broswer window when the width matches.]"
267
 
268
- #: ../templates/options-template.php:124
269
  msgid "[Button will be hidden on browser window with lesser or equal width.]"
270
  msgstr "[Button will be hidden on browser window with lesser or equal width.]"
271
 
272
- #: ../templates/options-template.php:133 ../templates/options-template.php:218
 
 
 
 
 
 
 
 
273
  msgid "Image"
274
  msgstr "Image"
275
 
276
- #: ../templates/options-template.php:141
277
  msgid "Text Button"
278
  msgstr "Text Button"
279
 
280
- #: ../templates/options-template.php:191
281
  msgid "Bottom Right"
282
  msgstr "Bottom Right"
283
 
284
- #: ../templates/options-template.php:192
285
  msgid "Bottom Left"
286
  msgstr "Bottom Left"
287
 
288
- #: ../templates/options-template.php:193
289
  msgid "Top Right"
290
  msgstr "Top Right"
291
 
292
- #: ../templates/options-template.php:194
293
  msgid "Top Left"
294
  msgstr "Top Left"
295
 
296
- #: ../templates/options-template.php:204 ../templates/options-template.php:213
297
  msgid "[Negative value allowed.]"
298
  msgstr "[Negative value allowed.]"
299
 
300
- #: ../templates/options-template.php:234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  msgid "Custom URL"
302
  msgstr "Custom URL"
303
 
@@ -313,9 +380,6 @@ msgstr "Custom URL"
313
  #~ msgid "Display Close Button"
314
  #~ msgstr "Display Close Button"
315
 
316
- #~ msgid "Auto Close After"
317
- #~ msgstr "Auto Close After"
318
-
319
  #~ msgid "Display Button"
320
  #~ msgstr "Display Button"
321
 
@@ -346,9 +410,6 @@ msgstr "Custom URL"
346
  #~ msgid "Button Text Color"
347
  #~ msgstr "Button Text Color"
348
 
349
- #~ msgid "Display on Pages"
350
- #~ msgstr "Display on Pages"
351
-
352
  #~ msgid "Display Reopen Button"
353
  #~ msgstr "Display Reopen Button"
354
 
@@ -367,15 +428,6 @@ msgstr "Custom URL"
367
  #~ msgid "Notification Bar"
368
  #~ msgstr "Notification Bar"
369
 
370
- #~ msgid "[Page]"
371
- #~ msgstr "[Page]"
372
-
373
- #~ msgid "Home"
374
- #~ msgstr "Home"
375
-
376
- #~ msgid "[Post]"
377
- #~ msgstr "[Post]"
378
-
379
  #~ msgid "Top"
380
  #~ msgstr "Top"
381
 
@@ -422,24 +474,12 @@ msgstr "Custom URL"
422
  #~ msgid "[Displays a button next to the message.]"
423
  #~ msgstr "[Displays a button next to the message.]"
424
 
425
- #~ msgid "Filter"
426
- #~ msgstr "Filter"
427
-
428
- #~ msgid "All pages."
429
- #~ msgstr "All pages."
430
-
431
  #~ msgid "Only in landing page."
432
  #~ msgstr "Only in landing page."
433
 
434
  #~ msgid "[The first page they visit on your website.]"
435
  #~ msgstr "[The first page they visit on your website.]"
436
 
437
- #~ msgid "Include in following pages"
438
- #~ msgstr "Include in following pages"
439
-
440
- #~ msgid "Exclude in following pages"
441
- #~ msgstr "Exclude in following pages"
442
-
443
  #~ msgid "Color"
444
  #~ msgstr "Color"
445
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
+ "POT-Creation-Date: 2014-03-16 22:12-0700\n"
5
+ "PO-Revision-Date: 2014-03-16 22:12-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
 
172
  msgstr "Scroll Duration"
173
 
174
  #: ../classes/class-wpfront-scroll-top-options.php:48
175
+ msgid "Auto Hide"
176
+ msgstr "Auto Hide"
177
+
178
+ #: ../classes/class-wpfront-scroll-top-options.php:49
179
+ msgid "Auto Hide After"
180
+ msgstr "Auto Hide After"
181
+
182
+ #: ../classes/class-wpfront-scroll-top-options.php:50
183
  msgid "Hide on Small Devices"
184
  msgstr "Hide on Small Devices"
185
 
186
+ #: ../classes/class-wpfront-scroll-top-options.php:51
187
  msgid "Small Device Max Width"
188
  msgstr "Small Device Max Width"
189
 
190
+ #: ../classes/class-wpfront-scroll-top-options.php:52
191
  msgid "Hide on Small Window"
192
  msgstr "Hide on Small Window"
193
 
194
+ #: ../classes/class-wpfront-scroll-top-options.php:53
195
  msgid "Small Window Max Width"
196
  msgstr "Small Window Max Width"
197
 
198
+ #: ../classes/class-wpfront-scroll-top-options.php:54
199
  msgid "Button Style"
200
  msgstr "Button Style"
201
 
202
+ #: ../classes/class-wpfront-scroll-top-options.php:55
203
+ msgid "Hide on WP-ADMIN"
204
+ msgstr "Hide on WP-ADMIN"
205
+
206
+ #: ../classes/class-wpfront-scroll-top-options.php:56
207
+ msgid "Hide on iframes"
208
+ msgstr "Hide on iframes"
209
+
210
+ #: ../classes/class-wpfront-scroll-top-options.php:58
211
+ #: ../templates/options-template.php:218
212
  msgid "Location"
213
  msgstr "Location"
214
 
215
+ #: ../classes/class-wpfront-scroll-top-options.php:59
216
  msgid "Margin X"
217
  msgstr "Margin X"
218
 
219
+ #: ../classes/class-wpfront-scroll-top-options.php:60
220
  msgid "Margin Y"
221
  msgstr "Margin Y"
222
 
223
+ #: ../classes/class-wpfront-scroll-top-options.php:62
224
+ #: ../templates/options-template.php:170
225
  msgid "Text"
226
  msgstr "Text"
227
 
228
+ #: ../classes/class-wpfront-scroll-top-options.php:63
229
  msgid "Text Color"
230
  msgstr "Text Color"
231
 
232
+ #: ../classes/class-wpfront-scroll-top-options.php:64
233
  msgid "Background Color"
234
  msgstr "Background Color"
235
 
236
+ #: ../classes/class-wpfront-scroll-top-options.php:65
237
  msgid "Custom CSS"
238
  msgstr "Custom CSS"
239
 
240
+ #: ../classes/class-wpfront-scroll-top-options.php:67
241
+ msgid "Display on Pages"
242
+ msgstr "Display on Pages"
243
+
244
  #: ../classes/class-wpfront-scroll-top.php:63
245
  msgid "WPFront Scroll Top"
246
  msgstr "WPFront Scroll Top"
249
  msgid "Scroll Top"
250
  msgstr "Scroll Top"
251
 
252
+ #: ../classes/class-wpfront-scroll-top.php:226
253
+ #: ../classes/class-wpfront-scroll-top.php:230
254
+ msgid "[Page]"
255
+ msgstr "[Page]"
256
+
257
+ #: ../classes/class-wpfront-scroll-top.php:226
258
+ msgid "Home"
259
+ msgstr "Home"
260
+
261
+ #: ../classes/class-wpfront-scroll-top.php:235
262
+ msgid "[Post]"
263
+ msgstr "[Post]"
264
+
265
  #: ../templates/options-template.php:32
266
  msgid "WPFront Scroll Top Settings"
267
  msgstr "WPFront Scroll Top Settings"
290
  msgid "[Window scroll duration in milliseconds.]"
291
  msgstr "[Window scroll duration in milliseconds.]"
292
 
293
+ #: ../templates/options-template.php:105
294
+ msgid ""
295
+ "[Button will be auto hidden after this duration in seconds, if enabled.]"
296
+ msgstr ""
297
+ "[Button will be auto hidden after this duration in seconds, if enabled.]"
298
+
299
+ #: ../templates/options-template.php:114
300
  msgid "[Button will be hidden on small devices when the width matches.]"
301
  msgstr "[Button will be hidden on small devices when the width matches.]"
302
 
303
+ #: ../templates/options-template.php:123
304
  msgid "[Button will be hidden on devices with lesser or equal width.]"
305
  msgstr "[Button will be hidden on devices with lesser or equal width.]"
306
 
307
+ #: ../templates/options-template.php:132
308
  msgid "[Button will be hidden on broswer window when the width matches.]"
309
  msgstr "[Button will be hidden on broswer window when the width matches.]"
310
 
311
+ #: ../templates/options-template.php:141
312
  msgid "[Button will be hidden on browser window with lesser or equal width.]"
313
  msgstr "[Button will be hidden on browser window with lesser or equal width.]"
314
 
315
+ #: ../templates/options-template.php:150
316
+ msgid "[Button will be hidden on 'wp-admin'.]"
317
+ msgstr "[Button will be hidden on 'wp-admin'.]"
318
+
319
+ #: ../templates/options-template.php:159
320
+ msgid "[Button will be hidden on iframes, usually inside popups.]"
321
+ msgstr "[Button will be hidden on iframes, usually inside popups.]"
322
+
323
+ #: ../templates/options-template.php:168 ../templates/options-template.php:309
324
  msgid "Image"
325
  msgstr "Image"
326
 
327
+ #: ../templates/options-template.php:176
328
  msgid "Text Button"
329
  msgstr "Text Button"
330
 
331
+ #: ../templates/options-template.php:226
332
  msgid "Bottom Right"
333
  msgstr "Bottom Right"
334
 
335
+ #: ../templates/options-template.php:227
336
  msgid "Bottom Left"
337
  msgstr "Bottom Left"
338
 
339
+ #: ../templates/options-template.php:228
340
  msgid "Top Right"
341
  msgstr "Top Right"
342
 
343
+ #: ../templates/options-template.php:229
344
  msgid "Top Left"
345
  msgstr "Top Left"
346
 
347
+ #: ../templates/options-template.php:239 ../templates/options-template.php:248
348
  msgid "[Negative value allowed.]"
349
  msgstr "[Negative value allowed.]"
350
 
351
+ #: ../templates/options-template.php:253
352
+ msgid "Filter"
353
+ msgstr "Filter"
354
+
355
+ #: ../templates/options-template.php:262
356
+ msgid "All pages."
357
+ msgstr "All pages."
358
+
359
+ #: ../templates/options-template.php:267
360
+ msgid "Include in following pages"
361
+ msgstr "Include in following pages"
362
+
363
+ #: ../templates/options-template.php:287
364
+ msgid "Exclude in following pages"
365
+ msgstr "Exclude in following pages"
366
+
367
+ #: ../templates/options-template.php:325
368
  msgid "Custom URL"
369
  msgstr "Custom URL"
370
 
380
  #~ msgid "Display Close Button"
381
  #~ msgstr "Display Close Button"
382
 
 
 
 
383
  #~ msgid "Display Button"
384
  #~ msgstr "Display Button"
385
 
410
  #~ msgid "Button Text Color"
411
  #~ msgstr "Button Text Color"
412
 
 
 
 
413
  #~ msgid "Display Reopen Button"
414
  #~ msgstr "Display Reopen Button"
415
 
428
  #~ msgid "Notification Bar"
429
  #~ msgstr "Notification Bar"
430
 
 
 
 
 
 
 
 
 
 
431
  #~ msgid "Top"
432
  #~ msgstr "Top"
433
 
474
  #~ msgid "[Displays a button next to the message.]"
475
  #~ msgstr "[Displays a button next to the message.]"
476
 
 
 
 
 
 
 
477
  #~ msgid "Only in landing page."
478
  #~ msgstr "Only in landing page."
479
 
480
  #~ msgid "[The first page they visit on your website.]"
481
  #~ msgstr "[The first page they visit on your website.]"
482
 
 
 
 
 
 
 
483
  #~ msgid "Color"
484
  #~ msgstr "Color"
485
 
readme.txt CHANGED
@@ -3,15 +3,15 @@ Contributors: syammohanm
3
  Donate link: http://wpfront.com/donate/
4
  Tags: back, back to top, navigation, navigate, page, scroll, scroll to top, scroll top, scroll up, top, up
5
  Requires at least: 3.0
6
- Tested up to: 3.8
7
- Stable tag: 1.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
11
- Allows the visitor to easily scroll back to the top of the page.
12
 
13
  == Description ==
14
- Allows the visitor to easily scroll back to the top of the page, with fully customizable options and image.
15
 
16
  ### Features
17
  * Displays a button when user scrolls down the page.
@@ -19,9 +19,16 @@ Allows the visitor to easily scroll back to the top of the page, with fully cust
19
  * Create text or image button.
20
  * Set any image you want.
21
  * Hide on small devices.
 
 
 
 
 
22
 
23
  Visit [WPFront Scroll Top Settings](http://wpfront.com/scroll-top-plugin-settings/) page for detailed option descriptions.
24
 
 
 
25
  == Installation ==
26
 
27
  1. Click Plugins/Add New from the WordPress admin panel
@@ -46,6 +53,12 @@ No one has asked anything yet.
46
 
47
  == Changelog ==
48
 
 
 
 
 
 
 
49
  = 1.2 =
50
  * Text button option
51
  * Bug fixes
@@ -66,6 +79,11 @@ No one has asked anything yet.
66
 
67
  == Upgrade Notice ==
68
 
 
 
 
 
 
69
  = 1.2 =
70
  * Text based button added
71
 
3
  Donate link: http://wpfront.com/donate/
4
  Tags: back, back to top, navigation, navigate, page, scroll, scroll to top, scroll top, scroll up, top, up
5
  Requires at least: 3.0
6
+ Tested up to: 3.9
7
+ Stable tag: 1.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
11
+ WPFront Scroll Top plugin allows the visitor to easily scroll back to the top of the page.
12
 
13
  == Description ==
14
+ WPFront Scroll Top plugin allows the visitor to easily scroll back to the top of the page, with fully customizable options and image. WPFront Scroll Top plugin has the following features.
15
 
16
  ### Features
17
  * Displays a button when user scrolls down the page.
19
  * Create text or image button.
20
  * Set any image you want.
21
  * Hide on small devices.
22
+ * Hide on iframes.
23
+ * Pages/Posts filter.
24
+ * Auto hide.
25
+
26
+ http://www.youtube.com/watch?v=DJ55kwTOerE
27
 
28
  Visit [WPFront Scroll Top Settings](http://wpfront.com/scroll-top-plugin-settings/) page for detailed option descriptions.
29
 
30
+ Visit [WPFront Scroll Top FAQ](http://wpfront.com/scroll-top-plugin-faq/) page for FAQ.
31
+
32
  == Installation ==
33
 
34
  1. Click Plugins/Add New from the WordPress admin panel
53
 
54
  == Changelog ==
55
 
56
+ = 1.3 =
57
+ * Auto hide
58
+ * Hide on wp-admin
59
+ * Hide on iframes
60
+ * Pages/posts filter
61
+
62
  = 1.2 =
63
  * Text button option
64
  * Bug fixes
79
 
80
  == Upgrade Notice ==
81
 
82
+ = 1.3 =
83
+ * Now you can auto hide it
84
+ * Hide on wp-admin/iframes
85
+ * Pages/posts filter added
86
+
87
  = 1.2 =
88
  * Text based button added
89
 
templates/options-template.php CHANGED
@@ -88,6 +88,23 @@
88
  <span class="description"><?php echo $this->__('[Window scroll duration in milliseconds.]'); ?></span>
89
  </td>
90
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  <tr>
92
  <th scope="row">
93
  <?php echo $this->options->hide_small_device_label(); ?>
@@ -124,6 +141,24 @@
124
  <span class="description"><?php echo $this->__('[Button will be hidden on browser window with lesser or equal width.]'); ?></span>
125
  </td>
126
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  <tr>
128
  <th scope="row">
129
  <?php echo $this->options->button_style_label(); ?>
@@ -215,6 +250,62 @@
215
  </tr>
216
  </table>
217
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  <h3><?php echo $this->__('Image'); ?></h3>
219
  <div class="icons-container">
220
  <?php
@@ -261,6 +352,15 @@
261
  setColorPicker($(e));
262
  });
263
 
 
 
 
 
 
 
 
 
 
264
  })(jQuery);
265
  </script>
266
 
88
  <span class="description"><?php echo $this->__('[Window scroll duration in milliseconds.]'); ?></span>
89
  </td>
90
  </tr>
91
+ <tr>
92
+ <th scope="row">
93
+ <?php echo $this->options->auto_hide_label(); ?>
94
+ </th>
95
+ <td>
96
+ <input type="checkbox" name="<?php echo $this->options->auto_hide_name(); ?>" <?php echo $this->options->auto_hide() ? "checked" : ""; ?> />
97
+ </td>
98
+ </tr>
99
+ <tr>
100
+ <th scope="row">
101
+ <?php echo $this->options->auto_hide_after_label(); ?>
102
+ </th>
103
+ <td>
104
+ <input class="seconds" name="<?php echo $this->options->auto_hide_after_name(); ?>" value="<?php echo $this->options->auto_hide_after(); ?>" />sec
105
+ <span class="description"><?php echo $this->__('[Button will be auto hidden after this duration in seconds, if enabled.]'); ?></span>
106
+ </td>
107
+ </tr>
108
  <tr>
109
  <th scope="row">
110
  <?php echo $this->options->hide_small_device_label(); ?>
141
  <span class="description"><?php echo $this->__('[Button will be hidden on browser window with lesser or equal width.]'); ?></span>
142
  </td>
143
  </tr>
144
+ <tr>
145
+ <th scope="row">
146
+ <?php echo $this->options->hide_wpadmin_label(); ?>
147
+ </th>
148
+ <td>
149
+ <input type="checkbox" name="<?php echo $this->options->hide_wpadmin_name(); ?>" <?php echo $this->options->hide_wpadmin() ? "checked" : ""; ?> />
150
+ <span class="description"><?php echo $this->__('[Button will be hidden on \'wp-admin\'.]'); ?></span>
151
+ </td>
152
+ </tr>
153
+ <tr>
154
+ <th scope="row">
155
+ <?php echo $this->options->hide_iframe_label(); ?>
156
+ </th>
157
+ <td>
158
+ <input type="checkbox" name="<?php echo $this->options->hide_iframe_name(); ?>" <?php echo $this->options->hide_iframe() ? "checked" : ""; ?> />
159
+ <span class="description"><?php echo $this->__('[Button will be hidden on iframes, usually inside popups.]'); ?></span>
160
+ </td>
161
+ </tr>
162
  <tr>
163
  <th scope="row">
164
  <?php echo $this->options->button_style_label(); ?>
250
  </tr>
251
  </table>
252
 
253
+ <h3><?php echo $this->__('Filter'); ?></h3>
254
+ <table class="form-table">
255
+ <tr>
256
+ <th scope="row">
257
+ <?php echo $this->options->display_pages_label(); ?>
258
+ </th>
259
+ <td>
260
+ <label>
261
+ <input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="1" <?php echo $this->options->display_pages() == 1 ? 'checked' : ''; ?> />
262
+ <span><?php echo $this->__('All pages.'); ?></span>
263
+ </label>
264
+ <br />
265
+ <label>
266
+ <input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="2" <?php echo $this->options->display_pages() == 2 ? 'checked' : ''; ?> />
267
+ <span><?php echo $this->__('Include in following pages'); ?></span>
268
+ </label>
269
+ <div class="pages-selection">
270
+ <input type="hidden" name="<?php echo $this->options->include_pages_name(); ?>" value="<?php echo $this->options->include_pages(); ?>" />
271
+ <?php
272
+ $objects = $this->get_filter_objects();
273
+ foreach ($objects as $key => $value) {
274
+ ?>
275
+ <div class="page-div">
276
+ <label>
277
+ <input type="checkbox" value="<?php echo $key; ?>" <?php echo strpos($this->options->include_pages(), $key) === FALSE ? '' : 'checked'; ?> />
278
+ <?php echo $value; ?>
279
+ </label>
280
+ </div>
281
+ <?php
282
+ }
283
+ ?>
284
+ </div>
285
+ <label>
286
+ <input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="3" <?php echo $this->options->display_pages() == 3 ? 'checked' : ''; ?> />
287
+ <span><?php echo $this->__('Exclude in following pages'); ?></span>
288
+ </label>
289
+ <div class="pages-selection">
290
+ <input type="hidden" name="<?php echo $this->options->exclude_pages_name(); ?>" value="<?php echo $this->options->exclude_pages(); ?>" />
291
+ <?php
292
+ $objects = $this->get_filter_objects();
293
+ foreach ($objects as $key => $value) {
294
+ ?>
295
+ <div class="page-div">
296
+ <label>
297
+ <input type="checkbox" value="<?php echo $key; ?>" <?php echo strpos($this->options->exclude_pages(), $key) === FALSE ? '' : 'checked'; ?> />
298
+ <?php echo $value; ?>
299
+ </label>
300
+ </div>
301
+ <?php
302
+ }
303
+ ?>
304
+ </div>
305
+ </td>
306
+ </tr>
307
+ </table>
308
+
309
  <h3><?php echo $this->__('Image'); ?></h3>
310
  <div class="icons-container">
311
  <?php
352
  setColorPicker($(e));
353
  });
354
 
355
+ $('#wpfront-scroll-top-options .pages-selection input[type="checkbox"]').change(function() {
356
+ var values = [];
357
+ var div = $(this).parent().parent().parent();
358
+ div.find('input:checked').each(function(i, e) {
359
+ values.push($(e).val());
360
+ });
361
+ div.children(":first").val(values.join());
362
+ });
363
+
364
  })(jQuery);
365
  </script>
366
 
wpfront-scroll-top.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WPFront Scroll Top
4
  * Plugin URI: http://wpfront.com/scroll-top-plugin/
5
  * Description: Allows the visitor to easily scroll back to the top of the page.
6
- * Version: 1.2
7
  * Author: Syam Mohan
8
  * Author URI: http://wpfront.com
9
  * License: GPL v3
3
  * Plugin Name: WPFront Scroll Top
4
  * Plugin URI: http://wpfront.com/scroll-top-plugin/
5
  * Description: Allows the visitor to easily scroll back to the top of the page.
6
+ * Version: 1.3
7
  * Author: Syam Mohan
8
  * Author URI: http://wpfront.com
9
  * License: GPL v3