Q2W3 Fixed Widget - Version 4.0.5

Version Description

  • New option "Inherit widget width from the parent container" to better support responsive layouts.
  • Javascript optimization.
Download this release

Release Info

Developer Max Bond
Plugin Icon 128x128 Q2W3 Fixed Widget
Version 4.0.5
Comparing to
See all releases

Code changes from version 4.0.4 to 4.0.5

js/q2w3-fixed-widget.js CHANGED
@@ -14,7 +14,7 @@ function q2w3_sidebar(options) {
14
  var document_height = jQuery(document).height();
15
  var fixed_margin_top = options.margin_top;
16
 
17
- jQuery('.q2w3-widget-clone').remove(); // clear fixed mode p1
18
 
19
  for ( var i = 0; i < options.widgets.length; i++ ) {
20
  widget_obj = jQuery('#' + options.widgets[i]);
@@ -25,7 +25,7 @@ function q2w3_sidebar(options) {
25
  widgets[i].clone = widget_obj.clone();
26
  widgets[i].clone.children().remove();
27
  widgets[i].clone_id = widget_obj.attr('id') + '_clone';
28
- widgets[i].clone.addClass('q2w3-widget-clone');
29
  widgets[i].clone.attr('id', widgets[i].clone_id);
30
  widgets[i].clone.css('height', widget_obj.height());
31
  widgets[i].clone.css('visibility', 'hidden');
@@ -67,9 +67,7 @@ function q2w3_sidebar(options) {
67
  var trigger_top = widget.offset_top - widget.fixed_margin_top;
68
  var trigger_bottom = document_height - options.margin_bottom;
69
 
70
- var widget_width = widget.obj.css('width');
71
- var widget_margin = widget.obj.css('margin');
72
- var widget_padding = widget.obj.css('padding');
73
 
74
  var style_applied_top = false;
75
  var style_applied_bottom = false;
@@ -82,8 +80,6 @@ function q2w3_sidebar(options) {
82
  widget.obj.css('position', 'fixed');
83
  widget.obj.css('top', '');
84
  widget.obj.css('width', widget_width);
85
- widget.obj.css('margin', widget_margin);
86
- widget.obj.css('padding', widget_padding);
87
  if(jQuery('#'+widget.clone_id).length <= 0) widget.obj.before(widget.clone);
88
  style_applied_bottom = true;
89
  style_applied_top = false;
@@ -96,8 +92,6 @@ function q2w3_sidebar(options) {
96
  widget.obj.css('top', widget.fixed_margin_top);
97
  widget.obj.css('bottom', '');
98
  widget.obj.css('width', widget_width);
99
- widget.obj.css('margin', widget_margin);
100
- widget.obj.css('padding', widget_padding);
101
  if(jQuery('#'+widget.clone_id).length <= 0) widget.obj.before(widget.clone);
102
  style_applied_top = true;
103
  style_applied_bottom = false;
@@ -108,8 +102,6 @@ function q2w3_sidebar(options) {
108
  widget.obj.css('position', '');
109
  widget.obj.css('top', '');
110
  widget.obj.css('width', '');
111
- widget.obj.css('margin', '');
112
- widget.obj.css('padding', '');
113
  if(jQuery('#'+widget.clone_id).length > 0) jQuery('#'+widget.clone_id).remove();
114
  style_applied_normal = true;
115
  style_applied_top = false;
14
  var document_height = jQuery(document).height();
15
  var fixed_margin_top = options.margin_top;
16
 
17
+ jQuery('.q2w3-widget-clone-' + options.sidebar).remove(); // clear fixed mode p1
18
 
19
  for ( var i = 0; i < options.widgets.length; i++ ) {
20
  widget_obj = jQuery('#' + options.widgets[i]);
25
  widgets[i].clone = widget_obj.clone();
26
  widgets[i].clone.children().remove();
27
  widgets[i].clone_id = widget_obj.attr('id') + '_clone';
28
+ widgets[i].clone.addClass('q2w3-widget-clone-' + options.sidebar);
29
  widgets[i].clone.attr('id', widgets[i].clone_id);
30
  widgets[i].clone.css('height', widget_obj.height());
31
  widgets[i].clone.css('visibility', 'hidden');
67
  var trigger_top = widget.offset_top - widget.fixed_margin_top;
68
  var trigger_bottom = document_height - options.margin_bottom;
69
 
70
+ var widget_width; if ( options.width_inherit ) widget_width = 'inherit'; else widget_width = widget.obj.css('width');
 
 
71
 
72
  var style_applied_top = false;
73
  var style_applied_bottom = false;
80
  widget.obj.css('position', 'fixed');
81
  widget.obj.css('top', '');
82
  widget.obj.css('width', widget_width);
 
 
83
  if(jQuery('#'+widget.clone_id).length <= 0) widget.obj.before(widget.clone);
84
  style_applied_bottom = true;
85
  style_applied_top = false;
92
  widget.obj.css('top', widget.fixed_margin_top);
93
  widget.obj.css('bottom', '');
94
  widget.obj.css('width', widget_width);
 
 
95
  if(jQuery('#'+widget.clone_id).length <= 0) widget.obj.before(widget.clone);
96
  style_applied_top = true;
97
  style_applied_bottom = false;
102
  widget.obj.css('position', '');
103
  widget.obj.css('top', '');
104
  widget.obj.css('width', '');
 
 
105
  if(jQuery('#'+widget.clone_id).length > 0) jQuery('#'+widget.clone_id).remove();
106
  style_applied_normal = true;
107
  style_applied_top = false;
js/q2w3-fixed-widget.min.js CHANGED
@@ -1 +1 @@
1
- function q2w3_sidebar(e){function t(){}function f(t){var n=t.offset_top-t.fixed_margin_top;var s=i-e.margin_bottom;var o=t.obj.css("width");var u=t.obj.css("margin");var a=t.obj.css("padding");var f=false;var l=false;var c=false;jQuery(window).on("scroll."+e.sidebar,function(e){var i=jQuery(this).scrollTop();if(i+t.fixed_margin_bottom>=s){if(!l){t.obj.css("position","fixed");t.obj.css("top","");t.obj.css("width",o);t.obj.css("margin",u);t.obj.css("padding",a);if(jQuery("#"+t.clone_id).length<=0)t.obj.before(t.clone);l=true;f=false;c=false}t.obj.css("bottom",i+r+t.next_widgets_height-s)}else if(i>=n){if(!f){t.obj.css("position","fixed");t.obj.css("top",t.fixed_margin_top);t.obj.css("bottom","");t.obj.css("width",o);t.obj.css("margin",u);t.obj.css("padding",a);if(jQuery("#"+t.clone_id).length<=0)t.obj.before(t.clone);f=true;l=false;c=false}}else{if(!c){t.obj.css("position","");t.obj.css("top","");t.obj.css("width","");t.obj.css("margin","");t.obj.css("padding","");if(jQuery("#"+t.clone_id).length>0)jQuery("#"+t.clone_id).remove();c=true;f=false;l=false}}}).trigger("scroll."+e.sidebar);jQuery(window).on("resize",function(){if(jQuery(window).width()<=e.screen_max_width){jQuery(window).off("load scroll."+e.sidebar);t.obj.css("position","");t.obj.css("top","");t.obj.css("width","");t.obj.css("margin","");t.obj.css("padding","");if(jQuery("#"+t.clone_id).length>0)jQuery("#"+t.clone_id).remove();c=true;f=false;l=false}}).trigger("resize")}if(!e.widgets)return false;if(e.widgets.length<1)return false;if(!e.sidebar)e.sidebar="q2w3-default-sidebar";var n=new Array;var r=jQuery(window).height();var i=jQuery(document).height();var s=e.margin_top;jQuery(".q2w3-widget-clone").remove();for(var o=0;o<e.widgets.length;o++){widget_obj=jQuery("#"+e.widgets[o]);widget_obj.css("position","");if(widget_obj.attr("id")){n[o]=new t;n[o].obj=widget_obj;n[o].clone=widget_obj.clone();n[o].clone.children().remove();n[o].clone_id=widget_obj.attr("id")+"_clone";n[o].clone.addClass("q2w3-widget-clone");n[o].clone.attr("id",n[o].clone_id);n[o].clone.css("height",widget_obj.height());n[o].clone.css("visibility","hidden");n[o].offset_top=widget_obj.offset().top;n[o].fixed_margin_top=s;n[o].height=widget_obj.outerHeight(true);n[o].fixed_margin_bottom=s+n[o].height;s+=n[o].height}else{n[o]=false}}var u=0;var a;for(var o=n.length-1;o>=0;o--){if(n[o]){n[o].next_widgets_height=u;n[o].fixed_margin_bottom+=u;u+=n[o].height;if(!a){a=widget_obj.parent();a.css("height","");a.height(a.height())}}}jQuery(window).off("load scroll."+e.sidebar);for(var o=0;o<n.length;o++){if(n[o])f(n[o])}}
1
+ function q2w3_sidebar(e){function t(){}function f(t){var n=t.offset_top-t.fixed_margin_top;var s=i-e.margin_bottom;var o;if(e.width_inherit)o="inherit";else o=t.obj.css("width");var u=false;var a=false;var f=false;jQuery(window).on("scroll."+e.sidebar,function(e){var i=jQuery(this).scrollTop();if(i+t.fixed_margin_bottom>=s){if(!a){t.obj.css("position","fixed");t.obj.css("top","");t.obj.css("width",o);if(jQuery("#"+t.clone_id).length<=0)t.obj.before(t.clone);a=true;u=false;f=false}t.obj.css("bottom",i+r+t.next_widgets_height-s)}else if(i>=n){if(!u){t.obj.css("position","fixed");t.obj.css("top",t.fixed_margin_top);t.obj.css("bottom","");t.obj.css("width",o);if(jQuery("#"+t.clone_id).length<=0)t.obj.before(t.clone);u=true;a=false;f=false}}else{if(!f){t.obj.css("position","");t.obj.css("top","");t.obj.css("width","");if(jQuery("#"+t.clone_id).length>0)jQuery("#"+t.clone_id).remove();f=true;u=false;a=false}}}).trigger("scroll."+e.sidebar);jQuery(window).on("resize",function(){if(jQuery(window).width()<=e.screen_max_width){jQuery(window).off("load scroll."+e.sidebar);t.obj.css("position","");t.obj.css("top","");t.obj.css("width","");t.obj.css("margin","");t.obj.css("padding","");if(jQuery("#"+t.clone_id).length>0)jQuery("#"+t.clone_id).remove();f=true;u=false;a=false}}).trigger("resize")}if(!e.widgets)return false;if(e.widgets.length<1)return false;if(!e.sidebar)e.sidebar="q2w3-default-sidebar";var n=new Array;var r=jQuery(window).height();var i=jQuery(document).height();var s=e.margin_top;jQuery(".q2w3-widget-clone-"+e.sidebar).remove();for(var o=0;o<e.widgets.length;o++){widget_obj=jQuery("#"+e.widgets[o]);widget_obj.css("position","");if(widget_obj.attr("id")){n[o]=new t;n[o].obj=widget_obj;n[o].clone=widget_obj.clone();n[o].clone.children().remove();n[o].clone_id=widget_obj.attr("id")+"_clone";n[o].clone.addClass("q2w3-widget-clone-"+e.sidebar);n[o].clone.attr("id",n[o].clone_id);n[o].clone.css("height",widget_obj.height());n[o].clone.css("visibility","hidden");n[o].offset_top=widget_obj.offset().top;n[o].fixed_margin_top=s;n[o].height=widget_obj.outerHeight(true);n[o].fixed_margin_bottom=s+n[o].height;s+=n[o].height}else{n[o]=false}}var u=0;var a;for(var o=n.length-1;o>=0;o--){if(n[o]){n[o].next_widgets_height=u;n[o].fixed_margin_bottom+=u;u+=n[o].height;if(!a){a=widget_obj.parent();a.css("height","");a.height(a.height())}}}jQuery(window).off("load scroll."+e.sidebar);for(var o=0;o<n.length;o++){if(n[o])f(n[o])}}
lang/ru_RU.mo CHANGED
Binary file
lang/ru_RU.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Q2W3 Fixed Widget\n"
4
- "POT-Creation-Date: 2013-09-22 19:32+0400\n"
5
- "PO-Revision-Date: 2013-09-22 19:33+0400\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
@@ -15,60 +15,90 @@ msgstr ""
15
  "ru-dev\\wp-content\\plugins\\q2w3-fixed-widget\n"
16
 
17
  #: c:\Program Files
18
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:173
19
  msgid "Fixed widget"
20
  msgstr "Зафиксировать виджет"
21
 
22
  #: c:\Program Files
23
  #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:213
24
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:275
25
  msgid "Fixed Widget Options"
26
  msgstr "Фикс. Виджеты"
27
 
28
  #: c:\Program Files
29
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  msgid "Settings saved."
31
  msgstr ""
32
 
33
  #: c:\Program Files
34
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:287
 
 
 
 
 
35
  msgid "Margin Top:"
36
  msgstr "Верхний отступ:"
37
 
38
  #: c:\Program Files
39
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:287
40
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:289
41
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:293
42
  msgid "px"
43
  msgstr "пикс."
44
 
45
  #: c:\Program Files
46
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:289
47
  msgid "Margin Bottom:"
48
  msgstr "Нижний отступ:"
49
 
50
  #: c:\Program Files
51
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:291
52
  msgid "Refresh interval:"
53
  msgstr "Интервал обновления:"
54
 
55
  #: c:\Program Files
56
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:291
57
  msgid "milliseconds"
58
  msgstr "миллисекунды"
59
 
60
  #: c:\Program Files
61
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:291
62
  msgid "Set 0 to disable."
63
  msgstr "Установите 0, чтобы отключить пересчет параметров"
64
 
65
  #: c:\Program Files
66
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:293
67
  msgid "Screen Max Width:"
68
  msgstr "Ширина окна браузера:"
69
 
70
  #: c:\Program Files
71
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:293
72
  msgid ""
73
  "Plugin will be disabled when browser window width equals or less then "
74
  "specified value"
@@ -76,42 +106,89 @@ msgstr ""
76
  "Плагин будет отключен, если ширина окна браузера меньше указанного значения"
77
 
78
  #: c:\Program Files
79
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:295
80
  msgid "Custom HTML IDs (each one on a new line):"
81
  msgstr ""
82
- "HTML-идентификаторы статических виджетов и прочих<br/> нестандартных "
83
- "элементов (каждый на новой строке):"
84
 
85
  #: c:\Program Files
86
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:297
87
- msgid "Use jQuery(window).load() hook:"
88
- msgstr "Вкл. jQuery(window).load():"
89
 
90
  #: c:\Program Files
91
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:297
92
- msgid ""
93
- "Use this option only if you have problems with <a href=\"http://wordpress."
94
- "org/support/topic/doesnt-work-with-infinte-scroll-for-widget-scripts\" "
95
- "target=\"_blank\">other scroll oriented javascript code</a>"
 
 
 
 
 
 
 
 
 
 
 
 
96
  msgstr ""
97
- "Используйте эту опцию только в случае проблем с <a href=\"http://wordpress."
98
- "org/support/topic/doesnt-work-with-infinte-scroll-for-widget-scripts\" "
99
- "target=\"_blank\">другими скриптами</a>"
100
 
101
  #: c:\Program Files
102
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:299
103
- msgid "Enable plugin for logged in users only:"
104
- msgstr "Вкл. плагин только для вошедших пользователей:"
105
 
106
  #: c:\Program Files
107
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:301
 
 
 
 
 
 
 
108
  msgid "widget_display_callback hook priority:"
109
  msgstr "Приоритет хука widget_display_callback:"
110
 
111
  #: c:\Program Files
112
- #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:303
113
- msgid "Save Changes"
114
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  #~ msgid "Disable plugin on phone devices:"
117
  #~ msgstr "Отключить плагин на мобильных:"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Q2W3 Fixed Widget\n"
4
+ "POT-Creation-Date: 2013-10-04 19:56+0400\n"
5
+ "PO-Revision-Date: 2013-10-04 20:04+0400\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
15
  "ru-dev\\wp-content\\plugins\\q2w3-fixed-widget\n"
16
 
17
  #: c:\Program Files
18
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:175
19
  msgid "Fixed widget"
20
  msgstr "Зафиксировать виджет"
21
 
22
  #: c:\Program Files
23
  #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:213
24
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:303
25
  msgid "Fixed Widget Options"
26
  msgstr "Фикс. Виджеты"
27
 
28
  #: c:\Program Files
29
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:291
30
+ msgid "General Options"
31
+ msgstr "Основные настройки"
32
+
33
+ #: c:\Program Files
34
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:293
35
+ msgid "Compatibility"
36
+ msgstr "Совместимость"
37
+
38
+ #: c:\Program Files
39
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:295
40
+ msgid "Custom IDs"
41
+ msgstr "Произвольные идентификаторы"
42
+
43
+ #: c:\Program Files
44
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:297
45
+ msgid "Help for users"
46
+ msgstr "Помощь пользователям"
47
+
48
+ #: c:\Program Files
49
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:299
50
+ msgid "Help for developer"
51
+ msgstr "Помощь разработчику"
52
+
53
+ #: c:\Program Files
54
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:307
55
  msgid "Settings saved."
56
  msgstr ""
57
 
58
  #: c:\Program Files
59
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:333
60
+ msgid "Save Changes"
61
+ msgstr ""
62
+
63
+ #: c:\Program Files
64
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:347
65
  msgid "Margin Top:"
66
  msgstr "Верхний отступ:"
67
 
68
  #: c:\Program Files
69
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:347
70
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:349
71
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:353
72
  msgid "px"
73
  msgstr "пикс."
74
 
75
  #: c:\Program Files
76
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:349
77
  msgid "Margin Bottom:"
78
  msgstr "Нижний отступ:"
79
 
80
  #: c:\Program Files
81
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:351
82
  msgid "Refresh interval:"
83
  msgstr "Интервал обновления:"
84
 
85
  #: c:\Program Files
86
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:351
87
  msgid "milliseconds"
88
  msgstr "миллисекунды"
89
 
90
  #: c:\Program Files
91
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:351
92
  msgid "Set 0 to disable."
93
  msgstr "Установите 0, чтобы отключить пересчет параметров"
94
 
95
  #: c:\Program Files
96
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:353
97
  msgid "Screen Max Width:"
98
  msgstr "Ширина окна браузера:"
99
 
100
  #: c:\Program Files
101
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:353
102
  msgid ""
103
  "Plugin will be disabled when browser window width equals or less then "
104
  "specified value"
106
  "Плагин будет отключен, если ширина окна браузера меньше указанного значения"
107
 
108
  #: c:\Program Files
109
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:359
110
  msgid "Custom HTML IDs (each one on a new line):"
111
  msgstr ""
112
+ "HTML-идентификаторы статических виджетов и прочих нестандартных элементов "
113
+ "(каждый на новой строке):"
114
 
115
  #: c:\Program Files
116
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:365
117
+ msgid "Enable plugin for logged in users only:"
118
+ msgstr "Только зарегистрированные пользователи:"
119
 
120
  #: c:\Program Files
121
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:365
122
+ msgid "Enable this option for debug purposes (frontend problems and etc.)"
123
+ msgstr "Используйте для отладки стилей, скриптов"
124
+
125
+ #: c:\Program Files
126
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:367
127
+ msgid "Auto fix widget id:"
128
+ msgstr "Автоматически исправлять id виджетов:"
129
+
130
+ #: c:\Program Files
131
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:369
132
+ msgid "Inherit widget width from the parent container:"
133
+ msgstr "Наследовать ширину фиксированного виджета:"
134
+
135
+ #: c:\Program Files
136
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:369
137
+ msgid "Enable this option for themes with responsive sidebar"
138
  msgstr ""
139
+ "Задействуйте эту опцию, если ширина сайдбара вашей темы меняется динамически"
 
 
140
 
141
  #: c:\Program Files
142
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:371
143
+ msgid "Use jQuery(window).load() hook:"
144
+ msgstr "Вкл. jQuery(window).load():"
145
 
146
  #: c:\Program Files
147
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:371
148
+ msgid ""
149
+ "Enable this option only if you have problems with other scroll oriented "
150
+ "javascript code"
151
+ msgstr "Задействуйте эту опцию в случае проблем с другими скриптами"
152
+
153
+ #: c:\Program Files
154
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:373
155
  msgid "widget_display_callback hook priority:"
156
  msgstr "Приоритет хука widget_display_callback:"
157
 
158
  #: c:\Program Files
159
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:379
160
+ msgid "RATE THE PLUGIN"
161
+ msgstr "ОЦЕНИТЬ ПЛАГИН"
162
+
163
+ #: c:\Program Files
164
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:387
165
+ msgid "Support forums:"
166
+ msgstr "Форумы поддержки:"
167
+
168
+ #: c:\Program Files
169
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:389
170
+ msgid "English (wordpress.org)"
171
+ msgstr "Английский (wordpress.org)"
172
+
173
+ #: c:\Program Files
174
+ #: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:391
175
+ msgid "Russian (www.q2w3.ru)"
176
+ msgstr "Русский (www.q2w3.ru)"
177
+
178
+ #~ msgid "English"
179
+ #~ msgstr "Английский (wordpress.org)"
180
+
181
+ #~ msgid "Russian"
182
+ #~ msgstr "Русский (www.q2w3.ru)"
183
+
184
+ #~ msgid ""
185
+ #~ "Use this option only if you have problems with <a href=\"http://wordpress."
186
+ #~ "org/support/topic/doesnt-work-with-infinte-scroll-for-widget-scripts\" "
187
+ #~ "target=\"_blank\">other scroll oriented javascript code</a>"
188
+ #~ msgstr ""
189
+ #~ "Используйте эту опцию только в случае проблем с <a href=\"http://"
190
+ #~ "wordpress.org/support/topic/doesnt-work-with-infinte-scroll-for-widget-"
191
+ #~ "scripts\" target=\"_blank\">другими скриптами</a>"
192
 
193
  #~ msgid "Disable plugin on phone devices:"
194
  #~ msgstr "Отключить плагин на мобильных:"
q2w3-fixed-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Q2W3 Fixed Widget
4
  Plugin URI: http://www.q2w3.ru/q2w3-fixed-widget-wordpress-plugin/
5
  Description: Fixes positioning of the selected widgets, when the page is scrolled down.
6
  Author: Max Bond
7
- Version: 4.0.4
8
  Author URI: http://www.q2w3.ru/
9
  */
10
 
@@ -16,11 +16,13 @@ class q2w3_fixed_widget { // Plugin class
16
 
17
  const ID = 'q2w3_fixed_widget';
18
 
19
- const VERSION = '4.0.4';
20
 
21
  protected static $sidebars_widgets;
22
 
23
  protected static $fixed_widgets;
 
 
24
 
25
 
26
 
@@ -41,16 +43,18 @@ class q2w3_fixed_widget { // Plugin class
41
  add_action('admin_init', array( __CLASS__, 'register_settings' ));
42
 
43
  add_action('admin_menu', array( __CLASS__, 'admin_menu' ));
 
 
44
 
45
  } else {
46
 
47
- if ( $options['fix-widget-id'] ) self::registered_sidebars_filter(); //add_action('wp_loaded', array( __CLASS__, 'registered_sidebars_filter' )); //
48
 
49
  add_filter('widget_display_callback', array( __CLASS__, 'is_widget_fixed' ), $options['widget_display_callback_priority'], 3);
50
 
51
  add_action('wp_loaded', array( __CLASS__, 'custom_ids' ));
52
 
53
- add_action('wp_footer', array( __CLASS__, 'action_script' ), 1);
54
 
55
  wp_enqueue_script('q2w3-fixed-widget', plugin_dir_url( __FILE__ ) . 'js/q2w3-fixed-widget.min.js', array('jquery'), self::VERSION);
56
 
@@ -140,9 +144,11 @@ class q2w3_fixed_widget { // Plugin class
140
 
141
  $i++;
142
 
 
 
143
  $widgets_array = implode(',', $widgets);
144
 
145
- echo ' var q2w3_sidebar_'. $i .'_options = { "sidebar" : "'. $sidebar .'", "margin_top" : '. $options['margin-top'] .', "margin_bottom" : '. $options['margin-bottom'] .', "screen_max_width" : '. $options['screen-max-width'] .', "widgets" : ['. $widgets_array .'] };'.PHP_EOL;
146
 
147
  echo ' q2w3_sidebar(q2w3_sidebar_'. $i .'_options);'.PHP_EOL;
148
 
@@ -206,8 +212,8 @@ class q2w3_fixed_widget { // Plugin class
206
 
207
  public static function admin_menu() {
208
 
209
- add_submenu_page( 'themes.php', __('Fixed Widget Options', 'q2w3_fixed_widget'), __('Fixed Widget Options', 'q2w3_fixed_widget'), 'activate_plugins', 'q2w3_fixed_widget', array( __CLASS__, 'settings_page' ) );
210
-
211
  }
212
 
213
  protected static function defaults() {
@@ -226,6 +232,8 @@ class q2w3_fixed_widget { // Plugin class
226
 
227
  $d['logged_in_req'] = false;
228
 
 
 
229
  $d['widget_display_callback_priority'] = 30;
230
 
231
  return $d;
@@ -264,12 +272,34 @@ class q2w3_fixed_widget { // Plugin class
264
 
265
  if ( !isset($input['logged_in_req']) ) $input['logged_in_req'] = false;
266
 
 
 
267
  return $input;
268
 
269
  }
270
 
 
 
 
 
 
 
 
 
271
  public static function settings_page() {
272
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  $options = self::load_options();
274
 
275
  echo '<div class="wrap"><div id="icon-themes" class="icon32"><br /></div><h2>'. __('Fixed Widget Options', 'q2w3_fixed_widget') .'</h2>'.PHP_EOL;
@@ -283,34 +313,84 @@ class q2w3_fixed_widget { // Plugin class
283
  echo '<form method="post" action="options.php">'.PHP_EOL;
284
 
285
  settings_fields(self::ID);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  echo '<p><span style="display: inline-block; width: 150px;">'. __('Margin Top:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[margin-top]" value="'. $options['margin-top'] .'" style="width: 50px; text-align: center;" />&nbsp;'. __('px', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
288
 
289
  echo '<p><span style="display: inline-block; width: 150px;">'. __('Margin Bottom:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[margin-bottom]" value="'. $options['margin-bottom'] .'" style="width: 50px; text-align: center;" />&nbsp;'. __('px', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
290
-
291
  echo '<p><span style="display: inline-block; width: 150px;">'. __('Refresh interval:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[refresh-interval]" value="'. $options['refresh-interval'] .'" style="width: 50px; text-align: center;" />&nbsp;'. __('milliseconds', 'q2w3_fixed_widget') .' / '. __('Set 0 to disable.', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
292
-
293
  echo '<p><span style="display: inline-block; width: 150px;">'. __('Screen Max Width:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[screen-max-width]" value="'. $options['screen-max-width'] .'" style="width: 50px; text-align: center;" />&nbsp;'. __('px', 'q2w3_fixed_widget') .' / '. __('Plugin will be disabled when browser window width equals or less then specified value', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
294
 
295
- echo '<p><span >'. __('Custom HTML IDs (each one on a new line):', 'q2w3_fixed_widget') .'</span><br/><textarea name="'. self::ID .'[custom-ids]" style="width: 320px; height: 120px;">'. $options['custom-ids'] .'</textarea>'.PHP_EOL;
296
-
297
- echo '<p><span style="display: inline-block; width: 220px;">'. __('Auto fix widget id:', 'q2w3_fixed_widget') .'</span><input type="checkbox" name="'. self::ID .'[fix-widget-id]" value="yes" '. checked('yes', $options['fix-widget-id'], false) .' /> </p>'.PHP_EOL;
 
 
298
 
299
- echo '<p><span style="display: inline-block; width: 220px;">'. __('Use jQuery(window).load() hook:', 'q2w3_fixed_widget') .'</span><input type="checkbox" name="'. self::ID .'[window-load-enabled]" value="yes" '. checked('yes', $options['window-load-enabled'], false) .' /> '. __('Use this option only if you have problems with <a href="http://wordpress.org/support/topic/doesnt-work-with-infinte-scroll-for-widget-scripts" target="_blank">other scroll oriented javascript code</a>', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
300
-
301
- echo '<p><span style="display: inline-block; width: 220px;">'. __('Enable plugin for logged in users only:', 'q2w3_fixed_widget') .'</span><input type="checkbox" name="'. self::ID .'[logged_in_req]" value="yes" '. checked('yes', $options['logged_in_req'], false) .' /></p>'.PHP_EOL;
 
 
 
 
302
 
303
- echo '<p><span style="display: inline-block; width: 220px;">'. __('widget_display_callback hook priority:', 'q2w3_fixed_widget') .'</span><select name="'. self::ID .'[widget_display_callback_priority]"><option value="1" '. selected('1', $options['widget_display_callback_priority'], false) .'>1</option><option value="10" '. selected('10', $options['widget_display_callback_priority'], false) .'>10</option><option value="20" '. selected('20', $options['widget_display_callback_priority'], false) .'>20</option><option value="30" '. selected('30', $options['widget_display_callback_priority'], false) .'>30</option><option value="50" '. selected('50', $options['widget_display_callback_priority'], false) .'>50</option><option value="100" '. selected('100', $options['widget_display_callback_priority'], false) .'>100</option></select></p>'.PHP_EOL;
 
 
 
 
 
 
 
 
304
 
305
- echo '<p class="submit"><input type="submit" class="button-primary" value="'. __('Save Changes') .'" /></p>'.PHP_EOL;
306
-
307
- echo '</form>'.PHP_EOL;
308
 
309
- echo '<br/>'.PHP_EOL;
310
-
311
- echo '<p><form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="Q36H2MHNVVP7U"><input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"></form></p>'.PHP_EOL;
312
-
313
- echo '</div><!-- .wrap -->'.PHP_EOL;
 
 
 
 
 
 
314
 
315
  }
316
 
4
  Plugin URI: http://www.q2w3.ru/q2w3-fixed-widget-wordpress-plugin/
5
  Description: Fixes positioning of the selected widgets, when the page is scrolled down.
6
  Author: Max Bond
7
+ Version: 4.0.5
8
  Author URI: http://www.q2w3.ru/
9
  */
10
 
16
 
17
  const ID = 'q2w3_fixed_widget';
18
 
19
+ const VERSION = '4.0.5';
20
 
21
  protected static $sidebars_widgets;
22
 
23
  protected static $fixed_widgets;
24
+
25
+ protected static $settings_page_hook;
26
 
27
 
28
 
43
  add_action('admin_init', array( __CLASS__, 'register_settings' ));
44
 
45
  add_action('admin_menu', array( __CLASS__, 'admin_menu' ));
46
+
47
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'settings_page_js' ) );
48
 
49
  } else {
50
 
51
+ if ( $options['fix-widget-id'] ) self::registered_sidebars_filter();
52
 
53
  add_filter('widget_display_callback', array( __CLASS__, 'is_widget_fixed' ), $options['widget_display_callback_priority'], 3);
54
 
55
  add_action('wp_loaded', array( __CLASS__, 'custom_ids' ));
56
 
57
+ add_action('wp_footer', array( __CLASS__, 'action_script' ));
58
 
59
  wp_enqueue_script('q2w3-fixed-widget', plugin_dir_url( __FILE__ ) . 'js/q2w3-fixed-widget.min.js', array('jquery'), self::VERSION);
60
 
144
 
145
  $i++;
146
 
147
+ if ( isset($options['width-inherit']) && $options['width-inherit'] ) $options['width-inherit'] = 'true'; else $options['width-inherit'] = 'false';
148
+
149
  $widgets_array = implode(',', $widgets);
150
 
151
+ echo ' var q2w3_sidebar_'. $i .'_options = { "sidebar" : "'. $sidebar .'", "margin_top" : '. $options['margin-top'] .', "margin_bottom" : '. $options['margin-bottom'] .', "screen_max_width" : '. $options['screen-max-width'] .', "width_inherit" : '. $options['width-inherit'] .', "widgets" : ['. $widgets_array .'] };'.PHP_EOL;
152
 
153
  echo ' q2w3_sidebar(q2w3_sidebar_'. $i .'_options);'.PHP_EOL;
154
 
212
 
213
  public static function admin_menu() {
214
 
215
+ self::$settings_page_hook = add_submenu_page( 'themes.php', __('Fixed Widget Options', 'q2w3_fixed_widget'), __('Fixed Widget Options', 'q2w3_fixed_widget'), 'activate_plugins', 'q2w3_fixed_widget', array( __CLASS__, 'settings_page' ) );
216
+
217
  }
218
 
219
  protected static function defaults() {
232
 
233
  $d['logged_in_req'] = false;
234
 
235
+ $d['width-inherit'] = false;
236
+
237
  $d['widget_display_callback_priority'] = 30;
238
 
239
  return $d;
272
 
273
  if ( !isset($input['logged_in_req']) ) $input['logged_in_req'] = false;
274
 
275
+ if ( !isset($input['width-inherit']) ) $input['width-inherit'] = false;
276
+
277
  return $input;
278
 
279
  }
280
 
281
+ public static function settings_page_js($hook) {
282
+
283
+ if( self::$settings_page_hook != $hook ) return;
284
+
285
+ wp_enqueue_script('postbox');
286
+
287
+ }
288
+
289
  public static function settings_page() {
290
 
291
+ $screen = get_current_screen();
292
+
293
+ add_meta_box(self::ID.'-general', __('General Options', 'q2w3_fixed_widget'), array( __CLASS__, 'settings_page_general_box' ), $screen, 'normal');
294
+
295
+ add_meta_box(self::ID.'-compatibility', __('Compatibility', 'q2w3_fixed_widget'), array( __CLASS__, 'settings_page_compatibility_box' ), $screen, 'normal');
296
+
297
+ add_meta_box(self::ID.'-custom-ids', __('Custom IDs', 'q2w3_fixed_widget'), array( __CLASS__, 'settings_page_custom_ids_box' ), $screen, 'normal');
298
+
299
+ add_meta_box(self::ID.'-help', __('Help for users', 'q2w3_fixed_widget'), array( __CLASS__, 'settings_page_help_box' ), $screen, 'side');
300
+
301
+ add_meta_box(self::ID.'-donate', __('Help for developer', 'q2w3_fixed_widget'), array( __CLASS__, 'settings_page_donate_box' ), $screen, 'side');
302
+
303
  $options = self::load_options();
304
 
305
  echo '<div class="wrap"><div id="icon-themes" class="icon32"><br /></div><h2>'. __('Fixed Widget Options', 'q2w3_fixed_widget') .'</h2>'.PHP_EOL;
313
  echo '<form method="post" action="options.php">'.PHP_EOL;
314
 
315
  settings_fields(self::ID);
316
+
317
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
318
+
319
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
320
+
321
+ echo '<div id="poststuff" class="metabox-holder has-right-sidebar">'.PHP_EOL;
322
+
323
+ echo '<div class="inner-sidebar" id="side-info-column">'.PHP_EOL;
324
+
325
+ do_meta_boxes( $screen, 'side', $options );
326
+
327
+ echo '</div>'.PHP_EOL;
328
+
329
+ echo '<div id="post-body-content">'.PHP_EOL;
330
+
331
+ do_meta_boxes( $screen, 'normal', $options );
332
+
333
+ echo '</div>'.PHP_EOL;
334
 
335
+ echo '<p class="submit"><input type="submit" class="button-primary" value="'. __('Save Changes') .'" /></p>'.PHP_EOL;
336
+
337
+ echo '</div><!-- #poststuff -->'.PHP_EOL;
338
+
339
+ echo '</form>'.PHP_EOL;
340
+
341
+ echo '<script>jQuery(document).ready(function(){ postboxes.add_postbox_toggles(pagenow); });</script>'.PHP_EOL;
342
+
343
+ echo '</div><!-- .wrap -->'.PHP_EOL;
344
+
345
+ }
346
+
347
+ public static function settings_page_general_box($options) {
348
+
349
  echo '<p><span style="display: inline-block; width: 150px;">'. __('Margin Top:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[margin-top]" value="'. $options['margin-top'] .'" style="width: 50px; text-align: center;" />&nbsp;'. __('px', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
350
 
351
  echo '<p><span style="display: inline-block; width: 150px;">'. __('Margin Bottom:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[margin-bottom]" value="'. $options['margin-bottom'] .'" style="width: 50px; text-align: center;" />&nbsp;'. __('px', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
352
+
353
  echo '<p><span style="display: inline-block; width: 150px;">'. __('Refresh interval:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[refresh-interval]" value="'. $options['refresh-interval'] .'" style="width: 50px; text-align: center;" />&nbsp;'. __('milliseconds', 'q2w3_fixed_widget') .' / '. __('Set 0 to disable.', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
354
+
355
  echo '<p><span style="display: inline-block; width: 150px;">'. __('Screen Max Width:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[screen-max-width]" value="'. $options['screen-max-width'] .'" style="width: 50px; text-align: center;" />&nbsp;'. __('px', 'q2w3_fixed_widget') .' / '. __('Plugin will be disabled when browser window width equals or less then specified value', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
356
 
357
+ }
358
+
359
+ public static function settings_page_custom_ids_box($options) {
360
+
361
+ echo '<p><span >'. __('Custom HTML IDs (each one on a new line):', 'q2w3_fixed_widget') .'</span><br/><br/><textarea name="'. self::ID .'[custom-ids]" style="width: 320px; height: 120px;">'. $options['custom-ids'] .'</textarea>'.PHP_EOL;
362
 
363
+ }
364
+
365
+ public static function settings_page_compatibility_box($options) {
366
+
367
+ echo '<p><span style="display: inline-block; width: 280px;">'. __('Auto fix widget id:', 'q2w3_fixed_widget') .'</span><input type="checkbox" name="'. self::ID .'[fix-widget-id]" value="yes" '. checked('yes', $options['fix-widget-id'], false) .' /> </p>'.PHP_EOL;
368
+
369
+ echo '<p><span style="display: inline-block; width: 280px;">'. __('Enable plugin for logged in users only:', 'q2w3_fixed_widget') .'</span><input type="checkbox" name="'. self::ID .'[logged_in_req]" value="yes" '. checked('yes', $options['logged_in_req'], false) .' /> '. __('Enable this option for debug purposes (frontend problems and etc.)', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
370
 
371
+ echo '<p><span style="display: inline-block; width: 280px;">'. __('Inherit widget width from the parent container:', 'q2w3_fixed_widget') .'</span><input type="checkbox" name="'. self::ID .'[width-inherit]" value="yes" '. checked('yes', $options['width-inherit'], false) .' /> '. __('Enable this option for themes with responsive sidebar', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
372
+
373
+ echo '<p><span style="display: inline-block; width: 280px;">'. __('Use jQuery(window).load() hook:', 'q2w3_fixed_widget') .'</span><input type="checkbox" name="'. self::ID .'[window-load-enabled]" value="yes" '. checked('yes', $options['window-load-enabled'], false) .' /> '. __('Enable this option only if you have problems with other scroll oriented javascript code', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
374
+
375
+ echo '<p><span style="display: inline-block; width: 280px;">'. __('widget_display_callback hook priority:', 'q2w3_fixed_widget') .'</span><select name="'. self::ID .'[widget_display_callback_priority]"><option value="1" '. selected('1', $options['widget_display_callback_priority'], false) .'>1</option><option value="10" '. selected('10', $options['widget_display_callback_priority'], false) .'>10</option><option value="20" '. selected('20', $options['widget_display_callback_priority'], false) .'>20</option><option value="30" '. selected('30', $options['widget_display_callback_priority'], false) .'>30</option><option value="50" '. selected('50', $options['widget_display_callback_priority'], false) .'>50</option><option value="100" '. selected('100', $options['widget_display_callback_priority'], false) .'>100</option></select></p>'.PHP_EOL;
376
+
377
+ }
378
+
379
+ public static function settings_page_donate_box($options) {
380
 
381
+ echo '<p style="text-align: center"><a href="http://wordpress.org/support/view/plugin-reviews/q2w3-fixed-widget/" target="_blank">'. __('RATE THE PLUGIN', 'q2w3_fixed_widget') .'</a></p>';
 
 
382
 
383
+ echo '<p style="text-align: center"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q36H2MHNVVP7U" target="_blank"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" alt="PayPal - The safer, easier way to pay online!" /></a></p>'.PHP_EOL;
384
+
385
+ }
386
+
387
+ public static function settings_page_help_box($options) {
388
+
389
+ echo '<p>'. __('Support forums:', 'q2w3_fixed_widget') .'</p>';
390
+
391
+ echo '<ul><li><a href="http://wordpress.org/support/plugin/q2w3-fixed-widget/" target="_blank">'. __('English (wordpress.org)', 'q2w3_fixed_widget') .'</a></li>'.PHP_EOL;
392
+
393
+ echo '<li><a href="http://www.q2w3.ru/2012/12/12/4827/" target="_blank">'. __('Russian (www.q2w3.ru)', 'q2w3_fixed_widget') .'</a></li></ul>'.PHP_EOL;
394
 
395
  }
396
 
readme.txt CHANGED
@@ -4,24 +4,22 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: sidebar, widget, scroll, scrolling, fixed, floating, sticky, russian, q2w3
5
  Requires at least: 3.0
6
  Tested up to: 3.6.1
7
- Stable tag: 4.0.3
8
 
9
  Fixes positioning of the selected widgets, when the page is scrolled down.
10
 
11
  == Description ==
12
 
13
  Enable "Fixed widget" option in the widget settings (see [screenshot](http://wordpress.org/extend/plugins/q2w3-fixed-widget/screenshots/))
14
- and it will be always in sight when page is scrolled down or up.
15
 
16
- There is no problem to "Fix" or "Stick" more than one widget.
17
- Version 3.0 brings you a long waited capability to stick widgets located in different sidebars!
18
 
19
- [Watch the demo](http://store.places-finder.com/cp-ajax-post-load).
20
  Right sidebar, last three widgets. Scroll down to the bottom.
21
 
22
  Compatibility note. The plugin is not working with all themes. Theme requirements:
23
 
24
- * Widgets must have unique id attributes in html code (see [FAQ](http://wordpress.org/extend/plugins/q2w3-fixed-widget/faq/)).
25
  * jQuery 1.7 required. jQuery 1.8.3 (or later) is recommended.
26
  * No JavaScript errors, coused by other plugins and scripts.
27
  * `wp_head()` and `wp_footer()` functions in header.php and footer.php files.
@@ -47,24 +45,24 @@ Supported languages:
47
 
48
  There are several reasons:
49
 
50
- 1. Widgets have no unique IDs. How to check. Place two text widgets in your sidebar. Then look at html source of your site. If these two widgets have the same IDs (widget_text) or they have no IDs at all - that's the problem. How to fix. Find `register_sidebar()` function (look first at functions.php file). Parameter `before_widget` should be like this: `<li id="%1$s" class="widget-container %2$s">`. Attention to this part: `id="%1$s"`.
51
- 2. Javascript errors on page. Commonly caused by buggy plugins. Check javascript console of your browser. If you find errors, try to locate and fix its source.
52
- 3. No `wp_head()` and `wp_footer()` functions in template. Check header.php and footer.php files of your active theme.
 
53
 
54
  = Why the plugin is not working in Chrome (and other Webkit based browsers)? =
55
 
56
  Check your CSS files for these two instructions:
57
- `-webkit-backface-visibility:hidden;`
58
- and
59
- `-webkit-transform: translate3d(0,0,0);`
60
- Then disable them and see the result.
61
 
62
  = I have a responsive theme. How can I make the plugin compatible with it? =
63
 
64
- For responsive compatibility I found only one approach: to disable plugin when mobile device detected or when browser window width is less then specified value.
65
- There are several options to accomplish this task. The latest (and recommended!) is to enable "Screen Max Width" option.
66
  For example you have a responsive styles: `@media screen and (max-width: 940px) {...}`. Set "Screen Max Width" = 940 - to disable plugin in responsive mode.
67
- The other options are: "Disable plugin on mobile devices" and "Disable plugin on tablet devices". From version 3.0 these options are depricated and will be removed in the near future.
68
 
69
  = How to prevent overlapping with the footer? =
70
 
@@ -92,6 +90,10 @@ Send me email from this page: [http://www.q2w3.ru/contacts/](http://www.q2w3.ru/
92
 
93
  == Changelog ==
94
 
 
 
 
 
95
  = 4.0.4 =
96
  * Added option "Auto fix widget id". It is on by default. If the plugin is working with this option switched off - leave it in off position!
97
 
4
  Tags: sidebar, widget, scroll, scrolling, fixed, floating, sticky, russian, q2w3
5
  Requires at least: 3.0
6
  Tested up to: 3.6.1
7
+ Stable tag: 4.0.5
8
 
9
  Fixes positioning of the selected widgets, when the page is scrolled down.
10
 
11
  == Description ==
12
 
13
  Enable "Fixed widget" option in the widget settings (see [screenshot](http://wordpress.org/extend/plugins/q2w3-fixed-widget/screenshots/))
14
+ and it will be always in sight when page is scrolled down or up. There is no problem to "Fix" or "Stick" more than one widget even located in different sidebars!
15
 
16
+ [youtube http://www.youtube.com/watch?v=sHXmeH5TfnA]
 
17
 
18
+ [Watch the live demo](http://store.places-finder.com/cp-ajax-post-load).
19
  Right sidebar, last three widgets. Scroll down to the bottom.
20
 
21
  Compatibility note. The plugin is not working with all themes. Theme requirements:
22
 
 
23
  * jQuery 1.7 required. jQuery 1.8.3 (or later) is recommended.
24
  * No JavaScript errors, coused by other plugins and scripts.
25
  * `wp_head()` and `wp_footer()` functions in header.php and footer.php files.
45
 
46
  There are several reasons:
47
 
48
+ 1. Javascript errors on page. Commonly caused by buggy plugins. Check javascript console of your browser. If you find errors, try to locate and fix its source.
49
+ 2. No `wp_head()` and `wp_footer()` functions in template. Check header.php and footer.php files of your active theme.
50
+ 3. Conflicts with other plugins and scripts
51
+ 4. CSS incompatibility
52
 
53
  = Why the plugin is not working in Chrome (and other Webkit based browsers)? =
54
 
55
  Check your CSS files for these two instructions:
56
+ `-webkit-backface-visibility:hidden;
57
+ -webkit-transform: translate3d(0,0,0);`
58
+ If found, disable them and see the result.
 
59
 
60
  = I have a responsive theme. How can I make the plugin compatible with it? =
61
 
62
+ There are several options to accomplish this task.
63
+ First, is to enable "Screen Max Width" option.
64
  For example you have a responsive styles: `@media screen and (max-width: 940px) {...}`. Set "Screen Max Width" = 940 - to disable plugin in responsive mode.
65
+ Second, use "Inherit widget width from the parent container" option.
66
 
67
  = How to prevent overlapping with the footer? =
68
 
90
 
91
  == Changelog ==
92
 
93
+ = 4.0.5 =
94
+ * New option "Inherit widget width from the parent container" to better support responsive layouts.
95
+ * Javascript optimization.
96
+
97
  = 4.0.4 =
98
  * Added option "Auto fix widget id". It is on by default. If the plugin is working with this option switched off - leave it in off position!
99
 
uninstall.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
 
3
- if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) exit(); //if uninstall not called from WordPress exit
4
 
5
  $option_name = 'q2w3_fixed_widget';
6
 
1
+ <?php // plugin uninstall script
2
 
3
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) exit(); // if uninstall not called from WordPress exit
4
 
5
  $option_name = 'q2w3_fixed_widget';
6