YITH WooCommerce Compare - Version 1.0.0

Version Description

  • Initial release

=

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Compare
Version 1.0.0
Comparing to
See all releases

Version 1.0.0

Files changed (55) hide show
  1. README.txt +103 -0
  2. assets/css/admin.css +28 -0
  3. assets/css/colorbox.css +57 -0
  4. assets/css/jquery.dataTables.css +221 -0
  5. assets/css/style.css +289 -0
  6. assets/css/widget.css +31 -0
  7. assets/images/bg-pattern.png +0 -0
  8. assets/images/box-bottom.png +0 -0
  9. assets/images/colorbox/border.png +0 -0
  10. assets/images/colorbox/controls.png +0 -0
  11. assets/images/colorbox/loading.gif +0 -0
  12. assets/images/colorbox/loading_background.png +0 -0
  13. assets/images/logo.png +0 -0
  14. assets/images/mascotte.png +0 -0
  15. assets/images/socials/behance.png +0 -0
  16. assets/images/socials/dribble.png +0 -0
  17. assets/images/socials/email.png +0 -0
  18. assets/images/socials/facebook.png +0 -0
  19. assets/images/socials/flickr.png +0 -0
  20. assets/images/socials/gplus.png +0 -0
  21. assets/images/socials/instagram.png +0 -0
  22. assets/images/socials/linkedin.png +0 -0
  23. assets/images/socials/pinterest.png +0 -0
  24. assets/images/socials/rss.png +0 -0
  25. assets/images/socials/skype.png +0 -0
  26. assets/images/socials/tumblr.png +0 -0
  27. assets/images/socials/twitter.png +0 -0
  28. assets/images/socials/youtube.png +0 -0
  29. assets/js/FixedColumns.min.js +48 -0
  30. assets/js/jquery.colorbox-min.js +6 -0
  31. assets/js/jquery.dataTables.min.js +155 -0
  32. assets/js/woocompare-admin.js +19 -0
  33. assets/js/woocompare.js +165 -0
  34. class.yith-woocompare-admin.php +420 -0
  35. class.yith-woocompare-frontend.php +567 -0
  36. class.yith-woocompare-helper.php +74 -0
  37. class.yith-woocompare.php +83 -0
  38. functions.yith-woocompare.php +11 -0
  39. init.php +60 -0
  40. languages/default.po +228 -0
  41. languages/yit-it_IT.mo +0 -0
  42. languages/yit-it_IT.po +617 -0
  43. languages/yit.pot +228 -0
  44. screenshot-1.png +0 -0
  45. screenshot-2.png +0 -0
  46. screenshot-3.png +0 -0
  47. templates/compare.php +220 -0
  48. widgets/class.yith-woocompare-widget.php +71 -0
  49. yit-common/assets/css/yith-panel.css +78 -0
  50. yit-common/assets/js/google_fonts.json +1 -0
  51. yit-common/assets/js/yith-panel.js +296 -0
  52. yit-common/google_fonts.php +68 -0
  53. yit-common/yit-functions.php +208 -0
  54. yit-common/yith-panel.php +504 -0
  55. yith-woocompare-options.php +118 -0
README.txt ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === YITH WooCommerce Compare ===
2
+
3
+ Contributors: yithemes
4
+ Tags: woocommerce, compare, compare products, product compare, widget
5
+ Requires at least: 3.5.1
6
+ Tested up to: 3.5.1
7
+ Stable tag: 1.0.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ YITH WooCommerce Compare allows you to compare more products of your shop in one complete table.
12
+
13
+
14
+ == Description ==
15
+
16
+ YITH WooCommerce Compare plugin is an extension of Woocommerce plugin that allow your users to compare some products of your shop.
17
+ All products are saved in one complete table where the user can see the difference between the products. Each product features can be
18
+ set with the woocommerce attributes in the product configuration.
19
+ You can also add a simple widget with the list of products the users have added, where you can manage them.
20
+ Also you can simply customize the compare table with your style, by editing the specific template.
21
+
22
+ Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woocommerce_compare/).
23
+
24
+
25
+ = Installation =
26
+
27
+ Once you have installed the plugin, you just need to activate the plugin in order to enable it.
28
+
29
+ = Configuration =
30
+
31
+ 1. Add the features in each product by setting the attributes in prouct configuration;
32
+ 2. Configure the options in Woocommerce -> Settings -> Products compare;
33
+ 3. The user of your shop will click in the "Compare" button located in the single product page;
34
+ 4. Will be open a popup with the compare table inside.
35
+
36
+ You can also add the widget with the product list of compare table, in Appearance -> Widgets and adding the widget "YITH Woocommerce Compare Widget".
37
+
38
+ = Developer =
39
+
40
+ Are you a developer? Want to customize the templates or the style of the plugin? Read on the [documentation](http://yithemes.com/docs-plugins/yith_woocommerce_compare/) and discover how to do that.
41
+
42
+ = Support =
43
+
44
+ Hi there, we have good news here: all our plugins are released for free. Wow!
45
+ Already knew it, right?! Great, but maybe you do not know that: if you're looking for how to install the plugins or how to use them within your Wordpress installations, which is the right way to ask support?
46
+ That's the way:
47
+
48
+ * Register on http://yithemes.com
49
+ * Go to Support > Get Support
50
+
51
+ Here we provide support, not on wordpress.org were, usually we do not read topics. It's better to follow us or write on our forum!
52
+
53
+ == Installation ==
54
+
55
+ 1. Unzip the downloaded zip file.
56
+ 2. Upload the plugin folder into the `wp-content/plugins/` directory of your WordPress site.
57
+ 3. Activate `YITH WooCommerce Compare` from Plugins page
58
+
59
+ == Frequently Asked Questions ==
60
+
61
+ = Can I customize the compare table? =
62
+ Yes, you can copy the template from the plugin folder and paste it inside the folder "woocommerce" of your theme folder.
63
+
64
+ = Can I select what fields show inside the compare table? =
65
+ Yes, you can choose what fields to show in the compare table. You can do it in Woocommerce -> Settings -> Products Compare.
66
+
67
+ = Can I order the fields in the compare table? =
68
+ Yes, you can sort the fields in the compare table. You can do it in Woocommerce -> Settings -> Products Compare.
69
+
70
+ == Screenshots ==
71
+
72
+ 1. The popup with compare table.
73
+ 2. The button compare.
74
+ 3. The settings of plugin
75
+
76
+ == Changelog ==
77
+
78
+ = 1.0.0 =
79
+
80
+ * Initial release
81
+
82
+ == Suggestions ==
83
+
84
+ If you have suggestions about how to improve YITH WooCommerce Compare, you can [write us](mailto:plugins@yithemes.com "Your Inspiration Themes") so we can bundle them into YITH WooCommerce Compare.
85
+
86
+ == Translators ==
87
+
88
+ = Available Languages =
89
+ * English (Default)
90
+ * Italiano
91
+
92
+ If you have created your own language pack, or have an update for an existing one, you can send [gettext PO and MO file](http://codex.wordpress.org/Translating_WordPress "Translating WordPress")
93
+ [use](http://yithemes.com/contact/ "Your Inspiration Themes") so we can bundle it into YITH WooCommerce Compare Languages.
94
+
95
+ == Documentation ==
96
+
97
+ Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woocommerce_compare/).
98
+
99
+ == Upgrade notice ==
100
+
101
+ = 1.0.0 =
102
+
103
+ Initial release
assets/css/admin.css ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .yith_woocommerce_slider {
2
+ width: 300px;
3
+ float: left
4
+ }
5
+ .yith_woocommerce_slider_value {
6
+ margin-top: -5px;
7
+ margin-left: 10px;
8
+ width: 50px;
9
+ float: left;
10
+ text-align: center;
11
+ font-weight: bold;
12
+ }
13
+
14
+ .attributes li {
15
+ margin-bottom: 0;
16
+ }
17
+
18
+ .attributes .ui-sortable-placeholder {
19
+ background: #f9f9f9;
20
+ border: 1px dashed #d4d4d4;
21
+ -webkit-border-radius: 3px;
22
+ -moz-border-radius: 3px;
23
+ border-radius: 3px;
24
+ visibility: visible !important;
25
+ box-sizing: border-box;
26
+ -moz-box-sizing: border-box;
27
+ margin-bottom: -2px;
28
+ }
assets/css/colorbox.css ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Colorbox Core Style:
3
+ The following CSS is consistent between example themes and should not be altered.
4
+ */
5
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:10000; overflow:hidden;}
6
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
7
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
8
+ #cboxContent{position:relative;}
9
+ #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
10
+ #cboxTitle{margin:0;}
11
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
12
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
13
+ .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
14
+ .cboxIframe{width:100%; height:100%; display:block; border:0;}
15
+ #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
16
+
17
+ /*
18
+ User Style:
19
+ Change the following styles to modify the appearance of Colorbox. They are
20
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
21
+ */
22
+ #cboxOverlay{background:#000;}
23
+ #colorbox{outline:0;}
24
+ #cboxTopLeft{width:14px; height:14px; background:url(../images/colorbox/controls.png) no-repeat 0 0;}
25
+ #cboxTopCenter{height:14px; background:url(../images/colorbox/border.png) repeat-x top left;}
26
+ #cboxTopRight{width:14px; height:14px; background:url(../images/colorbox/controls.png) no-repeat -36px 0;}
27
+ #cboxBottomLeft{width:14px; height:43px; background:url(../images/colorbox/controls.png) no-repeat 0 -32px;}
28
+ #cboxBottomCenter{height:43px; background:url(../images/colorbox/border.png) repeat-x bottom left;}
29
+ #cboxBottomRight{width:14px; height:43px; background:url(../images/colorbox/controls.png) no-repeat -36px -32px;}
30
+ #cboxMiddleLeft{width:14px; background:url(../images/colorbox/controls.png) repeat-y -175px 0;}
31
+ #cboxMiddleRight{width:14px; background:url(../images/colorbox/controls.png) repeat-y -211px 0;}
32
+ #cboxContent{background:#fff; overflow:visible;}
33
+ .cboxIframe{background:#fff;}
34
+ #cboxError{padding:50px; border:1px solid #ccc;}
35
+ #cboxLoadedContent{margin-bottom:5px;}
36
+ #cboxLoadingOverlay{background:url(../images/colorbox/loading_background.png) no-repeat center center;}
37
+ #cboxLoadingGraphic{background:url(../images/colorbox/loading.gif) no-repeat center center;}
38
+ #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
39
+ #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
40
+
41
+ /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
42
+ #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; position:absolute; bottom:-29px; background:url(../images/colorbox/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
43
+
44
+ /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
45
+ #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
46
+
47
+ #cboxPrevious{left:0px; background-position: -51px -25px;}
48
+ #cboxPrevious:hover{background-position:-51px 0px;}
49
+ #cboxNext{left:27px; background-position:-75px -25px;}
50
+ #cboxNext:hover{background-position:-75px 0px;}
51
+ #cboxClose{right:0; background-position:-100px -25px;}
52
+ #cboxClose:hover{background-position:-100px 0px;}
53
+
54
+ .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;}
55
+ .cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;}
56
+ .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
57
+ .cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;}
assets/css/jquery.dataTables.css ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*
3
+ * Table
4
+ */
5
+ table.dataTable {
6
+ margin: 0 auto;
7
+ clear: both;
8
+ width: 500px;
9
+ }
10
+
11
+ table.dataTable thead th {
12
+ padding: 3px 18px 3px 10px;
13
+ border-bottom: 1px solid black;
14
+ font-weight: bold;
15
+ cursor: pointer;
16
+ *cursor: hand;
17
+ }
18
+
19
+ table.dataTable tfoot th {
20
+ padding: 3px 18px 3px 10px;
21
+ border-top: 1px solid black;
22
+ font-weight: bold;
23
+ }
24
+
25
+ table.dataTable td {
26
+ padding: 3px 10px;
27
+ }
28
+
29
+ table.dataTable td.center,
30
+ table.dataTable td.dataTables_empty {
31
+ text-align: center;
32
+ }
33
+
34
+ /*table.dataTable tr.odd { background-color: #E2E4FF; }
35
+ table.dataTable tr.even { background-color: white; }
36
+
37
+ table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; }
38
+ table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; }
39
+ table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; }
40
+ table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; }
41
+ table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; }
42
+ table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }*/
43
+
44
+
45
+ /*
46
+ * Table wrapper
47
+ */
48
+ .dataTables_wrapper {
49
+ position: relative;
50
+ clear: both;
51
+ *zoom: 1;
52
+ }
53
+
54
+
55
+ /*
56
+ * Page length menu
57
+ */
58
+ .dataTables_length {
59
+ float: left;
60
+ }
61
+
62
+
63
+ /*
64
+ * Filter
65
+ */
66
+ .dataTables_filter {
67
+ float: right;
68
+ text-align: right;
69
+ }
70
+
71
+
72
+ /*
73
+ * Table information
74
+ */
75
+ .dataTables_info {
76
+ clear: both;
77
+ float: left;
78
+ }
79
+
80
+
81
+ /*
82
+ * Pagination
83
+ */
84
+ .dataTables_paginate {
85
+ float: right;
86
+ text-align: right;
87
+ }
88
+
89
+ /* Two button pagination - previous / next */
90
+ .paginate_disabled_previous,
91
+ .paginate_enabled_previous,
92
+ .paginate_disabled_next,
93
+ .paginate_enabled_next {
94
+ height: 19px;
95
+ float: left;
96
+ cursor: pointer;
97
+ *cursor: hand;
98
+ color: #111 !important;
99
+ }
100
+ .paginate_disabled_previous:hover,
101
+ .paginate_enabled_previous:hover,
102
+ .paginate_disabled_next:hover,
103
+ .paginate_enabled_next:hover {
104
+ text-decoration: none !important;
105
+ }
106
+ .paginate_disabled_previous:active,
107
+ .paginate_enabled_previous:active,
108
+ .paginate_disabled_next:active,
109
+ .paginate_enabled_next:active {
110
+ outline: none;
111
+ }
112
+
113
+ .paginate_disabled_previous,
114
+ .paginate_disabled_next {
115
+ color: #666 !important;
116
+ }
117
+ .paginate_disabled_previous,
118
+ .paginate_enabled_previous {
119
+ padding-left: 23px;
120
+ }
121
+ .paginate_disabled_next,
122
+ .paginate_enabled_next {
123
+ padding-right: 23px;
124
+ margin-left: 10px;
125
+ }
126
+
127
+ /*.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; }
128
+ .paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; }
129
+ .paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; }
130
+
131
+ .paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; }
132
+ .paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; }
133
+ .paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; }*/
134
+
135
+ /* Full number pagination */
136
+ .paging_full_numbers {
137
+ height: 22px;
138
+ line-height: 22px;
139
+ }
140
+ .paging_full_numbers a:active {
141
+ outline: none
142
+ }
143
+ .paging_full_numbers a:hover {
144
+ text-decoration: none;
145
+ }
146
+
147
+ .paging_full_numbers a.paginate_button,
148
+ .paging_full_numbers a.paginate_active {
149
+ border: 1px solid #aaa;
150
+ -webkit-border-radius: 5px;
151
+ -moz-border-radius: 5px;
152
+ border-radius: 5px;
153
+ padding: 2px 5px;
154
+ margin: 0 3px;
155
+ cursor: pointer;
156
+ *cursor: hand;
157
+ color: #333 !important;
158
+ }
159
+
160
+ .paging_full_numbers a.paginate_button {
161
+ background-color: #ddd;
162
+ }
163
+
164
+ .paging_full_numbers a.paginate_button:hover {
165
+ background-color: #ccc;
166
+ text-decoration: none !important;
167
+ }
168
+
169
+ .paging_full_numbers a.paginate_active {
170
+ background-color: #99B3FF;
171
+ }
172
+
173
+
174
+ /*
175
+ * Processing indicator
176
+ */
177
+ .dataTables_processing {
178
+ position: absolute;
179
+ top: 50%;
180
+ left: 50%;
181
+ width: 250px;
182
+ height: 30px;
183
+ margin-left: -125px;
184
+ margin-top: -15px;
185
+ padding: 14px 0 2px 0;
186
+ border: 1px solid #ddd;
187
+ text-align: center;
188
+ color: #999;
189
+ font-size: 14px;
190
+ background-color: white;
191
+ }
192
+
193
+
194
+ /*
195
+ * Sorting
196
+ */
197
+ /*.sorting { background: url('../images/sort_both.png') no-repeat center right; }
198
+ .sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; }
199
+ .sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; }
200
+
201
+ .sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; }
202
+ .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; }*/
203
+
204
+ table.dataTable thead th:active,
205
+ table.dataTable thead td:active {
206
+ outline: none;
207
+ }
208
+
209
+
210
+ /*
211
+ * Scrolling
212
+ */
213
+ .dataTables_scroll {
214
+ clear: both;
215
+ }
216
+
217
+ .dataTables_scrollBody {
218
+ *margin-top: -1px;
219
+ -webkit-overflow-scrolling: touch;
220
+ }
221
+
assets/css/style.css ADDED
@@ -0,0 +1,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The style of the woocommerce compare products
3
+ */
4
+
5
+ * {
6
+ margin: 0;
7
+ padding: 0;
8
+ }
9
+
10
+ body {
11
+ font-family: 'Open Sans', san-serif;
12
+ font-size: 13px;
13
+ line-height: 1.51em;
14
+ color: #747373;
15
+ background: none !important;
16
+ }
17
+
18
+ table.compare-list {
19
+ margin: 10px;
20
+ table-layout: fixed;
21
+ }
22
+
23
+ /* plugin fixedheadertable fix */
24
+ table.compare-list thead, table.compare-list tfoot {
25
+ display: none;
26
+ }
27
+
28
+ .table-wrapper {
29
+ width: 100%;
30
+ }
31
+
32
+ table.compare-list thead th, h1 {
33
+ background: #4F4F4F;
34
+ color: #fff;
35
+ font-weight: 800;
36
+ padding: 6px 10px;
37
+ border-bottom: 2px solid #fff;
38
+ display: block;
39
+ text-transform: uppercase;
40
+ font-size: 1.076em;
41
+ }
42
+
43
+ table.compare-list thead th a.close, h1 a.close {
44
+ float: right;
45
+ margin-right: 10px;
46
+ font-weight: 600;
47
+ font-size: 0.9em;
48
+ color: #fff;
49
+ text-decoration: none;
50
+ }
51
+
52
+ table.compare-list th, table.compare-list td,
53
+ table.compare-list th, table.compare-list .price.repeated td {
54
+ padding: 10px;
55
+ }
56
+
57
+ table.compare-list th, table.compare-list td {
58
+ border-bottom: 1px solid #D6D6D6;
59
+ }
60
+
61
+ table.compare-list tr.remove th, table.compare-list tr.remove td,
62
+ table.compare-list tr.image th, table.compare-list tr.image td,
63
+ table.compare-list tr.title th, table.compare-list tr.title td,
64
+ table.compare-list tr.price th, table.compare-list tr.price td {
65
+ border-bottom: 0;
66
+ padding-bottom: 0;
67
+ }
68
+
69
+ table.compare-list tr.image th, table.compare-list tr.image td {
70
+ height: 186px;
71
+ }
72
+
73
+ table.compare-list tr.image th, table.compare-list tr.image td,
74
+ table.compare-list tr.title th, table.compare-list tr.title td,
75
+ table.compare-list tr.price th, table.compare-list tr.price td {
76
+ color: #333;
77
+ text-transform: uppercase;
78
+ font-size: 1.076em;
79
+ }
80
+
81
+ table.compare-list tr.image th, table.compare-list tr.image td,
82
+ table.compare-list tr.price th, table.compare-list tr.price td,
83
+ table.compare-list tr.add-to-cart th, table.compare-list tr.add-to-cart td {
84
+ padding-top: 4px;
85
+ }
86
+
87
+ table.compare-list tr.image th,
88
+ table.compare-list tr.title th,
89
+ table.compare-list tr.price th,
90
+ table.compare-list tr.add-to-cart th {
91
+ text-indent: 150%;
92
+ overflow: hidden;
93
+ white-space: nowrap;
94
+ }
95
+
96
+ table.compare-list .remove td a {
97
+ color: #747373;
98
+ text-decoration: none;
99
+ }
100
+
101
+ table.compare-list .remove td a:hover {
102
+ color: #333333;
103
+ }
104
+
105
+ table.compare-list .remove td a .remove {
106
+ border-radius: 100% 100% 100% 100%;
107
+ color: red;
108
+ display: inline-block;
109
+ font-size: 1em;
110
+ font-weight: 600;
111
+ height: 1em;
112
+ line-height: 0.81em;
113
+ text-align: center;
114
+ text-decoration: none;
115
+ width: 1em;
116
+ }
117
+
118
+ .yith-woocompare-widget ul.products-list a.remove {
119
+ float: left;
120
+ }
121
+
122
+ table.compare-list .remove td a:hover .remove {
123
+ background-color: red;
124
+ color: #ffffff;
125
+ }
126
+
127
+ table.compare-list .add-to-cart td a {
128
+ display: inline-block;
129
+ margin: 10px 0;
130
+ background-color: #4F4F4F;
131
+ border: 0 none;
132
+ color: #FFFFFF;
133
+ font-weight: normal;
134
+ line-height: normal;
135
+ padding: 5px 20px;
136
+ text-decoration: none;
137
+ text-transform: uppercase;
138
+ }
139
+
140
+ table.compare-list .add-to-cart td a:hover {
141
+ background: #868686;
142
+ }
143
+
144
+ table.compare-list .stock td span {
145
+ color: #009900;
146
+ }
147
+
148
+ table.compare-list .stock td span.out-of-stock {
149
+ color: #990000;
150
+ }
151
+
152
+ table.compare-list .price td {
153
+ text-decoration: underline;
154
+ }
155
+
156
+ table.compare-list th .fixed-th {
157
+ width: 205px;
158
+ }
159
+
160
+ table.compare-list th {
161
+ width: 205px;
162
+ max-width: 205px;
163
+ min-width: 205px;
164
+ overflow: hidden;
165
+ text-align: left;
166
+ font-size: 1.076em;
167
+ color: #333333;
168
+ font-weight: 400;
169
+ text-transform: uppercase;
170
+ }
171
+
172
+ table.compare-list td {
173
+ width: 230px;
174
+ max-width: 230px;
175
+ min-width: 230px;
176
+ text-align: center;
177
+ }
178
+
179
+ table.compare-list td.odd {
180
+ background: #F7F7F7;
181
+ }
182
+
183
+ table.compare-list td.even {
184
+ background: #fff;
185
+ }
186
+
187
+ table.compare-list td img {
188
+ background: none repeat scroll 0 0 #FFFFFF;
189
+ border: 1px solid #DADADA;
190
+ height: auto;
191
+ max-width: 100%;
192
+ padding: 3px;
193
+ margin-bottom: 20px;
194
+ max-width: none;
195
+ }
196
+
197
+ /** Fixed Header Table Style */
198
+ /*!
199
+ * jquery.fixedHeaderTable. The jQuery fixedHeaderTable plugin
200
+ *
201
+ * Copyright (c) 2011 Mark Malek
202
+ * http://fixedheadertable.com
203
+ *
204
+ * Licensed under MIT
205
+ * http://www.opensource.org/licenses/mit-license.php
206
+ *
207
+ * http://docs.jquery.com/Plugins/Authoring
208
+ * jQuery authoring guidelines
209
+ *
210
+ * Launch : October 2009
211
+ * Version : 1.3
212
+ * Released: May 9th, 2011
213
+ *
214
+ *
215
+ * all CSS sizing (width,height) is done in pixels (px)
216
+ */
217
+
218
+ /* @group Reset */
219
+
220
+ .fht-table,
221
+ .fht-table thead,
222
+ .fht-table tfoot,
223
+ .fht-table tbody,
224
+ .fht-table tr,
225
+ .fht-table th,
226
+ .fht-table td {
227
+ /* position */
228
+ margin: 0;
229
+
230
+ /* size */
231
+ padding: 0;
232
+
233
+ /* text */
234
+ font-size: 100%;
235
+ font: inherit;
236
+ vertical-align: top;
237
+ }
238
+
239
+ .fht-table {
240
+ /* appearance */
241
+ border-collapse: collapse;
242
+ border-spacing: 0;
243
+ }
244
+
245
+ /* @end */
246
+
247
+ /* @group Content */
248
+
249
+ .fht-table-wrapper,
250
+ .fht-table-wrapper .fht-thead,
251
+ .fht-table-wrapper .fht-tfoot,
252
+ .fht-table-wrapper .fht-fixed-column .fht-tbody,
253
+ .fht-table-wrapper .fht-fixed-body .fht-tbody,
254
+ .fht-table-wrapper .fht-tbody {
255
+ /* appearance */
256
+ overflow: hidden;
257
+
258
+ /* position */
259
+ position: relative;
260
+ }
261
+
262
+ .fht-table-wrapper .fht-fixed-body .fht-tbody,
263
+ .fht-table-wrapper .fht-tbody {
264
+ /* appearance */
265
+ overflow: auto;
266
+ }
267
+
268
+ .fht-table-wrapper .fht-table .fht-cell {
269
+ /* appearance */
270
+ overflow: hidden;
271
+
272
+ /* size */
273
+ height: 1px;
274
+ }
275
+
276
+ .fht-table-wrapper .fht-fixed-column,
277
+ .fht-table-wrapper .fht-fixed-body {
278
+ /* position */
279
+ top: 0;
280
+ left: 0;
281
+ position: absolute;
282
+ }
283
+
284
+ .fht-table-wrapper .fht-fixed-column {
285
+ /* position */
286
+ z-index: 1;
287
+ }
288
+
289
+ /* @end */
assets/css/widget.css ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .yith-woocompare-widget ul.products-list a.remove {
2
+ border-radius: 100% 100% 100% 100%;
3
+ color: red;
4
+ display: inline-block;
5
+ font-size: 1em;
6
+ font-weight: 600;
7
+ height: 1em;
8
+ line-height: 0.81em;
9
+ text-align: center;
10
+ text-decoration: none;
11
+ margin-top: 0.5em;
12
+ width: 1em;
13
+ }
14
+
15
+ .yith-woocompare-widget ul.products-list a.remove {
16
+ float: right;
17
+ }
18
+
19
+ .yith-woocompare-widget ul.products-list a.remove:hover {
20
+ background-color: red;
21
+ color: #ffffff;
22
+ }
23
+
24
+ .yith-woocompare-widget ul.products-list li a.title {
25
+ display: inline-block;
26
+ width: 90%;
27
+ }
28
+
29
+ .yith-woocompare-widget a.compare {
30
+ float: right;
31
+ }
assets/images/bg-pattern.png ADDED
Binary file
assets/images/box-bottom.png ADDED
Binary file
assets/images/colorbox/border.png ADDED
Binary file
assets/images/colorbox/controls.png ADDED
Binary file
assets/images/colorbox/loading.gif ADDED
Binary file
assets/images/colorbox/loading_background.png ADDED
Binary file
assets/images/logo.png ADDED
Binary file
assets/images/mascotte.png ADDED
Binary file
assets/images/socials/behance.png ADDED
Binary file
assets/images/socials/dribble.png ADDED
Binary file
assets/images/socials/email.png ADDED
Binary file
assets/images/socials/facebook.png ADDED
Binary file
assets/images/socials/flickr.png ADDED
Binary file
assets/images/socials/gplus.png ADDED
Binary file
assets/images/socials/instagram.png ADDED
Binary file
assets/images/socials/linkedin.png ADDED
Binary file
assets/images/socials/pinterest.png ADDED
Binary file
assets/images/socials/rss.png ADDED
Binary file
assets/images/socials/skype.png ADDED
Binary file
assets/images/socials/tumblr.png ADDED
Binary file
assets/images/socials/twitter.png ADDED
Binary file
assets/images/socials/youtube.png ADDED
Binary file
assets/js/FixedColumns.min.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * File: FixedColumns.min.js
3
+ * Version: 2.0.3
4
+ * Author: Allan Jardine (www.sprymedia.co.uk)
5
+ *
6
+ * Copyright 2010-2010 Allan Jardine, all rights reserved.
7
+ *
8
+ * This source file is free software, under either the GPL v2 license or a
9
+ * BSD style license, available at:
10
+ * http://datatables.net/license_gpl2
11
+ * http://datatables.net/license_bsd
12
+ *
13
+ * This source file is distributed in the hope that it will be useful, but
14
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
16
+ */
17
+ /*
18
+ GPL v2 or BSD 3 point style
19
+ @contact www.sprymedia.co.uk/contact
20
+
21
+ @copyright Copyright 2010-2011 Allan Jardine, all rights reserved.
22
+
23
+ This source file is free software, under either the GPL v2 license or a
24
+ BSD style license, available at:
25
+ http://datatables.net/license_gpl2
26
+ http://datatables.net/license_bsd
27
+ */
28
+ var FixedColumns;
29
+ (function(b,q){FixedColumns=function(a,e){!this instanceof FixedColumns?alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword."):("undefined"==typeof e&&(e={}),this.s={dt:a.fnSettings(),iTableColumns:a.fnSettings().aoColumns.length,aiWidths:[],bOldIE:b.browser.msie&&("6.0"==b.browser.version||"7.0"==b.browser.version)},this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null,
30
+ head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}},this.s.dt.oFixedColumns=this,this._fnConstruct(e))};FixedColumns.prototype={fnUpdate:function(){this._fnDraw(!0)},fnRedrawLayout:function(){this._fnGridLayout()},fnRecalculateHeight:function(a){a._DTTC_iHeight=null;a.style.height="auto"},fnSetRowHeight:function(a,e){var c=b(a).children(":first"),c=c.outerHeight()-c.height();b.browser.mozilla||b.browser.opera?a.style.height=e+
31
+ "px":b(a).children().height(e-c)},_fnConstruct:function(a){var e,c=this;if("function"!=typeof this.s.dt.oInstance.fnVersionCheck||!0!==this.s.dt.oInstance.fnVersionCheck("1.8.0"))alert("FixedColumns "+FixedColumns.VERSION+" required DataTables 1.8.0 or later. Please upgrade your DataTables installation");else if(""===this.s.dt.oScroll.sX)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"FixedColumns is not needed (no x-scrolling in DataTables enabled), so no action will be taken. Use 'FixedHeader' for column fixing when scrolling is not enabled");
32
+ else{this.s=b.extend(!0,this.s,FixedColumns.defaults,a);this.dom.grid.dt=b(this.s.dt.nTable).parents("div.dataTables_scroll")[0];this.dom.scroller=b("div.dataTables_scrollBody",this.dom.grid.dt)[0];var a=b(this.dom.grid.dt).width(),f=0,g=0;b("tbody>tr:eq(0)>td",this.s.dt.nTable).each(function(a){e=b(this).outerWidth();c.s.aiWidths.push(e);a<c.s.iLeftColumns&&(f+=e);c.s.iTableColumns-c.s.iRightColumns<=a&&(g+=e)});null===this.s.iLeftWidth&&(this.s.iLeftWidth="fixed"==this.s.sLeftWidth?f:100*(f/a));
33
+ null===this.s.iRightWidth&&(this.s.iRightWidth="fixed"==this.s.sRightWidth?g:100*(g/a));this._fnGridSetup();for(a=0;a<this.s.iLeftColumns;a++)this.s.dt.oInstance.fnSetColumnVis(a,!1);for(a=this.s.iTableColumns-this.s.iRightColumns;a<this.s.iTableColumns;a++)this.s.dt.oInstance.fnSetColumnVis(a,!1);b(this.dom.scroller).scroll(function(){c.dom.grid.left.body.scrollTop=c.dom.scroller.scrollTop;if(c.s.iRightColumns>0)c.dom.grid.right.body.scrollTop=c.dom.scroller.scrollTop});b(q).resize(function(){c._fnGridLayout.call(c)});
34
+ var d=!0;this.s.dt.aoDrawCallback=[{fn:function(){c._fnDraw.call(c,d);c._fnGridHeight(c);d=false},sName:"FixedColumns"}].concat(this.s.dt.aoDrawCallback);this._fnGridLayout();this._fnGridHeight();this.s.dt.oInstance.fnDraw(!1)}},_fnGridSetup:function(){this.dom.body=this.s.dt.nTable;this.dom.header=this.s.dt.nTHead.parentNode;this.dom.header.parentNode.parentNode.style.position="relative";var a=b('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;"><div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_LeftBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_LeftFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div></div><div class="DTFC_RightWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_RightHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_RightBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_RightFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div></div></div>')[0];
35
+ nLeft=a.childNodes[0];nRight=a.childNodes[1];this.dom.grid.wrapper=a;this.dom.grid.left.wrapper=nLeft;this.dom.grid.left.head=nLeft.childNodes[0];this.dom.grid.left.body=nLeft.childNodes[1];0<this.s.iRightColumns&&(this.dom.grid.right.wrapper=nRight,this.dom.grid.right.head=nRight.childNodes[0],this.dom.grid.right.body=nRight.childNodes[1]);this.s.dt.nTFoot&&(this.dom.footer=this.s.dt.nTFoot.parentNode,this.dom.grid.left.foot=nLeft.childNodes[2],0<this.s.iRightColumns&&(this.dom.grid.right.foot=nRight.childNodes[2]));
36
+ a.appendChild(nLeft);this.dom.grid.dt.parentNode.insertBefore(a,this.dom.grid.dt);a.appendChild(this.dom.grid.dt);this.dom.grid.dt.style.position="absolute";this.dom.grid.dt.style.top="0px";this.dom.grid.dt.style.left=this.s.iLeftWidth+"px";this.dom.grid.dt.style.width=b(this.dom.grid.dt).width()-this.s.iLeftWidth-this.s.iRightWidth+"px"},_fnGridLayout:function(){var a=this.dom.grid,e=b(a.wrapper).width(),c=0,f=0,c="fixed"==this.s.sLeftWidth?this.s.iLeftWidth:this.s.iLeftWidth/100*e,f="fixed"==this.s.sRightWidth?
37
+ this.s.iRightWidth:this.s.iRightWidth/100*e;a.left.wrapper.style.width=c+"px";a.dt.style.width=e-c-f+"px";a.dt.style.left=c+"px";0<this.s.iRightColumns&&(a.right.wrapper.style.width=f+"px",a.right.wrapper.style.left=e-f+"px")},_fnGridHeight:function(){var a=this.dom.grid,e=b(this.dom.grid.dt).height();a.wrapper.style.height=e+"px";a.left.body.style.height=b(this.dom.scroller).height()+"px";a.left.wrapper.style.height=e+"px";0<this.s.iRightColumns&&(a.right.wrapper.style.height=e+"px",a.right.body.style.height=
38
+ b(this.dom.scroller).height()+"px")},_fnDraw:function(a){this._fnCloneLeft(a);this._fnCloneRight(a);null!==this.s.fnDrawCallback&&this.s.fnDrawCallback.call(this,this.dom.clone.left,this.dom.clone.right);b(this).trigger("draw",{leftClone:this.dom.clone.left,rightClone:this.dom.clone.right})},_fnCloneRight:function(a){if(!(0>=this.s.iRightColumns)){var b,c=[];for(b=this.s.iTableColumns-this.s.iRightColumns;b<this.s.iTableColumns;b++)c.push(b);this._fnClone(this.dom.clone.right,this.dom.grid.right,
39
+ c,a)}},_fnCloneLeft:function(a){if(!(0>=this.s.iLeftColumns)){var b,c=[];for(b=0;b<this.s.iLeftColumns;b++)c.push(b);this._fnClone(this.dom.clone.left,this.dom.grid.left,c,a)}},_fnCopyLayout:function(a,e){for(var c=[],f=[],g=[],d=0,h=a.length;d<h;d++){var i=[];i.nTr=b(a[d].nTr).clone(!0)[0];for(var k=0,m=this.s.iTableColumns;k<m;k++)if(-1!==b.inArray(k,e)){var j=b.inArray(a[d][k].cell,g);-1===j?(j=b(a[d][k].cell).clone(!0)[0],f.push(j),g.push(a[d][k].cell),i.push({cell:j,unique:a[d][k].unique})):
40
+ i.push({cell:f[j],unique:a[d][k].unique})}c.push(i)}return c},_fnClone:function(a,e,c,f){var g=this,d,h,i,k,m,j,n;if(f){null!==a.header&&a.header.parentNode.removeChild(a.header);a.header=b(this.dom.header).clone(!0)[0];a.header.className+=" DTFC_Cloned";a.header.style.width="100%";e.head.appendChild(a.header);var l=this._fnCopyLayout(this.s.dt.aoHeader,c);k=b(">thead",a.header);k.empty();d=0;for(h=l.length;d<h;d++)k[0].appendChild(l[d].nTr);this.s.dt.oApi._fnDrawHead(this.s.dt,l,!0)}else{var l=this._fnCopyLayout(this.s.dt.aoHeader,
41
+ c),o=[];this.s.dt.oApi._fnDetectHeader(o,b(">thead",a.header)[0]);d=0;for(h=l.length;d<h;d++){i=0;for(k=l[d].length;i<k;i++)o[d][i].cell.className=l[d][i].cell.className,b("span.DataTables_sort_icon",o[d][i].cell).each(function(){this.className=b("span.DataTables_sort_icon",l[d][i].cell)[0].className})}}this._fnEqualiseHeights("thead",this.dom.header,a.header);"auto"==this.s.sHeightMatch&&b(">tbody>tr",g.dom.body).css("height","auto");null!==a.body&&(a.body.parentNode.removeChild(a.body),a.body=null);
42
+ a.body=b(this.dom.body).clone(!0)[0];a.body.className+=" DTFC_Cloned";a.body.style.paddingBottom=this.s.dt.oScroll.iBarWidth+"px";a.body.style.marginBottom=2*this.s.dt.oScroll.iBarWidth+"px";null!==a.body.getAttribute("id")&&a.body.removeAttribute("id");b(">thead>tr",a.body).empty();b(">tfoot",a.body).remove();var p=b("tbody",a.body)[0];b(p).empty();if(0<this.s.dt.aiDisplay.length){h=b(">thead>tr",a.body)[0];for(n=0;n<c.length;n++)m=c[n],j=this.s.dt.aoColumns[m].nTh,j.innerHTML="",oStyle=j.style,
43
+ oStyle.paddingTop="0",oStyle.paddingBottom="0",oStyle.borderTopWidth="0",oStyle.borderBottomWidth="0",oStyle.height=0,oStyle.width=g.s.aiWidths[m]+"px",h.appendChild(j);b(">tbody>tr",g.dom.body).each(function(a){var d=this.cloneNode(false),a=g.s.dt.oFeatures.bServerSide===false?g.s.dt.aiDisplay[g.s.dt._iDisplayStart+a]:a;for(n=0;n<c.length;n++){m=c[n];if(typeof g.s.dt.aoData[a]._anHidden[m]!="undefined"){j=b(g.s.dt.aoData[a]._anHidden[m]).clone(true)[0];d.appendChild(j)}}p.appendChild(d)})}else b(">tbody>tr",
44
+ g.dom.body).each(function(){j=this.cloneNode(true);j.className=j.className+" DTFC_NoData";b("td",j).html("");p.appendChild(j)});a.body.style.width="100%";e.body.appendChild(a.body);this._fnEqualiseHeights("tbody",g.dom.body,a.body);if(null!==this.s.dt.nTFoot){if(f){null!==a.footer&&a.footer.parentNode.removeChild(a.footer);a.footer=b(this.dom.footer).clone(!0)[0];a.footer.className+=" DTFC_Cloned";a.footer.style.width="100%";e.foot.appendChild(a.footer);l=this._fnCopyLayout(this.s.dt.aoFooter,c);
45
+ e=b(">tfoot",a.footer);e.empty();d=0;for(h=l.length;d<h;d++)e[0].appendChild(l[d].nTr);this.s.dt.oApi._fnDrawHead(this.s.dt,l,!0)}else{l=this._fnCopyLayout(this.s.dt.aoFooter,c);e=[];this.s.dt.oApi._fnDetectHeader(e,b(">tfoot",a.footer)[0]);d=0;for(h=l.length;d<h;d++){i=0;for(k=l[d].length;i<k;i++)e[d][i].cell.className=l[d][i].cell.className}}this._fnEqualiseHeights("tfoot",this.dom.footer,a.footer)}h=this.s.dt.oApi._fnGetUniqueThs(this.s.dt,b(">thead",a.header)[0]);b(h).each(function(a){m=c[a];
46
+ this.style.width=g.s.aiWidths[m]+"px"});null!==g.s.dt.nTFoot&&(h=this.s.dt.oApi._fnGetUniqueThs(this.s.dt,b(">tfoot",a.footer)[0]),b(h).each(function(a){m=c[a];this.style.width=g.s.aiWidths[m]+"px"}))},_fnGetTrNodes:function(a){for(var b=[],c=0,f=a.childNodes.length;c<f;c++)"TR"==a.childNodes[c].nodeName.toUpperCase()&&b.push(a.childNodes[c]);return b},_fnEqualiseHeights:function(a,e,c){if(!("none"==this.s.sHeightMatch&&"thead"!==a&&"tfoot"!==a))for(var f,g,d=e.getElementsByTagName(a)[0],c=c.getElementsByTagName(a)[0],
47
+ a=b(">"+a+">tr:eq(0)",e).children(":first"),a=a.outerHeight()-a.height(),d=this._fnGetTrNodes(d),h=this._fnGetTrNodes(c),c=0,e=h.length;c<e;c++)"semiauto"==this.s.sHeightMatch&&"undefined"!=typeof d[c]._DTTC_iHeight&&null!==d[c]._DTTC_iHeight?b.browser.msie&&b(h[c]).children().height(d[c]._DTTC_iHeight-a):(f=d[c].offsetHeight,g=h[c].offsetHeight,f=g>f?g:f,"semiauto"==this.s.sHeightMatch&&(d[c]._DTTC_iHeight=f),b.browser.msie&&8>b.browser.version)?(b(h[c]).children().height(f-a),b(d[c]).children().height(f-
48
+ a)):(h[c].style.height=f+"px",d[c].style.height=f+"px")}};FixedColumns.defaults={iLeftColumns:1,iRightColumns:0,fnDrawCallback:null,sLeftWidth:"fixed",iLeftWidth:null,sRightWidth:"fixed",iRightWidth:null,sHeightMatch:"semiauto"};FixedColumns.prototype.CLASS="FixedColumns";FixedColumns.VERSION="2.0.3"})(jQuery,window,document);
assets/js/jquery.colorbox-min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*!
2
+ jQuery Colorbox v1.4.21 - 2013-06-06
3
+ (c) 2013 Jack Moore - jacklmoore.com/colorbox
4
+ license: http://www.opensource.org/licenses/mit-license.php
5
+ */
6
+ (function(t,e,i){function o(i,o,n){var r=e.createElement(i);return o&&(r.id=te+o),n&&(r.style.cssText=n),t(r)}function n(){return i.innerHeight?i.innerHeight:t(i).height()}function r(t){var e=E.length,i=(j+t)%e;return 0>i?e+i:i}function h(t,e){return Math.round((/%/.test(t)?("x"===e?H.width():n())/100:1)*parseInt(t,10))}function l(t,e){return t.photo||t.photoRegex.test(e)}function s(t,e){return t.retinaUrl&&i.devicePixelRatio>1?e.replace(t.photoRegex,t.retinaSuffix):e}function a(t){"contains"in y[0]&&!y[0].contains(t.target)&&(t.stopPropagation(),y.focus())}function d(){var e,i=t.data(A,Z);null==i?(_=t.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):_=t.extend({},i);for(e in _)t.isFunction(_[e])&&"on"!==e.slice(0,2)&&(_[e]=_[e].call(A));_.rel=_.rel||A.rel||t(A).data("rel")||"nofollow",_.href=_.href||t(A).attr("href"),_.title=_.title||A.title,"string"==typeof _.href&&(_.href=t.trim(_.href))}function c(i,o){t(e).trigger(i),se.trigger(i),t.isFunction(o)&&o.call(A)}function u(){var t,e,i,o,n,r=te+"Slideshow_",h="click."+te;_.slideshow&&E[1]?(e=function(){clearTimeout(t)},i=function(){(_.loop||E[j+1])&&(t=setTimeout(J.next,_.slideshowSpeed))},o=function(){R.html(_.slideshowStop).unbind(h).one(h,n),se.bind(ne,i).bind(oe,e).bind(re,n),y.removeClass(r+"off").addClass(r+"on")},n=function(){e(),se.unbind(ne,i).unbind(oe,e).unbind(re,n),R.html(_.slideshowStart).unbind(h).one(h,function(){J.next(),o()}),y.removeClass(r+"on").addClass(r+"off")},_.slideshowAuto?o():n()):y.removeClass(r+"off "+r+"on")}function f(i){G||(A=i,d(),E=t(A),j=0,"nofollow"!==_.rel&&(E=t("."+ee).filter(function(){var e,i=t.data(this,Z);return i&&(e=t(this).data("rel")||i.rel||this.rel),e===_.rel}),j=E.index(A),-1===j&&(E=E.add(A),j=E.length-1)),g.css({opacity:parseFloat(_.opacity),cursor:_.overlayClose?"pointer":"auto",visibility:"visible"}).show(),V&&y.add(g).removeClass(V),_.className&&y.add(g).addClass(_.className),V=_.className,P.html(_.close).show(),$||($=q=!0,y.css({visibility:"hidden",display:"block"}),W=o(ae,"LoadedContent","width:0; height:0; overflow:hidden").appendTo(v),D=b.height()+k.height()+v.outerHeight(!0)-v.height(),B=T.width()+C.width()+v.outerWidth(!0)-v.width(),N=W.outerHeight(!0),z=W.outerWidth(!0),_.w=h(_.initialWidth,"x"),_.h=h(_.initialHeight,"y"),J.position(),u(),c(ie,_.onOpen),O.add(S).hide(),y.focus(),_.trapFocus&&e.addEventListener&&(e.addEventListener("focus",a,!0),se.one(he,function(){e.removeEventListener("focus",a,!0)})),_.returnFocus&&se.one(he,function(){t(A).focus()})),w())}function p(){!y&&e.body&&(X=!1,H=t(i),y=o(ae).attr({id:Z,"class":t.support.opacity===!1?te+"IE":"",role:"dialog",tabindex:"-1"}).hide(),g=o(ae,"Overlay").hide(),L=o(ae,"LoadingOverlay").add(o(ae,"LoadingGraphic")),x=o(ae,"Wrapper"),v=o(ae,"Content").append(S=o(ae,"Title"),M=o(ae,"Current"),K=t('<button type="button"/>').attr({id:te+"Previous"}),I=t('<button type="button"/>').attr({id:te+"Next"}),R=o("button","Slideshow"),L,P=t('<button type="button"/>').attr({id:te+"Close"})),x.append(o(ae).append(o(ae,"TopLeft"),b=o(ae,"TopCenter"),o(ae,"TopRight")),o(ae,!1,"clear:left").append(T=o(ae,"MiddleLeft"),v,C=o(ae,"MiddleRight")),o(ae,!1,"clear:left").append(o(ae,"BottomLeft"),k=o(ae,"BottomCenter"),o(ae,"BottomRight"))).find("div div").css({"float":"left"}),F=o(ae,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),O=I.add(K).add(M).add(R),t(e.body).append(g,y.append(x,F)))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return y?(X||(X=!0,I.click(function(){J.next()}),K.click(function(){J.prev()}),P.click(function(){J.close()}),g.click(function(){_.overlayClose&&J.close()}),t(e).bind("keydown."+te,function(t){var e=t.keyCode;$&&_.escKey&&27===e&&(t.preventDefault(),J.close()),$&&_.arrowKey&&E[1]&&!t.altKey&&(37===e?(t.preventDefault(),K.click()):39===e&&(t.preventDefault(),I.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+te,"."+ee,i):t("."+ee).live("click."+te,i)),!0):!1}function w(){var n,r,a,u=J.prep,f=++de;q=!0,U=!1,A=E[j],d(),c(le),c(oe,_.onLoad),_.h=_.height?h(_.height,"y")-N-D:_.innerHeight&&h(_.innerHeight,"y"),_.w=_.width?h(_.width,"x")-z-B:_.innerWidth&&h(_.innerWidth,"x"),_.mw=_.w,_.mh=_.h,_.maxWidth&&(_.mw=h(_.maxWidth,"x")-z-B,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.maxHeight&&(_.mh=h(_.maxHeight,"y")-N-D,_.mh=_.h&&_.h<_.mh?_.h:_.mh),n=_.href,Q=setTimeout(function(){L.show()},100),_.inline?(a=o(ae).hide().insertBefore(t(n)[0]),se.one(le,function(){a.replaceWith(W.children())}),u(t(n))):_.iframe?u(" "):_.html?u(_.html):l(_,n)?(n=s(_,n),U=e.createElement("img"),t(U).addClass(te+"Photo").bind("error",function(){_.title=!1,u(o(ae,"Error").html(_.imgError))}).one("load",function(){var e;f===de&&(U.alt=t(A).attr("alt")||t(A).attr("data-alt")||"",_.retinaImage&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),_.scalePhotos&&(r=function(){U.height-=U.height*e,U.width-=U.width*e},_.mw&&U.width>_.mw&&(e=(U.width-_.mw)/U.width,r()),_.mh&&U.height>_.mh&&(e=(U.height-_.mh)/U.height,r())),_.h&&(U.style.marginTop=Math.max(_.mh-U.height,0)/2+"px"),E[1]&&(_.loop||E[j+1])&&(U.style.cursor="pointer",U.onclick=function(){J.next()}),U.style.width=U.width+"px",U.style.height=U.height+"px",setTimeout(function(){u(U)},1))}),setTimeout(function(){U.src=n},1)):n&&F.load(n,_.data,function(e,i){f===de&&u("error"===i?o(ae,"Error").html(_.xhrError):t(this).contents())})}var g,y,x,v,b,T,C,k,E,H,W,F,L,S,M,R,I,K,P,O,_,D,B,N,z,A,j,U,$,q,G,Q,J,V,X,Y={transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,trapFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0},Z="colorbox",te="cbox",ee=te+"Element",ie=te+"_open",oe=te+"_load",ne=te+"_complete",re=te+"_cleanup",he=te+"_closed",le=te+"_purge",se=t("<a/>"),ae="div",de=0;t.colorbox||(t(p),J=t.fn[Z]=t[Z]=function(e,i){var o=this;if(e=e||{},p(),m()){if(t.isFunction(o))o=t("<a/>"),e.open=!0;else if(!o[0])return o;i&&(e.onComplete=i),o.each(function(){t.data(this,Z,t.extend({},t.data(this,Z)||Y,e))}).addClass(ee),(t.isFunction(e.open)&&e.open.call(o)||e.open)&&f(o[0])}return o},J.position=function(t,e){function i(t){b[0].style.width=k[0].style.width=v[0].style.width=parseInt(t.style.width,10)-B+"px",v[0].style.height=T[0].style.height=C[0].style.height=parseInt(t.style.height,10)-D+"px"}var o,r,l,s=0,a=0,d=y.offset();H.unbind("resize."+te),y.css({top:-9e4,left:-9e4}),r=H.scrollTop(),l=H.scrollLeft(),_.fixed?(d.top-=r,d.left-=l,y.css({position:"fixed"})):(s=r,a=l,y.css({position:"absolute"})),a+=_.right!==!1?Math.max(H.width()-_.w-z-B-h(_.right,"x"),0):_.left!==!1?h(_.left,"x"):Math.round(Math.max(H.width()-_.w-z-B,0)/2),s+=_.bottom!==!1?Math.max(n()-_.h-N-D-h(_.bottom,"y"),0):_.top!==!1?h(_.top,"y"):Math.round(Math.max(n()-_.h-N-D,0)/2),y.css({top:d.top,left:d.left,visibility:"visible"}),t=y.width()===_.w+z&&y.height()===_.h+N?0:t||0,x[0].style.width=x[0].style.height="9999px",o={width:_.w+z+B,height:_.h+N+D,top:s,left:a},0===t&&y.css(o),y.dequeue().animate(o,{duration:t,complete:function(){i(this),q=!1,x[0].style.width=_.w+z+B+"px",x[0].style.height=_.h+N+D+"px",_.reposition&&setTimeout(function(){H.bind("resize."+te,J.position)},1),e&&e()},step:function(){i(this)}})},J.resize=function(t){var e;$&&(t=t||{},t.width&&(_.w=h(t.width,"x")-z-B),t.innerWidth&&(_.w=h(t.innerWidth,"x")),W.css({width:_.w}),t.height&&(_.h=h(t.height,"y")-N-D),t.innerHeight&&(_.h=h(t.innerHeight,"y")),t.innerHeight||t.height||(e=W.scrollTop(),W.css({height:"auto"}),_.h=W.height()),W.css({height:_.h}),e&&W.scrollTop(e),J.position("none"===_.transition?0:_.speed))},J.prep=function(i){function n(){return _.w=_.w||W.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function h(){return _.h=_.h||W.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if($){var a,d="none"===_.transition?0:_.speed;W.empty().remove(),W=o(ae,"LoadedContent").append(i),W.hide().appendTo(F.show()).css({width:n(),overflow:_.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(v),F.hide(),t(U).css({"float":"none"}),a=function(){function i(){t.support.opacity===!1&&y[0].style.removeAttribute("filter")}var n,h,a=E.length,u="frameBorder",f="allowTransparency";$&&(h=function(){clearTimeout(Q),L.hide(),c(ne,_.onComplete)},S.html(_.title).add(W).show(),a>1?("string"==typeof _.current&&M.html(_.current.replace("{current}",j+1).replace("{total}",a)).show(),I[_.loop||a-1>j?"show":"hide"]().html(_.next),K[_.loop||j?"show":"hide"]().html(_.previous),_.slideshow&&R.show(),_.preloading&&t.each([r(-1),r(1)],function(){var i,o,n=E[this],r=t.data(n,Z);r&&r.href?(i=r.href,t.isFunction(i)&&(i=i.call(n))):i=t(n).attr("href"),i&&l(r,i)&&(i=s(r,i),o=e.createElement("img"),o.src=i)})):O.hide(),_.iframe?(n=o("iframe")[0],u in n&&(n[u]=0),f in n&&(n[f]="true"),_.scrolling||(n.scrolling="no"),t(n).attr({src:_.href,name:(new Date).getTime(),"class":te+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",h).appendTo(W),se.one(le,function(){n.src="//about:blank"}),_.fastIframe&&t(n).trigger("load")):h(),"fade"===_.transition?y.fadeTo(d,1,i):i())},"fade"===_.transition?y.fadeTo(d,0,function(){J.position(0,a)}):J.position(d,a)}},J.next=function(){!q&&E[1]&&(_.loop||E[j+1])&&(j=r(1),f(E[j]))},J.prev=function(){!q&&E[1]&&(_.loop||j)&&(j=r(-1),f(E[j]))},J.close=function(){$&&!G&&(G=!0,$=!1,c(re,_.onCleanup),H.unbind("."+te),g.fadeTo(_.fadeOut||0,0),y.stop().fadeTo(_.fadeOut||0,0,function(){y.add(g).css({opacity:1,cursor:"auto"}).hide(),c(le),W.empty().remove(),setTimeout(function(){G=!1,c(he,_.onClosed)},1)}))},J.remove=function(){y&&(y.stop(),t.colorbox.close(),y.stop().remove(),g.remove(),G=!1,y=null,t("."+ee).removeData(Z).removeClass(ee),t(e).unbind("click."+te))},J.element=function(){return t(A)},J.settings=Y)})(jQuery,document,window);
assets/js/jquery.dataTables.min.js ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * File: jquery.dataTables.min.js
3
+ * Version: 1.9.4
4
+ * Author: Allan Jardine (www.sprymedia.co.uk)
5
+ * Info: www.datatables.net
6
+ *
7
+ * Copyright 2008-2012 Allan Jardine, all rights reserved.
8
+ *
9
+ * This source file is free software, under either the GPL v2 license or a
10
+ * BSD style license, available at:
11
+ * http://datatables.net/license_gpl2
12
+ * http://datatables.net/license_bsd
13
+ *
14
+ * This source file is distributed in the hope that it will be useful, but
15
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
17
+ */
18
+ (function(X,l,n){var L=function(h){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=h.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=h.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d],
19
+ c.bRegex===n&&(c.bRegex=!0),c.bSmart===n&&(c.bSmart=!0),c.bCaseInsensitive===n)c.bCaseInsensitive=!0;m(a,d,null)}function m(a,b,c){var d=a.aoColumns[b];c!==n&&null!==c&&(c.mDataProp&&!c.mData&&(c.mData=c.mDataProp),c.sType!==n&&(d.sType=c.sType,d._bAutoType=!1),h.extend(d,c),p(d,c,"sWidth","sWidthOrig"),c.iDataSort!==n&&(d.aDataSort=[c.iDataSort]),p(d,c,"aDataSort"));var i=d.mRender?Q(d.mRender):null,f=Q(d.mData);d.fnGetData=function(a,b){var c=f(a,b);return d.mRender&&b&&""!==b?i(c,b,a):c};d.fnSetData=
20
+ L(d.mData);a.oFeatures.bSort||(d.bSortable=!1);!d.bSortable||-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableNone,d.sSortingClassJUI=""):-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortable,d.sSortingClassJUI=a.oClasses.sSortJUI):-1!=h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableAsc,d.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed):-1==
21
+ h.inArray("asc",d.asSorting)&&-1!=h.inArray("desc",d.asSorting)&&(d.sSortingClass=a.oClasses.sSortableDesc,d.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed)}function k(a){if(!1===a.oFeatures.bAutoWidth)return!1;da(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function G(a,b){var c=r(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function R(a,b){var c=r(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function t(a){return r(a,"bVisible").length}
22
+ function r(a,b){var c=[];h.map(a.aoColumns,function(a,i){a[b]&&c.push(i)});return c}function B(a){for(var b=j.ext.aTypes,c=b.length,d=0;d<c;d++){var i=b[d](a);if(null!==i)return i}return"string"}function u(a,b){for(var c=b.split(","),d=[],i=0,f=a.aoColumns.length;i<f;i++)for(var g=0;g<f;g++)if(a.aoColumns[i].sName==c[g]){d.push(g);break}return d}function M(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function ta(a,b,c,d){var i,f,
23
+ g,e,w;if(b)for(i=b.length-1;0<=i;i--){var j=b[i].aTargets;h.isArray(j)||D(a,1,"aTargets must be an array of targets, not a "+typeof j);f=0;for(g=j.length;f<g;f++)if("number"===typeof j[f]&&0<=j[f]){for(;a.aoColumns.length<=j[f];)o(a);d(j[f],b[i])}else if("number"===typeof j[f]&&0>j[f])d(a.aoColumns.length+j[f],b[i]);else if("string"===typeof j[f]){e=0;for(w=a.aoColumns.length;e<w;e++)("_all"==j[f]||h(a.aoColumns[e].nTh).hasClass(j[f]))&&d(e,b[i])}}if(c){i=0;for(a=c.length;i<a;i++)d(i,c[i])}}function H(a,
24
+ b){var c;c=h.isArray(b)?b.slice():h.extend(!0,{},b);var d=a.aoData.length,i=h.extend(!0,{},j.models.oRow);i._aData=c;a.aoData.push(i);for(var f,i=0,g=a.aoColumns.length;i<g;i++)c=a.aoColumns[i],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mData?F(a,d,i,S(a,d,i)):F(a,d,i,v(a,d,i)),c._bAutoType&&"string"!=c.sType&&(f=v(a,d,i,"type"),null!==f&&""!==f&&(f=B(f),null===c.sType?c.sType=f:c.sType!=f&&"html"!=c.sType&&(c.sType="string")));a.aiDisplayMaster.push(d);a.oFeatures.bDeferRender||ea(a,
25
+ d);return d}function ua(a){var b,c,d,i,f,g,e;if(a.bDeferLoading||null===a.sAjaxSource)for(b=a.nTBody.firstChild;b;){if("TR"==b.nodeName.toUpperCase()){c=a.aoData.length;b._DT_RowIndex=c;a.aoData.push(h.extend(!0,{},j.models.oRow,{nTr:b}));a.aiDisplayMaster.push(c);f=b.firstChild;for(d=0;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)F(a,c,d,h.trim(f.innerHTML)),d++;f=f.nextSibling}}b=b.nextSibling}i=T(a);d=[];b=0;for(c=i.length;b<c;b++)for(f=i[b].firstChild;f;)g=f.nodeName.toUpperCase(),("TD"==
26
+ g||"TH"==g)&&d.push(f),f=f.nextSibling;c=0;for(i=a.aoColumns.length;c<i;c++){e=a.aoColumns[c];null===e.sTitle&&(e.sTitle=e.nTh.innerHTML);var w=e._bAutoType,o="function"===typeof e.fnRender,k=null!==e.sClass,n=e.bVisible,m,p;if(w||o||k||!n){g=0;for(b=a.aoData.length;g<b;g++)f=a.aoData[g],m=d[g*i+c],w&&"string"!=e.sType&&(p=v(a,g,c,"type"),""!==p&&(p=B(p),null===e.sType?e.sType=p:e.sType!=p&&"html"!=e.sType&&(e.sType="string"))),e.mRender?m.innerHTML=v(a,g,c,"display"):e.mData!==c&&(m.innerHTML=v(a,
27
+ g,c,"display")),o&&(p=S(a,g,c),m.innerHTML=p,e.bUseRendered&&F(a,g,c,p)),k&&(m.className+=" "+e.sClass),n?f._anHidden[c]=null:(f._anHidden[c]=m,m.parentNode.removeChild(m)),e.fnCreatedCell&&e.fnCreatedCell.call(a.oInstance,m,v(a,g,c,"display"),f._aData,g,c)}}if(0!==a.aoRowCreatedCallback.length){b=0;for(c=a.aoData.length;b<c;b++)f=a.aoData[b],A(a,"aoRowCreatedCallback",null,[f.nTr,f._aData,b])}}function I(a,b){return b._DT_RowIndex!==n?b._DT_RowIndex:null}function fa(a,b,c){for(var b=J(a,b),d=0,a=
28
+ a.aoColumns.length;d<a;d++)if(b[d]===c)return d;return-1}function Y(a,b,c,d){for(var i=[],f=0,g=d.length;f<g;f++)i.push(v(a,b,d[f],c));return i}function v(a,b,c,d){var i=a.aoColumns[c];if((c=i.fnGetData(a.aoData[b]._aData,d))===n)return a.iDrawError!=a.iDraw&&null===i.sDefaultContent&&(D(a,0,"Requested unknown parameter "+("function"==typeof i.mData?"{mData function}":"'"+i.mData+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw),i.sDefaultContent;if(null===c&&null!==i.sDefaultContent)c=
29
+ i.sDefaultContent;else if("function"===typeof c)return c();return"display"==d&&null===c?"":c}function F(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Q(a){if(null===a)return function(){return null};if("function"===typeof a)return function(b,d,i){return a(b,d,i)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var f=i.split("."),g;if(""!==i){var e=0;for(g=f.length;e<g;e++){if(i=f[e].match(U)){f[e]=f[e].replace(U,"");""!==f[e]&&(a=a[f[e]]);
30
+ g=[];f.splice(0,e+1);for(var f=f.join("."),e=0,h=a.length;e<h;e++)g.push(b(a[e],d,f));a=i[0].substring(1,i[0].length-1);a=""===a?g:g.join(a);break}if(null===a||a[f[e]]===n)return n;a=a[f[e]]}}return a};return function(c,d){return b(c,d,a)}}return function(b){return b[a]}}function L(a){if(null===a)return function(){};if("function"===typeof a)return function(b,d){a(b,"set",d)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var i=i.split("."),f,g,e=0;for(g=
31
+ i.length-1;e<g;e++){if(f=i[e].match(U)){i[e]=i[e].replace(U,"");a[i[e]]=[];f=i.slice();f.splice(0,e+1);g=f.join(".");for(var h=0,j=d.length;h<j;h++)f={},b(f,d[h],g),a[i[e]].push(f);return}if(null===a[i[e]]||a[i[e]]===n)a[i[e]]={};a=a[i[e]]}a[i[i.length-1].replace(U,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Z(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ga(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,
32
+ a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);y(a)}function ha(a,b){for(var c=-1,d=0,i=a.length;d<i;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function S(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mData},v(a,b,c,"display"))}function ea(a,b){var c=a.aoData[b],d;if(null===c.nTr){c.nTr=l.createElement("tr");c.nTr._DT_RowIndex=b;c._aData.DT_RowId&&(c.nTr.id=c._aData.DT_RowId);c._aData.DT_RowClass&&
33
+ (c.nTr.className=c._aData.DT_RowClass);for(var i=0,f=a.aoColumns.length;i<f;i++){var g=a.aoColumns[i];d=l.createElement(g.sCellType);d.innerHTML="function"===typeof g.fnRender&&(!g.bUseRendered||null===g.mData)?S(a,b,i):v(a,b,i,"display");null!==g.sClass&&(d.className=g.sClass);g.bVisible?(c.nTr.appendChild(d),c._anHidden[i]=null):c._anHidden[i]=d;g.fnCreatedCell&&g.fnCreatedCell.call(a.oInstance,d,v(a,b,i,"display"),c._aData,b,i)}A(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function va(a){var b,
34
+ c,d;if(0!==h("th, td",a.nTHead).length){b=0;for(d=a.aoColumns.length;b<d;b++)if(c=a.aoColumns[b].nTh,c.setAttribute("role","columnheader"),a.aoColumns[b].bSortable&&(c.setAttribute("tabindex",a.iTabIndex),c.setAttribute("aria-controls",a.sTableId)),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}else{var i=l.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++)c=a.aoColumns[b].nTh,c.innerHTML=a.aoColumns[b].sTitle,
35
+ c.setAttribute("tabindex","0"),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),i.appendChild(c);h(a.nTHead).html("")[0].appendChild(i);V(a.aoHeader,a.nTHead)}h(a.nTHead).children("tr").attr("role","row");if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;i=l.createElement("div");i.className=a.oClasses.sSortJUIWrapper;h(c).contents().appendTo(i);var f=l.createElement("span");f.className=a.oClasses.sSortIcon;i.appendChild(f);c.appendChild(i)}}if(a.oFeatures.bSort)for(b=
36
+ 0;b<a.aoColumns.length;b++)!1!==a.aoColumns[b].bSortable?ia(a,a.aoColumns[b].nTh,b):h(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);""!==a.oClasses.sFooterTH&&h(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot){c=N(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)c[b]&&(a.aoColumns[b].nTf=c[b],a.aoColumns[b].sClass&&h(c[b]).addClass(a.aoColumns[b].sClass))}}function W(a,b,c){var d,i,f,g=[],e=[],h=a.aoColumns.length,j;c===n&&(c=!1);d=0;for(i=
37
+ b.length;d<i;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=h-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);e.push([])}d=0;for(i=g.length;d<i;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(j=h=1,e[d][f]===n){a.appendChild(g[d][f].cell);for(e[d][f]=1;g[d+h]!==n&&g[d][f].cell==g[d+h][f].cell;)e[d+h][f]=1,h++;for(;g[d][f+j]!==n&&g[d][f].cell==g[d][f+j].cell;){for(c=0;c<h;c++)e[d+c][f+j]=1;j++}g[d][f].cell.rowSpan=h;g[d][f].cell.colSpan=j}}}function x(a){var b=
38
+ A(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))E(a,!1);else{var c,d,b=[],i=0,f=a.asStripeClasses.length;c=a.aoOpenRows.length;a.bDrawing=!0;a.iInitDisplayStart!==n&&-1!=a.iInitDisplayStart&&(a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,y(a));if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!wa(a))return}else a.iDraw++;if(0!==a.aiDisplay.length){var g=
39
+ a._iDisplayStart;d=a._iDisplayEnd;a.oFeatures.bServerSide&&(g=0,d=a.aoData.length);for(;g<d;g++){var e=a.aoData[a.aiDisplay[g]];null===e.nTr&&ea(a,a.aiDisplay[g]);var j=e.nTr;if(0!==f){var o=a.asStripeClasses[i%f];e._sRowStripe!=o&&(h(j).removeClass(e._sRowStripe).addClass(o),e._sRowStripe=o)}A(a,"aoRowCallback",null,[j,a.aoData[a.aiDisplay[g]]._aData,i,g]);b.push(j);i++;if(0!==c)for(e=0;e<c;e++)if(j==a.aoOpenRows[e].nParent){b.push(a.aoOpenRows[e].nTr);break}}}else b[0]=l.createElement("tr"),a.asStripeClasses[0]&&
40
+ (b[0].className=a.asStripeClasses[0]),c=a.oLanguage,f=c.sZeroRecords,1==a.iDraw&&null!==a.sAjaxSource&&!a.oFeatures.bServerSide?f=c.sLoadingRecords:c.sEmptyTable&&0===a.fnRecordsTotal()&&(f=c.sEmptyTable),c=l.createElement("td"),c.setAttribute("valign","top"),c.colSpan=t(a),c.className=a.oClasses.sRowEmpty,c.innerHTML=ja(a,f),b[i].appendChild(c);A(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);A(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],
41
+ Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);i=l.createDocumentFragment();c=l.createDocumentFragment();if(a.nTBody){f=a.nTBody.parentNode;c.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;c=a.nTBody.firstChild;)a.nTBody.removeChild(c);c=0;for(d=b.length;c<d;c++)i.appendChild(b[c]);a.nTBody.appendChild(i);null!==f&&f.appendChild(a.nTBody)}A(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(E(a,!1),
42
+ a._bInitComplete||$(a))}}function aa(a){a.oFeatures.bSort?O(a,a.oPreviousSearch):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(y(a),x(a))}function xa(a){var b=h("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=h('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),i,f,g,e,w,o,k,m=0;m<d.length;m++){f=0;g=d[m];if("<"==g){e=h("<div></div>")[0];w=d[m+
43
+ 1];if("'"==w||'"'==w){o="";for(k=2;d[m+k]!=w;)o+=d[m+k],k++;"H"==o?o=a.oClasses.sJUIHeader:"F"==o&&(o=a.oClasses.sJUIFooter);-1!=o.indexOf(".")?(w=o.split("."),e.id=w[0].substr(1,w[0].length-1),e.className=w[1]):"#"==o.charAt(0)?e.id=o.substr(1,o.length-1):e.className=o;m+=k}c.appendChild(e);c=e}else if(">"==g)c=c.parentNode;else if("l"==g&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)i=ya(a),f=1;else if("f"==g&&a.oFeatures.bFilter)i=za(a),f=1;else if("r"==g&&a.oFeatures.bProcessing)i=Aa(a),f=
44
+ 1;else if("t"==g)i=Ba(a),f=1;else if("i"==g&&a.oFeatures.bInfo)i=Ca(a),f=1;else if("p"==g&&a.oFeatures.bPaginate)i=Da(a),f=1;else if(0!==j.ext.aoFeatures.length){e=j.ext.aoFeatures;k=0;for(w=e.length;k<w;k++)if(g==e[k].cFeature){(i=e[k].fnInit(a))&&(f=1);break}}1==f&&null!==i&&("object"!==typeof a.aanFeatures[g]&&(a.aanFeatures[g]=[]),a.aanFeatures[g].push(i),c.appendChild(i))}b.parentNode.replaceChild(a.nTableWrapper,b)}function V(a,b){var c=h(b).children("tr"),d,i,f,g,e,j,o,k,m,p;a.splice(0,a.length);
45
+ f=0;for(j=c.length;f<j;f++)a.push([]);f=0;for(j=c.length;f<j;f++){d=c[f];for(i=d.firstChild;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){k=1*i.getAttribute("colspan");m=1*i.getAttribute("rowspan");k=!k||0===k||1===k?1:k;m=!m||0===m||1===m?1:m;g=0;for(e=a[f];e[g];)g++;o=g;p=1===k?!0:!1;for(e=0;e<k;e++)for(g=0;g<m;g++)a[f+g][o+e]={cell:i,unique:p},a[f+g].nTr=d}i=i.nextSibling}}}function N(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],V(c,b)));for(var b=0,i=c.length;b<i;b++)for(var f=
46
+ 0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function wa(a){if(a.bAjaxDataGet){a.iDraw++;E(a,!0);var b=Ea(a);ka(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){Fa(a,b)},a);return!1}return!0}function Ea(a){var b=a.aoColumns.length,c=[],d,i,f,g;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:M(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",
47
+ value:!1!==a.oFeatures.bPaginate?a._iDisplayLength:-1});for(f=0;f<b;f++)d=a.aoColumns[f].mData,c.push({name:"mDataProp_"+f,value:"function"===typeof d?"function":d});if(!1!==a.oFeatures.bFilter){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++)c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch}),c.push({name:"bRegex_"+f,value:a.aoPreSearchCols[f].bRegex}),c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}if(!1!==
48
+ a.oFeatures.bSort){var e=0;d=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f<d.length;f++){i=a.aoColumns[d[f][0]].aDataSort;for(g=0;g<i.length;g++)c.push({name:"iSortCol_"+e,value:i[g]}),c.push({name:"sSortDir_"+e,value:d[f][1]}),e++}c.push({name:"iSortingCols",value:e});for(f=0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}return c}function ka(a,b){A(a,"aoServerParams","serverParams",[b])}function Fa(a,b){if(b.sEcho!==n){if(1*b.sEcho<
49
+ a.iDraw)return;a.iDraw=1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&ga(a);a._iRecordsTotal=parseInt(b.iTotalRecords,10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=M(a),c=b.sColumns!==n&&""!==c&&b.sColumns!=c,d;c&&(d=u(a,b.sColumns));for(var i=Q(a.sAjaxDataProp)(b),f=0,g=i.length;f<g;f++)if(c){for(var e=[],h=0,j=a.aoColumns.length;h<j;h++)e.push(i[f][d[h]]);H(a,e)}else H(a,i[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;x(a);a.bAjaxDataGet=
50
+ !0;E(a,!1)}function za(a){var b=a.oPreviousSearch,c=a.oLanguage.sSearch,c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):""===c?'<input type="text" />':c+' <input type="text" />',d=l.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";a.aanFeatures.f||(d.id=a.sTableId+"_filter");c=h('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"&quot;"));c.bind("keyup.DT",function(){for(var c=a.aanFeatures.f,d=this.value===""?"":this.value,
51
+ g=0,e=c.length;g<e;g++)c[g]!=h(this).parents("div.dataTables_filter")[0]&&h(c[g]._DT_Input).val(d);d!=b.sSearch&&K(a,{sSearch:d,bRegex:b.bRegex,bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(a.keyCode==13)return false});return d}function K(a,b,c){var d=a.oPreviousSearch,i=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)f(b);
52
+ else{Ga(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<a.aoPreSearchCols.length;b++)Ha(a,i[b].sSearch,b,i[b].bRegex,i[b].bSmart,i[b].bCaseInsensitive);Ia(a)}a.bFiltered=!0;h(a.oInstance).trigger("filter",a);a._iDisplayStart=0;y(a);x(a);la(a,0)}function Ia(a){for(var b=j.ext.afnFiltering,c=r(a,"bSearchable"),d=0,i=b.length;d<i;d++)for(var f=0,g=0,e=a.aiDisplay.length;g<e;g++){var h=a.aiDisplay[g-f];b[d](a,Y(a,h,"filter",c),h)||(a.aiDisplay.splice(g-f,1),f++)}}function Ha(a,b,c,
53
+ d,i,f){if(""!==b)for(var g=0,b=ma(b,d,i,f),d=a.aiDisplay.length-1;0<=d;d--)i=Ja(v(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(i)||(a.aiDisplay.splice(d,1),g++)}function Ga(a,b,c,d,i,f){d=ma(b,d,i,f);i=a.oPreviousSearch;c||(c=0);0!==j.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||i.sSearch.length>b.length||1==c||0!==b.indexOf(i.sSearch)){a.aiDisplay.splice(0,
54
+ a.aiDisplay.length);la(a,1);for(b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&a.aiDisplay.push(a.aiDisplayMaster[b])}else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||(a.aiDisplay.splice(b-c,1),c++)}function la(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch=[];for(var c=r(a,"bSearchable"),d=1===b?a.aiDisplayMaster:a.aiDisplay,i=0,f=d.length;i<f;i++)a.asDataSearch[i]=na(a,Y(a,d[i],"filter",c))}}function na(a,b){var c=b.join(" ");-1!==c.indexOf("&")&&(c=h("<div>").html(c).text());
55
+ return c.replace(/[\n\r]/g," ")}function ma(a,b,c,d){if(c)return a=b?a.split(" "):oa(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",RegExp(a,d?"i":"");a=b?a:oa(a);return RegExp(a,d?"i":"")}function Ja(a,b){return"function"===typeof j.ext.ofnSearch[b]?j.ext.ofnSearch[b](a):null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?a.replace(/[\r\n]/g," "):a}function oa(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),
56
+ "\\$1")}function Ca(a){var b=l.createElement("div");b.className=a.oClasses.sInfo;a.aanFeatures.i||(a.aoDrawCallback.push({fn:Ka,sName:"information"}),b.id=a.sTableId+"_info");a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function Ka(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),i=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),g;g=0===f?b.sInfoEmpty:b.sInfo;f!=i&&(g+=" "+b.sInfoFiltered);g+=b.sInfoPostFix;g=ja(a,g);
57
+ null!==b.fnInfoCallback&&(g=b.fnInfoCallback.call(a.oInstance,a,c,d,i,f,g));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)h(a[b]).html(g)}}function ja(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd(),d=a.fnFormatNumber(d),i=a.fnRecordsDisplay(),i=a.fnFormatNumber(i),f=a.fnRecordsTotal(),f=a.fnFormatNumber(f);a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace(/_START_/g,c).replace(/_END_/g,d).replace(/_TOTAL_/g,i).replace(/_MAX_/g,f)}function ba(a){var b,c,d=a.iInitDisplayStart;
58
+ if(!1===a.bInitialised)setTimeout(function(){ba(a)},200);else{xa(a);va(a);W(a,a.aoHeader);a.nTFoot&&W(a,a.aoFooter);E(a,!0);a.oFeatures.bAutoWidth&&da(a);b=0;for(c=a.aoColumns.length;b<c;b++)null!==a.aoColumns[b].sWidth&&(a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth));a.oFeatures.bSort?O(a):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),y(a),x(a));null!==a.sAjaxSource&&!a.oFeatures.bServerSide?(c=[],ka(a,c),a.fnServerData.call(a.oInstance,a.sAjaxSource,
59
+ c,function(c){var f=a.sAjaxDataProp!==""?Q(a.sAjaxDataProp)(c):c;for(b=0;b<f.length;b++)H(a,f[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)O(a);else{a.aiDisplay=a.aiDisplayMaster.slice();y(a);x(a)}E(a,false);$(a,c)},a)):a.oFeatures.bServerSide||(E(a,!1),$(a))}}function $(a,b){a._bInitComplete=!0;A(a,"aoInitComplete","init",[a,b])}function pa(a){var b=j.defaults.oLanguage;!a.sEmptyTable&&(a.sZeroRecords&&"No data available in table"===b.sEmptyTable)&&p(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&
60
+ (a.sZeroRecords&&"Loading..."===b.sLoadingRecords)&&p(a,a,"sZeroRecords","sLoadingRecords")}function ya(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+('name="'+a.sTableId+'_length"')+">",c,d,i=a.aLengthMenu;if(2==i.length&&"object"===typeof i[0]&&"object"===typeof i[1]){c=0;for(d=i[0].length;c<d;c++)b+='<option value="'+i[0][c]+'">'+i[1][c]+"</option>"}else{c=0;for(d=i.length;c<d;c++)b+='<option value="'+i[c]+'">'+i[c]+"</option>"}b+="</select>";i=l.createElement("div");a.aanFeatures.l||
61
+ (i.id=a.sTableId+"_length");i.className=a.oClasses.sLength;i.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";h('select option[value="'+a._iDisplayLength+'"]',i).attr("selected",!0);h("select",i).bind("change.DT",function(){var b=h(this).val(),i=a.aanFeatures.l;c=0;for(d=i.length;c<d;c++)i[c]!=this.parentNode&&h("select",i[c]).val(b);a._iDisplayLength=parseInt(b,10);y(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<
62
+ 0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;x(a)});h("select",i).attr("aria-controls",a.sTableId);return i}function y(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Da(a){if(a.oScroll.bInfinite)return null;var b=l.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;j.ext.oPagination[a.sPaginationType].fnInit(a,
63
+ b,function(a){y(a);x(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){j.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){y(a);x(a)})},sName:"pagination"});return b}function qa(a,b){var c=a._iDisplayStart;if("number"===typeof b)a._iDisplayStart=b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay()&&(a._iDisplayStart=0);else if("first"==b)a._iDisplayStart=0;else if("previous"==b)a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart-a._iDisplayLength:0,0>a._iDisplayStart&&(a._iDisplayStart=
64
+ 0);else if("next"==b)0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0;else if("last"==b)if(0<=a._iDisplayLength){var d=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(d-1)*a._iDisplayLength}else a._iDisplayStart=0;else D(a,0,"Unknown paging action: "+b);h(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Aa(a){var b=l.createElement("div");a.aanFeatures.r||(b.id=a.sTableId+
65
+ "_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function E(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,i=c.length;d<i;d++)c[d].style.visibility=b?"visible":"hidden";h(a.oInstance).trigger("processing",[a,b])}function Ba(a){if(""===a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=l.createElement("div"),c=l.createElement("div"),d=l.createElement("div"),i=l.createElement("div"),f=l.createElement("div"),
66
+ g=l.createElement("div"),e=a.nTable.cloneNode(!1),j=a.nTable.cloneNode(!1),o=a.nTable.getElementsByTagName("thead")[0],k=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],m=a.oClasses;c.appendChild(d);f.appendChild(g);i.appendChild(a.nTable);b.appendChild(c);b.appendChild(i);d.appendChild(e);e.appendChild(o);null!==k&&(b.appendChild(f),g.appendChild(j),j.appendChild(k));b.className=m.sScrollWrapper;c.className=m.sScrollHead;d.className=m.sScrollHeadInner;
67
+ i.className=m.sScrollBody;f.className=m.sScrollFoot;g.className=m.sScrollFootInner;a.oScroll.bAutoCss&&(c.style.overflow="hidden",c.style.position="relative",f.style.overflow="hidden",i.style.overflow="auto");c.style.border="0";c.style.width="100%";f.style.border="0";d.style.width=""!==a.oScroll.sXInner?a.oScroll.sXInner:"100%";e.removeAttribute("id");e.style.marginLeft="0";a.nTable.style.marginLeft="0";null!==k&&(j.removeAttribute("id"),j.style.marginLeft="0");d=h(a.nTable).children("caption");0<
68
+ d.length&&(d=d[0],"top"===d._captionSide?e.appendChild(d):"bottom"===d._captionSide&&k&&j.appendChild(d));""!==a.oScroll.sX&&(c.style.width=q(a.oScroll.sX),i.style.width=q(a.oScroll.sX),null!==k&&(f.style.width=q(a.oScroll.sX)),h(i).scroll(function(){c.scrollLeft=this.scrollLeft;if(k!==null)f.scrollLeft=this.scrollLeft}));""!==a.oScroll.sY&&(i.style.height=q(a.oScroll.sY));a.aoDrawCallback.push({fn:La,sName:"scrolling"});a.oScroll.bInfinite&&h(i).scroll(function(){if(!a.bDrawing&&h(this).scrollTop()!==
69
+ 0&&h(this).scrollTop()+h(this).height()>h(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()){qa(a,"next");y(a);x(a)}});a.nScrollHead=c;a.nScrollFoot=f;return b}function La(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,i,f,g,e,j,o,k,m,p=[],n=[],l=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:null,R=null!==a.nTFoot?l.getElementsByTagName("table")[0]:null,r=a.oBrowser.bScrollOversize,s=function(a){k=
70
+ a.style;k.paddingTop="0";k.paddingBottom="0";k.borderTopWidth="0";k.borderBottomWidth="0";k.height=0};h(a.nTable).children("thead, tfoot").remove();i=h(a.nTHead).clone()[0];a.nTable.insertBefore(i,a.nTable.childNodes[0]);g=a.nTHead.getElementsByTagName("tr");e=i.getElementsByTagName("tr");null!==a.nTFoot&&(j=h(a.nTFoot).clone()[0],a.nTable.insertBefore(j,a.nTable.childNodes[1]),o=a.nTFoot.getElementsByTagName("tr"),j=j.getElementsByTagName("tr"));""===a.oScroll.sX&&(d.style.width="100%",b.parentNode.style.width=
71
+ "100%");var t=N(a,i);i=0;for(f=t.length;i<f;i++)m=G(a,i),t[i].style.width=a.aoColumns[m].sWidth;null!==a.nTFoot&&C(function(a){a.style.width=""},j);a.oScroll.bCollapse&&""!==a.oScroll.sY&&(d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px");i=h(a.nTable).outerWidth();if(""===a.oScroll.sX){if(a.nTable.style.width="100%",r&&(h("tbody",d).height()>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(h(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else""!==a.oScroll.sXInner?a.nTable.style.width=
72
+ q(a.oScroll.sXInner):i==h(d).width()&&h(d).height()<h(a.nTable).height()?(a.nTable.style.width=q(i-a.oScroll.iBarWidth),h(a.nTable).outerWidth()>i-a.oScroll.iBarWidth&&(a.nTable.style.width=q(i))):a.nTable.style.width=q(i);i=h(a.nTable).outerWidth();C(s,e);C(function(a){p.push(q(h(a).width()))},e);C(function(a,b){a.style.width=p[b]},g);h(e).height(0);null!==a.nTFoot&&(C(s,j),C(function(a){n.push(q(h(a).width()))},j),C(function(a,b){a.style.width=n[b]},o),h(j).height(0));C(function(a,b){a.innerHTML=
73
+ "";a.style.width=p[b]},e);null!==a.nTFoot&&C(function(a,b){a.innerHTML="";a.style.width=n[b]},j);if(h(a.nTable).outerWidth()<i){g=d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")?i+a.oScroll.iBarWidth:i;if(r&&(d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(g-a.oScroll.iBarWidth);d.style.width=q(g);a.nScrollHead.style.width=q(g);null!==a.nTFoot&&(a.nScrollFoot.style.width=q(g));""===a.oScroll.sX?D(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):
74
+ ""!==a.oScroll.sXInner&&D(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else d.style.width=q("100%"),a.nScrollHead.style.width=q("100%"),null!==a.nTFoot&&(a.nScrollFoot.style.width=q("100%"));""===a.oScroll.sY&&r&&(d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth));""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=q(a.oScroll.sY),r=""!==a.oScroll.sX&&a.nTable.offsetWidth>
75
+ d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight&&(d.style.height=q(a.nTable.offsetHeight+r)));r=h(a.nTable).outerWidth();c.style.width=q(r);b.style.width=q(r);c=h(a.nTable).height()>d.clientHeight||"scroll"==h(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px";null!==a.nTFoot&&(R.style.width=q(r),l.style.width=q(r),l.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px");h(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function C(a,b,c){for(var d=
76
+ 0,i=0,f=b.length,g,e;i<f;){g=b[i].firstChild;for(e=c?c[i].firstChild:null;g;)1===g.nodeType&&(c?a(g,e,d):a(g,d),d++),g=g.nextSibling,e=c?e.nextSibling:null;i++}}function Ma(a,b){if(!a||null===a||""===a)return 0;b||(b=l.body);var c,d=l.createElement("div");d.style.width=q(a);b.appendChild(d);c=d.offsetWidth;b.removeChild(d);return c}function da(a){var b=0,c,d=0,i=a.aoColumns.length,f,e,j=h("th",a.nTHead),o=a.nTable.getAttribute("width");e=a.nTable.parentNode;for(f=0;f<i;f++)a.aoColumns[f].bVisible&&
77
+ (d++,null!==a.aoColumns[f].sWidth&&(c=Ma(a.aoColumns[f].sWidthOrig,e),null!==c&&(a.aoColumns[f].sWidth=q(c)),b++));if(i==j.length&&0===b&&d==i&&""===a.oScroll.sX&&""===a.oScroll.sY)for(f=0;f<a.aoColumns.length;f++)c=h(j[f]).width(),null!==c&&(a.aoColumns[f].sWidth=q(c));else{b=a.nTable.cloneNode(!1);f=a.nTHead.cloneNode(!0);d=l.createElement("tbody");c=l.createElement("tr");b.removeAttribute("id");b.appendChild(f);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),C(function(a){a.style.width=
78
+ ""},b.getElementsByTagName("tr")));b.appendChild(d);d.appendChild(c);d=h("thead th",b);0===d.length&&(d=h("tbody tr:eq(0)>td",b));j=N(a,f);for(f=d=0;f<i;f++){var k=a.aoColumns[f];k.bVisible&&null!==k.sWidthOrig&&""!==k.sWidthOrig?j[f-d].style.width=q(k.sWidthOrig):k.bVisible?j[f-d].style.width="":d++}for(f=0;f<i;f++)a.aoColumns[f].bVisible&&(d=Na(a,f),null!==d&&(d=d.cloneNode(!0),""!==a.aoColumns[f].sContentPadding&&(d.innerHTML+=a.aoColumns[f].sContentPadding),c.appendChild(d)));e.appendChild(b);
79
+ ""!==a.oScroll.sX&&""!==a.oScroll.sXInner?b.style.width=q(a.oScroll.sXInner):""!==a.oScroll.sX?(b.style.width="",h(b).width()<e.offsetWidth&&(b.style.width=q(e.offsetWidth))):""!==a.oScroll.sY?b.style.width=q(e.offsetWidth):o&&(b.style.width=q(o));b.style.visibility="hidden";Oa(a,b);i=h("tbody tr:eq(0)",b).children();0===i.length&&(i=N(a,h("thead",b)[0]));if(""!==a.oScroll.sX){for(f=d=e=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=null===a.aoColumns[f].sWidthOrig?e+h(i[d]).outerWidth():
80
+ e+(parseInt(a.aoColumns[f].sWidth.replace("px",""),10)+(h(i[d]).outerWidth()-h(i[d]).width())),d++);b.style.width=q(e);a.nTable.style.width=q(e)}for(f=d=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=h(i[d]).width(),null!==e&&0<e&&(a.aoColumns[f].sWidth=q(e)),d++);i=h(b).css("width");a.nTable.style.width=-1!==i.indexOf("%")?i:q(h(b).outerWidth());b.parentNode.removeChild(b)}o&&(a.nTable.style.width=q(o))}function Oa(a,b){""===a.oScroll.sX&&""!==a.oScroll.sY?(h(b).width(),b.style.width=q(h(b).outerWidth()-
81
+ a.oScroll.iBarWidth)):""!==a.oScroll.sX&&(b.style.width=q(h(b).outerWidth()))}function Na(a,b){var c=Pa(a,b);if(0>c)return null;if(null===a.aoData[c].nTr){var d=l.createElement("td");d.innerHTML=v(a,c,b,"");return d}return J(a,c)[b]}function Pa(a,b){for(var c=-1,d=-1,i=0;i<a.aoData.length;i++){var e=v(a,i,b,"display")+"",e=e.replace(/<.*?>/g,"");e.length>c&&(c=e.length,d=i)}return d}function q(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1);
82
+ return 48>b||57<b?a:a+"px"}function Qa(){var a=l.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=l.createElement("div"),b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);l.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;b==a&&(a=c.clientWidth);l.body.removeChild(c);return b-a}function O(a,b){var c,d,i,e,g,k,o=[],m=[],p=
83
+ j.ext.oSort,l=a.aoData,q=a.aoColumns,G=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&(0!==a.aaSorting.length||null!==a.aaSortingFixed)){o=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<o.length;c++)if(d=o[c][0],i=R(a,d),e=a.aoColumns[d].sSortDataType,j.ext.afnSortData[e])if(g=j.ext.afnSortData[e].call(a.oInstance,a,d,i),g.length===l.length){i=0;for(e=l.length;i<e;i++)F(a,i,d,g[i])}else D(a,0,"Returned data sort array (col "+d+") is the wrong length");c=
84
+ 0;for(d=a.aiDisplayMaster.length;c<d;c++)m[a.aiDisplayMaster[c]]=c;var r=o.length,s;c=0;for(d=l.length;c<d;c++)for(i=0;i<r;i++){s=q[o[i][0]].aDataSort;g=0;for(k=s.length;g<k;g++)e=q[s[g]].sType,e=p[(e?e:"string")+"-pre"],l[c]._aSortData[s[g]]=e?e(v(a,c,s[g],"sort")):v(a,c,s[g],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d,e,i,f;for(c=0;c<r;c++){f=q[o[c][0]].aDataSort;d=0;for(e=f.length;d<e;d++)if(i=q[f[d]].sType,i=p[(i?i:"string")+"-"+o[c][1]](l[a]._aSortData[f[d]],l[b]._aSortData[f[d]]),0!==
85
+ i)return i}return p["numeric-asc"](m[a],m[b])})}(b===n||b)&&!a.oFeatures.bDeferRender&&P(a);c=0;for(d=a.aoColumns.length;c<d;c++)e=q[c].sTitle.replace(/<.*?>/g,""),i=q[c].nTh,i.removeAttribute("aria-sort"),i.removeAttribute("aria-label"),q[c].bSortable?0<o.length&&o[0][0]==c?(i.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),i.setAttribute("aria-label",e+("asc"==(q[c].asSorting[o[0][2]+1]?q[c].asSorting[o[0][2]+1]:q[c].asSorting[0])?G.sSortAscending:G.sSortDescending))):i.setAttribute("aria-label",
86
+ e+("asc"==q[c].asSorting[0]?G.sSortAscending:G.sSortDescending)):i.setAttribute("aria-label",e);a.bSorted=!0;h(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?K(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,y(a),x(a))}function ia(a,b,c,d){Ra(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var e=function(){var d,e;if(b.shiftKey){for(var f=!1,h=0;h<a.aaSorting.length;h++)if(a.aaSorting[h][0]==c){f=!0;d=a.aaSorting[h][0];e=a.aaSorting[h][2]+1;a.aoColumns[d].asSorting[e]?
87
+ (a.aaSorting[h][1]=a.aoColumns[d].asSorting[e],a.aaSorting[h][2]=e):a.aaSorting.splice(h,1);break}!1===f&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(d=a.aaSorting[0][0],e=a.aaSorting[0][2]+1,a.aoColumns[d].asSorting[e]||(e=0),a.aaSorting[0][1]=a.aoColumns[d].asSorting[e],a.aaSorting[0][2]=e):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));O(a)};a.oFeatures.bProcessing?(E(a,!0),setTimeout(function(){e();
88
+ a.oFeatures.bServerSide||E(a,!1)},0)):e();"function"==typeof d&&d(a)}})}function P(a){var b,c,d,e,f,g=a.aoColumns.length,j=a.oClasses;for(b=0;b<g;b++)a.aoColumns[b].bSortable&&h(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);c=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){f=a.aoColumns[b].sSortingClass;e=-1;for(d=0;d<c.length;d++)if(c[d][0]==b){f="asc"==c[d][1]?
89
+ j.sSortAsc:j.sSortDesc;e=d;break}h(a.aoColumns[b].nTh).addClass(f);a.bJUI&&(f=h("span."+j.sSortIcon,a.aoColumns[b].nTh),f.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed),f.addClass(-1==e?a.aoColumns[b].sSortingClassJUI:"asc"==c[e][1]?j.sSortJUIAsc:j.sSortJUIDesc))}else h(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);f=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){a=J(a);e=[];for(b=0;b<g;b++)e.push("");b=0;
90
+ for(d=1;b<c.length;b++)j=parseInt(c[b][0],10),e[j]=f+d,3>d&&d++;f=RegExp(f+"[123]");var o;b=0;for(c=a.length;b<c;b++)j=b%g,d=a[b].className,o=e[j],j=d.replace(f,o),j!=d?a[b].className=h.trim(j):0<o.length&&-1==d.indexOf(o)&&(a[b].className=d+" "+o)}}function ra(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,c;b=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:b?0:a._iDisplayStart,iEnd:b?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:h.extend(!0,[],a.aaSorting),
91
+ oSearch:h.extend(!0,{},a.oPreviousSearch),aoSearchCols:h.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};b=0;for(c=a.aoColumns.length;b<c;b++)d.abVisCols.push(a.aoColumns[b].bVisible);A(a,"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Sa(a,b){if(a.oFeatures.bStateSave){var c=a.fnStateLoad.call(a.oInstance,a);if(c){var d=A(a,"aoStateLoadParams","stateLoadParams",[a,c]);if(-1===h.inArray(!1,d)){a.oLoadedState=h.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=
92
+ c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();h.extend(a.oPreviousSearch,c.oSearch);h.extend(!0,a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=c.abVisCols[d];A(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function s(a){for(var b=0;b<j.settings.length;b++)if(j.settings[b].nTable===a)return j.settings[b];return null}function T(a){for(var b=
93
+ [],a=a.aoData,c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function J(a,b){var c=[],d,e,f,g,h,j;e=0;var o=a.aoData.length;b!==n&&(e=b,o=b+1);for(f=e;f<o;f++)if(j=a.aoData[f],null!==j.nTr){e=[];for(d=j.nTr.firstChild;d;)g=d.nodeName.toLowerCase(),("td"==g||"th"==g)&&e.push(d),d=d.nextSibling;g=d=0;for(h=a.aoColumns.length;g<h;g++)a.aoColumns[g].bVisible?c.push(e[g-d]):(c.push(j._anHidden[g]),d++)}return c}function D(a,b,c){a=null===a?"DataTables warning: "+c:"DataTables warning (table id = '"+
94
+ a.sTableId+"'): "+c;if(0===b)if("alert"==j.ext.sErrMode)alert(a);else throw Error(a);else X.console&&console.log&&console.log(a)}function p(a,b,c,d){d===n&&(d=c);b[c]!==n&&(a[d]=b[c])}function Ta(a,b){var c,d;for(d in b)b.hasOwnProperty(d)&&(c=b[d],"object"===typeof e[d]&&null!==c&&!1===h.isArray(c)?h.extend(!0,a[d],c):a[d]=c);return a}function Ra(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})}
95
+ function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function A(a,b,c,d){for(var b=a[b],e=[],f=b.length-1;0<=f;f--)e.push(b[f].fn.apply(a.oInstance,d));null!==c&&h(a.oInstance).trigger(c,d);return e}function Ua(a){var b=h('<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden"><div style="position:absolute; top:1px; left:1px; width:100px; overflow:scroll;"><div id="DT_BrowserTest" style="width:100%; height:10px;"></div></div></div>')[0];l.body.appendChild(b);a.oBrowser.bScrollOversize=
96
+ 100===h("#DT_BrowserTest",b)[0].offsetWidth?!0:!1;l.body.removeChild(b)}function Va(a){return function(){var b=[s(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return j.ext.oApi[a].apply(this,b)}}var U=/\[.*?\]$/,Wa=X.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d,e=[],f=h.isArray(a);for(c in a)d=a[c],b=typeof d,"string"===b?d='"'+d+'"':"object"===b&&null!==d&&(d=Wa(d)),e.push((f?"":'"'+c+'":')+d);return(f?
97
+ "[":"{")+e+(f?"]":"}")};this.$=function(a,b){var c,d,e=[],f;d=s(this[j.ext.iApiIndex]);var g=d.aoData,o=d.aiDisplay,k=d.aiDisplayMaster;b||(b={});b=h.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page){c=d._iDisplayStart;for(d=d.fnDisplayEnd();c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("current"==b.order&&"none"==b.filter){c=0;for(d=k.length;c<d;c++)(f=g[k[c]].nTr)&&e.push(f)}else if("current"==b.order&&"applied"==b.filter){c=0;for(d=o.length;c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("original"==
98
+ b.order&&"none"==b.filter){c=0;for(d=g.length;c<d;c++)(f=g[c].nTr)&&e.push(f)}else if("original"==b.order&&"applied"==b.filter){c=0;for(d=g.length;c<d;c++)f=g[c].nTr,-1!==h.inArray(c,o)&&f&&e.push(f)}else D(d,1,"Unknown selection options");e=h(e);c=e.filter(a);e=e.find(a);return h([].concat(h.makeArray(c),h.makeArray(e)))};this._=function(a,b){var c=[],d,e,f=this.$(a,b);d=0;for(e=f.length;d<e;d++)c.push(this.fnGetData(f[d]));return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[],
99
+ d,e=s(this[j.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var f=0;f<a.length;f++){d=H(e,a[f]);if(-1==d)return c;c.push(d)}else{d=H(e,a);if(-1==d)return c;c.push(d)}e.aiDisplay=e.aiDisplayMaster.slice();(b===n||b)&&aa(e);return c};this.fnAdjustColumnSizing=function(a){var b=s(this[j.ext.iApiIndex]);k(b);a===n||a?this.fnDraw(!1):(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=function(a){var b=s(this[j.ext.iApiIndex]);ga(b);(a===n||a)&&x(b)};this.fnClose=
100
+ function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),0;return 1};this.fnDeleteRow=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,a="object"===typeof a?I(d,a):a,g=d.aoData.splice(a,1);e=0;for(f=d.aoData.length;e<f;e++)null!==d.aoData[e].nTr&&(d.aoData[e].nTr._DT_RowIndex=e);e=h.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ha(d.aiDisplayMaster,
101
+ a);ha(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,g);d._iDisplayStart>=d.fnRecordsDisplay()&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart&&(d._iDisplayStart=0));if(c===n||c)y(d),x(d);return g};this.fnDestroy=function(a){var b=s(this[j.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,i,f,a=a===n?!1:a;b.bDestroying=!0;A(b,"aoDestroyCallback","destroy",[b]);if(!a){i=0;for(f=b.aoColumns.length;i<f;i++)!1===b.aoColumns[i].bVisible&&this.fnSetColumnVis(i,!0)}h(b.nTableWrapper).find("*").andSelf().unbind(".DT");
102
+ h("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(h(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(h(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);h(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];P(b);h(T(b)).removeClass(b.asStripeClasses.join(" "));h("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc,
103
+ b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(h("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),h("th, td",b.nTHead).each(function(){var a=h("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();h(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);i=0;for(f=b.aoData.length;i<f;i++)null!==b.aoData[i].nTr&&d.appendChild(b.aoData[i].nTr);!0===b.oFeatures.bAutoWidth&&
104
+ (b.nTable.style.width=q(b.sDestroyWidth));if(f=b.asDestroyStripes.length){a=h(d).children("tr");for(i=0;i<f;i++)a.filter(":nth-child("+f+"n + "+i+")").addClass(b.asDestroyStripes[i])}i=0;for(f=j.settings.length;i<f;i++)j.settings[i]==b&&j.settings.splice(i,1);e=b=null};this.fnDraw=function(a){var b=s(this[j.ext.iApiIndex]);!1===a?(y(b),x(b)):aa(b)};this.fnFilter=function(a,b,c,d,e,f){var g=s(this[j.ext.iApiIndex]);if(g.oFeatures.bFilter){if(c===n||null===c)c=!1;if(d===n||null===d)d=!0;if(e===n||null===
105
+ e)e=!0;if(f===n||null===f)f=!0;if(b===n||null===b){if(K(g,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f},1),e&&g.aanFeatures.f){b=g.aanFeatures.f;c=0;for(d=b.length;c<d;c++)try{b[c]._DT_Input!=l.activeElement&&h(b[c]._DT_Input).val(a)}catch(o){h(b[c]._DT_Input).val(a)}}}else h.extend(g.aoPreSearchCols[b],{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f}),K(g,g.oPreviousSearch,1)}};this.fnGetData=function(a,b){var c=s(this[j.ext.iApiIndex]);if(a!==n){var d=a;if("object"===typeof a){var e=a.nodeName.toLowerCase();
106
+ "tr"===e?d=I(c,a):"td"===e&&(d=I(c,a.parentNode),b=fa(c,d,a))}return b!==n?v(c,d,b,""):c.aoData[d]!==n?c.aoData[d]._aData:null}return Z(c)};this.fnGetNodes=function(a){var b=s(this[j.ext.iApiIndex]);return a!==n?b.aoData[a]!==n?b.aoData[a].nTr:null:T(b)};this.fnGetPosition=function(a){var b=s(this[j.ext.iApiIndex]),c=a.nodeName.toUpperCase();return"TR"==c?I(b,a):"TD"==c||"TH"==c?(c=I(b,a.parentNode),a=fa(b,c,a),[c,R(b,a),a]):null};this.fnIsOpen=function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<
107
+ b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return!0;return!1};this.fnOpen=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e=T(d);if(-1!==h.inArray(a,e)){this.fnClose(a);var e=l.createElement("tr"),f=l.createElement("td");e.appendChild(f);f.className=c;f.colSpan=t(d);"string"===typeof b?f.innerHTML=b:h(f).html(b);b=h("tr",d.nTBody);-1!=h.inArray(a,b)&&h(e).insertAfter(a);d.aoOpenRows.push({nTr:e,nParent:a});return e}};this.fnPageChange=function(a,b){var c=s(this[j.ext.iApiIndex]);qa(c,a);
108
+ y(c);(b===n||b)&&x(c)};this.fnSetColumnVis=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,g=d.aoColumns,h=d.aoData,o,m;if(g[a].bVisible!=b){if(b){for(e=f=0;e<a;e++)g[e].bVisible&&f++;m=f>=t(d);if(!m)for(e=a;e<g.length;e++)if(g[e].bVisible){o=e;break}e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(m?h[e].nTr.appendChild(h[e]._anHidden[a]):h[e].nTr.insertBefore(h[e]._anHidden[a],J(d,e)[o]))}else{e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(o=J(d,e)[a],h[e]._anHidden[a]=o,o.parentNode.removeChild(o))}g[a].bVisible=
109
+ b;W(d,d.aoHeader);d.nTFoot&&W(d,d.aoFooter);e=0;for(f=d.aoOpenRows.length;e<f;e++)d.aoOpenRows[e].nTr.colSpan=t(d);if(c===n||c)k(d),x(d);ra(d)}};this.fnSettings=function(){return s(this[j.ext.iApiIndex])};this.fnSort=function(a){var b=s(this[j.ext.iApiIndex]);b.aaSorting=a;O(b)};this.fnSortListener=function(a,b,c){ia(s(this[j.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,b,c,d,e){var f=s(this[j.ext.iApiIndex]),b="object"===typeof b?I(f,b):b;if(h.isArray(a)&&c===n){f.aoData[b]._aData=a.slice();
110
+ for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else if(h.isPlainObject(a)&&c===n){f.aoData[b]._aData=h.extend(!0,{},a);for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else{F(f,b,c,a);var a=v(f,b,c,"display"),g=f.aoColumns[c];null!==g.fnRender&&(a=S(f,b,c),g.bUseRendered&&F(f,b,c,a));null!==f.aoData[b].nTr&&(J(f,b)[c].innerHTML=a)}c=h.inArray(b,f.aiDisplay);f.asDataSearch[c]=na(f,Y(f,b,"filter",r(f,"bSearchable")));(e===n||e)&&k(f);(d===n||d)&&aa(f);return 0};
111
+ this.fnVersionCheck=j.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:Va,_fnInitialise:ba,_fnInitComplete:$,_fnLanguageCompat:pa,_fnAddColumn:o,_fnColumnOptions:m,_fnAddData:H,_fnCreateTr:ea,_fnGatherData:ua,_fnBuildHead:va,_fnDrawHead:W,_fnDraw:x,_fnReDraw:aa,_fnAjaxUpdate:wa,_fnAjaxParameters:Ea,_fnAjaxUpdateDraw:Fa,_fnServerParams:ka,_fnAddOptionsHtml:xa,_fnFeatureHtmlTable:Ba,_fnScrollDraw:La,_fnAdjustColumnSizing:k,_fnFeatureHtmlFilter:za,_fnFilterComplete:K,_fnFilterCustom:Ia,_fnFilterColumn:Ha,
112
+ _fnFilter:Ga,_fnBuildSearchArray:la,_fnBuildSearchRow:na,_fnFilterCreateSearch:ma,_fnDataToSearch:Ja,_fnSort:O,_fnSortAttachListener:ia,_fnSortingClasses:P,_fnFeatureHtmlPaginate:Da,_fnPageChange:qa,_fnFeatureHtmlInfo:Ca,_fnUpdateInfo:Ka,_fnFeatureHtmlLength:ya,_fnFeatureHtmlProcessing:Aa,_fnProcessingDisplay:E,_fnVisibleToColumnIndex:G,_fnColumnIndexToVisible:R,_fnNodeToDataIndex:I,_fnVisbleColumns:t,_fnCalculateEnd:y,_fnConvertToWidth:Ma,_fnCalculateColumnWidths:da,_fnScrollingWidthAdjust:Oa,_fnGetWidestNode:Na,
113
+ _fnGetMaxLenString:Pa,_fnStringToCss:q,_fnDetectType:B,_fnSettingsFromNode:s,_fnGetDataMaster:Z,_fnGetTrNodes:T,_fnGetTdNodes:J,_fnEscapeRegex:oa,_fnDeleteIndex:ha,_fnReOrderIndex:u,_fnColumnOrdering:M,_fnLog:D,_fnClearTable:ga,_fnSaveState:ra,_fnLoadState:Sa,_fnCreateCookie:function(a,b,c,d,e){var f=new Date;f.setTime(f.getTime()+1E3*c);var c=X.location.pathname.split("/"),a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase(),g;null!==e?(g="function"===typeof h.parseJSON?h.parseJSON(b):eval("("+b+")"),
114
+ b=e(a,g,f.toGMTString(),c.join("/")+"/")):b=a+"="+encodeURIComponent(b)+"; expires="+f.toGMTString()+"; path="+c.join("/")+"/";a=l.cookie.split(";");e=b.split(";")[0].length;f=[];if(4096<e+l.cookie.length+10){for(var j=0,o=a.length;j<o;j++)if(-1!=a[j].indexOf(d)){var k=a[j].split("=");try{(g=eval("("+decodeURIComponent(k[1])+")"))&&g.iCreate&&f.push({name:k[0],time:g.iCreate})}catch(m){}}for(f.sort(function(a,b){return b.time-a.time});4096<e+l.cookie.length+10;){if(0===f.length)return;d=f.pop();l.cookie=
115
+ d.name+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/"}}l.cookie=b},_fnReadCookie:function(a){for(var b=X.location.pathname.split("/"),a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",b=l.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null},_fnDetectHeader:V,_fnGetUniqueThs:N,_fnScrollBarWidth:Qa,_fnApplyToChildren:C,_fnMap:p,_fnGetRowData:Y,
116
+ _fnGetCellData:v,_fnSetCellData:F,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:L,_fnApplyColumnDefs:ta,_fnBindAction:Ra,_fnExtend:Ta,_fnCallbackReg:z,_fnCallbackFire:A,_fnJsonString:Wa,_fnRender:S,_fnNodeToColumnIndex:fa,_fnInfoMacros:ja,_fnBrowserDetect:Ua,_fnGetColumns:r};h.extend(j.ext.oApi,this.oApi);for(var sa in j.ext.oApi)sa&&(this[sa]=Va(sa));var ca=this;this.each(function(){var a=0,b,c,d;c=this.getAttribute("id");var i=!1,f=!1;if("table"!=this.nodeName.toLowerCase())D(null,0,"Attempted to initialise DataTables on a node which is not a table: "+
117
+ this.nodeName);else{a=0;for(b=j.settings.length;a<b;a++){if(j.settings[a].nTable==this){if(e===n||e.bRetrieve)return j.settings[a].oInstance;if(e.bDestroy){j.settings[a].oInstance.fnDestroy();break}else{D(j.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(j.settings[a].sTableId==this.id){j.settings.splice(a,1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+j.ext._oExternConfig.iNextUnique++;
118
+ var g=h.extend(!0,{},j.models.oSettings,{nTable:this,oApi:ca.oApi,oInit:e,sDestroyWidth:h(this).width(),sInstance:c,sTableId:c});j.settings.push(g);g.oInstance=1===ca.length?ca:h(this).dataTable();e||(e={});e.oLanguage&&pa(e.oLanguage);e=Ta(h.extend(!0,{},j.defaults),e);p(g.oFeatures,e,"bPaginate");p(g.oFeatures,e,"bLengthChange");p(g.oFeatures,e,"bFilter");p(g.oFeatures,e,"bSort");p(g.oFeatures,e,"bInfo");p(g.oFeatures,e,"bProcessing");p(g.oFeatures,e,"bAutoWidth");p(g.oFeatures,e,"bSortClasses");
119
+ p(g.oFeatures,e,"bServerSide");p(g.oFeatures,e,"bDeferRender");p(g.oScroll,e,"sScrollX","sX");p(g.oScroll,e,"sScrollXInner","sXInner");p(g.oScroll,e,"sScrollY","sY");p(g.oScroll,e,"bScrollCollapse","bCollapse");p(g.oScroll,e,"bScrollInfinite","bInfinite");p(g.oScroll,e,"iScrollLoadGap","iLoadGap");p(g.oScroll,e,"bScrollAutoCss","bAutoCss");p(g,e,"asStripeClasses");p(g,e,"asStripClasses","asStripeClasses");p(g,e,"fnServerData");p(g,e,"fnFormatNumber");p(g,e,"sServerMethod");p(g,e,"aaSorting");p(g,
120
+ e,"aaSortingFixed");p(g,e,"aLengthMenu");p(g,e,"sPaginationType");p(g,e,"sAjaxSource");p(g,e,"sAjaxDataProp");p(g,e,"iCookieDuration");p(g,e,"sCookiePrefix");p(g,e,"sDom");p(g,e,"bSortCellsTop");p(g,e,"iTabIndex");p(g,e,"oSearch","oPreviousSearch");p(g,e,"aoSearchCols","aoPreSearchCols");p(g,e,"iDisplayLength","_iDisplayLength");p(g,e,"bJQueryUI","bJUI");p(g,e,"fnCookieCallback");p(g,e,"fnStateLoad");p(g,e,"fnStateSave");p(g.oLanguage,e,"fnInfoCallback");z(g,"aoDrawCallback",e.fnDrawCallback,"user");
121
+ z(g,"aoServerParams",e.fnServerParams,"user");z(g,"aoStateSaveParams",e.fnStateSaveParams,"user");z(g,"aoStateLoadParams",e.fnStateLoadParams,"user");z(g,"aoStateLoaded",e.fnStateLoaded,"user");z(g,"aoRowCallback",e.fnRowCallback,"user");z(g,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(g,"aoHeaderCallback",e.fnHeaderCallback,"user");z(g,"aoFooterCallback",e.fnFooterCallback,"user");z(g,"aoInitComplete",e.fnInitComplete,"user");z(g,"aoPreDrawCallback",e.fnPreDrawCallback,"user");g.oFeatures.bServerSide&&
122
+ g.oFeatures.bSort&&g.oFeatures.bSortClasses?z(g,"aoDrawCallback",P,"server_side_sort_classes"):g.oFeatures.bDeferRender&&z(g,"aoDrawCallback",P,"defer_sort_classes");e.bJQueryUI?(h.extend(g.oClasses,j.ext.oJUIClasses),e.sDom===j.defaults.sDom&&"lfrtip"===j.defaults.sDom&&(g.sDom='<"H"lfr>t<"F"ip>')):h.extend(g.oClasses,j.ext.oStdClasses);h(this).addClass(g.oClasses.sTable);if(""!==g.oScroll.sX||""!==g.oScroll.sY)g.oScroll.iBarWidth=Qa();g.iInitDisplayStart===n&&(g.iInitDisplayStart=e.iDisplayStart,
123
+ g._iDisplayStart=e.iDisplayStart);e.bStateSave&&(g.oFeatures.bStateSave=!0,Sa(g,e),z(g,"aoDrawCallback",ra,"state_save"));null!==e.iDeferLoading&&(g.bDeferLoading=!0,a=h.isArray(e.iDeferLoading),g._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,g._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading);null!==e.aaData&&(f=!0);""!==e.oLanguage.sUrl?(g.oLanguage.sUrl=e.oLanguage.sUrl,h.getJSON(g.oLanguage.sUrl,null,function(a){pa(a);h.extend(true,g.oLanguage,e.oLanguage,a);ba(g)}),i=!0):h.extend(!0,
124
+ g.oLanguage,e.oLanguage);null===e.asStripeClasses&&(g.asStripeClasses=[g.oClasses.sStripeOdd,g.oClasses.sStripeEven]);b=g.asStripeClasses.length;g.asDestroyStripes=[];if(b){c=!1;d=h(this).children("tbody").children("tr:lt("+b+")");for(a=0;a<b;a++)d.hasClass(g.asStripeClasses[a])&&(c=!0,g.asDestroyStripes.push(g.asStripeClasses[a]));c&&d.removeClass(g.asStripeClasses.join(" "))}c=[];a=this.getElementsByTagName("thead");0!==a.length&&(V(g.aoHeader,a[0]),c=N(g));if(null===e.aoColumns){d=[];a=0;for(b=
125
+ c.length;a<b;a++)d.push(null)}else d=e.aoColumns;a=0;for(b=d.length;a<b;a++)e.saved_aoColumns!==n&&e.saved_aoColumns.length==b&&(null===d[a]&&(d[a]={}),d[a].bVisible=e.saved_aoColumns[a].bVisible),o(g,c?c[a]:null);ta(g,e.aoColumnDefs,d,function(a,b){m(g,a,b)});a=0;for(b=g.aaSorting.length;a<b;a++){g.aaSorting[a][0]>=g.aoColumns.length&&(g.aaSorting[a][0]=0);var k=g.aoColumns[g.aaSorting[a][0]];g.aaSorting[a][2]===n&&(g.aaSorting[a][2]=0);e.aaSorting===n&&g.saved_aaSorting===n&&(g.aaSorting[a][1]=
126
+ k.asSorting[0]);c=0;for(d=k.asSorting.length;c<d;c++)if(g.aaSorting[a][1]==k.asSorting[c]){g.aaSorting[a][2]=c;break}}P(g);Ua(g);a=h(this).children("caption").each(function(){this._captionSide=h(this).css("caption-side")});b=h(this).children("thead");0===b.length&&(b=[l.createElement("thead")],this.appendChild(b[0]));g.nTHead=b[0];b=h(this).children("tbody");0===b.length&&(b=[l.createElement("tbody")],this.appendChild(b[0]));g.nTBody=b[0];g.nTBody.setAttribute("role","alert");g.nTBody.setAttribute("aria-live",
127
+ "polite");g.nTBody.setAttribute("aria-relevant","all");b=h(this).children("tfoot");if(0===b.length&&0<a.length&&(""!==g.oScroll.sX||""!==g.oScroll.sY))b=[l.createElement("tfoot")],this.appendChild(b[0]);0<b.length&&(g.nTFoot=b[0],V(g.aoFooter,g.nTFoot));if(f)for(a=0;a<e.aaData.length;a++)H(g,e.aaData[a]);else ua(g);g.aiDisplay=g.aiDisplayMaster.slice();g.bInitialised=!0;!1===i&&ba(g)}});ca=null;return this};j.fnVersionCheck=function(e){for(var h=function(e,h){for(;e.length<h;)e+="0";return e},m=j.ext.sVersion.split("."),
128
+ e=e.split("."),k="",n="",l=0,t=e.length;l<t;l++)k+=h(m[l],3),n+=h(e[l],3);return parseInt(k,10)>=parseInt(n,10)};j.fnIsDataTable=function(e){for(var h=j.settings,m=0;m<h.length;m++)if(h[m].nTable===e||h[m].nScrollHead===e||h[m].nScrollFoot===e)return!0;return!1};j.fnTables=function(e){var o=[];jQuery.each(j.settings,function(j,k){(!e||!0===e&&h(k.nTable).is(":visible"))&&o.push(k.nTable)});return o};j.version="1.9.4";j.settings=[];j.models={};j.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],
129
+ aTypes:[],fnVersionCheck:j.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{},oSort:{},sVersion:j.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};j.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};j.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};j.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,
130
+ fnRender:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};j.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,
131
+ bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){if(1E3>e)return e;for(var h=e+"",e=h.split(""),j="",h=h.length,k=0;k<h;k++)0===k%3&&0!==k&&(j=this.oLanguage.sInfoThousands+j),j=e[h-k-1]+j;return j},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,
132
+ fnRowCallback:null,fnServerData:function(e,j,m,k){k.jqXHR=h.ajax({url:e,data:j,success:function(e){e.sError&&k.oApi._fnLog(k,0,e.sError);h(k.oInstance).trigger("xhr",[k,e]);m(e)},dataType:"json",cache:!1,type:k.sServerMethod,error:function(e,h){"parsererror"==h&&k.oApi._fnLog(k,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){var e=this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance),j;try{j=
133
+ "function"===typeof h.parseJSON?h.parseJSON(e):eval("("+e+")")}catch(m){j=null}return j},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(e,h){this.oApi._fnCreateCookie(e.sCookiePrefix+e.sInstance,this.oApi._fnJsonString(h),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},
134
+ oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},j.models.oSearch),sAjaxDataProp:"aaData",
135
+ sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};j.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};j.models.oSettings={oFeatures:{bAutoWidth:null,
136
+ bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null,
137
+ asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[],
138
+ oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length},
139
+ fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};j.ext=h.extend(!0,{},j.models.ext);h.extend(j.ext.oStdClasses,
140
+ {sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",
141
+ sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
142
+ sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"",sJUIHeader:"",sJUIFooter:""});h.extend(j.ext.oJUIClasses,j.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",
143
+ sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",
144
+ sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",
145
+ sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default",sJUIHeader:"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",sJUIFooter:"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"});h.extend(j.ext.oPagination,{two_button:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)},k=!e.bJUI?'<a class="'+
146
+ e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sPrevious+'</a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sNext+"</a>":'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>';h(j).append(k);var l=h("a",j),
147
+ k=l[0],l=l[1];e.oApi._fnBindAction(k,{action:"previous"},n);e.oApi._fnBindAction(l,{action:"next"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_previous",l.id=e.sTableId+"_next",k.setAttribute("aria-controls",e.sTableId),l.setAttribute("aria-controls",e.sTableId))},fnUpdate:function(e){if(e.aanFeatures.p)for(var h=e.oClasses,j=e.aanFeatures.p,k,l=0,n=j.length;l<n;l++)if(k=j[l].firstChild)k.className=0===e._iDisplayStart?h.sPagePrevDisabled:h.sPagePrevEnabled,k=k.nextSibling,
148
+ k.className=e.fnDisplayEnd()==e.fnRecordsDisplay()?h.sPageNextDisabled:h.sPageNextEnabled}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,l=e.oClasses,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)};h(j).append('<a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageFirst+'">'+k.sFirst+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPagePrevious+'">'+k.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'+
149
+ l.sPageButton+" "+l.sPageNext+'">'+k.sNext+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageLast+'">'+k.sLast+"</a>");var t=h("a",j),k=t[0],l=t[1],r=t[2],t=t[3];e.oApi._fnBindAction(k,{action:"first"},n);e.oApi._fnBindAction(l,{action:"previous"},n);e.oApi._fnBindAction(r,{action:"next"},n);e.oApi._fnBindAction(t,{action:"last"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",r.id=e.sTableId+"_next",t.id=e.sTableId+"_last")},
150
+ fnUpdate:function(e,o){if(e.aanFeatures.p){var m=j.ext.oPagination.iFullNumbersShowPages,k=Math.floor(m/2),l=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),n=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,t="",r,B=e.oClasses,u,M=e.aanFeatures.p,L=function(h){e.oApi._fnBindAction(this,{page:h+r-1},function(h){e.oApi._fnPageChange(e,h.data.page);o(e);h.preventDefault()})};-1===e._iDisplayLength?n=k=r=1:l<m?(r=1,k=l):n<=k?(r=1,k=m):n>=l-k?(r=l-m+1,k=l):(r=n-Math.ceil(m/2)+1,k=r+m-1);for(m=r;m<=k;m++)t+=
151
+ n!==m?'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButton+'">'+e.fnFormatNumber(m)+"</a>":'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButtonActive+'">'+e.fnFormatNumber(m)+"</a>";m=0;for(k=M.length;m<k;m++)u=M[m],u.hasChildNodes()&&(h("span:eq(0)",u).html(t).children("a").each(L),u=u.getElementsByTagName("a"),u=[u[0],u[1],u[u.length-2],u[u.length-1]],h(u).removeClass(B.sPageButton+" "+B.sPageButtonActive+" "+B.sPageButtonStaticDisabled),h([u[0],u[1]]).addClass(1==n?B.sPageButtonStaticDisabled:
152
+ B.sPageButton),h([u[2],u[3]]).addClass(0===l||n===l||-1===e._iDisplayLength?B.sPageButtonStaticDisabled:B.sPageButton))}}}});h.extend(j.ext.oSort,{"string-pre":function(e){"string"!=typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,h){return e<h?-1:e>h?1:0},"string-desc":function(e,h){return e<h?1:e>h?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,h){return e<h?-1:e>h?1:0},"html-desc":function(e,h){return e<
153
+ h?1:e>h?-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""===e)e=Date.parse("01/01/1970 00:00:00");return e},"date-asc":function(e,h){return e-h},"date-desc":function(e,h){return h-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,h){return e-h},"numeric-desc":function(e,h){return h-e}});h.extend(j.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var h,j=!1;h=e.charAt(0);if(-1=="0123456789-".indexOf(h))return null;
154
+ for(var k=1;k<e.length;k++){h=e.charAt(k);if(-1=="0123456789.".indexOf(h))return null;if("."==h){if(j)return null;j=!0}}return"numeric"},function(e){var h=Date.parse(e);return null!==h&&!isNaN(h)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);h.fn.DataTable=j;h.fn.dataTable=j;h.fn.dataTableSettings=j.settings;h.fn.dataTableExt=j.ext};"function"===typeof define&&define.amd?define(["jquery"],L):jQuery&&!jQuery.fn.dataTable&&
155
+ L(jQuery)})(window,document);
assets/js/woocompare-admin.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+
3
+ $( ".attributes .fields" ).sortable({
4
+ cursor: "move",
5
+ scrollSensitivity: 10,
6
+ tolerance: "pointer",
7
+ axis: "y",
8
+ stop: function(event, ui) {
9
+ var list = ui.item.parents('.fields'),
10
+ fields = new Array();
11
+ $('input[type="checkbox"]', list).each(function(i){
12
+ fields[i] = $(this).val();
13
+ });
14
+
15
+ list.next().val( fields.join(',') );
16
+ }
17
+ });
18
+
19
+ });
assets/js/woocompare.js ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+
3
+ // add into table
4
+ $(document).on( 'click', '.product .compare', function(e){
5
+ e.preventDefault();
6
+
7
+ var button = $(this),
8
+ data = {
9
+ _yitnonce_ajax: yith_woocompare.nonceadd,
10
+ action: yith_woocompare.actionadd,
11
+ id: button.data('product_id'),
12
+ context: 'frontend'
13
+ },
14
+ widget_list = $('.yith-woocompare-widget ul.products-list');
15
+
16
+ // add ajax loader
17
+ button.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
18
+ widget_list.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
19
+
20
+ $.ajax({
21
+ type: 'post',
22
+ url: yith_woocompare.ajaxurl,
23
+ data: data,
24
+ dataType: 'json',
25
+ success: function(response){
26
+ button.unblock().addClass('added').text( yith_woocompare.added_label );
27
+
28
+ // add the product in the widget
29
+ widget_list.unblock().html( response.widget_table );
30
+
31
+ if (yith_woocompare.auto_open == 'yes') $('body').trigger( 'yith_woocompare_open_popup', { response: response.table_url } );
32
+ }
33
+ });
34
+ });
35
+
36
+ // open popup
37
+ $('body').on( 'yith_woocompare_open_popup', function( e, data ) {
38
+ var response = data.response;
39
+
40
+ if ($(window).width() >= 768) {
41
+ $.colorbox({
42
+ href: response,
43
+ iframe: true,
44
+ width: '90%',
45
+ height: '90%',
46
+ onClosed: function(){
47
+ var widget_list = $('.yith-woocompare-widget ul.products-list'),
48
+ data = {
49
+ action: yith_woocompare.actionview,
50
+ context: 'frontend'
51
+ };
52
+
53
+ widget_list.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
54
+
55
+ $.ajax({
56
+ type: 'post',
57
+ url: yith_woocompare.ajaxurl,
58
+ data: data,
59
+ success: function(response){
60
+ // add the product in the widget
61
+ widget_list.unblock().html( response );
62
+ }
63
+ });
64
+ }
65
+ });
66
+
67
+ $(window).resize(function () {
68
+ $.colorbox.resize({
69
+ width: '90%',
70
+ height: '90%'
71
+ });
72
+ });
73
+
74
+ } else {
75
+ var urlparts = response.split('?');
76
+ var parameter = 'iframe';
77
+ if (urlparts.length >= 2) {
78
+ var prefix = encodeURIComponent(parameter) + '=';
79
+ var pars = urlparts[1].split(/[&;]/g);
80
+ for (var i = pars.length; i-- > 0;)
81
+ if (pars[i].lastIndexOf(prefix, 0) !== -1)
82
+ pars.splice(i, 1);
83
+ response = urlparts[0] + '?' + pars.join('&');
84
+ }
85
+
86
+ window.open(response, yith_woocompare.table_title);
87
+ }
88
+ });
89
+
90
+ // remove from table
91
+ $(document).on( 'click', '.remove a', function(e){
92
+ e.preventDefault();
93
+
94
+ var button = $(this),
95
+ data = {
96
+ _yitnonce_ajax: yith_woocompare.nonceremove,
97
+ action: yith_woocompare.actionremove,
98
+ id: button.data('product_id'),
99
+ context: 'frontend'
100
+ },
101
+ product_cell = $( 'td.product_' + data.id + ', th.product_' + data.id );
102
+
103
+ // add ajax loader
104
+ button.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
105
+
106
+ $.ajax({
107
+ type: 'post',
108
+ url: yith_woocompare.ajaxurl,
109
+ data: data,
110
+ dataType:'html',
111
+ success: function(response){
112
+ button.unblock();
113
+
114
+ // in compare table
115
+ var table = $(response).filter('table.compare-list');
116
+ $('body > table.compare-list').replaceWith( table );
117
+
118
+ // removed trigger
119
+ $(window).trigger('yith_woocompare_product_removed');
120
+ }
121
+ });
122
+ });
123
+
124
+
125
+
126
+ // ##### WIDGET ######
127
+
128
+ $('.yith-woocompare-widget')
129
+
130
+ // view table (click on compare
131
+ .on('click', 'a.compare', function (e) {
132
+ e.preventDefault();
133
+ $('body').trigger('yith_woocompare_open_popup', { response: $(this).attr('href') });
134
+ })
135
+
136
+ // remove product & clear all
137
+ .on('click', 'li a.remove, a.clear-all', function (e) {
138
+ e.preventDefault();
139
+
140
+ var button = $(this),
141
+ data = {
142
+ _yitnonce_ajax: yith_woocompare.nonceremove,
143
+ action: yith_woocompare.actionremove,
144
+ id: button.data('product_id'),
145
+ context: 'frontend',
146
+ responseType: 'product_list'
147
+ },
148
+ product_list = button.parents('.yith-woocompare-widget').find('ul.products-list');
149
+
150
+ // add ajax loader
151
+ product_list.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
152
+
153
+ $.ajax({
154
+ type: 'post',
155
+ url: yith_woocompare.ajaxurl,
156
+ data: data,
157
+ dataType: 'html',
158
+ success: function (response) {
159
+ product_list.html(response);
160
+ product_list.unblock();
161
+ }
162
+ });
163
+ });
164
+
165
+ });
class.yith-woocompare-admin.php ADDED
@@ -0,0 +1,420 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Magnifier
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
11
+
12
+ if( !class_exists( 'YITH_Woocompare_Admin' ) ) {
13
+ /**
14
+ * Admin class.
15
+ * The class manage all the admin behaviors.
16
+ *
17
+ * @since 1.0.0
18
+ */
19
+ class YITH_Woocompare_Admin {
20
+ /**
21
+ * Plugin version
22
+ *
23
+ * @var string
24
+ * @since 1.0.0
25
+ */
26
+ public $version = YITH_WOOCOMPARE_VERSION;
27
+
28
+ /**
29
+ * Plugin options
30
+ *
31
+ * @var array
32
+ * @access public
33
+ * @since 1.0.0
34
+ */
35
+ public $options = array();
36
+
37
+ /**
38
+ * The standard fields
39
+ *
40
+ * @var array
41
+ * @since 1.0.0
42
+ */
43
+ public $default_fields = array();
44
+
45
+ /**
46
+ * Various links
47
+ *
48
+ * @var string
49
+ * @access public
50
+ * @since 1.0.0
51
+ */
52
+ public $banner_url = 'http://cdn.yithemes.com/plugins/yith_woocommerce_compare.php?url';
53
+ public $banner_img = 'http://cdn.yithemes.com/plugins/yith_woocommerce_compare.php';
54
+ public $doc_url = 'http://yithemes.com/docs-plugins/yith_woocommerce_compare/';
55
+
56
+
57
+ /**
58
+ * Constructor
59
+ *
60
+ * @access public
61
+ * @since 1.0.0
62
+ */
63
+ public function __construct() {
64
+
65
+ // populate default fields for the comparison table
66
+ $this->default_fields = YITH_Woocompare_Helper::standard_fields();
67
+
68
+ // add image size
69
+ YITH_Woocompare_Helper::set_image_size();
70
+
71
+ //Actions
72
+ add_action( 'init', array( $this, 'init' ) );
73
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
74
+
75
+ add_action( 'woocommerce_settings_tabs_yith_woocompare', array( $this, 'print_plugin_options' ) );
76
+ add_action( 'woocommerce_update_options_yith_woocompare', array( $this, 'update_options' ) );
77
+ if ( !has_action('woocommerce_admin_field_slider')) add_action( 'woocommerce_admin_field_slider', array( $this, 'admin_fields_slider' ) );
78
+ if ( !has_action('woocommerce_admin_field_picker')) add_action( 'woocommerce_admin_field_picker', array( $this, 'admin_fields_picker' ) );
79
+ if ( !has_action('woocommerce_admin_field_attributes')) add_action( 'woocommerce_admin_field_attributes', array( $this, 'admin_fields_attributes' ) );
80
+ add_action( 'admin_print_footer_scripts', array( $this, 'admin_fields_image_deps' ) );
81
+
82
+ add_action( 'woocommerce_update_option_slider', array( $this, 'admin_update_option' ) );
83
+ add_action( 'woocommerce_update_option_picker', array( $this, 'admin_update_option' ) );
84
+ add_action( 'woocommerce_update_option_attributes', array( $this, 'admin_update_option' ) );
85
+
86
+ //Filters
87
+ add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_tab_woocommerce' ) );
88
+
89
+ // YITH WCWL Loaded
90
+ do_action( 'yith_woocompare_loaded' );
91
+ }
92
+
93
+
94
+ /**
95
+ * Init method:
96
+ * - default options
97
+ *
98
+ * @access public
99
+ * @since 1.0.0
100
+ */
101
+ public function init() {
102
+ $this->options = $this->_initOptions();
103
+ $this->_default_options();
104
+ }
105
+
106
+
107
+ /**
108
+ * Update plugin options.
109
+ *
110
+ * @return void
111
+ * @since 1.0.0
112
+ */
113
+ public function update_options() {
114
+ foreach( $this->options as $option ) {
115
+ woocommerce_update_options( $option );
116
+ }
117
+ }
118
+
119
+
120
+ /**
121
+ * Add Magnifier's tab to Woocommerce -> Settings page
122
+ *
123
+ * @access public
124
+ * @param array $tabs
125
+ *
126
+ * @return array
127
+ */
128
+ public function add_tab_woocommerce($tabs) {
129
+ $tabs['yith_woocompare'] = __('Products Compare', 'yit');
130
+
131
+ return $tabs;
132
+ }
133
+
134
+
135
+ /**
136
+ * Print all plugin options.
137
+ *
138
+ * @return void
139
+ * @since 1.0.0
140
+ */
141
+ public function print_plugin_options() {
142
+ $links = apply_filters( 'yith_woocompare_tab_links', array(
143
+ '<a href="#yith_woocompare_general">' . __( 'General Settings', 'yit' ) . '</a>'
144
+ ) );
145
+
146
+ $this->_printBanner();
147
+ ?>
148
+ <div class="subsubsub_section">
149
+
150
+ <?php foreach( $this->options as $id => $tab ) : ?>
151
+ <!-- tab #<?php echo $id ?> -->
152
+ <div class="section" id="yith_woocompare_<?php echo $id ?>">
153
+ <?php woocommerce_admin_fields( $this->options[$id] ) ?>
154
+ </div>
155
+ <?php endforeach ?>
156
+ </div>
157
+ <?php
158
+ }
159
+
160
+
161
+ /**
162
+ * Initialize the options
163
+ *
164
+ * @access protected
165
+ * @return array
166
+ * @since 1.0.0
167
+ */
168
+ protected function _initOptions() {
169
+ include dirname(__FILE__) . '/yith-woocompare-options.php';
170
+ return apply_filters('yith_woocompare_tab_options', $options);
171
+ }
172
+
173
+
174
+ /**
175
+ * Default options
176
+ *
177
+ * Sets up the default options used on the settings page
178
+ *
179
+ * @access protected
180
+ * @return void
181
+ * @since 1.0.0
182
+ */
183
+ protected function _default_options() {
184
+ foreach ($this->options as $section) {
185
+ foreach ( $section as $value ) {
186
+ if ( isset( $value['std'] ) && isset( $value['id'] ) ) {
187
+ if ( $value['type'] == 'image_width' ) {
188
+ add_option($value['id'], $value['std']);
189
+ } elseif ( $value['type'] == 'attributes' ) {
190
+ if ( $value['default'] == 'all' ) {
191
+ $fields = array_merge( $this->default_fields, YITH_Woocompare_Helper::attribute_taxonomies() );
192
+ $all = array();
193
+ foreach ( array_keys( $fields ) as $field ) $all[$field] = true;
194
+ add_option( $value['id'], $all );
195
+ } else {
196
+ add_option( $value['id'], $value['std'] );
197
+ }
198
+ } else {
199
+ add_option($value['id'], $value['std']);
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+
206
+
207
+ /**
208
+ * Create new Woocommerce admin field: slider
209
+ *
210
+ * @access public
211
+ * @param array $value
212
+ * @return void
213
+ * @since 1.0.0
214
+ */
215
+ public function admin_fields_slider( $value ) {
216
+ $slider_value = ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) ?
217
+ esc_attr( stripslashes( get_option($value['id'] ) ) ) :
218
+ esc_attr( $value['std'] );
219
+
220
+ ?><tr valign="top">
221
+ <th scope="row" class="titledesc">
222
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
223
+ </th>
224
+ <td class="forminp">
225
+ <div id="<?php echo esc_attr( $value['id'] ); ?>_slider" class="yith_woocommerce_slider" style="width: 300px; float: left;"></div>
226
+ <div id="<?php echo esc_attr( $value['id'] ); ?>_value" class="yith_woocommerce_slider_value ui-state-default ui-corner-all"><?php echo $slider_value ?></div>
227
+ <input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="hidden" value="<?php echo $slider_value ?>" /> <?php echo $value['desc']; ?></td>
228
+ </tr>
229
+
230
+
231
+
232
+ <script>
233
+ jQuery(document).ready(function($){
234
+ $('#<?php echo esc_attr( $value['id'] ); ?>_slider').slider({
235
+ min: <?php echo $value['min'] ?>,
236
+ max: <?php echo $value['max'] ?>,
237
+ step: <?php echo $value['step'] ?>,
238
+ value: <?php echo $slider_value ?>,
239
+ slide: function( event, ui ) {
240
+ $( "#<?php echo esc_attr( $value['id'] ); ?>" ).val( ui.value );
241
+ $( "#<?php echo esc_attr( $value['id'] ); ?>_value" ).text( ui.value );
242
+ }
243
+ });
244
+ });
245
+ </script>
246
+
247
+ <?php
248
+ }
249
+
250
+
251
+ /**
252
+ * Create new Woocommerce admin field: picker
253
+ *
254
+ * @access public
255
+ * @param array $value
256
+ * @return void
257
+ * @since 1.0.0
258
+ */
259
+ public function admin_fields_picker( $value ) {
260
+ $picker_value = ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) ?
261
+ esc_attr( stripslashes( get_option($value['id'] ) ) ) :
262
+ esc_attr( $value['std'] );
263
+ ?><tr valign="top">
264
+ <th scope="row" class="titledesc">
265
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
266
+ </th>
267
+
268
+ <td class="forminp">
269
+ <div class="color_box"><strong><?php echo $value['name']; ?></strong>
270
+ <input name="<?php echo esc_attr( $value['id'] ) ?>" id="<?php echo esc_attr( $value['id'] ) ?>" type="text" value="<?php echo $picker_value ?>" class="colorpick" /> <div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ) ?>" class="colorpickdiv"></div>
271
+ </div> <?php echo $value['desc']; ?></td>
272
+ </tr>
273
+ <?php
274
+ }
275
+
276
+ /**
277
+ * Create new Woocommerce admin field: checkboxes
278
+ *
279
+ * @access public
280
+ * @param array $value
281
+ * @return void
282
+ * @since 1.0.0
283
+ */
284
+ public function admin_fields_attributes( $value ) {
285
+ $fields = array_merge( $this->default_fields, YITH_Woocompare_Helper::attribute_taxonomies() );
286
+ $all = array();
287
+ foreach ( array_keys( $fields ) as $field ) $all[$field] = true;
288
+ $checkboxes = get_option( $value['id'], $value['default'] == 'all' ? $all : array() );
289
+
290
+ // add fields that are not still saved
291
+ $checkboxes = array_merge( $checkboxes, array_diff_assoc( $checkboxes, $all ) );
292
+ ?>
293
+ <tr valign="top">
294
+ <th scope="row" class="titledesc">
295
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
296
+ </th>
297
+
298
+ <td class="forminp attributes">
299
+ <p class="description"><?php echo $value['desc'] ?></p>
300
+ <ul class="fields">
301
+ <?php foreach ( $checkboxes as $slug => $checked ) { ?>
302
+ <li><label><input type="checkbox" name="<?php echo $value['id'] ?>[]" id="<?php echo $value['id'] ?>_<?php echo $slug ?>" value="<?php echo $slug ?>"<?php checked( $checked ) ?> /> <?php echo $fields[$slug] ?></label></li><?php
303
+ } ?>
304
+ </ul>
305
+ <input type="hidden" name="<?php echo $value['id'] ?>_positions" value="<?php echo implode( ',', array_keys( $checkboxes ) ) ?>" />
306
+ </td>
307
+ </tr>
308
+ <?php
309
+ }
310
+
311
+ /**
312
+ * Save the admin field: slider
313
+ *
314
+ * @access public
315
+ * @param mixed $value
316
+ * @return void
317
+ * @since 1.0.0
318
+ */
319
+ public function admin_update_option($value) {
320
+ if ( $value['type'] == 'attributes' ) {
321
+ //$fields = array_merge( $this->default_fields, YITH_Woocompare_Helper::attribute_taxonomies() );
322
+ $val = array();
323
+ $checked_fields = isset( $_POST[$value['id']] ) ? $_POST[$value['id']] : array();
324
+ $fields = array_map( 'trim', explode( ',', $_POST[ $value['id'] . '_positions' ] ) );
325
+ foreach ( $fields as $field ) {
326
+ $val[$field] = in_array( $field, $checked_fields );
327
+ }
328
+ //yith_debug($val);die;
329
+ update_option( $value['id'], $val );
330
+ } else {
331
+ update_option( $value['id'], woocommerce_clean($_POST[$value['id']]) );
332
+ }
333
+ }
334
+
335
+ /**
336
+ * Create new Woocommerce admin field: image deps
337
+ *
338
+ * @access public
339
+ * @param array $value
340
+ * @return void
341
+ * @since 1.0.0
342
+ */
343
+ public function admin_fields_image_deps( $value ) {
344
+ global $woocommerce;
345
+
346
+ $force = get_option('yith_woocompare_force_sizes') == 'yes';
347
+
348
+ if( $force ) {
349
+ $value['desc'] = 'These values ??are automatically calculated based on the values ??of the Single product. If you\'d like to customize yourself the values, please disable the "Forcing Zoom Image sizes" in "Magnifier" tab.';
350
+ }
351
+
352
+ if( $force && isset($_GET['page']) && isset($_GET['tab']) && $_GET['page'] == 'woocommerce_settings' && $_GET['tab'] == 'catalog' ): ?>
353
+ <script>
354
+ jQuery(document).ready(function($){
355
+ $('#woocommerce_magnifier_image-width, #woocommerce_magnifier_image-height, #woocommerce_magnifier_image-crop').attr('disabled', 'disabled');
356
+
357
+ $('#shop_single_image_size-width, #shop_single_image_size-height').on('keyup', function(){
358
+ var value = parseInt( $(this).val() );
359
+ var input = (this.id).indexOf('width') >= 0 ? 'width' : 'height';
360
+
361
+ if( !isNaN(value) ) {
362
+ $('#woocommerce_magnifier_image-' + input).val( value * 2 );
363
+ }
364
+ });
365
+
366
+ $('#shop_single_image_size-crop').on('change', function(){
367
+ if( $(this).is(':checked') ) {
368
+ $('#woocommerce_magnifier_image-crop').attr('checked', 'checked');
369
+ } else {
370
+ $('#woocommerce_magnifier_image-crop').removeAttr('checked');
371
+ }
372
+ });
373
+
374
+ $('#mainform').on('submit', function(){
375
+ $(':disabled').removeAttr('disabled');
376
+ });
377
+ });
378
+ </script>
379
+ <?php endif;
380
+ }
381
+
382
+
383
+ /**
384
+ * Enqueue admin styles and scripts
385
+ *
386
+ * @access public
387
+ * @return void
388
+ * @since 1.0.0
389
+ */
390
+ public function enqueue_styles_scripts() {
391
+ wp_enqueue_script( 'jquery-ui' );
392
+ wp_enqueue_script( 'jquery-ui-core' );
393
+ wp_enqueue_script( 'jquery-ui-mouse' );
394
+ wp_enqueue_script( 'jquery-ui-slider' );
395
+ wp_enqueue_script( 'jquery-ui-sortable' );
396
+
397
+ wp_enqueue_style( 'yith_woocompare_admin', YITH_WOOCOMPARE_URL . 'assets/css/admin.css' );
398
+ wp_enqueue_script( 'woocompare', YITH_WOOCOMPARE_URL . 'assets/js/woocompare-admin.js', array( 'jquery', 'jquery-ui-sortable' ) );
399
+ }
400
+
401
+
402
+ /**
403
+ * Print the banner
404
+ *
405
+ * @access protected
406
+ * @return void
407
+ * @since 1.0.0
408
+ */
409
+ protected function _printBanner() {
410
+ ?>
411
+ <div class="yith_banner">
412
+ <a href="<?php echo $this->banner_url ?>" target="_blank">
413
+ <img src="<?php echo $this->banner_img ?>" alt="" />
414
+ </a>
415
+ </div>
416
+ <?php
417
+ }
418
+
419
+ }
420
+ }
class.yith-woocompare-frontend.php ADDED
@@ -0,0 +1,567 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH Woocommerce Compare
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
11
+
12
+ if( !class_exists( 'YITH_Woocompare_Frontend' ) ) {
13
+ /**
14
+ * YITH Custom Login Frontend
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+ class YITH_Woocompare_Frontend {
19
+ /**
20
+ * Plugin version
21
+ *
22
+ * @var string
23
+ * @since 1.0.0
24
+ */
25
+ public $version = YITH_WOOCOMPARE_VERSION;
26
+
27
+ /**
28
+ * The list of products inside the comparison table
29
+ *
30
+ * @var array
31
+ * @since 1.0.0
32
+ */
33
+ public $products_list = array();
34
+
35
+ /**
36
+ * Plugin version
37
+ *
38
+ * @var string
39
+ * @since 1.0.0
40
+ */
41
+ public $template_file = 'compare.php';
42
+
43
+ /**
44
+ * The name of cookie name
45
+ *
46
+ * @var string
47
+ * @since 1.0.0
48
+ */
49
+ public $cookie_name = 'yith_woocompare_list';
50
+
51
+ /**
52
+ * The action used to view the table comparison
53
+ *
54
+ * @var string
55
+ * @since 1.0.0
56
+ */
57
+ public $action_view = 'yith-woocompare-view-table';
58
+
59
+ /**
60
+ * The action used to add the product to compare list
61
+ *
62
+ * @var string
63
+ * @since 1.0.0
64
+ */
65
+ public $action_add = 'yith-woocompare-add-product';
66
+
67
+ /**
68
+ * The action used to add the product to compare list
69
+ *
70
+ * @var string
71
+ * @since 1.0.0
72
+ */
73
+ public $action_remove = 'yith-woocompare-remove-product';
74
+
75
+ /**
76
+ * The standard fields
77
+ *
78
+ * @var array
79
+ * @since 1.0.0
80
+ */
81
+ public $default_fields = array();
82
+
83
+ /**
84
+ * Constructor
85
+ *
86
+ * @return YITH_Woocompare_Frontend
87
+ * @since 1.0.0
88
+ */
89
+ public function __construct() {
90
+
91
+ // set coookiename
92
+ if ( is_multisite() ) $this->cookie_name .= '_' . get_current_blog_id();
93
+
94
+ // populate the list of products
95
+ $this->products_list = isset( $_COOKIE[ $this->cookie_name ] ) ? unserialize( $_COOKIE[ $this->cookie_name ] ) : array();
96
+
97
+ // populate default fields for the comparison table
98
+ $this->default_fields = YITH_Woocompare_Helper::standard_fields();
99
+
100
+ // add image size
101
+ YITH_Woocompare_Helper::set_image_size();
102
+
103
+ // Add link or button in the products list or
104
+ if ( get_option('yith_woocompare_compare_button_in_product_page') == 'yes' ) add_action( 'woocommerce_single_product_summary', array( $this, 'add_compare_link' ), 35 );
105
+ if ( get_option('yith_woocompare_compare_button_in_products_list') == 'yes' ) add_action( 'woocommerce_after_shop_loop_item', array( $this, 'add_compare_link' ), 20 );
106
+ add_action( 'init', array( $this, 'add_product_to_compare_action' ) );
107
+ add_action( 'init', array( $this, 'remove_product_from_compare_action' ) );
108
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
109
+ add_action( 'template_redirect', array( $this, 'compare_table_html' ) );
110
+
111
+ // add the shortcode
112
+ add_shortcode( 'yith_compare_button', array( $this, 'compare_button_sc' ) );
113
+
114
+ // AJAX
115
+ add_action( 'wp_ajax_' . $this->action_add, array( $this, 'add_product_to_compare_ajax' ) );
116
+ add_action( 'wp_ajax_nopriv_' . $this->action_add, array( $this, 'add_product_to_compare_ajax' ) );
117
+
118
+ add_action( 'wp_ajax_' . $this->action_remove, array( $this, 'remove_product_from_compare_ajax' ) );
119
+ add_action( 'wp_ajax_nopriv_' . $this->action_remove, array( $this, 'remove_product_from_compare_ajax' ) );
120
+
121
+ add_action( 'wp_ajax_' . $this->action_view, array( $this, 'refresh_widget_list_ajax' ) );
122
+ add_action( 'wp_ajax_nopriv_' . $this->action_view, array( $this, 'refresh_widget_list_ajax' ) );
123
+
124
+ return $this;
125
+ }
126
+
127
+ /**
128
+ * Enqueue the scripts and styles in the page
129
+ */
130
+ public function enqueue_scripts() {
131
+
132
+ // scripts
133
+ wp_enqueue_script( 'yith-woocompare-main', YITH_WOOCOMPARE_URL . 'assets/js/woocompare.js', array('jquery'), $this->version, true );
134
+ wp_localize_script( 'yith-woocompare-main', 'yith_woocompare', array(
135
+ 'nonceadd' => wp_create_nonce( $this->action_add ),
136
+ 'nonceremove' => wp_create_nonce( $this->action_remove ),
137
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
138
+ 'actionadd' => $this->action_add,
139
+ 'actionremove' => $this->action_remove,
140
+ 'actionview' => $this->action_view,
141
+ 'added_label' => __( 'Added', 'yit' ),
142
+ 'table_title' => __( 'Product Comparison', 'yit' ),
143
+ 'auto_open' => get_option( 'yith_woocompare_auto_open', 'yes' )
144
+ ));
145
+
146
+ // colorbox
147
+ wp_enqueue_style( 'jquery-colorbox', YITH_WOOCOMPARE_URL . 'assets/css/colorbox.css' );
148
+ wp_enqueue_script( 'jquery-colorbox', YITH_WOOCOMPARE_URL . 'assets/js/jquery.colorbox-min.js', array('jquery'), '1.4.21', true );
149
+
150
+ // widget
151
+ if ( is_active_widget( false, false, 'yith-woocompare-widget', true ) && ! is_admin() ) {
152
+ wp_enqueue_style( 'yith-woocompare-widget', YITH_WOOCOMPARE_URL . 'assets/css/widget.css' );
153
+ }
154
+ }
155
+
156
+ /**
157
+ * The fields to show in the table
158
+ *
159
+ * @return mixed|void
160
+ * @since 1.0.0
161
+ */
162
+ public function fields() {
163
+ $fields = get_option( 'yith_woocompare_fields', array() );
164
+ foreach ( $fields as $field => $show ) {
165
+ if ( $show ) {
166
+ if ( isset( $this->default_fields[$field] ) ) {
167
+ $fields[$field] = $this->default_fields[$field];
168
+ } else {
169
+ if ( taxonomy_exists( $field ) ) {
170
+ $fields[$field] = get_taxonomy( $field )->label;
171
+ }
172
+ }
173
+ } else {
174
+ unset( $fields[$field] );
175
+ }
176
+ }
177
+
178
+ return $fields;
179
+ }
180
+
181
+ /**
182
+ * Render the maintenance page
183
+ *
184
+ */
185
+ public function compare_table_html() {
186
+ if ( ( ! defined('DOING_AJAX') || ! DOING_AJAX ) && ( ! isset( $_REQUEST['action'] ) || $_REQUEST['action'] != $this->action_view ) ) return;
187
+
188
+ global $woocommerce;
189
+
190
+ extract( $this->_vars() );
191
+
192
+ // remove all styles from compare template
193
+ add_action('wp_print_styles', array( $this, 'remove_all_styles' ), 100);
194
+
195
+ // remove admin bar
196
+ remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
197
+ remove_action( 'wp_head', '_admin_bar_bump_cb' );
198
+
199
+ $plugin_path = plugin_dir_path(__FILE__) . 'templates/' . $this->template_file;
200
+ $template_path = get_template_directory() . '/' . $woocommerce->template_url . $this->template_file;
201
+ $child_path = get_stylesheet_directory() . '/' . $woocommerce->template_url . $this->template_file;
202
+
203
+ foreach ( array( 'child_path', 'template_path', 'plugin_path' ) as $var ) {
204
+ if ( file_exists( ${$var} ) ) {
205
+ include ${$var};
206
+ exit();
207
+ }
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Return the array with all products and all attributes values
213
+ *
214
+ * @return array The complete list of products with all attributes value
215
+ */
216
+ public function get_products_list() {
217
+ $list = array();
218
+ $products = $this->products_list;
219
+ $fields = $this->fields();
220
+
221
+ foreach ( $products as $product_id ) {
222
+ $product = get_product( $product_id );
223
+ if ( ! $product ) continue;
224
+
225
+ $product->fields = array();
226
+
227
+ // custom attributes
228
+ foreach ( $fields as $field => $name ) {
229
+
230
+ switch( $field ) {
231
+ case 'title':
232
+ $product->fields[$field] = $product->get_title();
233
+ break;
234
+ case 'price':
235
+ $product->fields[$field] = $product->get_price_html();
236
+ break;
237
+ case 'image':
238
+ $product->fields[$field] = intval( get_post_thumbnail_id( $product_id ) );
239
+ break;
240
+ case 'description':
241
+ $product->fields[$field] = apply_filters( 'woocommerce_short_description', $product->post->post_excerpt );
242
+ break;
243
+ case 'stock':
244
+ $availability = $product->get_availability();
245
+ if ( empty( $availability['availability'] ) ) {
246
+ $availability['availability'] = __( 'In stock', 'yit' );
247
+ }
248
+ $product->fields[$field] = sprintf( '<span class="%s">%s</span>', esc_attr( $availability['class'] ), esc_html( $availability['availability'] ) );
249
+ break;
250
+ default:
251
+ //$taxonomy = 'pa_' . $field;
252
+ if ( taxonomy_exists( $field ) ) {
253
+ $product->fields[$field] = array();
254
+ $terms = get_the_terms( $product_id, $field );
255
+ if ( ! empty( $terms ) ) {
256
+ foreach ( $terms as $term ) {
257
+ $term = sanitize_term( $term, $field );
258
+ $product->fields[$field][] = $term->name;
259
+ }
260
+ }
261
+ $product->fields[$field] = implode( ', ', $product->fields[$field] );
262
+ } else {
263
+ do_action_ref_array( 'yith_woocompare_field_' . $field, array( $product, &$product->fields ) );
264
+ }
265
+ break;
266
+ }
267
+ }
268
+
269
+ $list[] = $product;
270
+ }
271
+
272
+ return $list;
273
+ }
274
+
275
+ /**
276
+ * The URL of product comparison table
277
+ *
278
+ * @param $product_id The ID of the product to add
279
+ * @return string The url to add the product in the comparison table
280
+ */
281
+ public function view_table_url() {
282
+ return add_query_arg( 'action', $this->action_view );
283
+ }
284
+
285
+ /**
286
+ * The URL to add the product into the comparison table
287
+ *
288
+ * @param $product_id The ID of the product to add
289
+ * @return string The url to add the product in the comparison table
290
+ */
291
+ public function add_product_url( $product_id ) {
292
+ $url_args = array(
293
+ 'action' => $this->action_add,
294
+ 'id' => $product_id
295
+ );
296
+ return wp_nonce_url( add_query_arg( $url_args ), $this->action_add );
297
+ }
298
+
299
+ /**
300
+ * The URL to remove the product into the comparison table
301
+ *
302
+ * @param $product_id The ID of the product to remove
303
+ * @return string The url to remove the product in the comparison table
304
+ */
305
+ public function remove_product_url( $product_id ) {
306
+ $url_args = array(
307
+ 'action' => $this->action_remove,
308
+ 'id' => $product_id
309
+ );
310
+ return wp_nonce_url( add_query_arg( $url_args ), $this->action_remove );
311
+ }
312
+
313
+ /**
314
+ * Add the link to compare
315
+ */
316
+ public function add_compare_link( $product_id = false, $args = array() ) {
317
+ extract( $args );
318
+
319
+ if ( ! $product_id ) {
320
+ global $product;
321
+ $product_id = isset( $product->id ) && $product->exists() ? $product->id : 0;
322
+ }
323
+
324
+ // return if product doesn't exist
325
+ if ( empty( $product_id ) ) return;
326
+
327
+ $is_button = !isset( $button_or_link ) || !$button_or_link ? get_option( 'yith_woocompare_is_button' ) : $button_or_link;
328
+
329
+ printf( '<a href="%s" class="%s" data-product_id="%d">%s</a>', $this->add_product_url( $product_id ), 'compare' . ( $is_button == 'button' ? ' button' : '' ), $product_id, ( isset( $button_text ) && $button_text != 'default' ? $button_text : __( 'Compare','yit' ) ) );
330
+ }
331
+
332
+ /**
333
+ * Return the url of stylesheet position
334
+ */
335
+ public function stylesheet_url() {
336
+ global $woocommerce;
337
+
338
+ $filename = 'compare.css';
339
+ $plugin_path = array( 'path' => plugin_dir_path(__FILE__) . 'assets/css/style.css', 'url' => YITH_WOOCOMPARE_URL . 'assets/css/style.css' );
340
+ $template_path = array( 'path' => get_template_directory() . '/' . $woocommerce->template_url . $filename, 'url' => get_template_directory_uri() . '/' . $woocommerce->template_url . $filename );
341
+ $child_path = array( 'path' => get_stylesheet_directory() . '/' . $woocommerce->template_url . $filename, 'url' => get_stylesheet_directory_uri() . '/' . $woocommerce->template_url . $filename );
342
+
343
+ foreach ( array( 'child_path', 'template_path', 'plugin_path' ) as $var ) {
344
+ if ( file_exists( ${$var}['path'] ) ) {
345
+ return ${$var}['url'];
346
+ }
347
+ }
348
+ }
349
+
350
+
351
+ /**
352
+ * Generate template vars
353
+ *
354
+ * @return array
355
+ * @since 1.0.0
356
+ * @access protected
357
+ */
358
+ protected function _vars() {
359
+ $vars = array(
360
+ 'products' => $this->get_products_list(),
361
+ 'fields' => $this->fields(),
362
+ 'repeat_price' => get_option( 'yith_woocompare_price_end' ),
363
+ 'repeat_add_to_cart' => get_option( 'yith_woocompare_add_to_cart_end' ),
364
+ );
365
+
366
+ return $vars;
367
+ }
368
+
369
+ /**
370
+ * The action called by the query string
371
+ */
372
+ public function add_product_to_compare_action() {
373
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ||
374
+ ( !isset( $_REQUEST['_wpnonce'] ) || !wp_verify_nonce( $_REQUEST['_wpnonce'], $this->action_add ) ) &&
375
+ ( ! isset( $_REQUEST['action'] ) || $_REQUEST['action'] != $this->action_add ) )
376
+ return;
377
+
378
+ $this->add_product_to_compare( intval( $_REQUEST['id'] ) );
379
+
380
+ wp_redirect( remove_query_arg( array( 'id', 'action', '_wpnonce' ) ) );
381
+ exit();
382
+ }
383
+
384
+ /**
385
+ * The action called by AJAX
386
+ */
387
+ public function add_product_to_compare_ajax() {
388
+ check_ajax_referer( $this->action_add, '_yitnonce_ajax' );
389
+
390
+ $this->add_product_to_compare( intval( $_REQUEST['id'] ) );
391
+
392
+ $json = array(
393
+ 'table_url' => add_query_arg( array(
394
+ 'action' => $this->action_view,
395
+ 'iframe' => 'true'
396
+ ), site_url() ),
397
+
398
+ 'widget_table' => $this->list_products_html()
399
+ );
400
+
401
+ echo json_encode( $json );
402
+ die();
403
+ }
404
+
405
+ /**
406
+ * Add a product in the products comparison table
407
+ *
408
+ * @param $product_id The product ID to add in the comparison table
409
+ */
410
+ public function add_product_to_compare( $product_id ) {
411
+ $product = get_product( $product_id );
412
+
413
+ // don't add the product if doesn't exist
414
+ if ( !$product->exists() || in_array( $product_id, $this->products_list ) ) return;
415
+
416
+ $this->products_list[] = $product_id;
417
+ setcookie( $this->cookie_name, serialize($this->products_list), 0, COOKIEPATH, COOKIE_DOMAIN, false, true );
418
+ }
419
+
420
+ /**
421
+ * The action called by the query string
422
+ */
423
+ public function remove_product_from_compare_action() {
424
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ||
425
+ ( !isset( $_REQUEST['_wpnonce'] ) || !wp_verify_nonce( $_REQUEST['_wpnonce'], $this->action_remove ) ) &&
426
+ ( ! isset( $_REQUEST['action'] ) || $_REQUEST['action'] != $this->action_remove ) )
427
+ return;
428
+
429
+ $this->remove_product_from_compare( intval( $_REQUEST['id'] ) );
430
+
431
+ // redirect
432
+ $redirect = remove_query_arg( array( 'id', 'action', '_wpnonce' ) );
433
+ if ( isset( $_REQUEST['redirect'] ) && $_REQUEST['redirect'] == 'view' ) $redirect = remove_query_arg( 'redirect', add_query_arg( 'action', $this->action_view, $redirect ) );
434
+ wp_redirect( $redirect );
435
+ exit();
436
+ }
437
+
438
+ /**
439
+ * The action called by AJAX
440
+ */
441
+ public function remove_product_from_compare_ajax() {
442
+ check_ajax_referer( $this->action_remove, '_yitnonce_ajax' );
443
+
444
+ if ( ! isset( $_REQUEST['id'] ) ) die();
445
+
446
+ if ( $_REQUEST['id'] == 'all' ) {
447
+ $products = $this->products_list;
448
+ foreach ( $products as $product_id ) {
449
+ $this->remove_product_from_compare( intval( $product_id ) );
450
+ }
451
+ } else {
452
+ $this->remove_product_from_compare( intval( $_REQUEST['id'] ) );
453
+ }
454
+
455
+ header('Content-Type: text/html; charset=utf-8');
456
+
457
+ if ( isset( $_REQUEST['responseType'] ) && $_REQUEST['responseType'] == 'product_list' ) {
458
+ echo $this->list_products_html();
459
+ } else {
460
+ $this->compare_table_html();
461
+ }
462
+
463
+ die();
464
+ }
465
+
466
+ /**
467
+ * Return the list of widget table, used in AJAX
468
+ */
469
+ public function refresh_widget_list_ajax() {
470
+ echo $this->list_products_html();
471
+ die();
472
+ }
473
+
474
+ /**
475
+ * The list of products as HTML list
476
+ */
477
+ public function list_products_html() {
478
+ ob_start();
479
+
480
+ if ( empty( $this->products_list ) ) {
481
+ echo '<li>' . __( 'No products to compare', 'yit' ) . '</li>';
482
+ return ob_get_clean();
483
+ }
484
+
485
+ foreach ( $this->products_list as $product_id ) {
486
+ $product = get_product( $product_id );
487
+ if ( ! $product ) continue;
488
+ ?>
489
+ <li>
490
+ <a class="title" href="<?php echo get_permalink( $product_id ) ?>"><?php echo $product->get_title() ?></a>
491
+ <a href="<?php echo $this->remove_product_url( $product_id ) ?>" data-product_id="<?php echo $product_id; ?>" class="remove" title="<?php _e( 'Remove', 'yit' ) ?>">x</a>
492
+ </li>
493
+ <?php
494
+ }
495
+
496
+ return ob_get_clean();
497
+ }
498
+
499
+ /**
500
+ * Remove a product from the comparison table
501
+ *
502
+ * @param $product_id The product ID to remove from the comparison table
503
+ */
504
+ public function remove_product_from_compare( $product_id ) {
505
+ $product = get_product( $product_id );
506
+ if ( ! $product ) return;
507
+
508
+ // don't add the product if doesn't exist
509
+ if ( !$product->exists() || !in_array( $product_id, $this->products_list ) ) return;
510
+
511
+ foreach ( $this->products_list as $k => $id ) {
512
+ if ( $product_id == $id ) unset( $this->products_list[$k] );
513
+ }
514
+ setcookie( $this->cookie_name, serialize($this->products_list), 0, COOKIEPATH, COOKIE_DOMAIN, false, true );
515
+ }
516
+
517
+ /**
518
+ * Remove all styles from the compare template
519
+ */
520
+ public function remove_all_styles() {
521
+ global $wp_styles;
522
+ $wp_styles->queue = array();
523
+ }
524
+
525
+ /**
526
+ * Show the html for the shortcode
527
+ */
528
+ public function compare_button_sc( $atts, $content = null ) {
529
+ $atts = shortcode_atts(array(
530
+ 'product' => false,
531
+ 'type' => 'default',
532
+ 'container' => 'yes'
533
+ ), $atts);
534
+
535
+ $product_id = 0;
536
+
537
+ /**
538
+ * Retrieve the product ID in these steps:
539
+ * - If "product" attribute is not set, get the product ID of current product loop
540
+ * - If "product" contains ID, post slug or post title
541
+ */
542
+ if ( ! $atts['product'] ) {
543
+ global $product;
544
+ $product_id = isset( $product->id ) && $product->exists() ? $product->id : 0;
545
+ } else {
546
+ global $wpdb;
547
+ $product = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE ID = %d OR post_name = %s OR post_title = %s LIMIT 1", $atts['product'], $atts['product'], $atts['product'] ) );
548
+ if ( ! empty( $product ) ) {
549
+ $product_id = $product->ID;
550
+ }
551
+ }
552
+
553
+ // if product ID is 0, maybe the product doesn't exists or is wrong.. in this case, doesn't show the button
554
+ if ( empty( $product_id ) ) return;
555
+
556
+ ob_start();
557
+ if ( $atts['container'] == 'yes' ) echo '<div class="woocommerce product compare-button">';
558
+ $this->add_compare_link( $product_id, array(
559
+ 'button_or_link' => ( $atts['type'] == 'default' ? false : $atts['type'] ),
560
+ 'button_text' => empty( $content ) ? 'default' : $content
561
+ ) );
562
+ if ( $atts['container'] == 'yes' ) echo '</div>';
563
+ return ob_get_clean();
564
+ }
565
+
566
+ }
567
+ }
class.yith-woocompare-helper.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Compare
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
11
+
12
+ if( !class_exists( 'YITH_Woocompare_Helper' ) ) {
13
+ /**
14
+ * YITH Woocommerce Compare helper
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+ class YITH_Woocompare_Helper {
19
+
20
+ /**
21
+ * Set the image size used in the comparison table
22
+ *
23
+ * @since 1.0.0
24
+ */
25
+ public static function set_image_size() {
26
+ $size = get_option( 'yith_woocompare_image_size' );
27
+ add_image_size( 'yith-woocompare-image', $size['width'], $size['height'], $size['crop'] );
28
+ }
29
+
30
+ /*
31
+ * The list of standard fields
32
+ *
33
+ * @since 1.0.0
34
+ * @access public
35
+ */
36
+ public static function standard_fields() {
37
+ return array(
38
+ 'image' => __('Image', 'yit'),
39
+ 'title' => __('Title', 'yit'),
40
+ 'price' => __('Price', 'yit'),
41
+ 'add-to-cart' => __('Add to cart', 'yit'),
42
+ 'description' => __('Description', 'yit'),
43
+ 'stock' => __( 'Availability', 'yit' )
44
+ );
45
+ }
46
+
47
+ /*
48
+ * Get Woocommerce Attribute Taxonomies
49
+ *
50
+ * @since 1.0.0
51
+ * @access public
52
+ */
53
+ public static function attribute_taxonomies() {
54
+ global $woocommerce;
55
+
56
+ if ( ! isset( $woocommerce ) ) return array();
57
+
58
+ $attributes = array();
59
+ $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
60
+
61
+ if( empty( $attribute_taxonomies ) ) return array();
62
+ foreach( $attribute_taxonomies as $attribute ) {
63
+ $tax = $woocommerce->attribute_taxonomy_name( $attribute->attribute_name );
64
+ if ( taxonomy_exists( $tax ) ) {
65
+ $attributes[$tax] = ucfirst( $attribute->attribute_name );
66
+ }
67
+ }
68
+
69
+ return $attributes;
70
+ }
71
+
72
+
73
+ }
74
+ }
class.yith-woocompare.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH Woocommerce Compare
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
11
+
12
+ if( !class_exists( 'YITH_Woocompare' ) ) {
13
+ /**
14
+ * YITH Woocommerce Compare
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+ class YITH_Woocompare {
19
+
20
+ /**
21
+ * Plugin object
22
+ *
23
+ * @var string
24
+ * @since 1.0.0
25
+ */
26
+ public $obj = null;
27
+
28
+ /**
29
+ * AJAX Helper
30
+ *
31
+ * @var string
32
+ * @since 1.0.0
33
+ */
34
+ public $ajax = null;
35
+
36
+ /**
37
+ * Constructor
38
+ *
39
+ * @return mixed|YITH_Woocompare_Admin|YITH_Woocompare_Frontend
40
+ * @since 1.0.0
41
+ */
42
+ public function __construct() {
43
+ add_action( 'widgets_init', array( $this, 'registerWidgets' ) );
44
+
45
+ if( $this->is_frontend() ) {
46
+ $this->obj = new YITH_Woocompare_Frontend();
47
+ } elseif( $this->is_admin() ) {
48
+ $this->obj = new YITH_Woocompare_Admin();
49
+ }
50
+
51
+ return $this->obj;
52
+ }
53
+
54
+ /**
55
+ * Detect if is frontend
56
+ * @return bool
57
+ */
58
+ public function is_frontend() {
59
+ $is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
60
+ return (bool) ( ! is_admin() || $is_ajax && isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'frontend' );
61
+ }
62
+
63
+ /**
64
+ * Detect if is admin
65
+ * @return bool
66
+ */
67
+ public function is_admin() {
68
+ $is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
69
+ return (bool) ( is_admin() || $is_ajax && isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'admin' );
70
+ }
71
+
72
+
73
+ /**
74
+ * Load and register widgets
75
+ *
76
+ * @access public
77
+ * @since 1.0.0
78
+ */
79
+ public function registerWidgets() {
80
+ register_widget( 'YITH_Woocompare_Widget' );
81
+ }
82
+ }
83
+ }
functions.yith-woocompare.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH Woocommerce Compare
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
11
+
init.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: YITH Woocommerce Compare
4
+ * Plugin URI: http://yithemes.com/
5
+ * Description: YITH Woocommerce Compare allows you to compare more products with woocommerce plugin, through product attributes.
6
+ * Version: 1.0.0
7
+ * Author: Your Inspiration Themes
8
+ * Author URI: http://yithemes.com/
9
+ * Text Domain: yit
10
+ * Domain Path: /languages/
11
+ *
12
+ * @author Your Inspiration Themes
13
+ * @package YITH Woocommerce Compare
14
+ * @version 1.0.0
15
+ */
16
+ /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
+
18
+ This program is free software; you can redistribute it and/or modify
19
+ it under the terms of the GNU General Public License, version 2, as
20
+ published by the Free Software Foundation.
21
+
22
+ This program is distributed in the hope that it will be useful,
23
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ GNU General Public License for more details.
26
+
27
+ You should have received a copy of the GNU General Public License
28
+ along with this program; if not, write to the Free Software
29
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
+ */
31
+ if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
32
+
33
+ /* Include common functions */
34
+ if( !defined('YITH_FUNCTIONS') ) {
35
+ require_once( 'yit-common/google_fonts.php' );
36
+ require_once( 'yit-common/yit-functions.php' );
37
+ require_once( 'yit-common/yith-panel.php' );
38
+ }
39
+
40
+ // don't active the plugin, without woocommerce
41
+ if ( ! yit_get_plugin_basename_from_slug( 'woocommerce' ) ) return;
42
+
43
+ load_plugin_textdomain( 'yit', false, dirname( plugin_basename( __FILE__ ) ). '/languages/' );
44
+
45
+ define( 'YITH_WOOCOMPARE', true );
46
+ define( 'YITH_WOOCOMPARE_VERSION', '1.0.0' );
47
+ define( 'YITH_WOOCOMPARE_URL', plugin_dir_url( __FILE__ ) );
48
+ define( 'YITH_WOOCOMPARE_DIR', plugin_dir_path( __FILE__ ) );
49
+
50
+ // Load required classes and functions
51
+ require_once('class.yith-woocompare-helper.php');
52
+ require_once('functions.yith-woocompare.php');
53
+ require_once('class.yith-woocompare-admin.php');
54
+ require_once('class.yith-woocompare-frontend.php');
55
+ require_once('widgets/class.yith-woocompare-widget.php');
56
+ require_once('class.yith-woocompare.php');
57
+
58
+ // Let's start the game!
59
+ global $yith_woocompare;
60
+ $yith_woocompare = new YITH_Woocompare();
languages/default.po ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: YITH Woocommerce Compare\n"
4
+ "POT-Creation-Date: 2013-06-19 18:25+0100\n"
5
+ "PO-Revision-Date: 2013-06-19 18:25+0100\n"
6
+ "Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
7
+ "Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.5\n"
13
+ "X-Poedit-KeywordsList: __;_e;_x\n"
14
+ "X-Poedit-Basepath: ./\n"
15
+ "X-Poedit-SearchPath-0: ..\n"
16
+
17
+ #: ../class.yith-woocompare-admin.php:118
18
+ msgid "Products Compare"
19
+ msgstr ""
20
+
21
+ #: ../class.yith-woocompare-admin.php:132 ../yith-woocompare-options.php:15
22
+ msgid "General Settings"
23
+ msgstr ""
24
+
25
+ #: ../class.yith-woocompare-frontend.php:133
26
+ msgid "Added"
27
+ msgstr ""
28
+
29
+ #: ../class.yith-woocompare-frontend.php:134 ../templates/compare.php:47
30
+ msgid "Product Comparison"
31
+ msgstr ""
32
+
33
+ #: ../class.yith-woocompare-frontend.php:238
34
+ msgid "In stock"
35
+ msgstr ""
36
+
37
+ #: ../class.yith-woocompare-frontend.php:314
38
+ #: ../widgets/class.yith-woocompare-widget.php:38
39
+ msgid "Compare"
40
+ msgstr ""
41
+
42
+ #: ../class.yith-woocompare-frontend.php:467
43
+ msgid "No products to compare"
44
+ msgstr ""
45
+
46
+ #: ../class.yith-woocompare-frontend.php:476 ../templates/compare.php:102
47
+ msgid "Remove"
48
+ msgstr ""
49
+
50
+ #: ../class.yith-woocompare-helper.php:38
51
+ #: ../widgets/class.yith-woocompare-widget.php:55
52
+ msgid "Title"
53
+ msgstr ""
54
+
55
+ #: ../class.yith-woocompare-helper.php:39
56
+ msgid "Image"
57
+ msgstr ""
58
+
59
+ #: ../class.yith-woocompare-helper.php:40
60
+ msgid "Description"
61
+ msgstr ""
62
+
63
+ #: ../class.yith-woocompare-helper.php:41
64
+ msgid "Price"
65
+ msgstr ""
66
+
67
+ #: ../class.yith-woocompare-helper.php:42
68
+ msgid "Add to cart"
69
+ msgstr ""
70
+
71
+ #: ../class.yith-woocompare-helper.php:43
72
+ msgid "Availability"
73
+ msgstr ""
74
+
75
+ #: ../yith-woocompare-options.php:22
76
+ msgid "Link or Button"
77
+ msgstr ""
78
+
79
+ #: ../yith-woocompare-options.php:23
80
+ msgid "Choose if you want to use a link or a button for the action button."
81
+ msgstr ""
82
+
83
+ #: ../yith-woocompare-options.php:29
84
+ msgid "Link"
85
+ msgstr ""
86
+
87
+ #: ../yith-woocompare-options.php:30
88
+ msgid "Button"
89
+ msgstr ""
90
+
91
+ #: ../yith-woocompare-options.php:35
92
+ msgid "Show button in single product page"
93
+ msgstr ""
94
+
95
+ #: ../yith-woocompare-options.php:36
96
+ msgid "Say if you want to show the button in the single product page."
97
+ msgstr ""
98
+
99
+ #: ../yith-woocompare-options.php:44
100
+ msgid "Show button in products list"
101
+ msgstr ""
102
+
103
+ #: ../yith-woocompare-options.php:45
104
+ msgid "Say if you want to show the button in the products list."
105
+ msgstr ""
106
+
107
+ #: ../yith-woocompare-options.php:53
108
+ msgid "Open automatically lightbox"
109
+ msgstr ""
110
+
111
+ #: ../yith-woocompare-options.php:54
112
+ msgid "Open link after click into \"Compare\" button\"."
113
+ msgstr ""
114
+
115
+ #: ../yith-woocompare-options.php:66
116
+ msgid "Table Settings"
117
+ msgstr ""
118
+
119
+ #: ../yith-woocompare-options.php:73
120
+ msgid "Fields to show"
121
+ msgstr ""
122
+
123
+ #: ../yith-woocompare-options.php:74 ../yith-woocompare-options.php:83
124
+ #: ../yith-woocompare-options.php:92
125
+ msgid ""
126
+ "Select the fields to show in the comparison table and order them by "
127
+ "drag&drop (are included also the woocommerce attributes)"
128
+ msgstr ""
129
+
130
+ #: ../yith-woocompare-options.php:82
131
+ msgid "Repeat \"Price\" field at the end of the table"
132
+ msgstr ""
133
+
134
+ #: ../yith-woocompare-options.php:91
135
+ msgid "Repeat \"Add to cart\" field at the end of the table"
136
+ msgstr ""
137
+
138
+ #: ../yith-woocompare-options.php:100
139
+ msgid "Image size"
140
+ msgstr ""
141
+
142
+ #: ../yith-woocompare-options.php:101
143
+ msgid "Set the size for the images"
144
+ msgstr ""
145
+
146
+ #: ../templates/compare.php:68
147
+ msgid "Compare products"
148
+ msgstr ""
149
+
150
+ #: ../templates/compare.php:69
151
+ msgid "Close window [X]"
152
+ msgstr ""
153
+
154
+ #: ../templates/compare.php:94
155
+ msgid "No products added in the compare table."
156
+ msgstr ""
157
+
158
+ #: ../widgets/class.yith-woocompare-widget.php:21
159
+ msgid "The widget show the list of products added in the compare table."
160
+ msgstr ""
161
+
162
+ #: ../widgets/class.yith-woocompare-widget.php:22
163
+ msgid "YITH Woocommerce Compare Widget"
164
+ msgstr ""
165
+
166
+ #: ../widgets/class.yith-woocompare-widget.php:37
167
+ msgid "Clear all"
168
+ msgstr ""
169
+
170
+ #: ../yit-common/yith-panel.php:396
171
+ msgid "Select a date"
172
+ msgstr ""
173
+
174
+ #: ../yit-common/yith-panel.php:397
175
+ msgid "Hours"
176
+ msgstr ""
177
+
178
+ #: ../yit-common/yith-panel.php:398 ../yit-common/yith-panel.php:399
179
+ msgid "Minutes"
180
+ msgstr ""
181
+
182
+ #: ../yit-common/yith-panel.php:407
183
+ msgid "Upload"
184
+ msgstr ""
185
+
186
+ #: ../yit-common/yith-panel.php:434
187
+ msgid "px"
188
+ msgstr ""
189
+
190
+ #: ../yit-common/yith-panel.php:435
191
+ msgid "em"
192
+ msgstr ""
193
+
194
+ #: ../yit-common/yith-panel.php:436
195
+ msgid "pt"
196
+ msgstr ""
197
+
198
+ #: ../yit-common/yith-panel.php:437
199
+ msgid "rem"
200
+ msgstr ""
201
+
202
+ #: ../yit-common/yith-panel.php:447
203
+ msgid "Select a font family"
204
+ msgstr ""
205
+
206
+ #: ../yit-common/yith-panel.php:455
207
+ msgid "Regular"
208
+ msgstr ""
209
+
210
+ #: ../yit-common/yith-panel.php:456
211
+ msgid "Bold"
212
+ msgstr ""
213
+
214
+ #: ../yit-common/yith-panel.php:457
215
+ msgid "Extra bold"
216
+ msgstr ""
217
+
218
+ #: ../yit-common/yith-panel.php:458
219
+ msgid "Italic"
220
+ msgstr ""
221
+
222
+ #: ../yit-common/yith-panel.php:459
223
+ msgid "Italic bold"
224
+ msgstr ""
225
+
226
+ #: ../yit-common/yith-panel.php:471
227
+ msgid "Click to preview"
228
+ msgstr ""
languages/yit-it_IT.mo ADDED
Binary file
languages/yit-it_IT.po ADDED
@@ -0,0 +1,617 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: YITH Woocommerce Compare\n"
4
+ "POT-Creation-Date: 2013-06-19 18:25+0100\n"
5
+ "PO-Revision-Date: 2013-06-19 18:36+0100\n"
6
+ "Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
7
+ "Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.5\n"
13
+ "X-Poedit-KeywordsList: __;_e;_x\n"
14
+ "X-Poedit-Basepath: ./\n"
15
+ "X-Poedit-SearchPath-0: ..\n"
16
+
17
+ #: ../class.yith-woocompare-admin.php:118
18
+ msgid "Products Compare"
19
+ msgstr "Compara Prodotti"
20
+
21
+ #: ../class.yith-woocompare-admin.php:132 ../yith-woocompare-options.php:15
22
+ msgid "General Settings"
23
+ msgstr "Impostazioni Generali"
24
+
25
+ #: ../class.yith-woocompare-frontend.php:133
26
+ msgid "Added"
27
+ msgstr "Aggiungo"
28
+
29
+ #: ../class.yith-woocompare-frontend.php:134 ../templates/compare.php:47
30
+ msgid "Product Comparison"
31
+ msgstr "Comparazione Prodotto"
32
+
33
+ #: ../class.yith-woocompare-frontend.php:238
34
+ msgid "In stock"
35
+ msgstr "In stock"
36
+
37
+ #: ../class.yith-woocompare-frontend.php:314
38
+ #: ../widgets/class.yith-woocompare-widget.php:38
39
+ msgid "Compare"
40
+ msgstr "Compara"
41
+
42
+ #: ../class.yith-woocompare-frontend.php:467
43
+ msgid "No products to compare"
44
+ msgstr "Nessun prodotto da comparare"
45
+
46
+ #: ../class.yith-woocompare-frontend.php:476 ../templates/compare.php:102
47
+ msgid "Remove"
48
+ msgstr "Rimuovi"
49
+
50
+ #: ../class.yith-woocompare-helper.php:38
51
+ #: ../widgets/class.yith-woocompare-widget.php:55
52
+ msgid "Title"
53
+ msgstr "Titolo"
54
+
55
+ #: ../class.yith-woocompare-helper.php:39
56
+ msgid "Image"
57
+ msgstr "Immagine"
58
+
59
+ #: ../class.yith-woocompare-helper.php:40
60
+ msgid "Description"
61
+ msgstr "Descrizione"
62
+
63
+ #: ../class.yith-woocompare-helper.php:41
64
+ msgid "Price"
65
+ msgstr "Prezzo"
66
+
67
+ #: ../class.yith-woocompare-helper.php:42
68
+ msgid "Add to cart"
69
+ msgstr "Aggiungi al carrello"
70
+
71
+ #: ../class.yith-woocompare-helper.php:43
72
+ msgid "Availability"
73
+ msgstr "Disponibilità"
74
+
75
+ #: ../yith-woocompare-options.php:22
76
+ msgid "Link or Button"
77
+ msgstr "Collegamento o Pulsante"
78
+
79
+ #: ../yith-woocompare-options.php:23
80
+ msgid "Choose if you want to use a link or a button for the action button."
81
+ msgstr ""
82
+ "Scegli se vuoi usare un collegamento o un pulsante per l'azione di "
83
+ "\"Comparazione\""
84
+
85
+ #: ../yith-woocompare-options.php:29
86
+ msgid "Link"
87
+ msgstr "Collegamento"
88
+
89
+ #: ../yith-woocompare-options.php:30
90
+ msgid "Button"
91
+ msgstr "Pulsante"
92
+
93
+ #: ../yith-woocompare-options.php:35
94
+ msgid "Show button in single product page"
95
+ msgstr "Mostra pulsante nella pagina del dettaglio prodotto"
96
+
97
+ #: ../yith-woocompare-options.php:36
98
+ msgid "Say if you want to show the button in the single product page."
99
+ msgstr ""
100
+ "Scegli se vuoi mostrare il pulsante nella pagina dettaglio del prodotto."
101
+
102
+ #: ../yith-woocompare-options.php:44
103
+ msgid "Show button in products list"
104
+ msgstr "Mostra pulsante nella lista prodotti"
105
+
106
+ #: ../yith-woocompare-options.php:45
107
+ msgid "Say if you want to show the button in the products list."
108
+ msgstr "Imposta se vuoi mostrare il pulsante nella lista prodotti."
109
+
110
+ #: ../yith-woocompare-options.php:53
111
+ msgid "Open automatically lightbox"
112
+ msgstr "Apri la lightbox automaticamente"
113
+
114
+ #: ../yith-woocompare-options.php:54
115
+ msgid "Open link after click into \"Compare\" button\"."
116
+ msgstr "Apri pagina dopo aver cliccato sul pulsante \"Compare\"."
117
+
118
+ #: ../yith-woocompare-options.php:66
119
+ msgid "Table Settings"
120
+ msgstr "Impostazioni tabella."
121
+
122
+ #: ../yith-woocompare-options.php:73
123
+ msgid "Fields to show"
124
+ msgstr "Campi da mostrare"
125
+
126
+ #: ../yith-woocompare-options.php:74 ../yith-woocompare-options.php:83
127
+ #: ../yith-woocompare-options.php:92
128
+ msgid ""
129
+ "Select the fields to show in the comparison table and order them by "
130
+ "drag&drop (are included also the woocommerce attributes)"
131
+ msgstr ""
132
+ "Seleziona i campi da mostrare nella tabella di comparazione e ordinali "
133
+ "attraverso il drag&drop (sono inclusi anche gli attributi di woocommerce)"
134
+
135
+ #: ../yith-woocompare-options.php:82
136
+ msgid "Repeat \"Price\" field at the end of the table"
137
+ msgstr "Ripeti il campo \"Prezzo\" alla fine della tabella"
138
+
139
+ #: ../yith-woocompare-options.php:91
140
+ msgid "Repeat \"Add to cart\" field at the end of the table"
141
+ msgstr "Ripeti il campo con \"Aggiungi al carrello\" alla fine della tabella"
142
+
143
+ #: ../yith-woocompare-options.php:100
144
+ msgid "Image size"
145
+ msgstr "Dimensione immagine"
146
+
147
+ #: ../yith-woocompare-options.php:101
148
+ msgid "Set the size for the images"
149
+ msgstr "Imposta la dimensione per le immagini"
150
+
151
+ #: ../templates/compare.php:68
152
+ msgid "Compare products"
153
+ msgstr "Compara prodotti"
154
+
155
+ #: ../templates/compare.php:69
156
+ msgid "Close window [X]"
157
+ msgstr "Chiudi finestra [X]"
158
+
159
+ #: ../templates/compare.php:94
160
+ msgid "No products added in the compare table."
161
+ msgstr "Nessun prodotto aggiunto nella tabella di comparazione."
162
+
163
+ #: ../widgets/class.yith-woocompare-widget.php:21
164
+ msgid "The widget show the list of products added in the compare table."
165
+ msgstr ""
166
+ "Widget che mostra la lista dei prodotti aggiunti nella tabella di "
167
+ "comparazione."
168
+
169
+ #: ../widgets/class.yith-woocompare-widget.php:22
170
+ msgid "YITH Woocommerce Compare Widget"
171
+ msgstr "YITH Woocommerce Compare Widget"
172
+
173
+ #: ../widgets/class.yith-woocompare-widget.php:37
174
+ msgid "Clear all"
175
+ msgstr "Cancella tutti"
176
+
177
+ #: ../yit-common/yith-panel.php:396
178
+ msgid "Select a date"
179
+ msgstr "Seleziona data"
180
+
181
+ #: ../yit-common/yith-panel.php:397
182
+ msgid "Hours"
183
+ msgstr "Ore"
184
+
185
+ #: ../yit-common/yith-panel.php:398 ../yit-common/yith-panel.php:399
186
+ msgid "Minutes"
187
+ msgstr "Minuti"
188
+
189
+ #: ../yit-common/yith-panel.php:407
190
+ msgid "Upload"
191
+ msgstr "Carica"
192
+
193
+ #: ../yit-common/yith-panel.php:434
194
+ msgid "px"
195
+ msgstr "px"
196
+
197
+ #: ../yit-common/yith-panel.php:435
198
+ msgid "em"
199
+ msgstr "em"
200
+
201
+ #: ../yit-common/yith-panel.php:436
202
+ msgid "pt"
203
+ msgstr "pt"
204
+
205
+ #: ../yit-common/yith-panel.php:437
206
+ msgid "rem"
207
+ msgstr "rem"
208
+
209
+ #: ../yit-common/yith-panel.php:447
210
+ msgid "Select a font family"
211
+ msgstr "Seleziona la famiglia font"
212
+
213
+ #: ../yit-common/yith-panel.php:455
214
+ msgid "Regular"
215
+ msgstr "Normale"
216
+
217
+ #: ../yit-common/yith-panel.php:456
218
+ msgid "Bold"
219
+ msgstr "Grassetto"
220
+
221
+ #: ../yit-common/yith-panel.php:457
222
+ msgid "Extra bold"
223
+ msgstr "Extra bold"
224
+
225
+ #: ../yit-common/yith-panel.php:458
226
+ msgid "Italic"
227
+ msgstr "Corsivo"
228
+
229
+ #: ../yit-common/yith-panel.php:459
230
+ msgid "Italic bold"
231
+ msgstr "Grassetto corsivo"
232
+
233
+ #: ../yit-common/yith-panel.php:471
234
+ msgid "Click to preview"
235
+ msgstr "Clicca per anteprima"
236
+
237
+ #~ msgid "Woocommerce Compare"
238
+ #~ msgstr "Modalità Manutenzione"
239
+
240
+ #~ msgid "Settings"
241
+ #~ msgstr "Impostazioni"
242
+
243
+ #~ msgid "Docs"
244
+ #~ msgstr "Documentazione"
245
+
246
+ #~ msgid "Woocommerce Compare Active"
247
+ #~ msgstr "Modalità Manutenzione attiva"
248
+
249
+ #~ msgid "General"
250
+ #~ msgstr "Generale"
251
+
252
+ #~ msgid "Enable Woocommerce Compare"
253
+ #~ msgstr "Abilità Modalità Manutenzione"
254
+
255
+ #~ msgid ""
256
+ #~ "Enable the splash page to lets users to know the blog is down for "
257
+ #~ "maintenance. (Default: Off) "
258
+ #~ msgstr ""
259
+ #~ "Abilita la pagina che permette agli utenti di vedere il sito in modalità "
260
+ #~ "di manutenzione. (Default: Off)"
261
+
262
+ #~ msgid "Roles"
263
+ #~ msgstr "Ruoli"
264
+
265
+ #~ msgid ""
266
+ #~ "The user roles enabled to see the frontend. Check a role to enable it to "
267
+ #~ "show the website with maintenance mode active."
268
+ #~ msgstr ""
269
+ #~ "I ruoli utente abilitati a vedere il frontend del sito. Controlla un "
270
+ #~ "ruolo per abilitarlo e fargli mostrare il sito, nonostante la modalità "
271
+ #~ "manutenzione attiva."
272
+
273
+ #~ msgid "Message"
274
+ #~ msgstr "Messaggio"
275
+
276
+ #~ msgid "The message displayed. You can also use HTML code."
277
+ #~ msgstr "Il messaggio mostrato. Puoi anche utilizzare del codice HTML."
278
+
279
+ #~ msgid "OPS! WE ARE NOT READY YET!"
280
+ #~ msgstr "OPS! NON SIAMO ANCORA PRONTI!"
281
+
282
+ #~ msgid ""
283
+ #~ "Hello there! We are not ready yet, but why don't you leave your email "
284
+ #~ "address and we'll let you know as soon as we're in business!"
285
+ #~ msgstr ""
286
+ #~ "Ciao a tutti! Non siamo ancora pronti, ma lascia pure il tuo indirizzo "
287
+ #~ "email così di essere avvisato non appena il sito sarà lanciato!"
288
+
289
+ #~ msgid "Insert here your custom CSS style."
290
+ #~ msgstr "Aggiungi qui il tuo stile CSS personalizzato."
291
+
292
+ #~ msgid ""
293
+ #~ "If you want, you can set here a mascotte image to show above the main "
294
+ #~ "box, in the right side."
295
+ #~ msgstr ""
296
+ #~ "A tuo piacimento, puoi impostare qui l'immagine di una mascotte da "
297
+ #~ "mostrare sopra il box principale, nella parte destra."
298
+
299
+ #~ msgid "Typography"
300
+ #~ msgstr "Tipografia"
301
+
302
+ #~ msgid "Title font of message"
303
+ #~ msgstr "Font del titolo all'interno del messaggio"
304
+
305
+ #~ msgid ""
306
+ #~ "Choose the font type, size and color for the titles inside the message "
307
+ #~ "text."
308
+ #~ msgstr ""
309
+ #~ "Scegli il font, dimensione e colore per i titoli dentro il testo del "
310
+ #~ "messaggio."
311
+
312
+ #~ msgid "Paragraph font of message"
313
+ #~ msgstr "Font del paragrafo all'interno del messaggio"
314
+
315
+ #~ msgid ""
316
+ #~ "Choose the font type, size and color for the paragraphs inside the "
317
+ #~ "message text."
318
+ #~ msgstr ""
319
+ #~ "Scegli il font, dimensione e colore per i paragrafi dentro il testo del "
320
+ #~ "messaggio."
321
+
322
+ #~ msgid "Colors"
323
+ #~ msgstr "Colori"
324
+
325
+ #~ msgid "Border top color"
326
+ #~ msgstr "Colore del bordo superiore"
327
+
328
+ #~ msgid "Choose the color for the big border top of the main box."
329
+ #~ msgstr "Scegli il colore per il bordo superiore del box"
330
+
331
+ #~ msgid "Background"
332
+ #~ msgstr "Sfondo"
333
+
334
+ #~ msgid "Background Settings"
335
+ #~ msgstr "Impostazioni sfondo"
336
+
337
+ #~ msgid "Customize the background of the page"
338
+ #~ msgstr "Personalizza lo sfondo della pagina"
339
+
340
+ #~ msgid "Background image"
341
+ #~ msgstr "Immagine sfondo"
342
+
343
+ #~ msgid "Upload or choose from your media library the background image"
344
+ #~ msgstr "Carica o scegli dalla libreria un'immagine di sfondo"
345
+
346
+ #~ msgid "Background Color"
347
+ #~ msgstr "Colore di sfondo"
348
+
349
+ #~ msgid "Choose a background color"
350
+ #~ msgstr "Scegli un colore di sfondo"
351
+
352
+ #~ msgid "Background Repeat"
353
+ #~ msgstr "Ripetizione sfondo"
354
+
355
+ #~ msgid "Select the repeat mode for the background image."
356
+ #~ msgstr "Seleziona la modalità di ripetizione per l'immagine di sfondo."
357
+
358
+ #~ msgid "Repeat"
359
+ #~ msgstr "Ripeti"
360
+
361
+ #~ msgid "Repeat Horizontally"
362
+ #~ msgstr "Ripeti orizontalmente"
363
+
364
+ #~ msgid "Repeat Vertically"
365
+ #~ msgstr "Ripeti verticalmente"
366
+
367
+ #~ msgid "No Repeat"
368
+ #~ msgstr "Nessuna ripetizione"
369
+
370
+ #~ msgid "Background Position"
371
+ #~ msgstr "Posizione sfondo"
372
+
373
+ #~ msgid "Center"
374
+ #~ msgstr "Centro"
375
+
376
+ #~ msgid "Top left"
377
+ #~ msgstr "In alto a sinistra"
378
+
379
+ #~ msgid "Top center"
380
+ #~ msgstr "In alto al centro"
381
+
382
+ #~ msgid "Top right"
383
+ #~ msgstr "In alto a destra"
384
+
385
+ #~ msgid "Bottom left"
386
+ #~ msgstr "In basso a sinistra"
387
+
388
+ #~ msgid "Bottom center"
389
+ #~ msgstr "In basso al centro"
390
+
391
+ #~ msgid "Bottom right"
392
+ #~ msgstr "In basso a destra"
393
+
394
+ #~ msgid "Background Attachment"
395
+ #~ msgstr "Ancorazione sfondo"
396
+
397
+ #~ msgid "Select the attachment for the background image."
398
+ #~ msgstr "Seleziona l'ancorazione dell'immagine di sfondo."
399
+
400
+ #~ msgid "Scroll"
401
+ #~ msgstr "Scorri"
402
+
403
+ #~ msgid "Fixed"
404
+ #~ msgstr "Fisso"
405
+
406
+ #~ msgid "Logo"
407
+ #~ msgstr "Logo"
408
+
409
+ #~ msgid "Logo Settings"
410
+ #~ msgstr "Impostazioni logo"
411
+
412
+ #~ msgid "Customize the logo"
413
+ #~ msgstr "Personalizza il logo"
414
+
415
+ #~ msgid "Logo image"
416
+ #~ msgstr "Immagine logo"
417
+
418
+ #~ msgid "Upload or choose from your media library the logo image"
419
+ #~ msgstr "Carica o scegli dalla libreria l'immagine del logo"
420
+
421
+ #~ msgid "Logo tagline"
422
+ #~ msgstr "Tagline del logo"
423
+
424
+ #~ msgid "Set the tagline to show below the logo image"
425
+ #~ msgstr "Imposta tagline da mostrare sotto l'immagine del logo"
426
+
427
+ #~ msgid "Logo tagline font"
428
+ #~ msgstr "Font della tagline"
429
+
430
+ #~ msgid "Newsletter"
431
+ #~ msgstr "Newsletter"
432
+
433
+ #~ msgid "Add a newsletter form in your maintenance mode page."
434
+ #~ msgstr "Aggiungi un form per la newsletter nella pagina di manutenzione."
435
+
436
+ #~ msgid "Enable Newsletter form"
437
+ #~ msgstr "Abilita il form per la newsletter"
438
+
439
+ #~ msgid "Newsletter Email Font"
440
+ #~ msgstr "Font email newsletter"
441
+
442
+ #~ msgid "Choose the font type, size and color for the email input field."
443
+ #~ msgstr "Scegli il font, dimensione e colore per il campo email del form."
444
+
445
+ #~ msgid "Newsletter Submit Font"
446
+ #~ msgstr "Font submit newsletter"
447
+
448
+ #~ msgid "Choose the font type, size and color for the email submit."
449
+ #~ msgstr "Scegli il font, dimensione e colore per il pulsante invia del form."
450
+
451
+ #~ msgid "Newsletter submit background"
452
+ #~ msgstr "Sfondo submit newsletter"
453
+
454
+ #~ msgid "The submit button background."
455
+ #~ msgstr "Sfondo del pulsante di invio "
456
+
457
+ #~ msgid "Newsletter submit hover background"
458
+ #~ msgstr "Font submit newsletter hover"
459
+
460
+ #~ msgid "The submit button hover background."
461
+ #~ msgstr "Colore di sfondo per il pulsante di invio all'hover del mouse."
462
+
463
+ #~ msgid "The title displayed above the newsletter form."
464
+ #~ msgstr "Il titolo mostrato sopra il form newsletter"
465
+
466
+ #~ msgid "STAY UPDATED WITH %s"
467
+ #~ msgstr "RESTA AGGIORNATO CON %s"
468
+
469
+ #~ msgid "Form configuration"
470
+ #~ msgstr "Configurazione form"
471
+
472
+ #~ msgid ""
473
+ #~ "Configure the form and each field, to integrate the newsletter features "
474
+ #~ "of an external service."
475
+ #~ msgstr ""
476
+ #~ "Configra il form e ogni campo, per integrarlo con le caratteristiche di "
477
+ #~ "un servizio newsletter esterno."
478
+
479
+ #~ msgid "Action URL"
480
+ #~ msgstr "URL Action"
481
+
482
+ #~ msgid "Set the action url of the form."
483
+ #~ msgstr "Imposta l'url dell'attributo \"action\" del form."
484
+
485
+ #~ msgid "Form method"
486
+ #~ msgstr "Metodo form"
487
+
488
+ #~ msgid "Set the method for the form request."
489
+ #~ msgstr "Imposta il metodo con la quale il form invia la richiesta."
490
+
491
+ #~ msgid "\"Email\" field label"
492
+ #~ msgstr "Label del campo \"Email\""
493
+
494
+ #~ msgid "The label for the email field"
495
+ #~ msgstr "La label per il campo email"
496
+
497
+ #~ msgid "\"Email\" field name"
498
+ #~ msgstr "Attributo name del campo \"Email\""
499
+
500
+ #~ msgid "The \"name\" attribute for the email field"
501
+ #~ msgstr "L'attributo \"name\" per il campo email"
502
+
503
+ #~ msgid "Submit button label"
504
+ #~ msgstr "Label del pulsante submit"
505
+
506
+ #~ msgid "The label for the submit button"
507
+ #~ msgstr "La label per il pulsante di invio"
508
+
509
+ #~ msgid "GET NOTIFY"
510
+ #~ msgstr "AGGIORNAMI"
511
+
512
+ #~ msgid "Newsletter Hidden fields"
513
+ #~ msgstr "Campi nascosti"
514
+
515
+ #~ msgid ""
516
+ #~ "Set the hidden fields to include in the form. Use the form: "
517
+ #~ "field1=value1&field2=value2&field3=value3"
518
+ #~ msgstr ""
519
+ #~ "Imposta i campi nascosti da includere nel form. Usa la forma: "
520
+ #~ "field1=value1&field2=value2&field3=value3"
521
+
522
+ #~ msgid "Socials"
523
+ #~ msgstr "Social"
524
+
525
+ #~ msgid "Set the socials"
526
+ #~ msgstr "Imposta i social"
527
+
528
+ #~ msgid ""
529
+ #~ "You can set here the url of your social accounts (you can leave empty if "
530
+ #~ "you don't want to show the social icon)"
531
+ #~ msgstr ""
532
+ #~ "Qui puoi settare gli url dei tuoi account social (puoi lasciare vuoto se "
533
+ #~ "non vuoi mostrare la rispettiva icona social)"
534
+
535
+ #~ msgid "Facebook"
536
+ #~ msgstr "Facebook"
537
+
538
+ #~ msgid "Set the URL of your facebook profile"
539
+ #~ msgstr "Imposta l'URL del tuo profilo facebok"
540
+
541
+ #~ msgid "Twitter"
542
+ #~ msgstr "Twitter"
543
+
544
+ #~ msgid "Set the URL of your twitter profile"
545
+ #~ msgstr "Imposta l'URL del tuo profilo twitter"
546
+
547
+ #~ msgid "Google+"
548
+ #~ msgstr "Google+"
549
+
550
+ #~ msgid "Set the URL of your Google+ profile"
551
+ #~ msgstr "Imposta l'url del tuo profilo Google+"
552
+
553
+ #~ msgid "Youtube"
554
+ #~ msgstr "Youtube"
555
+
556
+ #~ msgid "Set the URL of your youtube profile"
557
+ #~ msgstr "Imposta l'url del tuo canale YouTube"
558
+
559
+ #~ msgid "RSS"
560
+ #~ msgstr "RSS"
561
+
562
+ #~ msgid "Set the URL of your RSS feed"
563
+ #~ msgstr "Imposta l'URL dei tuoi feed RSS"
564
+
565
+ #~ msgid "Skype"
566
+ #~ msgstr "Skype"
567
+
568
+ #~ msgid "Set the username of your skype account"
569
+ #~ msgstr "Imposta l'username del tuo account skype"
570
+
571
+ #~ msgid "Email"
572
+ #~ msgstr "Email"
573
+
574
+ #~ msgid "Write here your email address"
575
+ #~ msgstr "Scrivi qui il tuo indirizzo email"
576
+
577
+ #~ msgid "Behance"
578
+ #~ msgstr "Behance"
579
+
580
+ #~ msgid "Set the URL of your Behance profile"
581
+ #~ msgstr "IMposta l'URL del tuo profilo Behance"
582
+
583
+ #~ msgid "Dribble"
584
+ #~ msgstr "Dribble"
585
+
586
+ #~ msgid "Set the URL of your dribble profile"
587
+ #~ msgstr "Imposta l'URL del tuo profilo dribble"
588
+
589
+ #~ msgid "FlickR"
590
+ #~ msgstr "FlicR"
591
+
592
+ #~ msgid "Set the URL of your Flickr profile"
593
+ #~ msgstr "Imposta l'URL del tuo profilo FlickR"
594
+
595
+ #~ msgid "Instagram"
596
+ #~ msgstr "Instagram"
597
+
598
+ #~ msgid "Set the URL of your instagram profile"
599
+ #~ msgstr "Imposta l'URL del tuo profilo Instagram"
600
+
601
+ #~ msgid "Pinterest"
602
+ #~ msgstr "Pinterest"
603
+
604
+ #~ msgid "Set the URL of your Pinterest profile"
605
+ #~ msgstr "Imposta l'URL del tuo profilo Pinterest"
606
+
607
+ #~ msgid "Tumblr"
608
+ #~ msgstr "Tumblr"
609
+
610
+ #~ msgid "Set the URL of your Tumblr profile"
611
+ #~ msgstr "Imposta l'URL del tuo profilo Tumblr"
612
+
613
+ #~ msgid "Set the URL of your LinkedIn profile"
614
+ #~ msgstr "Imposta l'URL del tuo profilo su LinkedIn"
615
+
616
+ #~ msgid "Choose a background color for the logo"
617
+ #~ msgstr "Scegli il colore di sfondo per il logo"
languages/yit.pot ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: YITH Woocommerce Compare\n"
4
+ "POT-Creation-Date: 2013-06-19 18:25+0100\n"
5
+ "PO-Revision-Date: 2013-06-19 18:25+0100\n"
6
+ "Last-Translator: Nicola Mustone <mail@nicolamustone.it>\n"
7
+ "Language-Team: Your Inspiration Themes <support@yithemes.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.5\n"
13
+ "X-Poedit-KeywordsList: __;_e;_x\n"
14
+ "X-Poedit-Basepath: ./\n"
15
+ "X-Poedit-SearchPath-0: ..\n"
16
+
17
+ #: ../class.yith-woocompare-admin.php:118
18
+ msgid "Products Compare"
19
+ msgstr ""
20
+
21
+ #: ../class.yith-woocompare-admin.php:132 ../yith-woocompare-options.php:15
22
+ msgid "General Settings"
23
+ msgstr ""
24
+
25
+ #: ../class.yith-woocompare-frontend.php:133
26
+ msgid "Added"
27
+ msgstr ""
28
+
29
+ #: ../class.yith-woocompare-frontend.php:134 ../templates/compare.php:47
30
+ msgid "Product Comparison"
31
+ msgstr ""
32
+
33
+ #: ../class.yith-woocompare-frontend.php:238
34
+ msgid "In stock"
35
+ msgstr ""
36
+
37
+ #: ../class.yith-woocompare-frontend.php:314
38
+ #: ../widgets/class.yith-woocompare-widget.php:38
39
+ msgid "Compare"
40
+ msgstr ""
41
+
42
+ #: ../class.yith-woocompare-frontend.php:467
43
+ msgid "No products to compare"
44
+ msgstr ""
45
+
46
+ #: ../class.yith-woocompare-frontend.php:476 ../templates/compare.php:102
47
+ msgid "Remove"
48
+ msgstr ""
49
+
50
+ #: ../class.yith-woocompare-helper.php:38
51
+ #: ../widgets/class.yith-woocompare-widget.php:55
52
+ msgid "Title"
53
+ msgstr ""
54
+
55
+ #: ../class.yith-woocompare-helper.php:39
56
+ msgid "Image"
57
+ msgstr ""
58
+
59
+ #: ../class.yith-woocompare-helper.php:40
60
+ msgid "Description"
61
+ msgstr ""
62
+
63
+ #: ../class.yith-woocompare-helper.php:41
64
+ msgid "Price"
65
+ msgstr ""
66
+
67
+ #: ../class.yith-woocompare-helper.php:42
68
+ msgid "Add to cart"
69
+ msgstr ""
70
+
71
+ #: ../class.yith-woocompare-helper.php:43
72
+ msgid "Availability"
73
+ msgstr ""
74
+
75
+ #: ../yith-woocompare-options.php:22
76
+ msgid "Link or Button"
77
+ msgstr ""
78
+
79
+ #: ../yith-woocompare-options.php:23
80
+ msgid "Choose if you want to use a link or a button for the action button."
81
+ msgstr ""
82
+
83
+ #: ../yith-woocompare-options.php:29
84
+ msgid "Link"
85
+ msgstr ""
86
+
87
+ #: ../yith-woocompare-options.php:30
88
+ msgid "Button"
89
+ msgstr ""
90
+
91
+ #: ../yith-woocompare-options.php:35
92
+ msgid "Show button in single product page"
93
+ msgstr ""
94
+
95
+ #: ../yith-woocompare-options.php:36
96
+ msgid "Say if you want to show the button in the single product page."
97
+ msgstr ""
98
+
99
+ #: ../yith-woocompare-options.php:44
100
+ msgid "Show button in products list"
101
+ msgstr ""
102
+
103
+ #: ../yith-woocompare-options.php:45
104
+ msgid "Say if you want to show the button in the products list."
105
+ msgstr ""
106
+
107
+ #: ../yith-woocompare-options.php:53
108
+ msgid "Open automatically lightbox"
109
+ msgstr ""
110
+
111
+ #: ../yith-woocompare-options.php:54
112
+ msgid "Open link after click into \"Compare\" button\"."
113
+ msgstr ""
114
+
115
+ #: ../yith-woocompare-options.php:66
116
+ msgid "Table Settings"
117
+ msgstr ""
118
+
119
+ #: ../yith-woocompare-options.php:73
120
+ msgid "Fields to show"
121
+ msgstr ""
122
+
123
+ #: ../yith-woocompare-options.php:74 ../yith-woocompare-options.php:83
124
+ #: ../yith-woocompare-options.php:92
125
+ msgid ""
126
+ "Select the fields to show in the comparison table and order them by "
127
+ "drag&drop (are included also the woocommerce attributes)"
128
+ msgstr ""
129
+
130
+ #: ../yith-woocompare-options.php:82
131
+ msgid "Repeat \"Price\" field at the end of the table"
132
+ msgstr ""
133
+
134
+ #: ../yith-woocompare-options.php:91
135
+ msgid "Repeat \"Add to cart\" field at the end of the table"
136
+ msgstr ""
137
+
138
+ #: ../yith-woocompare-options.php:100
139
+ msgid "Image size"
140
+ msgstr ""
141
+
142
+ #: ../yith-woocompare-options.php:101
143
+ msgid "Set the size for the images"
144
+ msgstr ""
145
+
146
+ #: ../templates/compare.php:68
147
+ msgid "Compare products"
148
+ msgstr ""
149
+
150
+ #: ../templates/compare.php:69
151
+ msgid "Close window [X]"
152
+ msgstr ""
153
+
154
+ #: ../templates/compare.php:94
155
+ msgid "No products added in the compare table."
156
+ msgstr ""
157
+
158
+ #: ../widgets/class.yith-woocompare-widget.php:21
159
+ msgid "The widget show the list of products added in the compare table."
160
+ msgstr ""
161
+
162
+ #: ../widgets/class.yith-woocompare-widget.php:22
163
+ msgid "YITH Woocommerce Compare Widget"
164
+ msgstr ""
165
+
166
+ #: ../widgets/class.yith-woocompare-widget.php:37
167
+ msgid "Clear all"
168
+ msgstr ""
169
+
170
+ #: ../yit-common/yith-panel.php:396
171
+ msgid "Select a date"
172
+ msgstr ""
173
+
174
+ #: ../yit-common/yith-panel.php:397
175
+ msgid "Hours"
176
+ msgstr ""
177
+
178
+ #: ../yit-common/yith-panel.php:398 ../yit-common/yith-panel.php:399
179
+ msgid "Minutes"
180
+ msgstr ""
181
+
182
+ #: ../yit-common/yith-panel.php:407
183
+ msgid "Upload"
184
+ msgstr ""
185
+
186
+ #: ../yit-common/yith-panel.php:434
187
+ msgid "px"
188
+ msgstr ""
189
+
190
+ #: ../yit-common/yith-panel.php:435
191
+ msgid "em"
192
+ msgstr ""
193
+
194
+ #: ../yit-common/yith-panel.php:436
195
+ msgid "pt"
196
+ msgstr ""
197
+
198
+ #: ../yit-common/yith-panel.php:437
199
+ msgid "rem"
200
+ msgstr ""
201
+
202
+ #: ../yit-common/yith-panel.php:447
203
+ msgid "Select a font family"
204
+ msgstr ""
205
+
206
+ #: ../yit-common/yith-panel.php:455
207
+ msgid "Regular"
208
+ msgstr ""
209
+
210
+ #: ../yit-common/yith-panel.php:456
211
+ msgid "Bold"
212
+ msgstr ""
213
+
214
+ #: ../yit-common/yith-panel.php:457
215
+ msgid "Extra bold"
216
+ msgstr ""
217
+
218
+ #: ../yit-common/yith-panel.php:458
219
+ msgid "Italic"
220
+ msgstr ""
221
+
222
+ #: ../yit-common/yith-panel.php:459
223
+ msgid "Italic bold"
224
+ msgstr ""
225
+
226
+ #: ../yit-common/yith-panel.php:471
227
+ msgid "Click to preview"
228
+ msgstr ""
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
templates/compare.php ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Woocommerce Compare page
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH Woocommerce Compare
7
+ * @version 1.0.0
8
+ */
9
+
10
+ global $product;
11
+
12
+ // remove the style of woocommerce
13
+ if ( defined('WOOCOMMERCE_USE_CSS') && WOOCOMMERCE_USE_CSS ) wp_dequeue_style('woocommerce_frontend_styles');
14
+
15
+ $is_iframe = (bool)( isset( $_REQUEST['iframe'] ) && $_REQUEST['iframe'] );
16
+
17
+ wp_enqueue_script( 'jquery-fixedheadertable', YITH_WOOCOMPARE_URL . 'assets/js/jquery.dataTables.min.js', array('jquery'), '1.3', true );
18
+ wp_enqueue_script( 'jquery-fixedcolumns', YITH_WOOCOMPARE_URL . 'assets/js/FixedColumns.min.js', array('jquery', 'jquery-fixedheadertable'), '1.3', true );
19
+
20
+ $widths = array();
21
+ foreach( $products as $product ) $widths[] = '{ "sWidth": "205px", resizeable:true }';
22
+
23
+ ?><!DOCTYPE html>
24
+ <!--[if IE 6]>
25
+ <html id="ie6" class="ie"<?php language_attributes() ?>>
26
+ <![endif]-->
27
+ <!--[if IE 7]>
28
+ <html id="ie7" class="ie"<?php language_attributes() ?>>
29
+ <![endif]-->
30
+ <!--[if IE 8]>
31
+ <html id="ie8" class="ie"<?php language_attributes() ?>>
32
+ <![endif]-->
33
+ <!--[if IE 9]>
34
+ <html id="ie9" class="ie"<?php language_attributes() ?>>
35
+ <![endif]-->
36
+ <!--[if gt IE 9]>
37
+ <html class="ie"<?php language_attributes() ?>>
38
+ <![endif]-->
39
+ <!--[if !IE]>
40
+ <html <?php language_attributes() ?>>
41
+ <![endif]-->
42
+
43
+ <!-- START HEAD -->
44
+ <head>
45
+ <meta charset="<?php bloginfo( 'charset' ); ?>" />
46
+ <meta name="viewport" content="width=device-width" />
47
+ <title><?php _e( 'Product Comparison', 'yit' ) ?></title>
48
+ <link rel="profile" href="http://gmpg.org/xfn/11" />
49
+
50
+ <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" />
51
+ <link rel="stylesheet" href="<?php echo $this->stylesheet_url() ?>" type="text/css" />
52
+ <link rel="stylesheet" href="<?php echo YITH_WOOCOMPARE_URL ?>assets/css/colorbox.css"/>
53
+ <link rel="stylesheet" href="<?php echo YITH_WOOCOMPARE_URL ?>assets/css/jquery.dataTables.css"/>
54
+
55
+ <?php wp_head() ?>
56
+
57
+ <style type="text/css">
58
+ body.loading {
59
+ background: url("<?php echo YITH_WOOCOMPARE_URL ?>assets/images/colorbox/loading.gif") no-repeat scroll center center transparent;
60
+ }
61
+ </style>
62
+ </head>
63
+ <!-- END HEAD -->
64
+ <!-- START BODY -->
65
+ <body <?php body_class('woocommerce') ?>>
66
+
67
+ <h1>
68
+ <?php _e( 'Compare products', 'yit' ) ?>
69
+ <?php if ( ! $is_iframe ) : ?><a class="close" href="#"><?php _e( 'Close window [X]', 'yit' ) ?></a><?php endif; ?>
70
+ </h1>
71
+
72
+ <table class="compare-list" cellpadding="0" cellspacing="0"<?php if ( empty( $products ) ) echo ' style="width:100%"' ?>>
73
+ <thead>
74
+ <tr>
75
+ <th>&nbsp;</th>
76
+ <?php foreach( $products as $i => $product ) : ?>
77
+ <td></td>
78
+ <?php endforeach; ?>
79
+ </tr>
80
+ </thead>
81
+ <tfoot>
82
+ <tr>
83
+ <th>&nbsp;</th>
84
+ <?php foreach( $products as $i => $product ) : ?>
85
+ <td></td>
86
+ <?php endforeach; ?>
87
+ </tr>
88
+ </tfoot>
89
+ <tbody>
90
+
91
+ <?php if ( empty( $products ) ) : ?>
92
+
93
+ <tr class="no-products">
94
+ <td><?php _e( 'No products added in the compare table.', 'yit' ) ?></td>
95
+ </tr>
96
+
97
+ <?php else : ?>
98
+ <tr class="remove">
99
+ <th>&nbsp;</th>
100
+ <?php foreach( $products as $i => $product ) : $product_class = ( $i % 2 == 0 ? 'odd' : 'even' ) . ' product_' . $product->id ?>
101
+ <td class="<?php echo $product_class; ?>">
102
+ <a href="<?php echo add_query_arg( 'redirect', 'view', $this->remove_product_url( $product->id ) ) ?>" data-product_id="<?php echo $product->id; ?>"><?php _e( 'Remove', 'yit' ) ?> <span class="remove">x</span></a>
103
+ </td>
104
+ <?php endforeach ?>
105
+ </tr>
106
+
107
+ <?php foreach ( $fields as $field => $name ) : ?>
108
+
109
+ <tr class="<?php echo $field ?>">
110
+
111
+ <th>
112
+ <?php echo $name ?>
113
+ <?php if ( $field == 'image' ) echo '<div class="fixed-th"></div>'; ?>
114
+ </th>
115
+
116
+ <?php foreach( $products as $i => $product ) : $product_class = ( $i % 2 == 0 ? 'odd' : 'even' ) . ' product_' . $product->id ?>
117
+ <td class="<?php echo $product_class; ?>"><?php
118
+ switch( $field ) {
119
+
120
+ case 'image':
121
+ echo '<div class="image-wrap">' . wp_get_attachment_image( $product->fields[$field], 'yith-woocompare-image' ) . '</div>';
122
+ break;
123
+
124
+ case 'add-to-cart':
125
+ woocommerce_get_template( 'loop/add-to-cart.php' );
126
+ break;
127
+
128
+ default:
129
+ echo empty( $product->fields[$field] ) ? '&nbsp;' : $product->fields[$field];
130
+ break;
131
+ }
132
+ ?>
133
+ </td>
134
+ <?php endforeach ?>
135
+
136
+ </tr>
137
+
138
+ <?php endforeach; ?>
139
+
140
+ <?php if ( $repeat_price == 'yes' && isset( $fields['price'] ) ) : ?>
141
+ <tr class="price repeated">
142
+ <th><?php echo $fields['price'] ?></th>
143
+
144
+ <?php foreach( $products as $i => $product ) : $product_class = ( $i % 2 == 0 ? 'odd' : 'even' ) . ' product_' . $product->id ?>
145
+ <td class="<?php echo $product_class ?>"><?php echo $product->fields['price'] ?></td>
146
+ <?php endforeach; ?>
147
+
148
+ </tr>
149
+ <?php endif; ?>
150
+
151
+ <?php if ( $repeat_add_to_cart == 'yes' && isset( $fields['add-to-cart'] ) ) : ?>
152
+ <tr class="add-to-cart repeated">
153
+ <th><?php echo $fields['add-to-cart'] ?></th>
154
+
155
+ <?php foreach( $products as $i => $product ) : $product_class = ( $i % 2 == 0 ? 'odd' : 'even' ) . ' product_' . $product->id ?>
156
+ <td class="<?php echo $product_class ?>"><?php woocommerce_get_template( 'loop/add-to-cart.php' ); ?></td>
157
+ <?php endforeach; ?>
158
+
159
+ </tr>
160
+ <?php endif; ?>
161
+
162
+ <?php endif; ?>
163
+
164
+ </tbody>
165
+ </table>
166
+
167
+ <?php wp_footer(); ?>
168
+
169
+ <script type="text/javascript">
170
+
171
+ jQuery(document).ready(function($){
172
+ <?php if ( $is_iframe ) : ?>$('a').attr('target', '_parent');<?php endif; ?>
173
+
174
+ var oTable;
175
+ $('body').on( 'yith_woocompare_render_table', function(){
176
+ oTable = $('table.compare-list').dataTable( {
177
+ "sScrollX": "100%",
178
+ //"sScrollXInner": "150%",
179
+ "bScrollInfinite": true,
180
+ "bScrollCollapse": true,
181
+ "bPaginate": false,
182
+ "bSort": false,
183
+ "bInfo": false,
184
+ "bFilter": false,
185
+ "bAutoWidth": false
186
+ } );
187
+ new FixedColumns( oTable );
188
+ $('<table class="compare-list" />').insertAfter( $('h1') ).hide();
189
+ }).trigger('yith_woocompare_render_table');
190
+
191
+ // add to cart
192
+ var button_clicked;
193
+ $(document).on('click', 'a.add_to_cart_button', function(){
194
+ button_clicked = $(this);
195
+ button_clicked.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
196
+ });
197
+
198
+ // remove add to cart button after added
199
+ $('body').on('added_to_cart', function(){
200
+ button_clicked.hide();
201
+ <?php if ( $is_iframe ) : ?>$('a').attr('target', '_parent');<?php endif; ?>
202
+ });
203
+
204
+ // close window
205
+ $(document).on( 'click', 'a.close', function(e){
206
+ e.preventDefault();
207
+ window.close();
208
+ });
209
+
210
+ $(window).on( 'yith_woocompare_product_removed', function(){
211
+ oTable.fnDestroy(true);
212
+ $('body').trigger('yith_woocompare_render_table');
213
+ });
214
+
215
+ });
216
+
217
+ </script>
218
+
219
+ </body>
220
+ </html>
widgets/class.yith-woocompare-widget.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
11
+
12
+ if( !class_exists( 'YITH_WOOCOMPARE' ) ) {
13
+ /**
14
+ * YITH WooCommerce Ajax Navigation Widget
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+ class YITH_Woocompare_Widget extends WP_Widget {
19
+
20
+ function __construct() {
21
+ $widget_ops = array('classname' => 'yith-woocompare-widget', 'description' => __( 'The widget show the list of products added in the compare table.', 'yit') );
22
+ parent::__construct('yith-woocompare-widget', __('YITH Woocommerce Compare Widget', 'yit'), $widget_ops);
23
+ }
24
+
25
+
26
+ function widget( $args, $instance ) {
27
+ global $yith_woocompare;
28
+
29
+ extract( $args );
30
+
31
+ echo $before_widget . $before_title . $instance['title'] . $after_title; ?>
32
+
33
+ <ul class="products-list">
34
+ <?php echo $yith_woocompare->obj->list_products_html(); ?>
35
+ </ul>
36
+
37
+ <a href="<?php echo $yith_woocompare->obj->remove_product_url('all') ?>" data-product_id="all" class="clear-all"><?php _e( 'Clear all', 'yit' ) ?></a>
38
+ <a href="<?php echo add_query_arg( array( 'iframe' => 'true' ), $yith_woocompare->obj->view_table_url() ) ?>" class="compare button"><?php _e( 'Compare', 'yit' ) ?></a>
39
+
40
+ <?php echo $after_widget;
41
+ }
42
+
43
+
44
+ function form( $instance ) {
45
+ global $woocommerce;
46
+
47
+ $defaults = array(
48
+ 'title' => '',
49
+ );
50
+
51
+ $instance = wp_parse_args( (array) $instance, $defaults ); ?>
52
+
53
+ <p>
54
+ <label>
55
+ <strong><?php _e( 'Title', 'yit' ) ?>:</strong><br />
56
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
57
+ </label>
58
+ </p>
59
+ <?php
60
+ }
61
+
62
+ function update( $new_instance, $old_instance ) {
63
+ $instance = $old_instance;
64
+
65
+ $instance['title'] = strip_tags( $new_instance['title'] );
66
+
67
+ return $instance;
68
+ }
69
+
70
+ }
71
+ }
yit-common/assets/css/yith-panel.css ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* typography */
2
+ .typography_container {
3
+ padding-bottom:0px;
4
+ }
5
+ .typography_container .option {
6
+ width: 100%;
7
+ }
8
+ .typography_container input {
9
+ float:left;
10
+ margin-right:14px;
11
+ }
12
+
13
+ .typography_container .select-wrapper {
14
+ float: left;
15
+ width: 150px;
16
+ margin-right: 10px;
17
+ margin-bottom: 0px !important;
18
+ }
19
+ .typography_container .select-wrapper.font-unit {
20
+ width: 61px;
21
+ }
22
+ .typography_container .ui-spinner-buttons {
23
+ top: 0px !important;
24
+ }
25
+ .typography_container .select-wrapper.font-style {
26
+ width: 93px;
27
+ }
28
+ .typography_container .select-wrapper select {
29
+ width:100%;
30
+ }
31
+
32
+ .typography_container .font-preview {
33
+ border: 1px dashed #ddd;
34
+ -webkit-border-radius: 10px;
35
+ -moz-border-radius: 10px;
36
+ border-radius: 10px;
37
+ margin: 10px 0;
38
+ padding: 20px;
39
+ position: relative;
40
+ }
41
+ .typography_container .font-preview .refresh_container {
42
+ background: rgba(255,255,255,0.82);
43
+ -webkit-border-radius: 10px;
44
+ -moz-border-radius: 10px;
45
+ border-radius: 10px;
46
+ position: absolute;
47
+ left: 0;
48
+ top: 0;
49
+ width: 100%;
50
+ height: 100%;
51
+ z-index: 0;
52
+ }
53
+ .typography_container button.refresh {
54
+ /*background: #F2F2F2 url(../images/white-grad.png) repeat-x scroll left top;*/
55
+ border: 1px solid #BBB;
56
+ -webkit-border-radius: 11px;
57
+ border-radius: 11px;
58
+ -moz-box-sizing: content-box;
59
+ -webkit-box-sizing: content-box;
60
+ box-sizing: content-box;
61
+ color: #464646;
62
+ cursor: pointer;
63
+ font-size: 12px!important;
64
+ line-height: 6px;
65
+ margin: -16px 0px 0px -105px;
66
+ padding: 3px 8px;
67
+ position: absolute;
68
+ text-shadow: rgba(255, 255, 255, 1) 0 1px 0;
69
+ text-decoration: none;
70
+ top: 50%;
71
+ left: 50%;
72
+ width: 108px;
73
+ height: 18px;
74
+ }
75
+ .typography_container button.refresh img {
76
+ margin-right: 5px;
77
+ vertical-align: middle;
78
+ }
yit-common/assets/js/google_fonts.json ADDED
@@ -0,0 +1 @@
 
1
+ {"items":["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Asap","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda:300","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Caudex","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption:800","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Federant","Federo","Felipa","Fenix","Finger Paint","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Habibi","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Irish Grover","Istok Web","Italiana","Italianno","Jacques Francois","Jacques Francois Shadow","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kameron","Karla","Kaushan Script","Kavoon","Keania One","Kelly Slab","Kenia","Khmer","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","La Belle Aurore","Lancelot","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modern Antiqua","Molengo","Molle:italic","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed:300","Open Sans Condensed:300italic","Open Sans Condensed:700","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Paprika","Parisienne","Passero One","Passion One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Port Lligat Sans","Port Lligat Slab","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Raleway","Raleway Dots","Rambla","Rammetto One","Ranchers","Rancho","Rationale","Redressed","Reenie Beanie","Revalia","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarina","Satisfy","Scada","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slackey","Smokum","Smythe","Sniglet:800","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sunshiney","Supermercado One","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Telex","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook:700","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Yanone Kaffeesatz","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}
yit-common/assets/js/yith-panel.js ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+
3
+ //image uploader
4
+ var _custom_media = true,
5
+ _orig_send_attachment = wp.media.editor.send.attachment;
6
+
7
+ $('.uploader .button').click(function(e) {
8
+ var send_attachment_bkp = wp.media.editor.send.attachment;
9
+ var button = $(this);
10
+ var id = button.attr('id').replace('_button', '');
11
+ _custom_media = true;
12
+ wp.media.editor.send.attachment = function(props, attachment){
13
+ if ( _custom_media ) {
14
+ $("#"+id).val(attachment.url);
15
+ } else {
16
+ return _orig_send_attachment.apply( this, [props, attachment] );
17
+ };
18
+ }
19
+
20
+ wp.media.editor.open(button);
21
+ return false;
22
+ });
23
+
24
+ $('.add_media').on('click', function(){
25
+ _custom_media = false;
26
+ });
27
+
28
+ //color-picker
29
+ $('.panel-colorpicker').wpColorPicker({
30
+ change: function(event, ui){
31
+ $('#'+event.target.id).parents('.typography_container').find('.font-preview > p').css('color', ui.color.toString());
32
+ }
33
+ });
34
+
35
+ //typography
36
+ $('.typography_container').yit_panel_typography();
37
+
38
+ //datepicker
39
+ $('.panel-datepicker').datepicker({
40
+ showOtherMonths: true,
41
+ selectOtherMonths: true,
42
+ numberOfMonths: 2,
43
+ minDate: 0
44
+ });
45
+ });
46
+
47
+ // typography
48
+ (function( window, $, undefined ) {
49
+
50
+ $.yit_panel_typography = function( options, element ) {
51
+ this.element = $( element );
52
+ this._init( options );
53
+ };
54
+
55
+ $.yit_panel_typography.defaults = {
56
+ elements : {
57
+ size: '.typography_size',
58
+ unit: '.typography_unit',
59
+ family: '.typography_family',
60
+ style: '.typography_style',
61
+ color: '.typography_color',
62
+ preview: '.font-preview p',
63
+ refresh: '.refresh'
64
+ }
65
+ };
66
+
67
+ $.yit_panel_typography.prototype = {
68
+ _init : function( options ) {
69
+ this.options = $.extend( true, {}, $.yit_panel_typography.defaults, options );
70
+
71
+ //init the options string
72
+ if( yit_family_string == '' ) {
73
+ //web fonts
74
+ var web_fonts = $.parseJSON(yit_web_fonts);
75
+ yit_family_string += '<optgroup label="Web Fonts">';
76
+ $.each(web_fonts.items, function(i,v){
77
+ yit_family_string += '<option>' + v + '</option>';
78
+ });
79
+ yit_family_string += '</optgroup>';
80
+
81
+ //google fonts
82
+ var google_fonts = $.parseJSON(yit_google_fonts);
83
+ yit_family_string += '<optgroup label="Google Fonts">';
84
+ $.each(google_fonts.items, function(i,v){
85
+ yit_family_string += '<option>' + v + '</option>';
86
+ });
87
+ yit_family_string += '</optgroup>';
88
+ }
89
+
90
+ this._loadElements();
91
+ this._initEvents();
92
+ },
93
+
94
+ _loadElements : function() {
95
+ var elements = this.options.elements;
96
+ var container = this.element;
97
+
98
+ for( var el in elements) {
99
+ elements[el] = container.find( elements[el] );
100
+ }
101
+ },
102
+
103
+ _initEvents : function() {
104
+ var elements = this.options.elements;
105
+ var self = this;
106
+
107
+ //refresh
108
+ var refresh = elements.refresh;
109
+ refresh.on('click', function(e){
110
+ e.preventDefault();
111
+
112
+ $(this).parent().fadeOut( 'slow' );
113
+
114
+ //Set current value, before trigger change event
115
+
116
+ //Color
117
+ elements.preview.css( 'color', elements.color.val() );
118
+
119
+ //Font size
120
+ var size = elements.size.val();
121
+ var unit = elements.unit.val();
122
+
123
+ elements.preview.css( 'font-size', size + unit );
124
+ elements.preview.css( 'line-height', ( unit == 'em' || unit == 'rem' ? Number( size ) + 0.4 : Number ( size ) + 4 ) + unit );
125
+
126
+ //Font style
127
+ var style = elements.style.val();
128
+
129
+ if( style == 'italic' ) {
130
+ elements.preview.css({ 'font-weight' : 'normal', 'font-style' : 'italic' });
131
+ } else if( style == 'bold' ) {
132
+ elements.preview.css({ 'font-weight' : 'bold', 'font-style' : 'normal' });
133
+ } else if( style == 'extra-bold' ) {
134
+ elements.preview.css({ 'font-weight' : '800', 'font-style' : 'normal' });
135
+ } else if( style == 'bold-italic' ) {
136
+ elements.preview.css({ 'font-weight' : 'bold', 'font-style' : 'italic' });
137
+ } else {
138
+ elements.preview.css({ 'font-weight' : 'normal', 'font-style' : 'normal' });
139
+ }
140
+
141
+ //Font Family
142
+ var group = elements.family.find( 'option:selected' ).parent().attr( 'label' );
143
+
144
+ if( group == 'Web fonts' ) {
145
+ //Web font
146
+ elements.preview.css( 'font-family', elements.family.val() );
147
+ } else {
148
+ //Google font
149
+ WebFontConfig = {
150
+ google: {
151
+ families: [ elements.family.find('option:selected' ).text() ] },
152
+ fontactive: function( fontFamily, fontDescription ) {
153
+ elements.preview.css( 'font-family', fontFamily );
154
+ }
155
+ };
156
+
157
+ (function() {
158
+ var wf = document.createElement('script');
159
+ wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
160
+ '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
161
+ wf.type = 'text/javascript';
162
+ wf.async = 'true';
163
+
164
+ var s = document.getElementsByTagName('script')[0];
165
+ s.parentNode.insertBefore(wf, s);
166
+ })();
167
+ }
168
+ });
169
+
170
+ //font size, font unit
171
+ $([elements.size, elements.unit]).each(function(){
172
+ $(this).on('change', function(){
173
+ if( elements.refresh.is( ':visible' ) ) { return; }
174
+
175
+ var size = elements.size.val();
176
+ var unit = elements.unit.val();
177
+
178
+ elements.preview.css({
179
+ 'font-size' : size + unit,
180
+ 'line-height' : ( unit == 'em' || unit == 'rem' ? Number( size ) + 0.4 : Number ( size ) + 4 ) + unit
181
+ }).trigger( 'resize' );
182
+ });
183
+ });
184
+
185
+ //font family
186
+ var family = elements.family;
187
+ family.on('mousedown', function(e){
188
+ var t = $(this);
189
+ if(t.data('instance') == false) {
190
+ var currentElement = {
191
+ 'value' : t.val(),
192
+ 'text' : t.find('option:selected').text()
193
+ };
194
+
195
+ t.html(yit_family_string)
196
+ .find('option')
197
+ .filter(function(){
198
+ return $(this).text() == currentElement.text;
199
+ }).attr('selected', true);
200
+
201
+ t.data('instance', 'true');
202
+ }
203
+ });
204
+ family.on('change', function(){
205
+ if( elements.refresh.is( ':visible' ) ) { return; }
206
+
207
+ var group = $( this ).find( 'option:selected' ).parent().attr( 'label' );
208
+
209
+ if( group == 'Web fonts' ) {
210
+ //Web font
211
+ elements.preview.css( 'font-family', $( this ).val() );
212
+ } else {
213
+ //Google font
214
+ WebFontConfig = {
215
+ google: {
216
+ families: [ $( this ).val() ]
217
+ },
218
+ fontactive: function( fontFamily, fontDescription ) {
219
+ elements.preview.css( 'font-family', fontFamily );
220
+ }
221
+ };
222
+
223
+ (function() {
224
+ var wf = document.createElement('script');
225
+ wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
226
+ '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
227
+ wf.type = 'text/javascript';
228
+ wf.async = 'true';
229
+
230
+ var s = document.getElementsByTagName('script')[0];
231
+ s.parentNode.insertBefore(wf, s);
232
+ })();
233
+ }
234
+
235
+ elements.preview.trigger( 'resize' );
236
+ });
237
+
238
+ elements.style.on('change', function(){
239
+ if( elements.refresh.is( ':visible' ) ) { return; }
240
+
241
+ var style = $( this ).val();
242
+
243
+ if( style == 'italic' ) {
244
+ elements.preview.css({ 'font-weight' : 'normal', 'font-style' : 'italic' });
245
+ } else if( style == 'bold' ) {
246
+ elements.preview.css({ 'font-weight' : 'bold', 'font-style' : 'normal' });
247
+ } else if( style == 'extra-bold' ) {
248
+ elements.preview.css({ 'font-weight' : '800', 'font-style' : 'normal' });
249
+ } else if( style == 'bold-italic' ) {
250
+ elements.preview.css({ 'font-weight' : 'bold', 'font-style' : 'italic' });
251
+ } else {
252
+ elements.preview.css({ 'font-weight' : 'normal', 'font-style' : 'normal' });
253
+ }
254
+
255
+ elements.preview.trigger( 'resize' );
256
+ });
257
+
258
+ //preview
259
+ elements.preview.resize(function(){
260
+ var box = $(this).parents('.yit-box');
261
+ $(this).parents('form').height( box.height() );
262
+ });
263
+ }
264
+ };
265
+
266
+ $.fn.yit_panel_typography = function( options ) {
267
+ if ( typeof options === 'string' ) {
268
+ var args = Array.prototype.slice.call( arguments, 1 );
269
+
270
+ this.each(function() {
271
+ var instance = $.data( this, 'yit_panel_typography' );
272
+ if ( !instance ) {
273
+ console.error( "cannot call methods on yit_checkout prior to initialization; " +
274
+ "attempted to call method '" + options + "'" );
275
+ return;
276
+ }
277
+ if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
278
+ console.error( "no such method '" + options + "' for yit_panel_typography instance" );
279
+ return;
280
+ }
281
+ instance[ options ].apply( instance, args );
282
+ });
283
+ }
284
+ else {
285
+ this.each(function() {
286
+ var instance = $.data( this, 'yit_panel_typography' );
287
+ if ( !instance ) {
288
+ $.data( this, 'yit_panel_typography', new $.yit_panel_typography( options, this ) );
289
+ }
290
+ });
291
+ }
292
+ return this;
293
+ };
294
+
295
+
296
+ })( window, jQuery );
yit-common/google_fonts.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Google font management
4
+ */
5
+
6
+ $yith_google_fonts = new Google_Font();
7
+
8
+ class Google_Font {
9
+
10
+ /**
11
+ * @var array The google fonts to include in the page
12
+ */
13
+ public $google_fonts = array();
14
+
15
+ /**
16
+ * Generate the url for the google fonts
17
+ */
18
+ public function google_fonts_url() {
19
+ $base_url = 'http://fonts.googleapis.com/css?family=';
20
+ $fonts = array();
21
+
22
+ if ( empty( $this->google_fonts ) ) return;
23
+
24
+ foreach ( $this->google_fonts as $font => $variants ) {
25
+ $fonts[] = urlencode( $font . ':' . implode( ',', $variants ) );
26
+ }
27
+
28
+ return $base_url . implode( '|', $fonts );
29
+ }
30
+
31
+ /**
32
+ * Add a new google font in queue
33
+ *
34
+ * @param $font The name of google font
35
+ * @param array $variants The variatns for the google font to add
36
+ */
37
+ public function add_google_font( $font, $variants = array() ) {
38
+ if ( ! is_array( $variants ) ) $variants = array( $variants );
39
+
40
+ foreach ( $variants as $variant ) {
41
+ if ( ! isset( $this->google_fonts[$font] ) ) $this->google_fonts[$font] = array( 300, 400 );
42
+ if ( ! in_array( $variant, $this->google_fonts[$font] ) ) $this->google_fonts[$font][] = $variant;
43
+ }
44
+ }
45
+ }
46
+
47
+ if ( ! function_exists( 'yith_add_google_font' ) ) {
48
+ /**
49
+ * Add a new google font in queue
50
+ *
51
+ * @param $font The name of google font
52
+ * @param array $variant The variatns for the google font to add
53
+ */
54
+ function yith_add_google_font( $font, $variant = array() ) {
55
+ global $yith_google_fonts;
56
+ $yith_google_fonts->add_google_font( $font, $variant );
57
+ }
58
+ }
59
+
60
+ if ( ! function_exists( 'yith_google_fonts_url' ) ) {
61
+ /**
62
+ * @return string The url with the google fonts to load
63
+ */
64
+ function yith_google_fonts_url() {
65
+ global $yith_google_fonts;
66
+ return $yith_google_fonts->google_fonts_url();
67
+ }
68
+ }
yit-common/yit-functions.php ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Your Inspiration Themes common functions
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @version 0.0.1
7
+ */
8
+
9
+ if( !defined('YITH_FUNCTIONS')) {
10
+ define( 'YITH_FUNCTIONS', true);
11
+ }
12
+
13
+ if ( ! function_exists( 'yit_is_woocommerce_active' ) ) {
14
+ /**
15
+ * WC Detection
16
+ */
17
+ function yit_is_woocommerce_active() {
18
+ $active_plugins = (array) get_option( 'active_plugins', array() );
19
+
20
+ if ( is_multisite() ) {
21
+ $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
22
+ }
23
+
24
+ $woo = yit_get_plugin_basename_from_slug( 'woocommerce' );
25
+ return in_array( $woo, $active_plugins ) || array_key_exists( $woo, $active_plugins );
26
+ }
27
+ }
28
+
29
+ if( ! function_exists( 'yit_get_plugin_basename_from_slug' ) ) {
30
+ /**
31
+ * Helper function to extract the file path of the plugin file from the
32
+ * plugin slug, if the plugin is installed.
33
+ *
34
+ * @param string $slug Plugin slug (typically folder name) as provided by the developer
35
+ * @return string Either file path for plugin if installed, or just the plugin slug
36
+ */
37
+ function yit_get_plugin_basename_from_slug( $slug ) {
38
+ include_once ABSPATH . '/wp-admin/includes/plugin.php';
39
+
40
+ $keys = array_keys( get_plugins() );
41
+
42
+ foreach ( $keys as $key ) {
43
+ if ( preg_match( '|^' . $slug .'|', $key ) )
44
+ return $key;
45
+ }
46
+
47
+ return $slug;
48
+ }
49
+ }
50
+
51
+ if( ! function_exists( 'yith_debug') ) {
52
+ /**
53
+ * Debug helper function. This is a wrapper for var_dump() that adds
54
+ * the <pre /> tags, cleans up newlines and indents, and runs
55
+ * htmlentities() before output.
56
+ *
57
+ * @param mixed $var The variable to dump.
58
+ * @param mixed $var2 The second variable to dump
59
+ * @param ...
60
+ * @return string
61
+ */
62
+ function yith_debug() {
63
+ $args = func_get_args();
64
+ if( !empty( $args ) ) {
65
+ foreach( $args as $k=>$arg ) {
66
+ // var_dump the variable into a buffer and keep the output
67
+ ob_start();
68
+ var_dump($arg);
69
+ $output = ob_get_clean();
70
+
71
+ // neaten the newlines and indents
72
+ $output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output);
73
+
74
+ if(!extension_loaded('xdebug')) {
75
+ $output = htmlspecialchars($output, ENT_QUOTES);
76
+ }
77
+
78
+ $output = '<pre class="yit-debug">'
79
+ . '<strong>$param_' . ($k+1) . ": </strong>"
80
+ . $output
81
+ . '</pre>';
82
+ echo $output;
83
+ }
84
+ } else {
85
+ trigger_error("yit_debug() expects at least 1 parameter, 0 given.", E_USER_WARNING);
86
+ }
87
+
88
+ return $args;
89
+ }
90
+ }
91
+
92
+
93
+ if( ! function_exists('yit_get_options_from_prefix') ) {
94
+ /**
95
+ * Returns an array of all options that starts with a prefix
96
+ *
97
+ * @param string $prefix
98
+ * @return array
99
+ */
100
+ function yit_get_options_from_prefix( $prefix ) {
101
+ if( !$prefix ) return array();
102
+
103
+ global $wpdb;
104
+
105
+ $sql = "SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE '{$prefix}%'";
106
+ $options = $wpdb->get_col( $sql );
107
+ $return = array();
108
+
109
+ foreach( $options as $option ) {
110
+ $return[$option] = get_option( $option );
111
+ }
112
+
113
+ return yit_debug($return);
114
+ }
115
+ }
116
+
117
+ if( !function_exists('yit_wp_roles') ) {
118
+ /**
119
+ * Returns the roles of the site.
120
+ *
121
+ * @return array
122
+ * @since 1.0.0
123
+ */
124
+ function yit_wp_roles() {
125
+ global $wp_roles;
126
+
127
+ if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles();
128
+
129
+ $roles = array();
130
+ foreach( $wp_roles->roles as $k=>$role ) {
131
+ $roles[$k] = $role['name'];
132
+ }
133
+
134
+ return $roles;
135
+ }
136
+ }
137
+
138
+ if( !function_exists('yit_user_roles') ) {
139
+ /**
140
+ * Returns the roles of the user
141
+ *
142
+ * @param int $user_id (Optional) The ID of a user. Defaults to the current user.
143
+ * @return array()
144
+ * @since 1.0.0
145
+ */
146
+ function yit_user_roles( $user_id = null ) {
147
+ if ( is_numeric( $user_id ) )
148
+ $user = get_userdata( $user_id );
149
+ else
150
+ $user = wp_get_current_user();
151
+
152
+ if ( empty( $user ) )
153
+ return false;
154
+
155
+ return (array) $user->roles;
156
+ }
157
+ }
158
+
159
+
160
+ // ADMIN
161
+ if( !function_exists('yit_typo_option_to_css') ) {
162
+ /**
163
+ * Change the typography option saved in database to attributes for css
164
+ *
165
+ * @param array $option The option as saved in the database
166
+ * @return string
167
+ * @since 1.0.0
168
+ */
169
+ function yit_typo_option_to_css( $option ) {
170
+ $attrs = $variant = array();
171
+
172
+ extract( $option );
173
+ $attrs[] = "color: $color;";
174
+ $attrs[] = "font-size: {$size}{$unit};";
175
+ $attrs[] = "font-family: '{$family}';";
176
+ switch ( $style ) {
177
+ case 'regular':
178
+ $attrs[] = 'font-weight: 400;';
179
+ $attrs[] = 'font-style: normal;';
180
+ $variant = 400;
181
+ break;
182
+ case 'bold':
183
+ $attrs[] = 'font-weight: 700;';
184
+ $attrs[] = 'font-style: normal;';
185
+ $variant = 700;
186
+ break;
187
+ case 'extra-bold':
188
+ $attrs[] = 'font-weight: 800;';
189
+ $attrs[] = 'font-style: normal;';
190
+ $variant = 800;
191
+ break;
192
+ case 'italic':
193
+ $attrs[] = 'font-weight: 400;';
194
+ $attrs[] = 'font-style: italic;';
195
+ $variant = 400;
196
+ break;
197
+ case 'bold-italic':
198
+ $attrs[] = 'font-weight: 700;';
199
+ $attrs[] = 'font-style: italic;';
200
+ $variant = 700;
201
+ break;
202
+ }
203
+
204
+ yith_add_google_font( $family, $variant );
205
+
206
+ return implode( "\n", $attrs ) . "\n";
207
+ }
208
+ }
yit-common/yith-panel.php ADDED
@@ -0,0 +1,504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Your Inspiration Themes Panel
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @version 0.1.0
7
+ */
8
+
9
+ if( !class_exists('YITH_Panel') ) {
10
+ /*
11
+ * The class manages the theme options for the Plugin
12
+ */
13
+ class YITH_Panel {
14
+
15
+ /**
16
+ * Class version
17
+ *
18
+ * @var string
19
+ */
20
+ public $version = '0.1.0';
21
+
22
+ /**
23
+ * Parameters for add_submenu_page
24
+ *
25
+ * add_submenu_page(
26
+ * 'themes.php', // The file name of a standard WordPress admin page
27
+ * 'Theme Options', // The text to be displayed in the title tags of the page when the menu is selected
28
+ * 'Theme Options', // The text to be used for the menu
29
+ * 'administrator', // The capability (or role) required for this menu to be displayed to the user.
30
+ * 'theme-options', // The slug name to refer to this menu by (should be unique for this menu).
31
+ * 'theme_options_display_page' // The function to be called to output the content for this page.
32
+ * );
33
+ *
34
+ * @access protected
35
+ */
36
+ protected $_submenu = array();
37
+
38
+ /**
39
+ * Initial Options definition:
40
+ * 'tab' => array(
41
+ * 'label',
42
+ * 'sections' => array(
43
+ * 'fields' => array(
44
+ * 'option1',
45
+ * 'option2',
46
+ * ...
47
+ * )
48
+ * )
49
+ * )
50
+ *
51
+ * @var array
52
+ * @access public
53
+ */
54
+ public $options = array();
55
+
56
+ /**
57
+ * Options group name
58
+ *
59
+ * @var string
60
+ * @access public
61
+ */
62
+ public $option_group = 'panel_group';
63
+
64
+ /**
65
+ * Option name
66
+ *
67
+ * @var string
68
+ * @access public
69
+ */
70
+ public $option_name = 'panel_options';
71
+
72
+ /**
73
+ * Banner links
74
+ *
75
+ * @var string
76
+ * @access public
77
+ */
78
+ public $banner_url = 'http://yithemes.com/?ap_id=plugin';
79
+ public $banner_img = '';
80
+
81
+ /**
82
+ * Constructor
83
+ *
84
+ * @param array $submenu Parameters for add_submenu_page
85
+ * @param array $options Array of plugin options
86
+ *
87
+ */
88
+ public function __construct( $submenu, $options, $banner = array(), $option_group = false, $option_name = false ) {
89
+ $this->_submenu = apply_filters('yith_panel_submenu', $submenu);
90
+ $this->options = apply_filters('yith_panel_options', $options);
91
+
92
+ if( !empty($banner) ) {
93
+ $this->banner_url = $banner['url'];
94
+ $this->banner_img = $banner['img'];
95
+ }
96
+
97
+ if( $option_group ) {
98
+ $this->option_group = $option_group;
99
+ }
100
+
101
+ if( $option_name ) {
102
+ $this->option_name = $option_name;
103
+ }
104
+
105
+ //add new menu item
106
+ //register new settings option group
107
+ //include js and css files
108
+ //print browser
109
+ add_action( 'admin_menu', array( $this, 'add_submenu_page') );
110
+ add_action( 'admin_init', array( $this, 'panel_register_setting') );
111
+ add_action( 'admin_enqueue_scripts', array( $this, 'panel_enqueue') );
112
+
113
+ // add the typography javascript vars
114
+ add_action( 'yith_panel_after_panel', array( $this, 'js_typo_vars' ) );
115
+ }
116
+
117
+ /**
118
+ * Create new submenu page
119
+ *
120
+ * @return void
121
+ * @access public
122
+ * @link http://codex.wordpress.org/Function_Reference/add_submenu_page
123
+ */
124
+ public function add_submenu_page() {
125
+ $submenu = $this->_submenu;
126
+ add_submenu_page(
127
+ $submenu[0],
128
+ $submenu[1],
129
+ $submenu[2],
130
+ $submenu[3],
131
+ $submenu[4],
132
+ array( $this, isset($submenu[5]) ? $submenu[5] : 'display_panel_page' )
133
+ );
134
+ }
135
+
136
+ /**
137
+ * Print the Panel page
138
+ *
139
+ * @return void
140
+ * @access public
141
+ */
142
+ public function display_panel_page() {
143
+ // Create a header in the default WordPress 'wrap' container
144
+ $page = $this->_get_tab();
145
+ ?>
146
+ <div id="icon-themes" class="icon32"><br /></div>
147
+ <h2 class="nav-tab-wrapper">
148
+ <?php foreach( $this->options as $k=>$tab ): ?>
149
+ <a class="nav-tab<?php if( $page == $k ): ?> nav-tab-active<?php endif ?>" href="<?php echo add_query_arg('panel_page', $k) ?>"><?php echo $tab['label'] ?></a>
150
+ <?php endforeach ?>
151
+ <?php do_action('yith_panel_after_tabs'); ?>
152
+ </h2>
153
+
154
+ <div class="wrap">
155
+ <?php $this->printBanner() ?>
156
+ <?php do_action('yith_panel_before_panel'); ?>
157
+ <form action="options.php" method="post">
158
+
159
+ <?php do_settings_sections( $this->option_name ); ?>
160
+ <?php settings_fields( $this->option_group ) ?>
161
+
162
+ <p class="submit">
163
+ <input type="hidden" name="panel_page" value="<?php echo $page ?>" />
164
+ <input class="button-primary" type="submit" name="save_options" value="Save Options" />
165
+ </p>
166
+ </form>
167
+ <?php do_action('yith_panel_after_panel'); ?>
168
+ </div>
169
+ <?php
170
+ }
171
+
172
+ /**
173
+ * Add the vars for the typography options
174
+ */
175
+ public function js_typo_vars() {
176
+ global $yith_panel_if_typography;
177
+ if ( ! isset( $yith_panel_if_typography ) || ! $yith_panel_if_typography ) return;
178
+
179
+ $web_fonts = array(
180
+ "Arial",
181
+ "Arial Black",
182
+ "Comic Sans MS",
183
+ "Courier New",
184
+ "Georgia",
185
+ "Impact",
186
+ "Lucida Console",
187
+ "Lucida Sans Unicode",
188
+ "Thaoma",
189
+ "Trebuchet MS",
190
+ "Verdana"
191
+ );
192
+
193
+ // http://niubbys.altervista.org/google_fonts.php
194
+ $google_fonts = file_get_contents( dirname(__FILE__) . '/assets/js/google_fonts.json' );
195
+ ?>
196
+ <script type="text/javascript">
197
+ var yit_google_fonts = '<?php echo $google_fonts ?>',
198
+ yit_web_fonts = '{"items":<?php echo json_encode( $web_fonts ) ?>}',
199
+ yit_family_string = '';
200
+ </script>
201
+ <?php
202
+ }
203
+
204
+ /**
205
+ * Register a new settings option group
206
+ *
207
+ * @return void
208
+ * @access public
209
+ * @link http://codex.wordpress.org/Function_Reference/register_setting
210
+ * @link http://codex.wordpress.org/Function_Reference/add_settings_section
211
+ * @link http://codex.wordpress.org/Function_Reference/add_settings_field
212
+ */
213
+ public function panel_register_setting() {
214
+ $page = $this->_get_tab();
215
+ $tab = isset( $this->options[$page] ) ? $this->options[$page] : array();
216
+
217
+ if( !empty($tab['sections']) ) {
218
+ //add sections and fields
219
+ foreach( $tab['sections'] as $section_name => $section) {
220
+ //add the section
221
+ add_settings_section(
222
+ $section_name,
223
+ $section['title'],
224
+ array( $this, 'panel_section_content'),
225
+ $this->option_name
226
+ );
227
+
228
+ //add the fields
229
+ foreach( $section['fields'] as $option_name => $option ) {
230
+ $option['id'] = $option_name;
231
+ $option['label_for'] = $option_name;
232
+
233
+ //register settings group
234
+ register_setting(
235
+ $this->option_group,
236
+ $option_name,
237
+ array( $this, 'panel_sanitize')
238
+ );
239
+
240
+ add_settings_field(
241
+ $option_name,
242
+ $option['title'],
243
+ array( $this, 'panel_field_content' ),
244
+ $this->option_name,
245
+ $section_name,
246
+ $option
247
+ );
248
+ }
249
+ }
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Display sections content
255
+ *
256
+ * @return void
257
+ * @access public
258
+ */
259
+ public function panel_section_content( $section ) {
260
+ $page = $this->_get_tab();
261
+ if( isset( $this->options[$page]['sections'][ $section['id'] ]['description'] )) {
262
+ echo "<p class='section-description'>" . $this->options[$page]['sections'][ $section['id'] ]['description'] . "</p>";
263
+ }
264
+ }
265
+
266
+ /**
267
+ * Sanitize the option's value
268
+ *
269
+ * @param array $input
270
+ * @return array
271
+ * @access public
272
+ */
273
+ public function panel_sanitize( $input ) {
274
+ return apply_filters('yith_panel_sanitize', $input);
275
+ }
276
+
277
+ /**
278
+ * Get the active tab. If the page isn't provided, the function
279
+ * will return the first tab name
280
+ *
281
+ * @return string
282
+ * @access protected
283
+ */
284
+ public function _get_tab() {
285
+ if( isset($_POST['panel_page']) && $_POST['panel_page'] != '' ) {
286
+ return $_POST['panel_page'];
287
+ } elseif( isset($_GET['panel_page']) && $_GET['panel_page'] != '' ) {
288
+ return $_GET['panel_page'];
289
+ } else {
290
+ $tabs = array_keys( $this->options );
291
+ return $tabs[0];
292
+ }
293
+ }
294
+
295
+ /**
296
+ * Enqueue scripts and styles
297
+ *
298
+ * @return void
299
+ * @access public
300
+ */
301
+ public function panel_enqueue( $hook ) {
302
+ global $pagenow;
303
+
304
+ if( $pagenow == $this->_submenu[0] && isset( $_GET['page'] ) && $_GET['page'] == $this->_submenu[4] ) {
305
+ wp_enqueue_style( 'wp-color-picker' );
306
+ wp_enqueue_style( 'jquery-ui', 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css' );
307
+ wp_enqueue_script( 'jquery-ui-datepicker' );
308
+
309
+ wp_enqueue_style( 'yith-panel-css', plugin_dir_url( __FILE__ ) . 'assets/css/yith-panel.css', array('wp-color-picker'), $this->version );
310
+ wp_enqueue_script( 'yith-panel-js', plugin_dir_url( __FILE__ ) . 'assets/js/yith-panel.js', array( 'jquery', 'wp-color-picker' ), $this->version, true );
311
+
312
+ wp_enqueue_media();
313
+
314
+ do_action( 'yith_panel_enqueue' );
315
+ }
316
+ }
317
+
318
+
319
+ /**
320
+ * Display field content
321
+ *
322
+ * @return void
323
+ * @access public
324
+ */
325
+ public function panel_field_content( $field ) {
326
+ $value = get_option( $field['id'], isset($field['std']) ? $field['std'] : '' );
327
+ $id = $field['id'];
328
+ $name = $field['id'];
329
+
330
+ $echo = '';
331
+
332
+ switch( $field['type'] ) {
333
+ case 'text':
334
+ $echo = "<input type='text' id='{$id}' name='{$name}' value='{$value}' class='regular-text code' />";
335
+
336
+ if( isset($field['description']) && $field['description'] != '' ) {
337
+ $echo .= "<p class='description'>{$field['description']}</p>";
338
+ }
339
+ break;
340
+
341
+ case 'textarea': $echo = "<textarea name='{$name}' id='{$id}' class='large-text code' rows='10' cols='50'>{$value}</textarea>";
342
+ if( isset($field['description']) && $field['description'] != '' ) {
343
+ $echo .= "<p class='description'>{$field['description']}</p>";
344
+ }
345
+ break;
346
+
347
+ case 'checkbox': $echo = "<input type='checkbox' id='{$id}' name='{$name}' value='1' ". checked($value, true, false) ." />";
348
+ if( isset($field['description']) && $field['description'] != '' ) {
349
+ $echo .= " <label for='{$id}'><span class='description'>{$field['description']}</span></label>";
350
+ }
351
+ break;
352
+
353
+ case 'select': $echo = "<select name='{$name}' id='{$id}'>";
354
+ foreach( $field['options'] as $v=>$label ) {
355
+ $echo .= "<option value='{$v}'". selected($value, $v, false) .">{$label}</option>";
356
+ }
357
+ $echo .= "</select>";
358
+ if( isset($field['description']) && $field['description'] != '' ) {
359
+ $echo .= "<p class='description'>{$field['description']}</p>";
360
+ }
361
+ break;
362
+
363
+ case 'number':
364
+ $mms = '';
365
+ if( isset( $field['min'] ) ) {
366
+ $mms .= " min='{$field['min']}'";
367
+ }
368
+
369
+ if( isset( $field['max'] ) ) {
370
+ $mms .= " max='{$field['max']}'";
371
+ }
372
+
373
+ if( isset( $field['step'] ) ) {
374
+ $mms .= " step='{$field['step']}'";
375
+ }
376
+
377
+ $echo = "<input type='number' id='{$id}' name='{$name}' value='{$value}' class='small-text' {$mms} />";
378
+ if( isset($field['description']) && $field['description'] != '' ) {
379
+ $echo .= "<p class='description'>{$field['description']}</p>";
380
+ }
381
+ break;
382
+
383
+ case 'colorpicker':
384
+ $std = isset( $field['std'] ) ? $field['std'] : '';
385
+
386
+ $echo = "<input type='text' id='{$id}' name='{$name}' value='{$value}' class='medium-text code panel-colorpicker' data-default-color='{$std}' />";
387
+ if( isset($field['description']) && $field['description'] != '' ) {
388
+ $echo .= "<p class='description'>{$field['description']}</p>";
389
+ }
390
+ break;
391
+
392
+ case 'datepicker':
393
+ $std = isset( $field['std'] ) ? $field['std'] : array( 'date' => '', 'hh' => 0, 'mm' => 0, 'ss' => 0 );
394
+ $value = ! empty( $value ) ? $value : array( 'date' => '', 'hh' => 0, 'mm' => 0, 'ss' => 0 );
395
+
396
+ $echo = "<input type='text' id='{$id}_date' name='{$name}[date]' value='{$value['date']}' class='medium-text code panel-datepicker' colorpicker='" . __( 'Select a date', 'yit' ) . "' /> - ";
397
+ $echo .= "<input type='text' id='{$id}_hh' name='{$name}[hh]' value='{$value['hh']}' class='small-text code' colorpicker='" . __( 'Hours', 'yit' ) . "' /> : ";
398
+ $echo .= "<input type='text' id='{$id}_mm' name='{$name}[mm]' value='{$value['mm']}' class='small-text code' colorpicker='" . __( 'Minutes', 'yit' ) . "' /> : ";
399
+ $echo .= "<input type='text' id='{$id}_ss' name='{$name}[ss]' value='{$value['ss']}' class='small-text code' colorpicker='" . __( 'Minutes', 'yit' ) . "' />";
400
+ if( isset($field['description']) && $field['description'] != '' ) {
401
+ $echo .= "<p class='description'>{$field['description']}</p>";
402
+ }
403
+ break;
404
+
405
+ case 'upload':
406
+ $echo = '<div class="uploader">';
407
+ $echo .= " <input type='text' id='{$id}' name='{$name}' value='{$value}' class='regular-text code' /> <input type='button' name='' id='{$id}_button' class='button' value='". __('Upload', 'yit') ."'>";
408
+ $echo .= '</div>';
409
+ if( isset($field['description']) && $field['description'] != '' ) {
410
+ $echo .= "<p class='description'>{$field['description']}</p>";
411
+ }
412
+ break;
413
+
414
+ case 'checkboxes':
415
+ $echo = '<div class="checkboxes">';
416
+ foreach ( $field['options'] as $check_value => $check_label ) {
417
+ $echo .= "<label><input type='checkbox' id='{$id}_{$check_value}' name='{$name}[]' value='$check_value' ". checked( in_array( $check_value, $value ), true, false) ." /> {$check_label}</label><br />";
418
+ }
419
+
420
+ $echo .= " <p class='description'>{$field['description']}</p>";
421
+ break;
422
+
423
+ case 'typography': $value = wp_parse_args( $value, $field['std'] ); ?>
424
+ <div class="typography_container typography">
425
+ <div class="option">
426
+ <!-- Size -->
427
+ <div class="spinner_container">
428
+ <input class="typography_size number small-text" type="number" name="<?php echo $name ?>[size]" id="<?php echo $id ?>-size" value="<?php echo $value['size'] ?>" data-min="<?php if(isset( $field['min'] )) echo $field['min'] ?>" data-max="<?php if(isset( $field['max'] )) echo $field['max'] ?>" />
429
+ </div>
430
+
431
+ <!-- Unit -->
432
+ <div class="select-wrapper font-unit">
433
+ <select class="typography_unit" name="<?php echo $name ?>[unit]" id="<?php echo $id ?>-unit">
434
+ <option value="px" <?php selected( $value['unit'], 'px' ) ?>><?php _e( 'px', 'yit' ) ?></option>
435
+ <option value="em" <?php selected( $value['unit'], 'em' ) ?>><?php _e( 'em', 'yit' ) ?></option>
436
+ <option value="pt" <?php selected( $value['unit'], 'pt' ) ?>><?php _e( 'pt', 'yit' ) ?></option>
437
+ <option value="rem" <?php selected( $value['unit'], 'rem' ) ?>><?php _e( 'rem', 'yit' ) ?></option>
438
+ </select>
439
+ </div>
440
+
441
+ <!-- Family -->
442
+ <div class="select-wrapper font-family">
443
+ <select class="typography_family" name="<?php echo $name ?>[family]" id="<?php echo $id ?>-family" data-instance="false">
444
+ <?php if( $value['family'] ): ?>
445
+ <option value="<?php echo stripslashes( $value['family'] ) ?>"><?php echo $value['family'] ?></option>
446
+ <?php else: ?>
447
+ <option value=""><?php _e('Select a font family', 'yit') ?></option>
448
+ <?php endif ?>
449
+ </select>
450
+ </div>
451
+
452
+ <!-- Style -->
453
+ <div class="select-wrapper font-style">
454
+ <select class="typography_style" name="<?php echo $name ?>[style]" id="<?php echo $id ?>-style">
455
+ <option value="regular" <?php selected( $value['style'], 'regular' ) ?>><?php _e( 'Regular', 'yit' ) ?></option>
456
+ <option value="bold" <?php selected( $value['style'], 'bold' ) ?>><?php _e( 'Bold', 'yit' ) ?></option>
457
+ <option value="extra-bold" <?php selected( $value['style'], 'extra-bold' ) ?>><?php _e( 'Extra bold', 'yit' ) ?></option>
458
+ <option value="italic" <?php selected( $value['style'], 'italic' ) ?>><?php _e( 'Italic', 'yit' ) ?></option>
459
+ <option value="bold-italic" <?php selected( $value['style'], 'bold-italic' ) ?>><?php _e( 'Italic bold', 'yit' ) ?></option>
460
+ </select>
461
+ </div>
462
+
463
+ <!-- Color -->
464
+ <input type='text' id='<?php echo $id ?>-color' name='<?php echo $name ?>[color]' value='<?php echo $value['color'] ?>' class='medium-text code panel-colorpicker typography_color' data-default-color='<?php echo $field['std']['color'] ?>' />
465
+
466
+ </div>
467
+ <div class="clear"></div>
468
+ <div class="font-preview">
469
+ <p>The quick brown fox jumps over the lazy dog</p>
470
+ <!-- Refresh -->
471
+ <div class="refresh_container"><button class="refresh"><?php _e( 'Click to preview', 'yit' ) ?></button></div>
472
+ </div>
473
+ </div>
474
+ <?php
475
+ global $yith_panel_if_typography;
476
+ $yith_panel_if_typography = true;
477
+ break;
478
+
479
+ default:
480
+ do_action('yith_panel_field_' . $field['type']);
481
+ break;
482
+ }
483
+
484
+ echo $echo;
485
+ }
486
+
487
+ /**
488
+ * Print the banner
489
+ *
490
+ * @access protected
491
+ * @return void
492
+ */
493
+ public function printBanner() {
494
+ if( !$this->banner_url || !$this->banner_img ) return;
495
+ ?>
496
+ <div class="yith_banner">
497
+ <a href="<?php echo $this->banner_url ?>" target="_blank">
498
+ <img src="<?php echo $this->banner_img ?>" alt="" />
499
+ </a>
500
+ </div>
501
+ <?php
502
+ }
503
+ }
504
+ }
yith-woocompare-options.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main admin class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH Woocommerce Compare
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
11
+
12
+ $options = array(
13
+ 'general' => array(
14
+ array(
15
+ 'name' => __( 'General Settings', 'yit' ),
16
+ 'type' => 'title',
17
+ 'desc' => '',
18
+ 'id' => 'yith_woocompare_general'
19
+ ),
20
+
21
+ array(
22
+ 'name' => __( 'Link or Button', 'yit' ),
23
+ 'desc' => __( 'Choose if you want to use a link or a button for the action button.', 'yit' ),
24
+ 'id' => 'yith_woocompare_is_button',
25
+ 'std' => 'button',
26
+ 'default' => 'button',
27
+ 'type' => 'select',
28
+ 'options' => array(
29
+ 'link' => __( 'Link', 'yit' ),
30
+ 'button' => __( 'Button', 'yit' )
31
+ )
32
+ ),
33
+
34
+ array(
35
+ 'name' => __( 'Show button in single product page', 'yit' ),
36
+ 'desc' => __( 'Say if you want to show the button in the single product page.', 'yit' ),
37
+ 'id' => 'yith_woocompare_compare_button_in_product_page',
38
+ 'std' => 'yes',
39
+ 'default' => 'yes',
40
+ 'type' => 'checkbox'
41
+ ),
42
+
43
+ array(
44
+ 'name' => __( 'Show button in products list', 'yit' ),
45
+ 'desc' => __( 'Say if you want to show the button in the products list.', 'yit' ),
46
+ 'id' => 'yith_woocompare_compare_button_in_products_list',
47
+ 'std' => 'no',
48
+ 'default' => 'no',
49
+ 'type' => 'checkbox'
50
+ ),
51
+
52
+ array(
53
+ 'name' => __( 'Open automatically lightbox', 'yit' ),
54
+ 'desc' => __( 'Open link after click into "Compare" button".', 'yit' ),
55
+ 'id' => 'yith_woocompare_auto_open',
56
+ 'std' => 'yes',
57
+ 'default' => 'yes',
58
+ 'type' => 'checkbox'
59
+ ),
60
+
61
+ array( 'type' => 'sectionend', 'id' => 'yith_woocompare_general' )
62
+ ),
63
+
64
+ 'table-settings' => array(
65
+ array(
66
+ 'name' => __( 'Table Settings', 'yit' ),
67
+ 'type' => 'title',
68
+ 'desc' => '',
69
+ 'id' => 'yith_woocompare_general'
70
+ ),
71
+
72
+ array(
73
+ 'name' => __( 'Fields to show', 'yit' ),
74
+ 'desc' => __( 'Select the fields to show in the comparison table and order them by drag&drop (are included also the woocommerce attributes)', 'yit' ),
75
+ 'id' => 'yith_woocompare_fields',
76
+ 'std' => 'all',
77
+ 'default' => 'all',
78
+ 'type' => 'attributes'
79
+ ),
80
+
81
+ array(
82
+ 'name' => __( 'Repeat "Price" field at the end of the table', 'yit' ),
83
+ 'desc' => __( 'Select the fields to show in the comparison table and order them by drag&drop (are included also the woocommerce attributes)', 'yit' ),
84
+ 'id' => 'yith_woocompare_price_end',
85
+ 'std' => 'yes',
86
+ 'default' => 'yes',
87
+ 'type' => 'checkbox'
88
+ ),
89
+
90
+ array(
91
+ 'name' => __( 'Repeat "Add to cart" field at the end of the table', 'yit' ),
92
+ 'desc' => __( 'Select the fields to show in the comparison table and order them by drag&drop (are included also the woocommerce attributes)', 'yit' ),
93
+ 'id' => 'yith_woocompare_add_to_cart_end',
94
+ 'std' => 'no',
95
+ 'default' => 'no',
96
+ 'type' => 'checkbox'
97
+ ),
98
+
99
+ array(
100
+ 'name' => __( 'Image size', 'yit' ),
101
+ 'desc' => __( 'Set the size for the images', 'yit' ),
102
+ 'id' => 'yith_woocompare_image_size',
103
+ 'type' => 'image_width',
104
+ 'default' => array(
105
+ 'width' => 220,
106
+ 'height' => 154,
107
+ 'crop' => 1
108
+ ),
109
+ 'std' => array(
110
+ 'width' => 220,
111
+ 'height' => 154,
112
+ 'crop' => 1
113
+ )
114
+ ),
115
+
116
+ array( 'type' => 'sectionend', 'id' => 'yith_woocompare_general' )
117
+ ),
118
+ );